@webx-ui/module-inbox 0.3.1 → 0.4.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/InboxPage.d.ts +43 -3
- package/dist/SubmissionList.d.ts +4 -6
- package/dist/index.js +1355 -1335
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as ae, useModel as
|
|
2
|
-
import { useRoute as
|
|
3
|
-
import { useAdmin as
|
|
4
|
-
import { useLocales as xe, WxLocales as vl, WxRichText as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as ae, useModel as $e, computed as F, unref as e, openBlock as u, createBlock as _, withCtx as a, createVNode as t, mergeModels as Me, ref as W, watch as Se, isRef as ne, createElementVNode as G, createElementBlock as j, Fragment as ee, createCommentVNode as H, createTextVNode as z, toDisplayString as k, renderList as we, createSlots as Ie, onMounted as dl, reactive as cl, useTemplateRef as nl, normalizeClass as Je } from "vue";
|
|
2
|
+
import { useRoute as Le, useRouter as Oe } from "vue-router";
|
|
3
|
+
import { useAdmin as oe, useTranslate as te, useErrorText as me, WxRowMenu as Te, WxScreenHead as Ye, rowMenuWidth as pl, WxDate as Ne, WxListScreen as sl, WxNotes as ml } from "@webx-ui/module-admin";
|
|
4
|
+
import { useLocales as xe, WxLocales as vl, WxRichText as Xe, useModal as Ee, WxDialog as Pe, WxFormItem as B, WxSelect as fe, WxInput as X, WxText as J, WxAction as ke, WxButton as le, WxIcon as Ve, WxInputNumber as _e, WxDatePicker as Ke, WxTagsInput as fl, WxCheckbox as ve, WxSpace as We, toast as E, createModal as Re, WxCard as se, WxEmpty as Be, WxSortableList as Ze, WxBadge as Ue, localizedValue as pe, confirm as Ce, WxSwitch as ol, WxTable as il, WxAlert as De, WxSkeleton as Fe, WxTabs as Qe, WxTab as ge, WxActionBar as bl, WxTextarea as hl, WxRadioGroup as yl, WxCheckboxGroup as gl, useElementWidth as xl, WxEntityCard as _l, WxAvatar as el, WxTooltip as wl, WxListDetail as kl, WxIndicator as ll, WxDescriptions as tl, WxDescriptionsItem as Ae, WxFileCard as Vl, WxTimeline as $l, WxTimelineItem as Ul } from "@webx-ui/core";
|
|
5
|
+
const ul = /* @__PURE__ */ ae({
|
|
6
6
|
__name: "LocalizedRichText",
|
|
7
7
|
props: /* @__PURE__ */ Me({
|
|
8
8
|
placeholder: { default: void 0 },
|
|
@@ -12,93 +12,93 @@ const il = /* @__PURE__ */ ae({
|
|
|
12
12
|
modelModifiers: {}
|
|
13
13
|
}),
|
|
14
14
|
emits: ["update:modelValue"],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
return v.list.value.some((
|
|
19
|
-
}),
|
|
15
|
+
setup(r) {
|
|
16
|
+
const s = $e(r, "modelValue"), o = r, v = xe(), n = F(() => {
|
|
17
|
+
const m = v.active.value;
|
|
18
|
+
return v.list.value.some(($) => $.code === m) ? m : v.list.value[0]?.code ?? "";
|
|
19
|
+
}), d = F({
|
|
20
20
|
get: () => {
|
|
21
|
-
const
|
|
22
|
-
return typeof
|
|
21
|
+
const m = s.value;
|
|
22
|
+
return typeof m == "string" ? n.value === "" || n.value === v.list.value[0]?.code ? m : "" : m[n.value] ?? "";
|
|
23
23
|
},
|
|
24
|
-
set: (
|
|
24
|
+
set: (m) => {
|
|
25
25
|
if (n.value === "") {
|
|
26
|
-
|
|
26
|
+
s.value = m;
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
const l = typeof
|
|
30
|
-
|
|
29
|
+
const l = typeof s.value == "string" ? { [n.value]: s.value } : s.value;
|
|
30
|
+
s.value = { ...l, [n.value]: m };
|
|
31
31
|
}
|
|
32
32
|
});
|
|
33
|
-
return (
|
|
33
|
+
return (m, l) => e(v).list.value.length > 0 ? (u(), _(e(vl), { key: 0 }, {
|
|
34
34
|
default: a(() => [
|
|
35
|
-
t(e(
|
|
36
|
-
modelValue:
|
|
37
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
38
|
-
placeholder:
|
|
39
|
-
"min-height":
|
|
35
|
+
t(e(Xe), {
|
|
36
|
+
modelValue: d.value,
|
|
37
|
+
"onUpdate:modelValue": l[0] || (l[0] = ($) => d.value = $),
|
|
38
|
+
placeholder: o.placeholder,
|
|
39
|
+
"min-height": o.minHeight
|
|
40
40
|
}, null, 8, ["modelValue", "placeholder", "min-height"])
|
|
41
41
|
]),
|
|
42
42
|
_: 1
|
|
43
|
-
})) : (
|
|
43
|
+
})) : (u(), _(e(Xe), {
|
|
44
44
|
key: 1,
|
|
45
|
-
modelValue:
|
|
46
|
-
"onUpdate:modelValue": l[1] || (l[1] = (
|
|
47
|
-
placeholder:
|
|
48
|
-
"min-height":
|
|
45
|
+
modelValue: d.value,
|
|
46
|
+
"onUpdate:modelValue": l[1] || (l[1] = ($) => d.value = $),
|
|
47
|
+
placeholder: o.placeholder,
|
|
48
|
+
"min-height": o.minHeight
|
|
49
49
|
}, null, 8, ["modelValue", "placeholder", "min-height"]));
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
|
-
function re(
|
|
53
|
-
const
|
|
52
|
+
function re(r) {
|
|
53
|
+
const s = `${r.apiPath}/inbox`, o = (n) => n.data, v = () => {
|
|
54
54
|
};
|
|
55
55
|
return {
|
|
56
|
-
forms: () =>
|
|
57
|
-
form: (n) =>
|
|
58
|
-
createForm: (n) =>
|
|
59
|
-
saveForm: (n,
|
|
60
|
-
removeForm: (n) =>
|
|
61
|
-
duplicateForm: (n) =>
|
|
62
|
-
sortForms: (n) =>
|
|
63
|
-
fields: (n) =>
|
|
64
|
-
createField: (n,
|
|
65
|
-
saveField: (n,
|
|
66
|
-
removeField: (n) =>
|
|
67
|
-
sortFields: (n,
|
|
68
|
-
statuses: () =>
|
|
69
|
-
createStatus: (n) =>
|
|
70
|
-
saveStatus: (n,
|
|
71
|
-
removeStatus: (n) =>
|
|
72
|
-
sortStatuses: (n) =>
|
|
73
|
-
recipients: () =>
|
|
74
|
-
submissions: (n,
|
|
75
|
-
...
|
|
76
|
-
data:
|
|
77
|
-
columns:
|
|
78
|
-
counts:
|
|
56
|
+
forms: () => r.http.get(`${s}/forms`).then(o),
|
|
57
|
+
form: (n) => r.http.get(`${s}/forms/${n}`).then(o),
|
|
58
|
+
createForm: (n) => r.http.post(`${s}/forms`, n).then(o),
|
|
59
|
+
saveForm: (n, d) => r.http.put(`${s}/forms/${n}`, d).then(o),
|
|
60
|
+
removeForm: (n) => r.http.delete(`${s}/forms/${n}`).then(v),
|
|
61
|
+
duplicateForm: (n) => r.http.post(`${s}/forms/${n}/duplicate`, {}).then(o),
|
|
62
|
+
sortForms: (n) => r.http.post(`${s}/forms/sorting`, { ids: n }).then(v),
|
|
63
|
+
fields: (n) => r.http.get(`${s}/forms/${n}/fields`).then(o),
|
|
64
|
+
createField: (n, d) => r.http.post(`${s}/forms/${n}/fields`, d).then(o),
|
|
65
|
+
saveField: (n, d) => r.http.put(`${s}/fields/${n}`, d).then(o),
|
|
66
|
+
removeField: (n) => r.http.delete(`${s}/fields/${n}`).then(v),
|
|
67
|
+
sortFields: (n, d) => r.http.post(`${s}/forms/${n}/fields/sorting`, { ids: d }).then(v),
|
|
68
|
+
statuses: () => r.http.get(`${s}/statuses`).then(o),
|
|
69
|
+
createStatus: (n) => r.http.post(`${s}/statuses`, n).then(o),
|
|
70
|
+
saveStatus: (n, d) => r.http.put(`${s}/statuses/${n}`, d).then(o),
|
|
71
|
+
removeStatus: (n) => r.http.delete(`${s}/statuses/${n}`).then(v),
|
|
72
|
+
sortStatuses: (n) => r.http.post(`${s}/statuses/sorting`, { ids: n }).then(v),
|
|
73
|
+
recipients: () => r.http.get(`${s}/recipients`).then(o),
|
|
74
|
+
submissions: (n, d = {}) => r.http.get(`${s}/forms/${n}/submissions`, { query: je(d) }).then((m) => ({
|
|
75
|
+
...m.meta,
|
|
76
|
+
data: m.data,
|
|
77
|
+
columns: m.columns,
|
|
78
|
+
counts: m.counts
|
|
79
79
|
})),
|
|
80
|
-
submission: (n,
|
|
81
|
-
createSubmission: (n,
|
|
82
|
-
saveSubmission: (n,
|
|
83
|
-
removeSubmission: (n) =>
|
|
84
|
-
massSubmissions: (n) =>
|
|
85
|
-
exportUrl: (n,
|
|
86
|
-
const
|
|
87
|
-
for (const [
|
|
88
|
-
|
|
89
|
-
const l =
|
|
90
|
-
return `${
|
|
80
|
+
submission: (n, d = {}) => r.http.get(`${s}/submissions/${n}`, { query: je(d) }).then(o),
|
|
81
|
+
createSubmission: (n, d) => r.http.post(`${s}/forms/${n}/submissions`, { fields: d }).then(o),
|
|
82
|
+
saveSubmission: (n, d) => r.http.put(`${s}/submissions/${n}`, d).then(o),
|
|
83
|
+
removeSubmission: (n) => r.http.delete(`${s}/submissions/${n}`).then(v),
|
|
84
|
+
massSubmissions: (n) => r.http.post(`${s}/submissions/mass`, n).then(o),
|
|
85
|
+
exportUrl: (n, d = {}) => {
|
|
86
|
+
const m = new URLSearchParams();
|
|
87
|
+
for (const [$, p] of Object.entries(je(d)))
|
|
88
|
+
p != null && p !== "" && m.set($, String(p));
|
|
89
|
+
const l = m.toString();
|
|
90
|
+
return `${s}/forms/${n}/submissions/export${l === "" ? "" : `?${l}`}`;
|
|
91
91
|
}
|
|
92
92
|
};
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function je(r) {
|
|
95
95
|
return {
|
|
96
|
-
view:
|
|
97
|
-
search:
|
|
98
|
-
assignee:
|
|
99
|
-
sort:
|
|
100
|
-
page:
|
|
101
|
-
per_page:
|
|
96
|
+
view: r.view === void 0 || r.view === "" ? void 0 : r.view,
|
|
97
|
+
search: r.search === void 0 || r.search === "" ? void 0 : r.search,
|
|
98
|
+
assignee: r.assignee ?? void 0,
|
|
99
|
+
sort: r.sort ?? void 0,
|
|
100
|
+
page: r.page,
|
|
101
|
+
per_page: r.per_page
|
|
102
102
|
};
|
|
103
103
|
}
|
|
104
104
|
const Sl = {
|
|
@@ -110,7 +110,6 @@ const Sl = {
|
|
|
110
110
|
"new-form": "New form",
|
|
111
111
|
"no-forms": "No forms yet.",
|
|
112
112
|
"no-forms-help": "A form is a few questions and a list of who hears the answers.",
|
|
113
|
-
"choose-form": "Choose a form to see what has come in.",
|
|
114
113
|
unread: "Unread",
|
|
115
114
|
submissions: "Submissions in all",
|
|
116
115
|
off: "Off",
|
|
@@ -201,7 +200,7 @@ const Sl = {
|
|
|
201
200
|
"view-all": "All",
|
|
202
201
|
"view-unread": "Unread",
|
|
203
202
|
export: "Export",
|
|
204
|
-
"new-submission": "
|
|
203
|
+
"new-submission": "New submission",
|
|
205
204
|
"new-submission-title": "A submission by hand",
|
|
206
205
|
"new-submission-help": "For one that came by telephone or on paper. It is written the same way and lands in the same list.",
|
|
207
206
|
created: "Added.",
|
|
@@ -296,11 +295,11 @@ const Sl = {
|
|
|
296
295
|
"type-file": "File",
|
|
297
296
|
"type-hidden": "Hidden"
|
|
298
297
|
}
|
|
299
|
-
},
|
|
298
|
+
}, al = /* @__PURE__ */ new WeakSet();
|
|
300
299
|
function de() {
|
|
301
300
|
try {
|
|
302
|
-
const { i18n:
|
|
303
|
-
|
|
301
|
+
const { i18n: r } = oe();
|
|
302
|
+
al.has(r) || (r.defaults("webx-inbox", Sl), al.add(r));
|
|
304
303
|
} catch {
|
|
305
304
|
}
|
|
306
305
|
}
|
|
@@ -316,7 +315,7 @@ const Cl = [
|
|
|
316
315
|
"date",
|
|
317
316
|
"file",
|
|
318
317
|
"hidden"
|
|
319
|
-
], zl = ["default", "primary", "success", "warning", "info", "danger"], Tl = { class: "wx-inbox-field-form" },
|
|
318
|
+
], zl = ["default", "primary", "success", "warning", "info", "danger"], Tl = { class: "wx-inbox-field-form" }, Fl = { class: "wx-inbox-field-form__row" }, Wl = {
|
|
320
319
|
key: 2,
|
|
321
320
|
class: "wx-inbox-choices"
|
|
322
321
|
}, ql = { class: "wx-inbox-field-form__row" }, Al = { class: "wx-inbox-field-form__checks" }, Il = /* @__PURE__ */ ae({
|
|
@@ -325,99 +324,99 @@ const Cl = [
|
|
|
325
324
|
field: {},
|
|
326
325
|
form: {}
|
|
327
326
|
},
|
|
328
|
-
setup(
|
|
329
|
-
const
|
|
327
|
+
setup(r) {
|
|
328
|
+
const s = r, { resolve: o, dismiss: v, open: n } = Ee(), d = oe(), m = re(d);
|
|
330
329
|
de();
|
|
331
|
-
const l = te("webx-inbox"),
|
|
332
|
-
|
|
333
|
-
() =>
|
|
334
|
-
(
|
|
335
|
-
|
|
330
|
+
const l = te("webx-inbox"), $ = me(), p = W(!1), i = W({}), O = W(""), S = W("text"), T = W({}), b = W({}), q = W({}), c = W({}), U = W(!0), f = W(!1), I = W(!0), w = W(!1);
|
|
331
|
+
Se(
|
|
332
|
+
() => s.field,
|
|
333
|
+
(D) => {
|
|
334
|
+
O.value = D?.name ?? "", S.value = D?.type ?? "text", T.value = { ...D?.title ?? {} }, b.value = { ...D?.placeholder ?? {} }, q.value = { ...D?.help ?? {} }, c.value = { ...D?.options ?? {} }, U.value = D?.is_enabled ?? !0, f.value = D?.is_required ?? !1, I.value = D?.is_fullsize ?? !0, w.value = D?.in_table ?? !1, i.value = {};
|
|
336
335
|
},
|
|
337
336
|
{ immediate: !0 }
|
|
338
337
|
);
|
|
339
|
-
const
|
|
340
|
-
() => Cl.map((
|
|
341
|
-
),
|
|
342
|
-
() => Array.isArray(
|
|
343
|
-
),
|
|
344
|
-
get: () => Array.isArray(
|
|
345
|
-
set: (
|
|
338
|
+
const P = F(
|
|
339
|
+
() => Cl.map((D) => ({ value: D, label: l(`fields.type-${D}`) }))
|
|
340
|
+
), M = F(() => ["select", "radio", "checkbox"].includes(S.value)), A = F(
|
|
341
|
+
() => Array.isArray(c.value.choices) ? c.value.choices : []
|
|
342
|
+
), C = F({
|
|
343
|
+
get: () => Array.isArray(c.value.extensions) ? c.value.extensions : [],
|
|
344
|
+
set: (D) => g(
|
|
346
345
|
"extensions",
|
|
347
|
-
|
|
346
|
+
D.map((x) => x.replace(/^\./, ""))
|
|
348
347
|
)
|
|
349
348
|
});
|
|
350
|
-
function
|
|
351
|
-
|
|
349
|
+
function g(D, x) {
|
|
350
|
+
c.value = { ...c.value, [D]: x };
|
|
352
351
|
}
|
|
353
|
-
function
|
|
354
|
-
|
|
352
|
+
function Q() {
|
|
353
|
+
g("choices", [...A.value, { value: "", label: {} }]);
|
|
355
354
|
}
|
|
356
|
-
function
|
|
357
|
-
|
|
355
|
+
function be(D) {
|
|
356
|
+
g(
|
|
358
357
|
"choices",
|
|
359
|
-
|
|
358
|
+
A.value.filter((x, h) => h !== D)
|
|
360
359
|
);
|
|
361
360
|
}
|
|
362
|
-
function
|
|
363
|
-
|
|
361
|
+
function he(D, x) {
|
|
362
|
+
g(
|
|
364
363
|
"choices",
|
|
365
|
-
|
|
364
|
+
A.value.map((h, ue) => ue === D ? { ...h, ...x } : h)
|
|
366
365
|
);
|
|
367
366
|
}
|
|
368
|
-
function
|
|
369
|
-
return
|
|
367
|
+
function N(D) {
|
|
368
|
+
return i.value[D]?.[0];
|
|
370
369
|
}
|
|
371
|
-
async function
|
|
372
|
-
|
|
373
|
-
const
|
|
374
|
-
name:
|
|
375
|
-
type:
|
|
370
|
+
async function K() {
|
|
371
|
+
p.value = !0, i.value = {};
|
|
372
|
+
const D = {
|
|
373
|
+
name: O.value.trim() === "" ? null : O.value.trim(),
|
|
374
|
+
type: S.value,
|
|
376
375
|
title: T.value,
|
|
377
|
-
placeholder:
|
|
378
|
-
help:
|
|
379
|
-
options:
|
|
380
|
-
is_enabled:
|
|
381
|
-
is_required:
|
|
382
|
-
is_fullsize:
|
|
383
|
-
in_table:
|
|
376
|
+
placeholder: b.value,
|
|
377
|
+
help: q.value,
|
|
378
|
+
options: c.value,
|
|
379
|
+
is_enabled: U.value,
|
|
380
|
+
is_required: f.value,
|
|
381
|
+
is_fullsize: I.value,
|
|
382
|
+
in_table: w.value
|
|
384
383
|
};
|
|
385
384
|
try {
|
|
386
|
-
|
|
387
|
-
|
|
385
|
+
o(
|
|
386
|
+
s.field === null ? await m.createField(s.form.id, D) : await m.saveField(s.field.id, D)
|
|
388
387
|
);
|
|
389
|
-
} catch (
|
|
390
|
-
const
|
|
391
|
-
|
|
388
|
+
} catch (x) {
|
|
389
|
+
const h = x.body;
|
|
390
|
+
h?.errors ? (i.value = h.errors, E.danger(l("panel.failed"))) : E.danger($(x));
|
|
392
391
|
} finally {
|
|
393
|
-
|
|
392
|
+
p.value = !1;
|
|
394
393
|
}
|
|
395
394
|
}
|
|
396
|
-
return (
|
|
395
|
+
return (D, x) => (u(), _(e(Pe), {
|
|
397
396
|
open: e(n),
|
|
398
|
-
"onUpdate:open":
|
|
399
|
-
title:
|
|
397
|
+
"onUpdate:open": x[21] || (x[21] = (h) => ne(n) ? n.value = h : null),
|
|
398
|
+
title: r.field ? e(l)("fields.edit-field") : e(l)("fields.new-field"),
|
|
400
399
|
width: 720
|
|
401
400
|
}, {
|
|
402
401
|
footer: a(() => [
|
|
403
|
-
t(e(
|
|
402
|
+
t(e(We), { size: "sm" }, {
|
|
404
403
|
default: a(() => [
|
|
405
|
-
t(e(
|
|
404
|
+
t(e(le), {
|
|
406
405
|
variant: "outline",
|
|
407
|
-
onClick:
|
|
406
|
+
onClick: x[20] || (x[20] = (h) => e(v)())
|
|
408
407
|
}, {
|
|
409
408
|
default: a(() => [
|
|
410
|
-
|
|
409
|
+
z(k(e(l)("fields.cancel")), 1)
|
|
411
410
|
]),
|
|
412
411
|
_: 1
|
|
413
412
|
}),
|
|
414
|
-
t(e(
|
|
413
|
+
t(e(le), {
|
|
415
414
|
type: "primary",
|
|
416
|
-
loading:
|
|
417
|
-
onClick:
|
|
415
|
+
loading: p.value,
|
|
416
|
+
onClick: K
|
|
418
417
|
}, {
|
|
419
418
|
default: a(() => [
|
|
420
|
-
|
|
419
|
+
z(k(e(l)("fields.save")), 1)
|
|
421
420
|
]),
|
|
422
421
|
_: 1
|
|
423
422
|
}, 8, ["loading"])
|
|
@@ -426,292 +425,292 @@ const Cl = [
|
|
|
426
425
|
})
|
|
427
426
|
]),
|
|
428
427
|
default: a(() => [
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
t(e(
|
|
428
|
+
G("div", Tl, [
|
|
429
|
+
G("div", Fl, [
|
|
430
|
+
t(e(B), {
|
|
432
431
|
label: e(l)("fields.type")
|
|
433
432
|
}, {
|
|
434
433
|
default: a(() => [
|
|
435
|
-
t(e(
|
|
436
|
-
modelValue:
|
|
437
|
-
"onUpdate:modelValue":
|
|
438
|
-
options:
|
|
434
|
+
t(e(fe), {
|
|
435
|
+
modelValue: S.value,
|
|
436
|
+
"onUpdate:modelValue": x[0] || (x[0] = (h) => S.value = h),
|
|
437
|
+
options: P.value
|
|
439
438
|
}, null, 8, ["modelValue", "options"])
|
|
440
439
|
]),
|
|
441
440
|
_: 1
|
|
442
441
|
}, 8, ["label"]),
|
|
443
|
-
t(e(
|
|
442
|
+
t(e(B), {
|
|
444
443
|
label: e(l)("fields.name"),
|
|
445
444
|
help: e(l)("fields.name-help"),
|
|
446
|
-
error:
|
|
445
|
+
error: N("name")
|
|
447
446
|
}, {
|
|
448
447
|
default: a(() => [
|
|
449
448
|
t(e(X), {
|
|
450
|
-
modelValue:
|
|
451
|
-
"onUpdate:modelValue":
|
|
449
|
+
modelValue: O.value,
|
|
450
|
+
"onUpdate:modelValue": x[1] || (x[1] = (h) => O.value = h),
|
|
452
451
|
placeholder: "email"
|
|
453
452
|
}, null, 8, ["modelValue"])
|
|
454
453
|
]),
|
|
455
454
|
_: 1
|
|
456
455
|
}, 8, ["label", "help", "error"])
|
|
457
456
|
]),
|
|
458
|
-
t(e(
|
|
457
|
+
t(e(B), {
|
|
459
458
|
label: e(l)("fields.title"),
|
|
460
|
-
error:
|
|
459
|
+
error: N("title"),
|
|
461
460
|
required: ""
|
|
462
461
|
}, {
|
|
463
462
|
default: a(() => [
|
|
464
463
|
t(e(X), {
|
|
465
464
|
modelValue: T.value,
|
|
466
|
-
"onUpdate:modelValue":
|
|
465
|
+
"onUpdate:modelValue": x[2] || (x[2] = (h) => T.value = h),
|
|
467
466
|
localized: ""
|
|
468
467
|
}, null, 8, ["modelValue"])
|
|
469
468
|
]),
|
|
470
469
|
_: 1
|
|
471
470
|
}, 8, ["label", "error"]),
|
|
472
|
-
|
|
473
|
-
|
|
471
|
+
S.value !== "hidden" ? (u(), j(ee, { key: 0 }, [
|
|
472
|
+
S.value !== "consent" ? (u(), _(e(B), {
|
|
474
473
|
key: 0,
|
|
475
474
|
label: e(l)("fields.placeholder")
|
|
476
475
|
}, {
|
|
477
476
|
default: a(() => [
|
|
478
477
|
t(e(X), {
|
|
479
|
-
modelValue:
|
|
480
|
-
"onUpdate:modelValue":
|
|
478
|
+
modelValue: b.value,
|
|
479
|
+
"onUpdate:modelValue": x[3] || (x[3] = (h) => b.value = h),
|
|
481
480
|
localized: ""
|
|
482
481
|
}, null, 8, ["modelValue"])
|
|
483
482
|
]),
|
|
484
483
|
_: 1
|
|
485
|
-
}, 8, ["label"])) :
|
|
486
|
-
t(e(
|
|
484
|
+
}, 8, ["label"])) : H("", !0),
|
|
485
|
+
t(e(B), {
|
|
487
486
|
label: e(l)("fields.help")
|
|
488
487
|
}, {
|
|
489
488
|
default: a(() => [
|
|
490
489
|
t(e(X), {
|
|
491
|
-
modelValue:
|
|
492
|
-
"onUpdate:modelValue":
|
|
490
|
+
modelValue: q.value,
|
|
491
|
+
"onUpdate:modelValue": x[4] || (x[4] = (h) => q.value = h),
|
|
493
492
|
localized: ""
|
|
494
493
|
}, null, 8, ["modelValue"])
|
|
495
494
|
]),
|
|
496
495
|
_: 1
|
|
497
496
|
}, 8, ["label"])
|
|
498
|
-
], 64)) :
|
|
499
|
-
|
|
497
|
+
], 64)) : H("", !0),
|
|
498
|
+
S.value === "consent" ? (u(), _(e(B), {
|
|
500
499
|
key: 1,
|
|
501
500
|
label: e(l)("fields.consent-text"),
|
|
502
501
|
help: e(l)("fields.consent-text-help")
|
|
503
502
|
}, {
|
|
504
503
|
default: a(() => [
|
|
505
|
-
t(
|
|
506
|
-
"model-value":
|
|
504
|
+
t(ul, {
|
|
505
|
+
"model-value": c.value.text ?? {},
|
|
507
506
|
"min-height": "100px",
|
|
508
|
-
"onUpdate:modelValue":
|
|
507
|
+
"onUpdate:modelValue": x[5] || (x[5] = (h) => g("text", h))
|
|
509
508
|
}, null, 8, ["model-value"])
|
|
510
509
|
]),
|
|
511
510
|
_: 1
|
|
512
|
-
}, 8, ["label", "help"])) :
|
|
513
|
-
|
|
511
|
+
}, 8, ["label", "help"])) : H("", !0),
|
|
512
|
+
M.value ? (u(), j("div", Wl, [
|
|
514
513
|
t(e(J), {
|
|
515
514
|
size: "sm",
|
|
516
515
|
weight: "medium"
|
|
517
516
|
}, {
|
|
518
517
|
default: a(() => [
|
|
519
|
-
|
|
518
|
+
z(k(e(l)("fields.choices")), 1)
|
|
520
519
|
]),
|
|
521
520
|
_: 1
|
|
522
521
|
}),
|
|
523
|
-
|
|
522
|
+
A.value.length === 0 ? (u(), _(e(J), {
|
|
524
523
|
key: 0,
|
|
525
524
|
size: "sm",
|
|
526
525
|
tone: "placeholder"
|
|
527
526
|
}, {
|
|
528
527
|
default: a(() => [
|
|
529
|
-
|
|
528
|
+
z(k(e(l)("fields.no-choices")), 1)
|
|
530
529
|
]),
|
|
531
530
|
_: 1
|
|
532
|
-
})) :
|
|
533
|
-
(
|
|
534
|
-
key:
|
|
531
|
+
})) : H("", !0),
|
|
532
|
+
(u(!0), j(ee, null, we(A.value, (h, ue) => (u(), j("div", {
|
|
533
|
+
key: ue,
|
|
535
534
|
class: "wx-inbox-choices__row"
|
|
536
535
|
}, [
|
|
537
536
|
t(e(X), {
|
|
538
|
-
"model-value":
|
|
537
|
+
"model-value": h.value,
|
|
539
538
|
placeholder: e(l)("fields.choice-value"),
|
|
540
|
-
"onUpdate:modelValue": (
|
|
539
|
+
"onUpdate:modelValue": (ye) => he(ue, { value: String(ye) })
|
|
541
540
|
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
|
|
542
541
|
t(e(X), {
|
|
543
|
-
"model-value":
|
|
542
|
+
"model-value": h.label,
|
|
544
543
|
localized: "",
|
|
545
544
|
placeholder: e(l)("fields.choice-label"),
|
|
546
|
-
"onUpdate:modelValue": (
|
|
545
|
+
"onUpdate:modelValue": (ye) => he(ue, { label: ye })
|
|
547
546
|
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
|
|
548
|
-
t(e(
|
|
547
|
+
t(e(ke), {
|
|
549
548
|
icon: "trash",
|
|
550
549
|
title: e(l)("fields.delete"),
|
|
551
|
-
onClick: (
|
|
550
|
+
onClick: (ye) => be(ue)
|
|
552
551
|
}, null, 8, ["title", "onClick"])
|
|
553
552
|
]))), 128)),
|
|
554
|
-
t(e(
|
|
553
|
+
t(e(le), {
|
|
555
554
|
variant: "outline",
|
|
556
555
|
size: "sm",
|
|
557
|
-
onClick:
|
|
556
|
+
onClick: Q
|
|
558
557
|
}, {
|
|
559
558
|
icon: a(() => [
|
|
560
|
-
t(e(
|
|
559
|
+
t(e(Ve), { name: "plus" })
|
|
561
560
|
]),
|
|
562
561
|
default: a(() => [
|
|
563
|
-
|
|
562
|
+
z(" " + k(e(l)("fields.add-choice")), 1)
|
|
564
563
|
]),
|
|
565
564
|
_: 1
|
|
566
565
|
})
|
|
567
|
-
])) :
|
|
568
|
-
|
|
569
|
-
|
|
566
|
+
])) : H("", !0),
|
|
567
|
+
G("div", ql, [
|
|
568
|
+
S.value === "textarea" ? (u(), _(e(B), {
|
|
570
569
|
key: 0,
|
|
571
570
|
label: e(l)("fields.rows")
|
|
572
571
|
}, {
|
|
573
572
|
default: a(() => [
|
|
574
573
|
t(e(_e), {
|
|
575
|
-
"model-value":
|
|
574
|
+
"model-value": c.value.rows ?? 5,
|
|
576
575
|
min: 2,
|
|
577
576
|
max: 30,
|
|
578
|
-
"onUpdate:modelValue":
|
|
577
|
+
"onUpdate:modelValue": x[6] || (x[6] = (h) => g("rows", h))
|
|
579
578
|
}, null, 8, ["model-value"])
|
|
580
579
|
]),
|
|
581
580
|
_: 1
|
|
582
|
-
}, 8, ["label"])) :
|
|
583
|
-
["text", "email", "textarea"].includes(
|
|
581
|
+
}, 8, ["label"])) : H("", !0),
|
|
582
|
+
["text", "email", "textarea"].includes(S.value) ? (u(), _(e(B), {
|
|
584
583
|
key: 1,
|
|
585
584
|
label: e(l)("fields.maxlength")
|
|
586
585
|
}, {
|
|
587
586
|
default: a(() => [
|
|
588
587
|
t(e(_e), {
|
|
589
|
-
"model-value":
|
|
588
|
+
"model-value": c.value.maxlength ?? null,
|
|
590
589
|
min: 1,
|
|
591
590
|
max: 2e4,
|
|
592
|
-
"onUpdate:modelValue":
|
|
591
|
+
"onUpdate:modelValue": x[7] || (x[7] = (h) => g("maxlength", h))
|
|
593
592
|
}, null, 8, ["model-value"])
|
|
594
593
|
]),
|
|
595
594
|
_: 1
|
|
596
|
-
}, 8, ["label"])) :
|
|
597
|
-
|
|
595
|
+
}, 8, ["label"])) : H("", !0),
|
|
596
|
+
S.value === "tel" ? (u(), _(e(B), {
|
|
598
597
|
key: 2,
|
|
599
598
|
label: e(l)("fields.pattern"),
|
|
600
599
|
help: e(l)("fields.pattern-help")
|
|
601
600
|
}, {
|
|
602
601
|
default: a(() => [
|
|
603
602
|
t(e(X), {
|
|
604
|
-
"model-value":
|
|
605
|
-
"onUpdate:modelValue":
|
|
603
|
+
"model-value": c.value.pattern ?? "",
|
|
604
|
+
"onUpdate:modelValue": x[8] || (x[8] = (h) => g("pattern", h))
|
|
606
605
|
}, null, 8, ["model-value"])
|
|
607
606
|
]),
|
|
608
607
|
_: 1
|
|
609
|
-
}, 8, ["label", "help"])) :
|
|
610
|
-
|
|
611
|
-
t(e(
|
|
608
|
+
}, 8, ["label", "help"])) : H("", !0),
|
|
609
|
+
S.value === "date" ? (u(), j(ee, { key: 3 }, [
|
|
610
|
+
t(e(B), {
|
|
612
611
|
label: e(l)("fields.earliest")
|
|
613
612
|
}, {
|
|
614
613
|
default: a(() => [
|
|
615
|
-
t(e(
|
|
614
|
+
t(e(Ke), {
|
|
616
615
|
clearable: "",
|
|
617
|
-
"model-value":
|
|
618
|
-
"onUpdate:modelValue":
|
|
616
|
+
"model-value": c.value.min ?? null,
|
|
617
|
+
"onUpdate:modelValue": x[9] || (x[9] = (h) => g("min", h))
|
|
619
618
|
}, null, 8, ["model-value"])
|
|
620
619
|
]),
|
|
621
620
|
_: 1
|
|
622
621
|
}, 8, ["label"]),
|
|
623
|
-
t(e(
|
|
622
|
+
t(e(B), {
|
|
624
623
|
label: e(l)("fields.latest")
|
|
625
624
|
}, {
|
|
626
625
|
default: a(() => [
|
|
627
|
-
t(e(
|
|
626
|
+
t(e(Ke), {
|
|
628
627
|
clearable: "",
|
|
629
|
-
"model-value":
|
|
630
|
-
"onUpdate:modelValue":
|
|
628
|
+
"model-value": c.value.max ?? null,
|
|
629
|
+
"onUpdate:modelValue": x[10] || (x[10] = (h) => g("max", h))
|
|
631
630
|
}, null, 8, ["model-value"])
|
|
632
631
|
]),
|
|
633
632
|
_: 1
|
|
634
633
|
}, 8, ["label"])
|
|
635
|
-
], 64)) :
|
|
636
|
-
|
|
637
|
-
t(e(
|
|
634
|
+
], 64)) : H("", !0),
|
|
635
|
+
S.value === "checkbox" ? (u(), j(ee, { key: 4 }, [
|
|
636
|
+
t(e(B), {
|
|
638
637
|
label: e(l)("fields.min-choices")
|
|
639
638
|
}, {
|
|
640
639
|
default: a(() => [
|
|
641
640
|
t(e(_e), {
|
|
642
|
-
"model-value":
|
|
641
|
+
"model-value": c.value.min ?? null,
|
|
643
642
|
min: 0,
|
|
644
|
-
"onUpdate:modelValue":
|
|
643
|
+
"onUpdate:modelValue": x[11] || (x[11] = (h) => g("min", h))
|
|
645
644
|
}, null, 8, ["model-value"])
|
|
646
645
|
]),
|
|
647
646
|
_: 1
|
|
648
647
|
}, 8, ["label"]),
|
|
649
|
-
t(e(
|
|
648
|
+
t(e(B), {
|
|
650
649
|
label: e(l)("fields.max-choices")
|
|
651
650
|
}, {
|
|
652
651
|
default: a(() => [
|
|
653
652
|
t(e(_e), {
|
|
654
|
-
"model-value":
|
|
653
|
+
"model-value": c.value.max ?? null,
|
|
655
654
|
min: 0,
|
|
656
|
-
"onUpdate:modelValue":
|
|
655
|
+
"onUpdate:modelValue": x[12] || (x[12] = (h) => g("max", h))
|
|
657
656
|
}, null, 8, ["model-value"])
|
|
658
657
|
]),
|
|
659
658
|
_: 1
|
|
660
659
|
}, 8, ["label"])
|
|
661
|
-
], 64)) :
|
|
662
|
-
|
|
660
|
+
], 64)) : H("", !0),
|
|
661
|
+
S.value === "file" ? (u(), _(e(B), {
|
|
663
662
|
key: 5,
|
|
664
663
|
label: e(l)("fields.max-size")
|
|
665
664
|
}, {
|
|
666
665
|
default: a(() => [
|
|
667
666
|
t(e(_e), {
|
|
668
|
-
"model-value":
|
|
667
|
+
"model-value": c.value.max_size ?? null,
|
|
669
668
|
min: 1,
|
|
670
|
-
"onUpdate:modelValue":
|
|
669
|
+
"onUpdate:modelValue": x[13] || (x[13] = (h) => g("max_size", h))
|
|
671
670
|
}, null, 8, ["model-value"])
|
|
672
671
|
]),
|
|
673
672
|
_: 1
|
|
674
|
-
}, 8, ["label"])) :
|
|
673
|
+
}, 8, ["label"])) : H("", !0)
|
|
675
674
|
]),
|
|
676
|
-
|
|
677
|
-
t(e(
|
|
675
|
+
S.value === "file" ? (u(), j(ee, { key: 3 }, [
|
|
676
|
+
t(e(B), {
|
|
678
677
|
label: e(l)("fields.extensions"),
|
|
679
678
|
help: e(l)("fields.extensions-help")
|
|
680
679
|
}, {
|
|
681
680
|
default: a(() => [
|
|
682
681
|
t(e(fl), {
|
|
683
|
-
modelValue:
|
|
684
|
-
"onUpdate:modelValue":
|
|
682
|
+
modelValue: C.value,
|
|
683
|
+
"onUpdate:modelValue": x[14] || (x[14] = (h) => C.value = h)
|
|
685
684
|
}, null, 8, ["modelValue"])
|
|
686
685
|
]),
|
|
687
686
|
_: 1
|
|
688
687
|
}, 8, ["label", "help"]),
|
|
689
|
-
t(e(
|
|
690
|
-
"model-value": !!
|
|
688
|
+
t(e(ve), {
|
|
689
|
+
"model-value": !!c.value.multiple,
|
|
691
690
|
label: e(l)("fields.multiple"),
|
|
692
|
-
"onUpdate:modelValue":
|
|
691
|
+
"onUpdate:modelValue": x[15] || (x[15] = (h) => g("multiple", h))
|
|
693
692
|
}, null, 8, ["model-value", "label"])
|
|
694
|
-
], 64)) :
|
|
695
|
-
|
|
696
|
-
t(e(
|
|
697
|
-
modelValue:
|
|
698
|
-
"onUpdate:modelValue":
|
|
693
|
+
], 64)) : H("", !0),
|
|
694
|
+
G("div", Al, [
|
|
695
|
+
t(e(ve), {
|
|
696
|
+
modelValue: U.value,
|
|
697
|
+
"onUpdate:modelValue": x[16] || (x[16] = (h) => U.value = h),
|
|
699
698
|
label: e(l)("fields.is-enabled")
|
|
700
699
|
}, null, 8, ["modelValue", "label"]),
|
|
701
|
-
t(e(
|
|
702
|
-
modelValue:
|
|
703
|
-
"onUpdate:modelValue":
|
|
700
|
+
t(e(ve), {
|
|
701
|
+
modelValue: f.value,
|
|
702
|
+
"onUpdate:modelValue": x[17] || (x[17] = (h) => f.value = h),
|
|
704
703
|
label: e(l)("fields.is-required")
|
|
705
704
|
}, null, 8, ["modelValue", "label"]),
|
|
706
|
-
|
|
705
|
+
S.value !== "hidden" ? (u(), _(e(ve), {
|
|
707
706
|
key: 0,
|
|
708
|
-
modelValue:
|
|
709
|
-
"onUpdate:modelValue":
|
|
707
|
+
modelValue: I.value,
|
|
708
|
+
"onUpdate:modelValue": x[18] || (x[18] = (h) => I.value = h),
|
|
710
709
|
label: e(l)("fields.is-fullsize")
|
|
711
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
712
|
-
t(e(
|
|
713
|
-
modelValue:
|
|
714
|
-
"onUpdate:modelValue":
|
|
710
|
+
}, null, 8, ["modelValue", "label"])) : H("", !0),
|
|
711
|
+
t(e(ve), {
|
|
712
|
+
modelValue: w.value,
|
|
713
|
+
"onUpdate:modelValue": x[19] || (x[19] = (h) => w.value = h),
|
|
715
714
|
label: e(l)("fields.in-table")
|
|
716
715
|
}, null, 8, ["modelValue", "label"])
|
|
717
716
|
])
|
|
@@ -720,12 +719,12 @@ const Cl = [
|
|
|
720
719
|
_: 1
|
|
721
720
|
}, 8, ["open", "title"]));
|
|
722
721
|
}
|
|
723
|
-
}),
|
|
724
|
-
const
|
|
725
|
-
for (const [v, n] of
|
|
726
|
-
|
|
727
|
-
return
|
|
728
|
-
}, Nl = /* @__PURE__ */
|
|
722
|
+
}), ie = (r, s) => {
|
|
723
|
+
const o = r.__vccOpts || r;
|
|
724
|
+
for (const [v, n] of s)
|
|
725
|
+
o[v] = n;
|
|
726
|
+
return o;
|
|
727
|
+
}, Nl = /* @__PURE__ */ ie(Il, [["__scopeId", "data-v-6696bbc1"]]), Dl = { class: "wx-inbox-field" }, Ml = { class: "wx-inbox-field__name" }, Ll = /* @__PURE__ */ ae({
|
|
729
728
|
__name: "FieldList",
|
|
730
729
|
props: /* @__PURE__ */ Me({
|
|
731
730
|
form: {},
|
|
@@ -735,103 +734,103 @@ const Cl = [
|
|
|
735
734
|
modelModifiers: {}
|
|
736
735
|
}),
|
|
737
736
|
emits: ["update:modelValue"],
|
|
738
|
-
setup(
|
|
739
|
-
const
|
|
737
|
+
setup(r) {
|
|
738
|
+
const s = r, o = $e(r, "modelValue"), v = oe(), n = re(v), d = xe();
|
|
740
739
|
de();
|
|
741
|
-
const
|
|
742
|
-
function
|
|
743
|
-
return
|
|
740
|
+
const m = te("webx-inbox"), l = me(), $ = Re(Nl);
|
|
741
|
+
function p(c) {
|
|
742
|
+
return pe(c.title, d.active.value, c.key);
|
|
744
743
|
}
|
|
745
|
-
function c
|
|
744
|
+
function i(c) {
|
|
746
745
|
return [
|
|
747
|
-
|
|
748
|
-
...
|
|
749
|
-
...
|
|
750
|
-
...
|
|
746
|
+
m(`fields.type-${c.type}`),
|
|
747
|
+
...c.is_required ? [m("fields.is-required")] : [],
|
|
748
|
+
...c.in_table ? [m("fields.in-table")] : [],
|
|
749
|
+
...c.is_fullsize ? [] : [m("fields.is-fullsize")]
|
|
751
750
|
];
|
|
752
751
|
}
|
|
753
|
-
const
|
|
754
|
-
async function
|
|
755
|
-
const
|
|
756
|
-
|
|
757
|
-
}
|
|
758
|
-
async function T(
|
|
759
|
-
if (await
|
|
760
|
-
title:
|
|
761
|
-
message:
|
|
762
|
-
confirmText:
|
|
763
|
-
cancelText:
|
|
752
|
+
const O = F(() => o.value.length === 0);
|
|
753
|
+
async function S(c) {
|
|
754
|
+
const U = await $({ field: c, form: s.form });
|
|
755
|
+
U && (o.value = c === null ? [...o.value, U] : o.value.map((f) => f.id === U.id ? U : f));
|
|
756
|
+
}
|
|
757
|
+
async function T(c) {
|
|
758
|
+
if (await Ce({
|
|
759
|
+
title: m("fields.delete-title", { field: p(c) }),
|
|
760
|
+
message: m("fields.delete-text"),
|
|
761
|
+
confirmText: m("fields.delete"),
|
|
762
|
+
cancelText: m("fields.cancel"),
|
|
764
763
|
tone: "danger"
|
|
765
764
|
}))
|
|
766
765
|
try {
|
|
767
|
-
await n.removeField(
|
|
768
|
-
} catch (
|
|
769
|
-
E.danger(l(
|
|
766
|
+
await n.removeField(c.id), o.value = o.value.filter((f) => f.id !== c.id), E.success(m("panel.deleted"));
|
|
767
|
+
} catch (f) {
|
|
768
|
+
E.danger(l(f));
|
|
770
769
|
}
|
|
771
770
|
}
|
|
772
|
-
function
|
|
773
|
-
return
|
|
774
|
-
{ key: "edit", icon: "edit", label:
|
|
775
|
-
|
|
771
|
+
function b(c) {
|
|
772
|
+
return s.canManage ? [
|
|
773
|
+
{ key: "edit", icon: "edit", label: m("fields.edit-field"), run: () => {
|
|
774
|
+
S(c);
|
|
776
775
|
} },
|
|
777
776
|
{
|
|
778
777
|
key: "delete",
|
|
779
778
|
icon: "trash",
|
|
780
|
-
label:
|
|
779
|
+
label: m("fields.delete"),
|
|
781
780
|
danger: !0,
|
|
782
781
|
run: () => {
|
|
783
|
-
T(
|
|
782
|
+
T(c);
|
|
784
783
|
}
|
|
785
784
|
}
|
|
786
785
|
] : [];
|
|
787
786
|
}
|
|
788
|
-
async function
|
|
787
|
+
async function q() {
|
|
789
788
|
try {
|
|
790
789
|
await n.sortFields(
|
|
791
|
-
|
|
792
|
-
|
|
790
|
+
s.form.id,
|
|
791
|
+
o.value.map((c) => c.id)
|
|
793
792
|
);
|
|
794
|
-
} catch (
|
|
795
|
-
E.danger(l(
|
|
793
|
+
} catch (c) {
|
|
794
|
+
E.danger(l(c, m("panel.reorder-failed")));
|
|
796
795
|
}
|
|
797
796
|
}
|
|
798
|
-
return (
|
|
799
|
-
title: e(
|
|
800
|
-
},
|
|
797
|
+
return (c, U) => (u(), _(e(se), {
|
|
798
|
+
title: e(m)("panel.tab-fields")
|
|
799
|
+
}, Ie({
|
|
801
800
|
default: a(() => [
|
|
802
|
-
|
|
801
|
+
O.value ? (u(), _(e(Be), {
|
|
803
802
|
key: 0,
|
|
804
|
-
title: e(
|
|
805
|
-
description: e(
|
|
806
|
-
}, null, 8, ["title", "description"])) : (
|
|
803
|
+
title: e(m)("fields.no-fields"),
|
|
804
|
+
description: e(m)("fields.no-fields-help")
|
|
805
|
+
}, null, 8, ["title", "description"])) : (u(), _(e(Ze), {
|
|
807
806
|
key: 1,
|
|
808
|
-
modelValue:
|
|
809
|
-
"onUpdate:modelValue":
|
|
807
|
+
modelValue: o.value,
|
|
808
|
+
"onUpdate:modelValue": U[1] || (U[1] = (f) => o.value = f),
|
|
810
809
|
plain: "",
|
|
811
810
|
"item-key": "id",
|
|
812
|
-
"item-label":
|
|
813
|
-
disabled: !
|
|
814
|
-
"aria-label": e(
|
|
815
|
-
onMove:
|
|
811
|
+
"item-label": p,
|
|
812
|
+
disabled: !r.canManage,
|
|
813
|
+
"aria-label": e(m)("panel.tab-fields"),
|
|
814
|
+
onMove: q
|
|
816
815
|
}, {
|
|
817
|
-
default: a(({ item:
|
|
818
|
-
|
|
819
|
-
|
|
816
|
+
default: a(({ item: f }) => [
|
|
817
|
+
G("div", Dl, [
|
|
818
|
+
G("div", Ml, [
|
|
820
819
|
t(e(J), {
|
|
821
820
|
weight: "medium",
|
|
822
821
|
truncate: ""
|
|
823
822
|
}, {
|
|
824
823
|
default: a(() => [
|
|
825
|
-
|
|
824
|
+
z(k(p(f)), 1)
|
|
826
825
|
]),
|
|
827
826
|
_: 2
|
|
828
827
|
}, 1024),
|
|
829
|
-
|
|
828
|
+
f.is_enabled ? H("", !0) : (u(), _(e(Ue), {
|
|
830
829
|
key: 0,
|
|
831
830
|
type: "default"
|
|
832
831
|
}, {
|
|
833
832
|
default: a(() => [
|
|
834
|
-
|
|
833
|
+
z(k(e(m)("panel.off")), 1)
|
|
835
834
|
]),
|
|
836
835
|
_: 1
|
|
837
836
|
}))
|
|
@@ -842,17 +841,17 @@ const Cl = [
|
|
|
842
841
|
truncate: ""
|
|
843
842
|
}, {
|
|
844
843
|
default: a(() => [
|
|
845
|
-
|
|
846
|
-
|
|
844
|
+
G("code", null, "fields[" + k(f.key) + "]", 1),
|
|
845
|
+
z(" · " + k(i(f).join(" · ")), 1)
|
|
847
846
|
]),
|
|
848
847
|
_: 2
|
|
849
848
|
}, 1024)
|
|
850
849
|
])
|
|
851
850
|
]),
|
|
852
|
-
actions: a(({ item:
|
|
853
|
-
t(e(
|
|
854
|
-
actions:
|
|
855
|
-
label:
|
|
851
|
+
actions: a(({ item: f }) => [
|
|
852
|
+
t(e(Te), {
|
|
853
|
+
actions: b(f),
|
|
854
|
+
label: p(f)
|
|
856
855
|
}, null, 8, ["actions", "label"])
|
|
857
856
|
]),
|
|
858
857
|
_: 1
|
|
@@ -860,19 +859,19 @@ const Cl = [
|
|
|
860
859
|
]),
|
|
861
860
|
_: 2
|
|
862
861
|
}, [
|
|
863
|
-
|
|
862
|
+
r.canManage ? {
|
|
864
863
|
name: "extra",
|
|
865
864
|
fn: a(() => [
|
|
866
|
-
t(e(
|
|
865
|
+
t(e(le), {
|
|
867
866
|
type: "primary",
|
|
868
867
|
size: "sm",
|
|
869
|
-
onClick:
|
|
868
|
+
onClick: U[0] || (U[0] = (f) => S(null))
|
|
870
869
|
}, {
|
|
871
870
|
icon: a(() => [
|
|
872
|
-
t(e(
|
|
871
|
+
t(e(Ve), { name: "plus" })
|
|
873
872
|
]),
|
|
874
873
|
default: a(() => [
|
|
875
|
-
|
|
874
|
+
z(" " + k(e(m)("fields.new-field")), 1)
|
|
876
875
|
]),
|
|
877
876
|
_: 1
|
|
878
877
|
})
|
|
@@ -881,79 +880,79 @@ const Cl = [
|
|
|
881
880
|
} : void 0
|
|
882
881
|
]), 1032, ["title"]));
|
|
883
882
|
}
|
|
884
|
-
}),
|
|
885
|
-
function
|
|
886
|
-
return
|
|
887
|
-
get: () =>
|
|
883
|
+
}), Ol = /* @__PURE__ */ ie(Ll, [["__scopeId", "data-v-421ed0af"]]);
|
|
884
|
+
function ce(r, s, o) {
|
|
885
|
+
return F({
|
|
886
|
+
get: () => r.value[s] ?? o,
|
|
888
887
|
set: (v) => {
|
|
889
|
-
const n = { ...
|
|
890
|
-
v === "" || v === null || v === void 0 ? delete n[
|
|
888
|
+
const n = { ...r.value };
|
|
889
|
+
v === "" || v === null || v === void 0 ? delete n[s] : n[s] = v, r.value = n;
|
|
891
890
|
}
|
|
892
891
|
});
|
|
893
892
|
}
|
|
894
|
-
const
|
|
893
|
+
const El = /* @__PURE__ */ ae({
|
|
895
894
|
__name: "FormAntispam",
|
|
896
895
|
props: {
|
|
897
896
|
modelValue: { required: !0 },
|
|
898
897
|
modelModifiers: {}
|
|
899
898
|
},
|
|
900
899
|
emits: ["update:modelValue"],
|
|
901
|
-
setup(
|
|
902
|
-
const
|
|
903
|
-
{ value: "off", label:
|
|
904
|
-
{ value: "recaptcha", label:
|
|
905
|
-
{ value: "turnstile", label:
|
|
900
|
+
setup(r) {
|
|
901
|
+
const s = $e(r, "modelValue"), o = te("webx-inbox"), v = ce(s, "antispam.honeypot", !0), n = ce(s, "antispam.min_seconds", 3), d = ce(s, "antispam.throttle", 5), m = ce(s, "antispam.captcha", "off"), l = F(() => [
|
|
902
|
+
{ value: "off", label: o("panel.captcha-off") },
|
|
903
|
+
{ value: "recaptcha", label: o("panel.captcha-recaptcha") },
|
|
904
|
+
{ value: "turnstile", label: o("panel.captcha-turnstile") }
|
|
906
905
|
]);
|
|
907
|
-
return (
|
|
906
|
+
return ($, p) => (u(), _(e(se), null, {
|
|
908
907
|
default: a(() => [
|
|
909
|
-
t(e(
|
|
910
|
-
label: e(
|
|
911
|
-
help: e(
|
|
908
|
+
t(e(B), {
|
|
909
|
+
label: e(o)("panel.honeypot"),
|
|
910
|
+
help: e(o)("panel.honeypot-help")
|
|
912
911
|
}, {
|
|
913
912
|
default: a(() => [
|
|
914
|
-
t(e(
|
|
913
|
+
t(e(ol), {
|
|
915
914
|
modelValue: e(v),
|
|
916
|
-
"onUpdate:modelValue":
|
|
915
|
+
"onUpdate:modelValue": p[0] || (p[0] = (i) => ne(v) ? v.value = i : null)
|
|
917
916
|
}, null, 8, ["modelValue"])
|
|
918
917
|
]),
|
|
919
918
|
_: 1
|
|
920
919
|
}, 8, ["label", "help"]),
|
|
921
|
-
t(e(
|
|
922
|
-
label: e(
|
|
923
|
-
help: e(
|
|
920
|
+
t(e(B), {
|
|
921
|
+
label: e(o)("panel.min-seconds"),
|
|
922
|
+
help: e(o)("panel.min-seconds-help")
|
|
924
923
|
}, {
|
|
925
924
|
default: a(() => [
|
|
926
925
|
t(e(_e), {
|
|
927
926
|
modelValue: e(n),
|
|
928
|
-
"onUpdate:modelValue":
|
|
927
|
+
"onUpdate:modelValue": p[1] || (p[1] = (i) => ne(n) ? n.value = i : null),
|
|
929
928
|
min: 0,
|
|
930
929
|
max: 120
|
|
931
930
|
}, null, 8, ["modelValue"])
|
|
932
931
|
]),
|
|
933
932
|
_: 1
|
|
934
933
|
}, 8, ["label", "help"]),
|
|
935
|
-
t(e(
|
|
936
|
-
label: e(
|
|
937
|
-
help: e(
|
|
934
|
+
t(e(B), {
|
|
935
|
+
label: e(o)("panel.throttle"),
|
|
936
|
+
help: e(o)("panel.throttle-help")
|
|
938
937
|
}, {
|
|
939
938
|
default: a(() => [
|
|
940
939
|
t(e(_e), {
|
|
941
|
-
modelValue: e(
|
|
942
|
-
"onUpdate:modelValue":
|
|
940
|
+
modelValue: e(d),
|
|
941
|
+
"onUpdate:modelValue": p[2] || (p[2] = (i) => ne(d) ? d.value = i : null),
|
|
943
942
|
min: 0,
|
|
944
943
|
max: 120
|
|
945
944
|
}, null, 8, ["modelValue"])
|
|
946
945
|
]),
|
|
947
946
|
_: 1
|
|
948
947
|
}, 8, ["label", "help"]),
|
|
949
|
-
t(e(
|
|
950
|
-
label: e(
|
|
951
|
-
help: e(
|
|
948
|
+
t(e(B), {
|
|
949
|
+
label: e(o)("panel.captcha"),
|
|
950
|
+
help: e(o)("panel.captcha-help")
|
|
952
951
|
}, {
|
|
953
952
|
default: a(() => [
|
|
954
|
-
t(e(
|
|
955
|
-
modelValue: e(
|
|
956
|
-
"onUpdate:modelValue":
|
|
953
|
+
t(e(fe), {
|
|
954
|
+
modelValue: e(m),
|
|
955
|
+
"onUpdate:modelValue": p[3] || (p[3] = (i) => ne(m) ? m.value = i : null),
|
|
957
956
|
options: l.value
|
|
958
957
|
}, null, 8, ["modelValue", "options"])
|
|
959
958
|
]),
|
|
@@ -970,26 +969,26 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
970
969
|
slug: {},
|
|
971
970
|
fields: {}
|
|
972
971
|
},
|
|
973
|
-
setup(
|
|
974
|
-
const
|
|
972
|
+
setup(r) {
|
|
973
|
+
const s = r;
|
|
975
974
|
de();
|
|
976
|
-
const
|
|
975
|
+
const o = te("webx-inbox"), v = F(() => `<x-webx-form slug="${s.slug}" />`), n = F(
|
|
977
976
|
() => `{{-- resources/views/blocks/contact.blade.php --}}
|
|
978
|
-
<x-webx-form slug="${
|
|
979
|
-
),
|
|
980
|
-
{ key: "key", label:
|
|
981
|
-
{ key: "title", label:
|
|
982
|
-
{ key: "type", label:
|
|
983
|
-
]),
|
|
984
|
-
async function l(
|
|
977
|
+
<x-webx-form slug="${s.slug}" />`
|
|
978
|
+
), d = F(() => [
|
|
979
|
+
{ key: "key", label: o("fields.name") },
|
|
980
|
+
{ key: "title", label: o("fields.title") },
|
|
981
|
+
{ key: "type", label: o("fields.type"), hideBelow: 520 }
|
|
982
|
+
]), m = F(() => s.fields.filter(($) => $.is_enabled));
|
|
983
|
+
async function l($) {
|
|
985
984
|
try {
|
|
986
|
-
await navigator.clipboard.writeText(
|
|
985
|
+
await navigator.clipboard.writeText($), E.success(o("panel.copied"));
|
|
987
986
|
} catch {
|
|
988
987
|
}
|
|
989
988
|
}
|
|
990
|
-
return (
|
|
989
|
+
return ($, p) => (u(), j("div", Pl, [
|
|
991
990
|
t(e(se), {
|
|
992
|
-
title: e(
|
|
991
|
+
title: e(o)("panel.embed-blade")
|
|
993
992
|
}, {
|
|
994
993
|
default: a(() => [
|
|
995
994
|
t(e(J), {
|
|
@@ -997,23 +996,23 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
997
996
|
tone: "muted"
|
|
998
997
|
}, {
|
|
999
998
|
default: a(() => [
|
|
1000
|
-
|
|
999
|
+
z(k(e(o)("panel.embed-blade-help")), 1)
|
|
1001
1000
|
]),
|
|
1002
1001
|
_: 1
|
|
1003
1002
|
}),
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
t(e(
|
|
1003
|
+
G("div", Rl, [
|
|
1004
|
+
G("code", null, k(v.value), 1),
|
|
1005
|
+
t(e(ke), {
|
|
1007
1006
|
icon: "copy",
|
|
1008
|
-
title: e(
|
|
1009
|
-
onClick:
|
|
1007
|
+
title: e(o)("panel.copy"),
|
|
1008
|
+
onClick: p[0] || (p[0] = (i) => l(v.value))
|
|
1010
1009
|
}, null, 8, ["title"])
|
|
1011
1010
|
])
|
|
1012
1011
|
]),
|
|
1013
1012
|
_: 1
|
|
1014
1013
|
}, 8, ["title"]),
|
|
1015
1014
|
t(e(se), {
|
|
1016
|
-
title: e(
|
|
1015
|
+
title: e(o)("panel.embed-block")
|
|
1017
1016
|
}, {
|
|
1018
1017
|
default: a(() => [
|
|
1019
1018
|
t(e(J), {
|
|
@@ -1021,23 +1020,23 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1021
1020
|
tone: "muted"
|
|
1022
1021
|
}, {
|
|
1023
1022
|
default: a(() => [
|
|
1024
|
-
|
|
1023
|
+
z(k(e(o)("panel.embed-block-help")), 1)
|
|
1025
1024
|
]),
|
|
1026
1025
|
_: 1
|
|
1027
1026
|
}),
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
t(e(
|
|
1027
|
+
G("div", Bl, [
|
|
1028
|
+
G("code", null, k(n.value), 1),
|
|
1029
|
+
t(e(ke), {
|
|
1031
1030
|
icon: "copy",
|
|
1032
|
-
title: e(
|
|
1033
|
-
onClick:
|
|
1031
|
+
title: e(o)("panel.copy"),
|
|
1032
|
+
onClick: p[1] || (p[1] = (i) => l(n.value))
|
|
1034
1033
|
}, null, 8, ["title"])
|
|
1035
1034
|
])
|
|
1036
1035
|
]),
|
|
1037
1036
|
_: 1
|
|
1038
1037
|
}, 8, ["title"]),
|
|
1039
1038
|
t(e(se), {
|
|
1040
|
-
title: e(
|
|
1039
|
+
title: e(o)("panel.embed-names")
|
|
1041
1040
|
}, {
|
|
1042
1041
|
default: a(() => [
|
|
1043
1042
|
t(e(J), {
|
|
@@ -1045,33 +1044,33 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1045
1044
|
tone: "muted"
|
|
1046
1045
|
}, {
|
|
1047
1046
|
default: a(() => [
|
|
1048
|
-
|
|
1047
|
+
z(k(e(o)("panel.embed-names-help")), 1)
|
|
1049
1048
|
]),
|
|
1050
1049
|
_: 1
|
|
1051
1050
|
}),
|
|
1052
|
-
t(e(
|
|
1053
|
-
data:
|
|
1054
|
-
columns:
|
|
1051
|
+
t(e(il), {
|
|
1052
|
+
data: m.value,
|
|
1053
|
+
columns: d.value,
|
|
1055
1054
|
"row-key": "id",
|
|
1056
1055
|
flush: "",
|
|
1057
|
-
"empty-text": e(
|
|
1056
|
+
"empty-text": e(o)("fields.no-fields")
|
|
1058
1057
|
}, {
|
|
1059
|
-
"cell-key": a(({ row:
|
|
1058
|
+
"cell-key": a(({ row: i }) => [
|
|
1060
1059
|
t(e(J), {
|
|
1061
1060
|
mono: "",
|
|
1062
1061
|
size: "sm"
|
|
1063
1062
|
}, {
|
|
1064
1063
|
default: a(() => [
|
|
1065
|
-
|
|
1064
|
+
z("fields[" + k(i.key) + "]", 1)
|
|
1066
1065
|
]),
|
|
1067
1066
|
_: 2
|
|
1068
1067
|
}, 1024)
|
|
1069
1068
|
]),
|
|
1070
|
-
"cell-title": a(({ row:
|
|
1071
|
-
|
|
1069
|
+
"cell-title": a(({ row: i }) => [
|
|
1070
|
+
z(k(Object.values(i.title)[0] ?? i.key), 1)
|
|
1072
1071
|
]),
|
|
1073
|
-
"cell-type": a(({ row:
|
|
1074
|
-
|
|
1072
|
+
"cell-type": a(({ row: i }) => [
|
|
1073
|
+
z(k(e(o)(`fields.type-${i.type}`)), 1)
|
|
1075
1074
|
]),
|
|
1076
1075
|
_: 1
|
|
1077
1076
|
}, 8, ["data", "columns", "empty-text"])
|
|
@@ -1080,7 +1079,7 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1080
1079
|
}, 8, ["title"])
|
|
1081
1080
|
]));
|
|
1082
1081
|
}
|
|
1083
|
-
}), Gl = /* @__PURE__ */
|
|
1082
|
+
}), Gl = /* @__PURE__ */ ie(Hl, [["__scopeId", "data-v-fdabb537"]]), jl = { class: "wx-inbox-general" }, Kl = /* @__PURE__ */ ae({
|
|
1084
1083
|
__name: "FormGeneral",
|
|
1085
1084
|
props: /* @__PURE__ */ Me({
|
|
1086
1085
|
errors: {}
|
|
@@ -1091,51 +1090,51 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1091
1090
|
optionsModifiers: {}
|
|
1092
1091
|
}),
|
|
1093
1092
|
emits: ["update:settings", "update:options"],
|
|
1094
|
-
setup(
|
|
1095
|
-
const
|
|
1096
|
-
|
|
1093
|
+
setup(r) {
|
|
1094
|
+
const s = $e(
|
|
1095
|
+
r,
|
|
1097
1096
|
"settings"
|
|
1098
|
-
),
|
|
1099
|
-
return (
|
|
1097
|
+
), o = $e(r, "options"), v = te("webx-inbox"), n = ce(o, "thank-you.heading", {}), d = ce(o, "thank-you.text", {}), m = ce(o, "design.submit-text", {}), l = ce(o, "redirect", "");
|
|
1098
|
+
return ($, p) => (u(), j("div", jl, [
|
|
1100
1099
|
t(e(se), null, {
|
|
1101
1100
|
default: a(() => [
|
|
1102
|
-
t(e(
|
|
1101
|
+
t(e(B), {
|
|
1103
1102
|
label: e(v)("panel.title"),
|
|
1104
|
-
error:
|
|
1103
|
+
error: r.errors.title?.[0],
|
|
1105
1104
|
required: ""
|
|
1106
1105
|
}, {
|
|
1107
1106
|
default: a(() => [
|
|
1108
1107
|
t(e(X), {
|
|
1109
|
-
modelValue:
|
|
1110
|
-
"onUpdate:modelValue":
|
|
1108
|
+
modelValue: s.value.title,
|
|
1109
|
+
"onUpdate:modelValue": p[0] || (p[0] = (i) => s.value.title = i),
|
|
1111
1110
|
localized: ""
|
|
1112
1111
|
}, null, 8, ["modelValue"])
|
|
1113
1112
|
]),
|
|
1114
1113
|
_: 1
|
|
1115
1114
|
}, 8, ["label", "error"]),
|
|
1116
|
-
t(e(
|
|
1115
|
+
t(e(B), {
|
|
1117
1116
|
label: e(v)("panel.slug"),
|
|
1118
1117
|
help: e(v)("panel.slug-help"),
|
|
1119
|
-
error:
|
|
1118
|
+
error: r.errors.slug?.[0],
|
|
1120
1119
|
required: ""
|
|
1121
1120
|
}, {
|
|
1122
1121
|
default: a(() => [
|
|
1123
1122
|
t(e(X), {
|
|
1124
|
-
modelValue:
|
|
1125
|
-
"onUpdate:modelValue":
|
|
1123
|
+
modelValue: s.value.slug,
|
|
1124
|
+
"onUpdate:modelValue": p[1] || (p[1] = (i) => s.value.slug = i),
|
|
1126
1125
|
placeholder: "contact"
|
|
1127
1126
|
}, null, 8, ["modelValue"])
|
|
1128
1127
|
]),
|
|
1129
1128
|
_: 1
|
|
1130
1129
|
}, 8, ["label", "help", "error"]),
|
|
1131
|
-
t(e(
|
|
1130
|
+
t(e(B), {
|
|
1132
1131
|
label: e(v)("panel.is-enabled"),
|
|
1133
1132
|
help: e(v)("panel.is-enabled-help")
|
|
1134
1133
|
}, {
|
|
1135
1134
|
default: a(() => [
|
|
1136
|
-
t(e(
|
|
1137
|
-
modelValue:
|
|
1138
|
-
"onUpdate:modelValue":
|
|
1135
|
+
t(e(ol), {
|
|
1136
|
+
modelValue: s.value.is_enabled,
|
|
1137
|
+
"onUpdate:modelValue": p[2] || (p[2] = (i) => s.value.is_enabled = i)
|
|
1139
1138
|
}, null, 8, ["modelValue"])
|
|
1140
1139
|
]),
|
|
1141
1140
|
_: 1
|
|
@@ -1147,49 +1146,49 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1147
1146
|
title: e(v)("panel.after-sending")
|
|
1148
1147
|
}, {
|
|
1149
1148
|
default: a(() => [
|
|
1150
|
-
t(e(
|
|
1149
|
+
t(e(B), {
|
|
1151
1150
|
label: e(v)("panel.submit-text")
|
|
1152
1151
|
}, {
|
|
1153
1152
|
default: a(() => [
|
|
1154
1153
|
t(e(X), {
|
|
1155
|
-
modelValue: e(
|
|
1156
|
-
"onUpdate:modelValue":
|
|
1154
|
+
modelValue: e(m),
|
|
1155
|
+
"onUpdate:modelValue": p[3] || (p[3] = (i) => ne(m) ? m.value = i : null),
|
|
1157
1156
|
localized: ""
|
|
1158
1157
|
}, null, 8, ["modelValue"])
|
|
1159
1158
|
]),
|
|
1160
1159
|
_: 1
|
|
1161
1160
|
}, 8, ["label"]),
|
|
1162
|
-
t(e(
|
|
1161
|
+
t(e(B), {
|
|
1163
1162
|
label: e(v)("panel.thank-you-heading")
|
|
1164
1163
|
}, {
|
|
1165
1164
|
default: a(() => [
|
|
1166
1165
|
t(e(X), {
|
|
1167
1166
|
modelValue: e(n),
|
|
1168
|
-
"onUpdate:modelValue":
|
|
1167
|
+
"onUpdate:modelValue": p[4] || (p[4] = (i) => ne(n) ? n.value = i : null),
|
|
1169
1168
|
localized: ""
|
|
1170
1169
|
}, null, 8, ["modelValue"])
|
|
1171
1170
|
]),
|
|
1172
1171
|
_: 1
|
|
1173
1172
|
}, 8, ["label"]),
|
|
1174
|
-
t(e(
|
|
1173
|
+
t(e(B), {
|
|
1175
1174
|
label: e(v)("panel.thank-you-text")
|
|
1176
1175
|
}, {
|
|
1177
1176
|
default: a(() => [
|
|
1178
|
-
t(
|
|
1179
|
-
modelValue: e(
|
|
1180
|
-
"onUpdate:modelValue":
|
|
1177
|
+
t(ul, {
|
|
1178
|
+
modelValue: e(d),
|
|
1179
|
+
"onUpdate:modelValue": p[5] || (p[5] = (i) => ne(d) ? d.value = i : null)
|
|
1181
1180
|
}, null, 8, ["modelValue"])
|
|
1182
1181
|
]),
|
|
1183
1182
|
_: 1
|
|
1184
1183
|
}, 8, ["label"]),
|
|
1185
|
-
t(e(
|
|
1184
|
+
t(e(B), {
|
|
1186
1185
|
label: e(v)("panel.redirect"),
|
|
1187
1186
|
help: e(v)("panel.redirect-help")
|
|
1188
1187
|
}, {
|
|
1189
1188
|
default: a(() => [
|
|
1190
1189
|
t(e(X), {
|
|
1191
1190
|
modelValue: e(l),
|
|
1192
|
-
"onUpdate:modelValue":
|
|
1191
|
+
"onUpdate:modelValue": p[6] || (p[6] = (i) => ne(l) ? l.value = i : null),
|
|
1193
1192
|
placeholder: "/thank-you"
|
|
1194
1193
|
}, null, 8, ["modelValue"])
|
|
1195
1194
|
]),
|
|
@@ -1200,7 +1199,7 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1200
1199
|
}, 8, ["title"])
|
|
1201
1200
|
]));
|
|
1202
1201
|
}
|
|
1203
|
-
}),
|
|
1202
|
+
}), Yl = /* @__PURE__ */ ie(Kl, [["__scopeId", "data-v-35e56e3d"]]), Zl = { class: "wx-inbox-recipients" }, Ql = /* @__PURE__ */ ae({
|
|
1204
1203
|
__name: "FormNotifications",
|
|
1205
1204
|
props: /* @__PURE__ */ Me({
|
|
1206
1205
|
fields: {},
|
|
@@ -1210,44 +1209,44 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1210
1209
|
modelModifiers: {}
|
|
1211
1210
|
}),
|
|
1212
1211
|
emits: ["update:modelValue"],
|
|
1213
|
-
setup(
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1212
|
+
setup(r) {
|
|
1213
|
+
const s = r, o = $e(r, "modelValue"), v = oe(), n = re(v), d = te("webx-inbox"), m = W([]), l = ce(o, "recipients", []), $ = ce(o, "email_field", "");
|
|
1214
|
+
dl(async () => {
|
|
1216
1215
|
try {
|
|
1217
|
-
|
|
1216
|
+
m.value = await n.recipients();
|
|
1218
1217
|
} catch {
|
|
1219
1218
|
}
|
|
1220
1219
|
});
|
|
1221
|
-
const
|
|
1222
|
-
() =>
|
|
1223
|
-
),
|
|
1224
|
-
{ value: "", label:
|
|
1225
|
-
...
|
|
1220
|
+
const p = F(
|
|
1221
|
+
() => m.value.map((c) => ({ value: c.id, label: `${c.name} · ${c.email}` }))
|
|
1222
|
+
), i = F(() => [
|
|
1223
|
+
{ value: "", label: d("panel.no-email-field") },
|
|
1224
|
+
...s.fields.filter((c) => c.type === "email").map((c) => ({ value: c.key, label: c.key }))
|
|
1226
1225
|
]);
|
|
1227
|
-
function
|
|
1228
|
-
return "admin_id" in
|
|
1229
|
-
}
|
|
1230
|
-
function
|
|
1231
|
-
l.value = [...l.value,
|
|
1232
|
-
}
|
|
1233
|
-
async function T(
|
|
1234
|
-
const
|
|
1235
|
-
|
|
1236
|
-
title:
|
|
1237
|
-
message:
|
|
1238
|
-
confirmText:
|
|
1239
|
-
cancelText:
|
|
1226
|
+
function O(c) {
|
|
1227
|
+
return "admin_id" in c;
|
|
1228
|
+
}
|
|
1229
|
+
function S(c) {
|
|
1230
|
+
l.value = [...l.value, c];
|
|
1231
|
+
}
|
|
1232
|
+
async function T(c) {
|
|
1233
|
+
const U = l.value[c];
|
|
1234
|
+
U !== void 0 && (O(U) || (U.email ?? "").trim() !== "") && !await Ce({
|
|
1235
|
+
title: d("panel.remove-recipient-title"),
|
|
1236
|
+
message: d("panel.remove-recipient-text"),
|
|
1237
|
+
confirmText: d("panel.remove"),
|
|
1238
|
+
cancelText: d("panel.cancel"),
|
|
1240
1239
|
tone: "danger"
|
|
1241
|
-
}) || (l.value = l.value.filter((
|
|
1240
|
+
}) || (l.value = l.value.filter((I, w) => w !== c));
|
|
1242
1241
|
}
|
|
1243
|
-
function
|
|
1244
|
-
l.value = l.value.map((
|
|
1242
|
+
function b(c, U) {
|
|
1243
|
+
l.value = l.value.map((f, I) => I === c ? { admin_id: U } : f);
|
|
1245
1244
|
}
|
|
1246
|
-
function
|
|
1247
|
-
l.value = l.value.map((
|
|
1245
|
+
function q(c, U) {
|
|
1246
|
+
l.value = l.value.map((f, I) => I === c ? { email: U } : f);
|
|
1248
1247
|
}
|
|
1249
|
-
return (
|
|
1250
|
-
title: e(
|
|
1248
|
+
return (c, U) => (u(), _(e(se), {
|
|
1249
|
+
title: e(d)("panel.recipients")
|
|
1251
1250
|
}, {
|
|
1252
1251
|
default: a(() => [
|
|
1253
1252
|
t(e(J), {
|
|
@@ -1255,88 +1254,88 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1255
1254
|
tone: "muted"
|
|
1256
1255
|
}, {
|
|
1257
1256
|
default: a(() => [
|
|
1258
|
-
|
|
1257
|
+
z(k(e(d)("panel.recipients-help")), 1)
|
|
1259
1258
|
]),
|
|
1260
1259
|
_: 1
|
|
1261
1260
|
}),
|
|
1262
|
-
|
|
1261
|
+
r.errors["options.recipients"] ? (u(), _(e(De), {
|
|
1263
1262
|
key: 0,
|
|
1264
1263
|
type: "danger",
|
|
1265
1264
|
variant: "soft",
|
|
1266
|
-
description:
|
|
1267
|
-
}, null, 8, ["description"])) :
|
|
1268
|
-
|
|
1269
|
-
e(l).length === 0 ? (
|
|
1265
|
+
description: r.errors["options.recipients"]?.[0]
|
|
1266
|
+
}, null, 8, ["description"])) : H("", !0),
|
|
1267
|
+
G("div", Zl, [
|
|
1268
|
+
e(l).length === 0 ? (u(), _(e(J), {
|
|
1270
1269
|
key: 0,
|
|
1271
1270
|
size: "sm",
|
|
1272
1271
|
tone: "placeholder"
|
|
1273
1272
|
}, {
|
|
1274
1273
|
default: a(() => [
|
|
1275
|
-
|
|
1274
|
+
z(k(e(d)("panel.no-recipients")), 1)
|
|
1276
1275
|
]),
|
|
1277
1276
|
_: 1
|
|
1278
|
-
})) :
|
|
1279
|
-
(
|
|
1280
|
-
key:
|
|
1277
|
+
})) : H("", !0),
|
|
1278
|
+
(u(!0), j(ee, null, we(e(l), (f, I) => (u(), j("div", {
|
|
1279
|
+
key: I,
|
|
1281
1280
|
class: "wx-inbox-recipients__row"
|
|
1282
1281
|
}, [
|
|
1283
|
-
|
|
1282
|
+
O(f) ? (u(), _(e(fe), {
|
|
1284
1283
|
key: 0,
|
|
1285
|
-
"model-value":
|
|
1286
|
-
options:
|
|
1287
|
-
"onUpdate:modelValue": (
|
|
1288
|
-
}, null, 8, ["model-value", "options", "onUpdate:modelValue"])) : (
|
|
1284
|
+
"model-value": f.admin_id,
|
|
1285
|
+
options: p.value,
|
|
1286
|
+
"onUpdate:modelValue": (w) => b(I, Number(w))
|
|
1287
|
+
}, null, 8, ["model-value", "options", "onUpdate:modelValue"])) : (u(), _(e(X), {
|
|
1289
1288
|
key: 1,
|
|
1290
|
-
"model-value":
|
|
1289
|
+
"model-value": f.email,
|
|
1291
1290
|
type: "email",
|
|
1292
1291
|
placeholder: "sales@example.com",
|
|
1293
|
-
"onUpdate:modelValue": (
|
|
1292
|
+
"onUpdate:modelValue": (w) => q(I, String(w))
|
|
1294
1293
|
}, null, 8, ["model-value", "onUpdate:modelValue"])),
|
|
1295
|
-
t(e(
|
|
1294
|
+
t(e(ke), {
|
|
1296
1295
|
icon: "trash",
|
|
1297
1296
|
tone: "danger",
|
|
1298
|
-
title: e(
|
|
1299
|
-
onClick: (
|
|
1297
|
+
title: e(d)("panel.remove"),
|
|
1298
|
+
onClick: (w) => T(I)
|
|
1300
1299
|
}, null, 8, ["title", "onClick"])
|
|
1301
1300
|
]))), 128))
|
|
1302
1301
|
]),
|
|
1303
|
-
t(e(
|
|
1302
|
+
t(e(We), { size: "sm" }, {
|
|
1304
1303
|
default: a(() => [
|
|
1305
|
-
t(e(
|
|
1304
|
+
t(e(le), {
|
|
1306
1305
|
variant: "outline",
|
|
1307
1306
|
icon: "user",
|
|
1308
|
-
disabled:
|
|
1309
|
-
onClick:
|
|
1307
|
+
disabled: p.value.length === 0,
|
|
1308
|
+
onClick: U[0] || (U[0] = (f) => S({ admin_id: Number(p.value[0]?.value) }))
|
|
1310
1309
|
}, {
|
|
1311
1310
|
default: a(() => [
|
|
1312
|
-
|
|
1311
|
+
z(k(e(d)("panel.add-admin")), 1)
|
|
1313
1312
|
]),
|
|
1314
1313
|
_: 1
|
|
1315
1314
|
}, 8, ["disabled"]),
|
|
1316
|
-
t(e(
|
|
1315
|
+
t(e(le), {
|
|
1317
1316
|
variant: "outline",
|
|
1318
|
-
onClick:
|
|
1317
|
+
onClick: U[1] || (U[1] = (f) => S({ email: "" }))
|
|
1319
1318
|
}, {
|
|
1320
1319
|
icon: a(() => [
|
|
1321
|
-
t(e(
|
|
1320
|
+
t(e(Ve), { name: "mail" })
|
|
1322
1321
|
]),
|
|
1323
1322
|
default: a(() => [
|
|
1324
|
-
|
|
1323
|
+
z(" " + k(e(d)("panel.add-email")), 1)
|
|
1325
1324
|
]),
|
|
1326
1325
|
_: 1
|
|
1327
1326
|
})
|
|
1328
1327
|
]),
|
|
1329
1328
|
_: 1
|
|
1330
1329
|
}),
|
|
1331
|
-
t(e(
|
|
1332
|
-
label: e(
|
|
1333
|
-
help: e(
|
|
1330
|
+
t(e(B), {
|
|
1331
|
+
label: e(d)("panel.email-field"),
|
|
1332
|
+
help: e(d)("panel.email-field-help")
|
|
1334
1333
|
}, {
|
|
1335
1334
|
default: a(() => [
|
|
1336
|
-
t(e(
|
|
1337
|
-
modelValue: e(
|
|
1338
|
-
"onUpdate:modelValue":
|
|
1339
|
-
options:
|
|
1335
|
+
t(e(fe), {
|
|
1336
|
+
modelValue: e($),
|
|
1337
|
+
"onUpdate:modelValue": U[2] || (U[2] = (f) => ne($) ? $.value = f : null),
|
|
1338
|
+
options: i.value
|
|
1340
1339
|
}, null, 8, ["modelValue", "options"])
|
|
1341
1340
|
]),
|
|
1342
1341
|
_: 1
|
|
@@ -1345,78 +1344,78 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1345
1344
|
_: 1
|
|
1346
1345
|
}, 8, ["title"]));
|
|
1347
1346
|
}
|
|
1348
|
-
}), Jl = /* @__PURE__ */
|
|
1347
|
+
}), Jl = /* @__PURE__ */ ie(Ql, [["__scopeId", "data-v-a5998eb4"]]), Xl = { class: "wx-inbox-editor" }, et = /* @__PURE__ */ ae({
|
|
1349
1348
|
__name: "FormEditorPage",
|
|
1350
1349
|
props: {
|
|
1351
1350
|
base: { default: "/inbox" }
|
|
1352
1351
|
},
|
|
1353
|
-
setup(
|
|
1354
|
-
const
|
|
1352
|
+
setup(r) {
|
|
1353
|
+
const s = r, o = oe(), v = re(o), n = Le(), d = Oe(), m = xe();
|
|
1355
1354
|
de();
|
|
1356
|
-
const l = te("webx-inbox"),
|
|
1357
|
-
let
|
|
1355
|
+
const l = te("webx-inbox"), $ = me(), p = W(null), i = W([]), O = W(!0), S = W(!1), T = W({});
|
|
1356
|
+
let b = cl({
|
|
1358
1357
|
slug: "",
|
|
1359
1358
|
title: {},
|
|
1360
1359
|
is_enabled: !0
|
|
1361
1360
|
});
|
|
1362
|
-
const
|
|
1363
|
-
() =>
|
|
1364
|
-
),
|
|
1365
|
-
async function
|
|
1366
|
-
|
|
1361
|
+
const q = W({}), c = F(() => o.can("inbox.manage")), U = F(() => Number(n.params.id)), f = F(
|
|
1362
|
+
() => p.value === null ? "" : pe(b.title, m.active.value, b.slug)
|
|
1363
|
+
), I = F(() => `${s.base}?form=${U.value}`);
|
|
1364
|
+
async function w() {
|
|
1365
|
+
O.value = !0;
|
|
1367
1366
|
try {
|
|
1368
|
-
const
|
|
1369
|
-
|
|
1370
|
-
} catch (
|
|
1371
|
-
E.danger(
|
|
1367
|
+
const M = await v.form(U.value);
|
|
1368
|
+
p.value = M, i.value = M.fields ?? [], b.slug = M.slug, b.title = { ...M.title }, b.is_enabled = M.is_enabled, q.value = { ...M.options };
|
|
1369
|
+
} catch (M) {
|
|
1370
|
+
E.danger($(M)), d.replace(s.base);
|
|
1372
1371
|
} finally {
|
|
1373
|
-
|
|
1372
|
+
O.value = !1;
|
|
1374
1373
|
}
|
|
1375
1374
|
}
|
|
1376
|
-
|
|
1377
|
-
|
|
1375
|
+
Se(U, () => {
|
|
1376
|
+
w();
|
|
1378
1377
|
}, { immediate: !0 });
|
|
1379
|
-
async function
|
|
1380
|
-
|
|
1378
|
+
async function P() {
|
|
1379
|
+
S.value = !0, T.value = {};
|
|
1381
1380
|
try {
|
|
1382
|
-
const
|
|
1383
|
-
slug:
|
|
1384
|
-
title:
|
|
1385
|
-
is_enabled:
|
|
1386
|
-
options:
|
|
1381
|
+
const M = await v.saveForm(U.value, {
|
|
1382
|
+
slug: b.slug.trim(),
|
|
1383
|
+
title: b.title,
|
|
1384
|
+
is_enabled: b.is_enabled,
|
|
1385
|
+
options: q.value
|
|
1387
1386
|
});
|
|
1388
|
-
|
|
1389
|
-
} catch (
|
|
1390
|
-
const
|
|
1391
|
-
|
|
1387
|
+
p.value = M, E.success(l("panel.saved"));
|
|
1388
|
+
} catch (M) {
|
|
1389
|
+
const A = M.body;
|
|
1390
|
+
A?.errors ? (T.value = A.errors, E.danger(l("panel.failed"))) : E.danger($(M));
|
|
1392
1391
|
} finally {
|
|
1393
|
-
|
|
1392
|
+
S.value = !1;
|
|
1394
1393
|
}
|
|
1395
1394
|
}
|
|
1396
|
-
return (
|
|
1397
|
-
|
|
1395
|
+
return (M, A) => (u(), j("div", Xl, [
|
|
1396
|
+
O.value ? (u(), _(e(se), { key: 0 }, {
|
|
1398
1397
|
default: a(() => [
|
|
1399
|
-
t(e(
|
|
1398
|
+
t(e(Fe), {
|
|
1400
1399
|
title: "",
|
|
1401
1400
|
rows: 8
|
|
1402
1401
|
})
|
|
1403
1402
|
]),
|
|
1404
1403
|
_: 1
|
|
1405
|
-
})) :
|
|
1406
|
-
t(e(
|
|
1404
|
+
})) : p.value ? (u(), j(ee, { key: 1 }, [
|
|
1405
|
+
t(e(Ye), {
|
|
1407
1406
|
class: "wx-inbox-editor__head",
|
|
1408
|
-
title:
|
|
1409
|
-
subtitle:
|
|
1410
|
-
back:
|
|
1407
|
+
title: f.value,
|
|
1408
|
+
subtitle: p.value.slug,
|
|
1409
|
+
back: I.value,
|
|
1411
1410
|
"back-label": e(l)("panel.forms")
|
|
1412
1411
|
}, {
|
|
1413
1412
|
"title-after": a(() => [
|
|
1414
|
-
e(
|
|
1413
|
+
e(b).is_enabled ? H("", !0) : (u(), _(e(Ue), {
|
|
1415
1414
|
key: 0,
|
|
1416
1415
|
type: "default"
|
|
1417
1416
|
}, {
|
|
1418
1417
|
default: a(() => [
|
|
1419
|
-
|
|
1418
|
+
z(k(e(l)("panel.off")), 1)
|
|
1420
1419
|
]),
|
|
1421
1420
|
_: 1
|
|
1422
1421
|
}))
|
|
@@ -1433,11 +1432,11 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1433
1432
|
label: e(l)("panel.tab-general")
|
|
1434
1433
|
}, {
|
|
1435
1434
|
default: a(() => [
|
|
1436
|
-
t(
|
|
1437
|
-
settings: e(
|
|
1438
|
-
"onUpdate:settings":
|
|
1439
|
-
options:
|
|
1440
|
-
"onUpdate:options":
|
|
1435
|
+
t(Yl, {
|
|
1436
|
+
settings: e(b),
|
|
1437
|
+
"onUpdate:settings": A[0] || (A[0] = (C) => ne(b) ? b.value = C : b = C),
|
|
1438
|
+
options: q.value,
|
|
1439
|
+
"onUpdate:options": A[1] || (A[1] = (C) => q.value = C),
|
|
1441
1440
|
errors: T.value
|
|
1442
1441
|
}, null, 8, ["settings", "options", "errors"])
|
|
1443
1442
|
]),
|
|
@@ -1448,11 +1447,11 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1448
1447
|
label: e(l)("panel.tab-fields")
|
|
1449
1448
|
}, {
|
|
1450
1449
|
default: a(() => [
|
|
1451
|
-
t(
|
|
1452
|
-
modelValue:
|
|
1453
|
-
"onUpdate:modelValue":
|
|
1454
|
-
form:
|
|
1455
|
-
"can-manage":
|
|
1450
|
+
t(Ol, {
|
|
1451
|
+
modelValue: i.value,
|
|
1452
|
+
"onUpdate:modelValue": A[2] || (A[2] = (C) => i.value = C),
|
|
1453
|
+
form: p.value,
|
|
1454
|
+
"can-manage": c.value
|
|
1456
1455
|
}, null, 8, ["modelValue", "form", "can-manage"])
|
|
1457
1456
|
]),
|
|
1458
1457
|
_: 1
|
|
@@ -1463,9 +1462,9 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1463
1462
|
}, {
|
|
1464
1463
|
default: a(() => [
|
|
1465
1464
|
t(Jl, {
|
|
1466
|
-
modelValue:
|
|
1467
|
-
"onUpdate:modelValue":
|
|
1468
|
-
fields:
|
|
1465
|
+
modelValue: q.value,
|
|
1466
|
+
"onUpdate:modelValue": A[3] || (A[3] = (C) => q.value = C),
|
|
1467
|
+
fields: i.value,
|
|
1469
1468
|
errors: T.value
|
|
1470
1469
|
}, null, 8, ["modelValue", "fields", "errors"])
|
|
1471
1470
|
]),
|
|
@@ -1476,9 +1475,9 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1476
1475
|
label: e(l)("panel.tab-antispam")
|
|
1477
1476
|
}, {
|
|
1478
1477
|
default: a(() => [
|
|
1479
|
-
t(
|
|
1480
|
-
modelValue:
|
|
1481
|
-
"onUpdate:modelValue":
|
|
1478
|
+
t(El, {
|
|
1479
|
+
modelValue: q.value,
|
|
1480
|
+
"onUpdate:modelValue": A[4] || (A[4] = (C) => q.value = C)
|
|
1482
1481
|
}, null, 8, ["modelValue"])
|
|
1483
1482
|
]),
|
|
1484
1483
|
_: 1
|
|
@@ -1489,9 +1488,9 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1489
1488
|
}, {
|
|
1490
1489
|
default: a(() => [
|
|
1491
1490
|
t(Gl, {
|
|
1492
|
-
form:
|
|
1493
|
-
slug: e(
|
|
1494
|
-
fields:
|
|
1491
|
+
form: p.value,
|
|
1492
|
+
slug: e(b).slug,
|
|
1493
|
+
fields: i.value
|
|
1495
1494
|
}, null, 8, ["form", "slug", "fields"])
|
|
1496
1495
|
]),
|
|
1497
1496
|
_: 1
|
|
@@ -1499,76 +1498,76 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1499
1498
|
]),
|
|
1500
1499
|
_: 1
|
|
1501
1500
|
}),
|
|
1502
|
-
|
|
1501
|
+
c.value ? (u(), _(e(bl), { key: 0 }, {
|
|
1503
1502
|
default: a(() => [
|
|
1504
|
-
t(e(
|
|
1503
|
+
t(e(le), {
|
|
1505
1504
|
type: "primary",
|
|
1506
|
-
loading:
|
|
1507
|
-
onClick:
|
|
1505
|
+
loading: S.value,
|
|
1506
|
+
onClick: P
|
|
1508
1507
|
}, {
|
|
1509
1508
|
default: a(() => [
|
|
1510
|
-
|
|
1509
|
+
z(k(e(l)("panel.save")), 1)
|
|
1511
1510
|
]),
|
|
1512
1511
|
_: 1
|
|
1513
1512
|
}, 8, ["loading"])
|
|
1514
1513
|
]),
|
|
1515
1514
|
_: 1
|
|
1516
|
-
})) :
|
|
1517
|
-
], 64)) :
|
|
1515
|
+
})) : H("", !0)
|
|
1516
|
+
], 64)) : H("", !0)
|
|
1518
1517
|
]));
|
|
1519
1518
|
}
|
|
1520
|
-
}), lt = /* @__PURE__ */
|
|
1519
|
+
}), lt = /* @__PURE__ */ ie(et, [["__scopeId", "data-v-11c10bb6"]]), tt = { class: "wx-inbox-create" }, at = /* @__PURE__ */ ae({
|
|
1521
1520
|
__name: "FormCreateDialog",
|
|
1522
|
-
setup(
|
|
1523
|
-
const { resolve:
|
|
1521
|
+
setup(r) {
|
|
1522
|
+
const { resolve: s, dismiss: o, open: v } = Ee(), n = oe(), d = re(n);
|
|
1524
1523
|
de();
|
|
1525
|
-
const
|
|
1526
|
-
function
|
|
1527
|
-
return
|
|
1524
|
+
const m = te("webx-inbox"), l = me(), $ = W({}), p = W(""), i = W(!1), O = W({});
|
|
1525
|
+
function S(b) {
|
|
1526
|
+
return O.value[b]?.[0];
|
|
1528
1527
|
}
|
|
1529
1528
|
async function T() {
|
|
1530
|
-
|
|
1529
|
+
i.value = !0, O.value = {};
|
|
1531
1530
|
try {
|
|
1532
|
-
|
|
1533
|
-
await
|
|
1534
|
-
title:
|
|
1535
|
-
slug:
|
|
1531
|
+
s(
|
|
1532
|
+
await d.createForm({
|
|
1533
|
+
title: $.value,
|
|
1534
|
+
slug: p.value.trim(),
|
|
1536
1535
|
is_enabled: !0,
|
|
1537
1536
|
options: {}
|
|
1538
1537
|
})
|
|
1539
1538
|
);
|
|
1540
|
-
} catch (
|
|
1541
|
-
const
|
|
1542
|
-
|
|
1539
|
+
} catch (b) {
|
|
1540
|
+
const q = b.body;
|
|
1541
|
+
q?.errors ? (O.value = q.errors, E.danger(m("panel.failed"))) : E.danger(l(b));
|
|
1543
1542
|
} finally {
|
|
1544
|
-
|
|
1543
|
+
i.value = !1;
|
|
1545
1544
|
}
|
|
1546
1545
|
}
|
|
1547
|
-
return (
|
|
1546
|
+
return (b, q) => (u(), _(e(Pe), {
|
|
1548
1547
|
open: e(v),
|
|
1549
|
-
"onUpdate:open":
|
|
1550
|
-
title: e(
|
|
1548
|
+
"onUpdate:open": q[3] || (q[3] = (c) => ne(v) ? v.value = c : null),
|
|
1549
|
+
title: e(m)("panel.new-form-title"),
|
|
1551
1550
|
width: 520
|
|
1552
1551
|
}, {
|
|
1553
1552
|
footer: a(() => [
|
|
1554
|
-
t(e(
|
|
1553
|
+
t(e(We), { size: "sm" }, {
|
|
1555
1554
|
default: a(() => [
|
|
1556
|
-
t(e(
|
|
1555
|
+
t(e(le), {
|
|
1557
1556
|
variant: "outline",
|
|
1558
|
-
onClick:
|
|
1557
|
+
onClick: q[2] || (q[2] = (c) => e(o)())
|
|
1559
1558
|
}, {
|
|
1560
1559
|
default: a(() => [
|
|
1561
|
-
|
|
1560
|
+
z(k(e(m)("panel.cancel")), 1)
|
|
1562
1561
|
]),
|
|
1563
1562
|
_: 1
|
|
1564
1563
|
}),
|
|
1565
|
-
t(e(
|
|
1564
|
+
t(e(le), {
|
|
1566
1565
|
type: "primary",
|
|
1567
|
-
loading:
|
|
1566
|
+
loading: i.value,
|
|
1568
1567
|
onClick: T
|
|
1569
1568
|
}, {
|
|
1570
1569
|
default: a(() => [
|
|
1571
|
-
|
|
1570
|
+
z(k(e(m)("panel.save")), 1)
|
|
1572
1571
|
]),
|
|
1573
1572
|
_: 1
|
|
1574
1573
|
}, 8, ["loading"])
|
|
@@ -1577,31 +1576,31 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1577
1576
|
})
|
|
1578
1577
|
]),
|
|
1579
1578
|
default: a(() => [
|
|
1580
|
-
|
|
1581
|
-
t(e(
|
|
1582
|
-
label: e(
|
|
1583
|
-
error:
|
|
1579
|
+
G("div", tt, [
|
|
1580
|
+
t(e(B), {
|
|
1581
|
+
label: e(m)("panel.title"),
|
|
1582
|
+
error: S("title"),
|
|
1584
1583
|
required: ""
|
|
1585
1584
|
}, {
|
|
1586
1585
|
default: a(() => [
|
|
1587
1586
|
t(e(X), {
|
|
1588
|
-
modelValue:
|
|
1589
|
-
"onUpdate:modelValue":
|
|
1587
|
+
modelValue: $.value,
|
|
1588
|
+
"onUpdate:modelValue": q[0] || (q[0] = (c) => $.value = c),
|
|
1590
1589
|
localized: "",
|
|
1591
1590
|
autofocus: ""
|
|
1592
1591
|
}, null, 8, ["modelValue"])
|
|
1593
1592
|
]),
|
|
1594
1593
|
_: 1
|
|
1595
1594
|
}, 8, ["label", "error"]),
|
|
1596
|
-
t(e(
|
|
1597
|
-
label: e(
|
|
1598
|
-
help: e(
|
|
1599
|
-
error:
|
|
1595
|
+
t(e(B), {
|
|
1596
|
+
label: e(m)("panel.slug"),
|
|
1597
|
+
help: e(m)("panel.slug-help"),
|
|
1598
|
+
error: S("slug")
|
|
1600
1599
|
}, {
|
|
1601
1600
|
default: a(() => [
|
|
1602
1601
|
t(e(X), {
|
|
1603
|
-
modelValue:
|
|
1604
|
-
"onUpdate:modelValue":
|
|
1602
|
+
modelValue: p.value,
|
|
1603
|
+
"onUpdate:modelValue": q[1] || (q[1] = (c) => p.value = c),
|
|
1605
1604
|
placeholder: "contact"
|
|
1606
1605
|
}, null, 8, ["modelValue"])
|
|
1607
1606
|
]),
|
|
@@ -1612,84 +1611,84 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1612
1611
|
_: 1
|
|
1613
1612
|
}, 8, ["open", "title"]));
|
|
1614
1613
|
}
|
|
1615
|
-
}), nt = /* @__PURE__ */
|
|
1614
|
+
}), nt = /* @__PURE__ */ ie(at, [["__scopeId", "data-v-55fb40d8"]]), st = { class: "wx-inbox-by-hand" }, ot = /* @__PURE__ */ ae({
|
|
1616
1615
|
__name: "SubmissionCreateDialog",
|
|
1617
1616
|
props: {
|
|
1618
1617
|
form: {}
|
|
1619
1618
|
},
|
|
1620
|
-
setup(
|
|
1621
|
-
const
|
|
1619
|
+
setup(r) {
|
|
1620
|
+
const s = r, { resolve: o, dismiss: v, open: n } = Ee(), d = oe(), m = re(d), l = xe();
|
|
1622
1621
|
de();
|
|
1623
|
-
const
|
|
1624
|
-
function
|
|
1625
|
-
return
|
|
1622
|
+
const $ = te("webx-inbox"), p = me(), i = W([]), O = W(!0), S = W(!1), T = W({}), b = W({}), q = F(() => i.value.filter((A) => A.type !== "file")), c = F(() => i.value.some((A) => A.type === "file"));
|
|
1623
|
+
function U(A) {
|
|
1624
|
+
return b.value[`fields.${A.key}`]?.[0];
|
|
1626
1625
|
}
|
|
1627
|
-
function
|
|
1628
|
-
return
|
|
1626
|
+
function f(A) {
|
|
1627
|
+
return pe(A.title, l.active.value, A.key);
|
|
1629
1628
|
}
|
|
1630
|
-
function
|
|
1631
|
-
return
|
|
1632
|
-
|
|
1629
|
+
function I(A, C = "") {
|
|
1630
|
+
return pe(
|
|
1631
|
+
A,
|
|
1633
1632
|
l.active.value,
|
|
1634
|
-
|
|
1633
|
+
C
|
|
1635
1634
|
);
|
|
1636
1635
|
}
|
|
1637
|
-
function
|
|
1638
|
-
return (
|
|
1639
|
-
value:
|
|
1640
|
-
label:
|
|
1636
|
+
function w(A) {
|
|
1637
|
+
return (A.options.choices ?? []).map((C) => ({
|
|
1638
|
+
value: C.value,
|
|
1639
|
+
label: I(C.label, C.value)
|
|
1641
1640
|
}));
|
|
1642
1641
|
}
|
|
1643
|
-
async function
|
|
1642
|
+
async function P() {
|
|
1644
1643
|
try {
|
|
1645
|
-
const
|
|
1646
|
-
|
|
1647
|
-
for (const
|
|
1648
|
-
T.value[
|
|
1649
|
-
} catch (
|
|
1650
|
-
E.danger(
|
|
1644
|
+
const A = await m.form(s.form.id);
|
|
1645
|
+
i.value = (A.fields ?? []).filter((C) => C.is_enabled);
|
|
1646
|
+
for (const C of i.value)
|
|
1647
|
+
T.value[C.key] = C.type === "checkbox" ? [] : C.type === "consent" ? !1 : "";
|
|
1648
|
+
} catch (A) {
|
|
1649
|
+
E.danger(p(A));
|
|
1651
1650
|
} finally {
|
|
1652
|
-
|
|
1651
|
+
O.value = !1;
|
|
1653
1652
|
}
|
|
1654
1653
|
}
|
|
1655
|
-
|
|
1656
|
-
async function
|
|
1657
|
-
|
|
1654
|
+
P();
|
|
1655
|
+
async function M() {
|
|
1656
|
+
S.value = !0, b.value = {};
|
|
1658
1657
|
try {
|
|
1659
|
-
|
|
1660
|
-
} catch (
|
|
1661
|
-
const
|
|
1662
|
-
|
|
1658
|
+
o(await m.createSubmission(s.form.id, T.value));
|
|
1659
|
+
} catch (A) {
|
|
1660
|
+
const C = A.body;
|
|
1661
|
+
C?.errors ? (b.value = C.errors, E.danger($("panel.failed"))) : E.danger(p(A));
|
|
1663
1662
|
} finally {
|
|
1664
|
-
|
|
1663
|
+
S.value = !1;
|
|
1665
1664
|
}
|
|
1666
1665
|
}
|
|
1667
|
-
return (
|
|
1666
|
+
return (A, C) => (u(), _(e(Pe), {
|
|
1668
1667
|
open: e(n),
|
|
1669
|
-
"onUpdate:open":
|
|
1670
|
-
title: e(
|
|
1668
|
+
"onUpdate:open": C[1] || (C[1] = (g) => ne(n) ? n.value = g : null),
|
|
1669
|
+
title: e($)("panel.new-submission-title"),
|
|
1671
1670
|
width: 560
|
|
1672
1671
|
}, {
|
|
1673
1672
|
footer: a(() => [
|
|
1674
|
-
t(e(
|
|
1673
|
+
t(e(We), { size: "sm" }, {
|
|
1675
1674
|
default: a(() => [
|
|
1676
|
-
t(e(
|
|
1675
|
+
t(e(le), {
|
|
1677
1676
|
variant: "outline",
|
|
1678
|
-
onClick:
|
|
1677
|
+
onClick: C[0] || (C[0] = (g) => e(v)())
|
|
1679
1678
|
}, {
|
|
1680
1679
|
default: a(() => [
|
|
1681
|
-
|
|
1680
|
+
z(k(e($)("panel.cancel")), 1)
|
|
1682
1681
|
]),
|
|
1683
1682
|
_: 1
|
|
1684
1683
|
}),
|
|
1685
|
-
t(e(
|
|
1684
|
+
t(e(le), {
|
|
1686
1685
|
type: "primary",
|
|
1687
|
-
loading:
|
|
1688
|
-
disabled:
|
|
1689
|
-
onClick:
|
|
1686
|
+
loading: S.value,
|
|
1687
|
+
disabled: O.value,
|
|
1688
|
+
onClick: M
|
|
1690
1689
|
}, {
|
|
1691
1690
|
default: a(() => [
|
|
1692
|
-
|
|
1691
|
+
z(k(e($)("panel.save")), 1)
|
|
1693
1692
|
]),
|
|
1694
1693
|
_: 1
|
|
1695
1694
|
}, 8, ["loading", "disabled"])
|
|
@@ -1698,133 +1697,132 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1698
1697
|
})
|
|
1699
1698
|
]),
|
|
1700
1699
|
default: a(() => [
|
|
1701
|
-
|
|
1702
|
-
t(e(
|
|
1700
|
+
G("div", st, [
|
|
1701
|
+
t(e(De), {
|
|
1703
1702
|
type: "info",
|
|
1704
1703
|
closable: !1
|
|
1705
1704
|
}, {
|
|
1706
1705
|
default: a(() => [
|
|
1707
|
-
|
|
1706
|
+
z(k(e($)("panel.new-submission-help")), 1)
|
|
1708
1707
|
]),
|
|
1709
1708
|
_: 1
|
|
1710
1709
|
}),
|
|
1711
|
-
|
|
1710
|
+
O.value ? (u(), _(e(Fe), {
|
|
1712
1711
|
key: 0,
|
|
1713
1712
|
rows: 4
|
|
1714
|
-
})) : (
|
|
1715
|
-
(
|
|
1716
|
-
key:
|
|
1717
|
-
label:
|
|
1718
|
-
help:
|
|
1719
|
-
error:
|
|
1720
|
-
required:
|
|
1713
|
+
})) : (u(), j(ee, { key: 1 }, [
|
|
1714
|
+
(u(!0), j(ee, null, we(q.value, (g) => (u(), _(e(B), {
|
|
1715
|
+
key: g.id,
|
|
1716
|
+
label: f(g),
|
|
1717
|
+
help: I(g.help),
|
|
1718
|
+
error: U(g),
|
|
1719
|
+
required: g.is_required
|
|
1721
1720
|
}, {
|
|
1722
1721
|
default: a(() => [
|
|
1723
|
-
|
|
1722
|
+
g.type === "textarea" ? (u(), _(e(hl), {
|
|
1724
1723
|
key: 0,
|
|
1725
|
-
modelValue: T.value[
|
|
1726
|
-
"onUpdate:modelValue": (
|
|
1727
|
-
rows:
|
|
1728
|
-
placeholder:
|
|
1729
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "rows", "placeholder"])) :
|
|
1724
|
+
modelValue: T.value[g.key],
|
|
1725
|
+
"onUpdate:modelValue": (Q) => T.value[g.key] = Q,
|
|
1726
|
+
rows: g.options.rows ?? 4,
|
|
1727
|
+
placeholder: I(g.placeholder)
|
|
1728
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "rows", "placeholder"])) : g.type === "select" ? (u(), _(e(fe), {
|
|
1730
1729
|
key: 1,
|
|
1731
|
-
modelValue: T.value[
|
|
1732
|
-
"onUpdate:modelValue": (
|
|
1733
|
-
options:
|
|
1730
|
+
modelValue: T.value[g.key],
|
|
1731
|
+
"onUpdate:modelValue": (Q) => T.value[g.key] = Q,
|
|
1732
|
+
options: w(g),
|
|
1734
1733
|
clearable: "",
|
|
1735
|
-
placeholder:
|
|
1736
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder"])) :
|
|
1734
|
+
placeholder: I(g.placeholder)
|
|
1735
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder"])) : g.type === "radio" ? (u(), _(e(yl), {
|
|
1737
1736
|
key: 2,
|
|
1738
|
-
modelValue: T.value[
|
|
1739
|
-
"onUpdate:modelValue": (
|
|
1740
|
-
options:
|
|
1741
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) :
|
|
1737
|
+
modelValue: T.value[g.key],
|
|
1738
|
+
"onUpdate:modelValue": (Q) => T.value[g.key] = Q,
|
|
1739
|
+
options: w(g)
|
|
1740
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : g.type === "checkbox" ? (u(), _(e(gl), {
|
|
1742
1741
|
key: 3,
|
|
1743
|
-
modelValue: T.value[
|
|
1744
|
-
"onUpdate:modelValue": (
|
|
1745
|
-
options:
|
|
1746
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) :
|
|
1742
|
+
modelValue: T.value[g.key],
|
|
1743
|
+
"onUpdate:modelValue": (Q) => T.value[g.key] = Q,
|
|
1744
|
+
options: w(g)
|
|
1745
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : g.type === "consent" ? (u(), _(e(ve), {
|
|
1747
1746
|
key: 4,
|
|
1748
|
-
modelValue: T.value[
|
|
1749
|
-
"onUpdate:modelValue": (
|
|
1750
|
-
label:
|
|
1751
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) :
|
|
1747
|
+
modelValue: T.value[g.key],
|
|
1748
|
+
"onUpdate:modelValue": (Q) => T.value[g.key] = Q,
|
|
1749
|
+
label: I(g.options.text, f(g))
|
|
1750
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) : g.type === "date" ? (u(), _(e(Ke), {
|
|
1752
1751
|
key: 5,
|
|
1753
|
-
modelValue: T.value[
|
|
1754
|
-
"onUpdate:modelValue": (
|
|
1755
|
-
placeholder:
|
|
1756
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (
|
|
1752
|
+
modelValue: T.value[g.key],
|
|
1753
|
+
"onUpdate:modelValue": (Q) => T.value[g.key] = Q,
|
|
1754
|
+
placeholder: I(g.placeholder)
|
|
1755
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (u(), _(e(X), {
|
|
1757
1756
|
key: 6,
|
|
1758
|
-
modelValue: T.value[
|
|
1759
|
-
"onUpdate:modelValue": (
|
|
1760
|
-
type:
|
|
1761
|
-
placeholder:
|
|
1762
|
-
maxlength:
|
|
1757
|
+
modelValue: T.value[g.key],
|
|
1758
|
+
"onUpdate:modelValue": (Q) => T.value[g.key] = Q,
|
|
1759
|
+
type: g.type === "email" ? "email" : g.type === "tel" ? "tel" : "text",
|
|
1760
|
+
placeholder: I(g.placeholder),
|
|
1761
|
+
maxlength: g.options.maxlength
|
|
1763
1762
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "maxlength"]))
|
|
1764
1763
|
]),
|
|
1765
1764
|
_: 2
|
|
1766
1765
|
}, 1032, ["label", "help", "error", "required"]))), 128)),
|
|
1767
|
-
|
|
1766
|
+
c.value ? (u(), _(e(De), {
|
|
1768
1767
|
key: 0,
|
|
1769
1768
|
type: "warning",
|
|
1770
1769
|
closable: !1
|
|
1771
1770
|
}, {
|
|
1772
1771
|
default: a(() => [
|
|
1773
|
-
|
|
1772
|
+
z(k(e($)("panel.no-files-by-hand")), 1)
|
|
1774
1773
|
]),
|
|
1775
1774
|
_: 1
|
|
1776
|
-
})) :
|
|
1775
|
+
})) : H("", !0)
|
|
1777
1776
|
], 64))
|
|
1778
1777
|
])
|
|
1779
1778
|
]),
|
|
1780
1779
|
_: 1
|
|
1781
1780
|
}, 8, ["open", "title"]));
|
|
1782
1781
|
}
|
|
1783
|
-
}), it = /* @__PURE__ */
|
|
1782
|
+
}), it = /* @__PURE__ */ ie(ot, [["__scopeId", "data-v-72006299"]]), ut = { class: "wx-submissions__mass" }, rt = { class: "wx-submissions__state" }, dt = 640, ct = /* @__PURE__ */ ae({
|
|
1784
1783
|
__name: "SubmissionList",
|
|
1785
1784
|
props: {
|
|
1786
1785
|
form: {},
|
|
1787
|
-
base: { default: "/inbox" }
|
|
1788
|
-
inline: { type: Boolean, default: !0 }
|
|
1786
|
+
base: { default: "/inbox" }
|
|
1789
1787
|
},
|
|
1790
|
-
emits: ["
|
|
1791
|
-
setup(
|
|
1792
|
-
const
|
|
1788
|
+
emits: ["changed"],
|
|
1789
|
+
setup(r, { expose: s, emit: o }) {
|
|
1790
|
+
const v = r, n = o, d = oe(), m = re(d), l = Le(), $ = Oe(), p = xe();
|
|
1793
1791
|
de();
|
|
1794
|
-
const
|
|
1795
|
-
get: () => typeof
|
|
1796
|
-
set: (
|
|
1797
|
-
|
|
1798
|
-
query: { ...
|
|
1792
|
+
const i = nl("root"), O = xl(i), S = F(() => O.value > 0 && O.value < dt), T = F(() => S.value ? Number.POSITIVE_INFINITY : 0), b = te("webx-inbox"), q = me(), c = W(null), U = W([]), f = W(!1), I = W([]), w = W(!1), P = F(() => d.can("inbox.update")), M = Re(it), A = F({
|
|
1793
|
+
get: () => typeof l.query.view == "string" && l.query.view !== "" ? l.query.view : "all",
|
|
1794
|
+
set: (V) => {
|
|
1795
|
+
$.replace({
|
|
1796
|
+
query: { ...l.query, view: V === "all" ? void 0 : V, page: void 0 }
|
|
1799
1797
|
});
|
|
1800
1798
|
}
|
|
1801
|
-
}),
|
|
1799
|
+
}), C = F(() => ({
|
|
1802
1800
|
view: A.value,
|
|
1803
|
-
search: typeof
|
|
1804
|
-
assignee: typeof
|
|
1805
|
-
sort: typeof
|
|
1806
|
-
page: Number(
|
|
1807
|
-
})),
|
|
1808
|
-
const
|
|
1809
|
-
{ value: "all", label:
|
|
1810
|
-
{ value: "unread", label:
|
|
1801
|
+
search: typeof l.query.search == "string" ? l.query.search : "",
|
|
1802
|
+
assignee: typeof l.query.assignee == "string" ? l.query.assignee : null,
|
|
1803
|
+
sort: typeof l.query.sort == "string" ? l.query.sort : null,
|
|
1804
|
+
page: Number(l.query.page ?? 1) || 1
|
|
1805
|
+
})), g = F(() => {
|
|
1806
|
+
const V = c.value?.counts, Z = [
|
|
1807
|
+
{ value: "all", label: b("panel.view-all"), badge: V?.all || void 0 },
|
|
1808
|
+
{ value: "unread", label: b("panel.view-unread"), badge: V?.unread || void 0 }
|
|
1811
1809
|
];
|
|
1812
|
-
for (const
|
|
1810
|
+
for (const L of U.value)
|
|
1813
1811
|
Z.push({
|
|
1814
|
-
value:
|
|
1815
|
-
label:
|
|
1816
|
-
badge:
|
|
1812
|
+
value: L.key,
|
|
1813
|
+
label: K(L),
|
|
1814
|
+
badge: V?.statuses[L.key] || void 0
|
|
1817
1815
|
});
|
|
1818
1816
|
return Z;
|
|
1819
1817
|
});
|
|
1820
|
-
function
|
|
1821
|
-
const
|
|
1822
|
-
return
|
|
1823
|
-
}
|
|
1824
|
-
const
|
|
1825
|
-
const
|
|
1826
|
-
return
|
|
1827
|
-
...
|
|
1818
|
+
function Q(V, Z) {
|
|
1819
|
+
const L = c.value?.columns?.[Z];
|
|
1820
|
+
return L ? V.values[L.key] ?? "" : "";
|
|
1821
|
+
}
|
|
1822
|
+
const be = F(() => {
|
|
1823
|
+
const V = c.value?.columns ?? [];
|
|
1824
|
+
return S.value ? [{ key: "card", label: "" }] : [
|
|
1825
|
+
...V.map((Z, L) => ({
|
|
1828
1826
|
key: `values.${Z.key}`,
|
|
1829
1827
|
label: Z.label,
|
|
1830
1828
|
sortable: !0,
|
|
@@ -1833,15 +1831,15 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1833
1831
|
// wide — 640, 960 — because an answer is a sentence and not a number: two of them plus
|
|
1834
1832
|
// the status and the date is already what a 755px pane holds without scrolling sideways,
|
|
1835
1833
|
// which is what the pane beside the forms actually is on a 1280 screen (§11).
|
|
1836
|
-
hideBelow:
|
|
1834
|
+
hideBelow: L === 0 ? void 0 : 320 + L * 320
|
|
1837
1835
|
})),
|
|
1838
1836
|
// A floor rather than a width: the cell holds a badge, sometimes an avatar and sometimes
|
|
1839
1837
|
// a paperclip, and a fixed width that any of them overflows makes the whole table scroll
|
|
1840
1838
|
// sideways by two pixels.
|
|
1841
|
-
{ key: "status", label:
|
|
1839
|
+
{ key: "status", label: b("panel.status"), minWidth: 100 },
|
|
1842
1840
|
{
|
|
1843
1841
|
key: "created_at",
|
|
1844
|
-
label:
|
|
1842
|
+
label: b("panel.received"),
|
|
1845
1843
|
sortable: !0,
|
|
1846
1844
|
width: 120,
|
|
1847
1845
|
// "today at 16:22" is three words the table will break over two lines given half a
|
|
@@ -1853,294 +1851,279 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
1853
1851
|
},
|
|
1854
1852
|
{ key: "actions", label: "", width: pl, align: "right", hideOnCards: !0 }
|
|
1855
1853
|
];
|
|
1856
|
-
}),
|
|
1857
|
-
() =>
|
|
1858
|
-
),
|
|
1859
|
-
() =>
|
|
1854
|
+
}), he = F(
|
|
1855
|
+
() => C.value.view === "all" && C.value.search === "" && C.value.assignee === null ? b("panel.submissions-empty") : b("panel.submissions-none")
|
|
1856
|
+
), N = F(
|
|
1857
|
+
() => U.value.map((V) => ({ value: V.id, label: K(V) }))
|
|
1860
1858
|
);
|
|
1861
|
-
function
|
|
1862
|
-
return
|
|
1859
|
+
function K(V) {
|
|
1860
|
+
return pe(V.title, p.active.value, V.key);
|
|
1863
1861
|
}
|
|
1864
|
-
function
|
|
1865
|
-
return
|
|
1862
|
+
function D() {
|
|
1863
|
+
return pe(v.form.title, p.active.value, v.form.slug);
|
|
1866
1864
|
}
|
|
1867
|
-
async function
|
|
1868
|
-
|
|
1865
|
+
async function x(V) {
|
|
1866
|
+
f.value = !0;
|
|
1869
1867
|
try {
|
|
1870
|
-
|
|
1871
|
-
view:
|
|
1872
|
-
search:
|
|
1873
|
-
assignee:
|
|
1874
|
-
sort:
|
|
1875
|
-
page:
|
|
1876
|
-
per_page:
|
|
1868
|
+
c.value = await m.submissions(v.form.id, {
|
|
1869
|
+
view: C.value.view,
|
|
1870
|
+
search: V?.search ?? C.value.search,
|
|
1871
|
+
assignee: C.value.assignee,
|
|
1872
|
+
sort: V?.sort ? `${V.sort.order === "desc" ? "-" : ""}${V.sort.key}` : null,
|
|
1873
|
+
page: V?.page ?? C.value.page,
|
|
1874
|
+
per_page: V?.perPage
|
|
1877
1875
|
});
|
|
1878
1876
|
} catch (Z) {
|
|
1879
|
-
E.danger(
|
|
1877
|
+
E.danger(q(Z));
|
|
1880
1878
|
} finally {
|
|
1881
|
-
|
|
1879
|
+
f.value = !1;
|
|
1882
1880
|
}
|
|
1883
1881
|
}
|
|
1884
|
-
function
|
|
1882
|
+
function h(V) {
|
|
1885
1883
|
const Z = {
|
|
1886
|
-
...
|
|
1887
|
-
search:
|
|
1888
|
-
sort:
|
|
1889
|
-
page:
|
|
1884
|
+
...l.query,
|
|
1885
|
+
search: V.search === "" ? void 0 : V.search,
|
|
1886
|
+
sort: V.sort === null ? void 0 : `${V.sort.order === "desc" ? "-" : ""}${V.sort.key}`,
|
|
1887
|
+
page: V.page === 1 ? void 0 : String(V.page)
|
|
1890
1888
|
};
|
|
1891
|
-
|
|
1889
|
+
$.replace({ query: Z }), x(V);
|
|
1892
1890
|
}
|
|
1893
|
-
|
|
1894
|
-
() => [
|
|
1891
|
+
Se(
|
|
1892
|
+
() => [v.form.id, A.value, C.value.assignee],
|
|
1895
1893
|
() => {
|
|
1896
|
-
|
|
1894
|
+
I.value = [], x();
|
|
1897
1895
|
}
|
|
1898
|
-
),
|
|
1899
|
-
async function
|
|
1896
|
+
), x(), ue();
|
|
1897
|
+
async function ue() {
|
|
1900
1898
|
try {
|
|
1901
|
-
|
|
1902
|
-
} catch (
|
|
1903
|
-
E.danger(
|
|
1899
|
+
U.value = await m.statuses();
|
|
1900
|
+
} catch (V) {
|
|
1901
|
+
E.danger(q(V));
|
|
1904
1902
|
}
|
|
1905
1903
|
}
|
|
1906
|
-
function
|
|
1907
|
-
|
|
1904
|
+
function ye(V) {
|
|
1905
|
+
$.push({ path: `${v.base}/submissions/${V.id}`, query: { ...l.query } });
|
|
1908
1906
|
}
|
|
1909
|
-
function
|
|
1910
|
-
return
|
|
1907
|
+
function qe(V) {
|
|
1908
|
+
return P.value ? [
|
|
1911
1909
|
{
|
|
1912
1910
|
key: "read",
|
|
1913
|
-
icon:
|
|
1914
|
-
label:
|
|
1911
|
+
icon: V.is_read ? "eye-off" : "eye",
|
|
1912
|
+
label: V.is_read ? b("panel.mark-unread") : b("panel.mark-read"),
|
|
1915
1913
|
run: () => {
|
|
1916
|
-
|
|
1914
|
+
Y([V.id], V.is_read ? "unread" : "read");
|
|
1917
1915
|
}
|
|
1918
1916
|
},
|
|
1919
1917
|
{
|
|
1920
1918
|
key: "delete",
|
|
1921
1919
|
icon: "trash",
|
|
1922
|
-
label:
|
|
1920
|
+
label: b("panel.delete"),
|
|
1923
1921
|
danger: !0,
|
|
1924
1922
|
run: () => {
|
|
1925
|
-
|
|
1923
|
+
y([V.id]);
|
|
1926
1924
|
}
|
|
1927
1925
|
}
|
|
1928
1926
|
] : [];
|
|
1929
1927
|
}
|
|
1930
|
-
async function
|
|
1931
|
-
typeof
|
|
1932
|
-
|
|
1928
|
+
async function He(V) {
|
|
1929
|
+
typeof V == "number" && (w.value = !0, await Y(
|
|
1930
|
+
I.value.map((Z) => Z.id),
|
|
1933
1931
|
"status",
|
|
1934
|
-
|
|
1935
|
-
),
|
|
1936
|
-
}
|
|
1937
|
-
async function
|
|
1938
|
-
await
|
|
1939
|
-
title:
|
|
1940
|
-
message:
|
|
1941
|
-
confirmText:
|
|
1942
|
-
cancelText:
|
|
1932
|
+
V
|
|
1933
|
+
), w.value = !1);
|
|
1934
|
+
}
|
|
1935
|
+
async function y(V) {
|
|
1936
|
+
await Ce({
|
|
1937
|
+
title: V.length === 1 ? b("panel.delete-submission-title") : b("panel.delete-selected-title", { count: V.length }),
|
|
1938
|
+
message: b("panel.delete-submission-text"),
|
|
1939
|
+
confirmText: b("panel.delete"),
|
|
1940
|
+
cancelText: b("panel.cancel"),
|
|
1943
1941
|
tone: "danger"
|
|
1944
|
-
}) && await
|
|
1942
|
+
}) && await Y(V, "delete");
|
|
1945
1943
|
}
|
|
1946
|
-
async function
|
|
1947
|
-
if (
|
|
1944
|
+
async function Y(V, Z, L) {
|
|
1945
|
+
if (V.length !== 0)
|
|
1948
1946
|
try {
|
|
1949
|
-
await
|
|
1950
|
-
} catch (
|
|
1951
|
-
E.danger(
|
|
1947
|
+
await m.massSubmissions({ ids: V, action: Z, status_id: L }), I.value = [], await x(), n("changed");
|
|
1948
|
+
} catch (ze) {
|
|
1949
|
+
E.danger(q(ze));
|
|
1952
1950
|
}
|
|
1953
1951
|
}
|
|
1954
|
-
async function
|
|
1955
|
-
const
|
|
1956
|
-
|
|
1957
|
-
}
|
|
1958
|
-
const
|
|
1959
|
-
() =>
|
|
1960
|
-
view:
|
|
1961
|
-
search:
|
|
1962
|
-
assignee:
|
|
1963
|
-
sort:
|
|
1952
|
+
async function R() {
|
|
1953
|
+
const V = await M({ form: v.form });
|
|
1954
|
+
V && (E.success(b("panel.created")), await x(), n("changed"), $.push({ path: `${v.base}/submissions/${V.id}`, query: { ...l.query } }));
|
|
1955
|
+
}
|
|
1956
|
+
const Ge = F(
|
|
1957
|
+
() => m.exportUrl(v.form.id, {
|
|
1958
|
+
view: C.value.view,
|
|
1959
|
+
search: C.value.search,
|
|
1960
|
+
assignee: C.value.assignee,
|
|
1961
|
+
sort: C.value.sort
|
|
1964
1962
|
})
|
|
1965
|
-
)
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
}
|
|
1969
|
-
const ul = W(() => {
|
|
1970
|
-
const x = [];
|
|
1971
|
-
return L.value && x.push({
|
|
1972
|
-
key: "new",
|
|
1973
|
-
label: f("panel.new-submission"),
|
|
1974
|
-
icon: "plus",
|
|
1975
|
-
run: () => {
|
|
1976
|
-
Q();
|
|
1977
|
-
}
|
|
1978
|
-
}), x.push({ key: "export", label: f("panel.export"), icon: "download", href: H.value }), k.value && x.push({ key: "settings", label: f("panel.settings"), icon: "settings", run: He }), x;
|
|
1979
|
-
});
|
|
1980
|
-
return (x, Z) => (p(), K("div", {
|
|
1963
|
+
), rl = F(() => [
|
|
1964
|
+
{ key: "export", label: b("panel.export"), icon: "download", href: Ge.value }
|
|
1965
|
+
]);
|
|
1966
|
+
return s({ create: R }), (V, Z) => (u(), j("div", {
|
|
1981
1967
|
ref_key: "root",
|
|
1982
|
-
ref:
|
|
1983
|
-
class:
|
|
1968
|
+
ref: i,
|
|
1969
|
+
class: "wx-submissions"
|
|
1984
1970
|
}, [
|
|
1985
|
-
t(e(
|
|
1971
|
+
t(e(Ye), {
|
|
1986
1972
|
class: "wx-submissions__head",
|
|
1987
1973
|
level: 3,
|
|
1988
|
-
title:
|
|
1989
|
-
subtitle:
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
actions: ul.value,
|
|
1993
|
-
onBack: Z[0] || (Z[0] = (I) => v("back"))
|
|
1994
|
-
}, null, 8, ["title", "subtitle", "back", "back-label", "actions"]),
|
|
1974
|
+
title: D(),
|
|
1975
|
+
subtitle: r.form.slug,
|
|
1976
|
+
actions: rl.value
|
|
1977
|
+
}, null, 8, ["title", "subtitle", "actions"]),
|
|
1995
1978
|
t(e(Qe), {
|
|
1996
1979
|
modelValue: A.value,
|
|
1997
|
-
"onUpdate:modelValue": Z[
|
|
1980
|
+
"onUpdate:modelValue": Z[2] || (Z[2] = (L) => A.value = L),
|
|
1998
1981
|
class: "wx-submissions__views",
|
|
1999
|
-
items:
|
|
1982
|
+
items: g.value,
|
|
2000
1983
|
"collapse-below": 560,
|
|
2001
|
-
"aria-label": e(
|
|
1984
|
+
"aria-label": e(b)("panel.status")
|
|
2002
1985
|
}, {
|
|
2003
1986
|
default: a(() => [
|
|
2004
|
-
t(e(
|
|
2005
|
-
data:
|
|
2006
|
-
columns:
|
|
1987
|
+
t(e(il), {
|
|
1988
|
+
data: c.value,
|
|
1989
|
+
columns: be.value,
|
|
2007
1990
|
"row-key": "id",
|
|
2008
1991
|
searchable: "",
|
|
2009
1992
|
clickable: "",
|
|
2010
1993
|
hover: "",
|
|
2011
1994
|
flush: "",
|
|
2012
|
-
loading:
|
|
2013
|
-
selectable:
|
|
2014
|
-
"row-class": (
|
|
2015
|
-
"search-placeholder": e(
|
|
2016
|
-
"empty-text":
|
|
2017
|
-
"cards-below":
|
|
2018
|
-
onRowClick:
|
|
2019
|
-
onStateChange:
|
|
2020
|
-
onSelectionChange: Z[
|
|
2021
|
-
},
|
|
2022
|
-
"cell-status": a(({ row:
|
|
2023
|
-
|
|
2024
|
-
|
|
1995
|
+
loading: f.value,
|
|
1996
|
+
selectable: P.value,
|
|
1997
|
+
"row-class": (L) => L.is_read ? void 0 : "is-unread",
|
|
1998
|
+
"search-placeholder": e(b)("panel.search-submissions"),
|
|
1999
|
+
"empty-text": he.value,
|
|
2000
|
+
"cards-below": T.value,
|
|
2001
|
+
onRowClick: ye,
|
|
2002
|
+
onStateChange: h,
|
|
2003
|
+
onSelectionChange: Z[1] || (Z[1] = (L, ze) => I.value = ze)
|
|
2004
|
+
}, Ie({
|
|
2005
|
+
"cell-status": a(({ row: L }) => [
|
|
2006
|
+
G("div", rt, [
|
|
2007
|
+
L.status ? (u(), _(e(Ue), {
|
|
2025
2008
|
key: 0,
|
|
2026
|
-
type:
|
|
2009
|
+
type: L.status.color
|
|
2027
2010
|
}, {
|
|
2028
2011
|
default: a(() => [
|
|
2029
|
-
|
|
2012
|
+
z(k(K(L.status)), 1)
|
|
2030
2013
|
]),
|
|
2031
2014
|
_: 2
|
|
2032
|
-
}, 1032, ["type"])) :
|
|
2033
|
-
|
|
2015
|
+
}, 1032, ["type"])) : H("", !0),
|
|
2016
|
+
L.assignee ? (u(), _(e(el), {
|
|
2034
2017
|
key: 1,
|
|
2035
|
-
name:
|
|
2036
|
-
title:
|
|
2018
|
+
name: L.assignee.name,
|
|
2019
|
+
title: L.assignee.name,
|
|
2037
2020
|
size: "xs",
|
|
2038
2021
|
tone: "auto"
|
|
2039
|
-
}, null, 8, ["name", "title"])) :
|
|
2040
|
-
|
|
2022
|
+
}, null, 8, ["name", "title"])) : H("", !0),
|
|
2023
|
+
L.files_count > 0 ? (u(), _(e(wl), {
|
|
2041
2024
|
key: 2,
|
|
2042
|
-
content: e(
|
|
2025
|
+
content: e(b)("panel.attachments")
|
|
2043
2026
|
}, {
|
|
2044
2027
|
default: a(() => [
|
|
2045
|
-
t(e(
|
|
2028
|
+
t(e(Ve), {
|
|
2046
2029
|
name: "file",
|
|
2047
2030
|
size: "sm"
|
|
2048
2031
|
})
|
|
2049
2032
|
]),
|
|
2050
2033
|
_: 1
|
|
2051
|
-
}, 8, ["content"])) :
|
|
2034
|
+
}, 8, ["content"])) : H("", !0)
|
|
2052
2035
|
])
|
|
2053
2036
|
]),
|
|
2054
|
-
"cell-created_at": a(({ row:
|
|
2055
|
-
t(e(
|
|
2056
|
-
value:
|
|
2037
|
+
"cell-created_at": a(({ row: L }) => [
|
|
2038
|
+
t(e(Ne), {
|
|
2039
|
+
value: L.created_at,
|
|
2057
2040
|
compact: ""
|
|
2058
2041
|
}, null, 8, ["value"])
|
|
2059
2042
|
]),
|
|
2060
|
-
"cell-card": a(({ row:
|
|
2043
|
+
"cell-card": a(({ row: L }) => [
|
|
2061
2044
|
t(e(_l), {
|
|
2062
2045
|
variant: "plain",
|
|
2063
2046
|
shape: "circle",
|
|
2064
|
-
title:
|
|
2047
|
+
title: Q(L, 0)
|
|
2065
2048
|
}, {
|
|
2066
2049
|
subtitle: a(() => [
|
|
2067
|
-
|
|
2050
|
+
z(k(Q(L, 1)), 1)
|
|
2068
2051
|
]),
|
|
2069
2052
|
meta: a(() => [
|
|
2070
|
-
|
|
2053
|
+
L.status ? (u(), _(e(Ue), {
|
|
2071
2054
|
key: 0,
|
|
2072
|
-
type:
|
|
2055
|
+
type: L.status.color,
|
|
2073
2056
|
size: "sm"
|
|
2074
2057
|
}, {
|
|
2075
2058
|
default: a(() => [
|
|
2076
|
-
|
|
2059
|
+
z(k(K(L.status)), 1)
|
|
2077
2060
|
]),
|
|
2078
2061
|
_: 2
|
|
2079
|
-
}, 1032, ["type"])) :
|
|
2080
|
-
|
|
2062
|
+
}, 1032, ["type"])) : H("", !0),
|
|
2063
|
+
L.assignee ? (u(), _(e(el), {
|
|
2081
2064
|
key: 1,
|
|
2082
|
-
name:
|
|
2083
|
-
title:
|
|
2065
|
+
name: L.assignee.name,
|
|
2066
|
+
title: L.assignee.name,
|
|
2084
2067
|
size: "xs",
|
|
2085
2068
|
tone: "auto"
|
|
2086
|
-
}, null, 8, ["name", "title"])) :
|
|
2087
|
-
|
|
2069
|
+
}, null, 8, ["name", "title"])) : H("", !0),
|
|
2070
|
+
L.files_count > 0 ? (u(), _(e(Ve), {
|
|
2088
2071
|
key: 2,
|
|
2089
2072
|
name: "file",
|
|
2090
2073
|
size: "sm"
|
|
2091
|
-
})) :
|
|
2092
|
-
t(e(
|
|
2093
|
-
value:
|
|
2074
|
+
})) : H("", !0),
|
|
2075
|
+
t(e(Ne), {
|
|
2076
|
+
value: L.created_at
|
|
2094
2077
|
}, null, 8, ["value"])
|
|
2095
2078
|
]),
|
|
2096
2079
|
_: 2
|
|
2097
2080
|
}, 1032, ["title"])
|
|
2098
2081
|
]),
|
|
2099
|
-
"card-actions": a(({ row:
|
|
2100
|
-
t(e(
|
|
2101
|
-
actions:
|
|
2102
|
-
label: String(
|
|
2082
|
+
"card-actions": a(({ row: L }) => [
|
|
2083
|
+
t(e(Te), {
|
|
2084
|
+
actions: qe(L),
|
|
2085
|
+
label: String(L.id)
|
|
2103
2086
|
}, null, 8, ["actions", "label"])
|
|
2104
2087
|
]),
|
|
2105
|
-
"cell-actions": a(({ row:
|
|
2106
|
-
t(e(
|
|
2107
|
-
actions:
|
|
2108
|
-
label: String(
|
|
2088
|
+
"cell-actions": a(({ row: L }) => [
|
|
2089
|
+
t(e(Te), {
|
|
2090
|
+
actions: qe(L),
|
|
2091
|
+
label: String(L.id)
|
|
2109
2092
|
}, null, 8, ["actions", "label"])
|
|
2110
2093
|
]),
|
|
2111
2094
|
_: 2
|
|
2112
2095
|
}, [
|
|
2113
|
-
|
|
2096
|
+
I.value.length > 0 ? {
|
|
2114
2097
|
name: "actions",
|
|
2115
2098
|
fn: a(() => [
|
|
2116
|
-
|
|
2099
|
+
G("div", ut, [
|
|
2117
2100
|
t(e(J), {
|
|
2118
2101
|
size: "sm",
|
|
2119
2102
|
weight: "medium"
|
|
2120
2103
|
}, {
|
|
2121
2104
|
default: a(() => [
|
|
2122
|
-
|
|
2105
|
+
z(k(e(b)("panel.selected", { count: I.value.length })), 1)
|
|
2123
2106
|
]),
|
|
2124
2107
|
_: 1
|
|
2125
2108
|
}),
|
|
2126
|
-
t(e(
|
|
2109
|
+
t(e(fe), {
|
|
2127
2110
|
"model-value": null,
|
|
2128
|
-
options:
|
|
2129
|
-
placeholder: e(
|
|
2130
|
-
disabled:
|
|
2111
|
+
options: N.value,
|
|
2112
|
+
placeholder: e(b)("panel.move-to"),
|
|
2113
|
+
disabled: w.value,
|
|
2131
2114
|
size: "sm",
|
|
2132
2115
|
style: { width: "180px" },
|
|
2133
|
-
"onUpdate:modelValue":
|
|
2116
|
+
"onUpdate:modelValue": He
|
|
2134
2117
|
}, null, 8, ["options", "placeholder", "disabled"]),
|
|
2135
|
-
t(e(
|
|
2118
|
+
t(e(le), {
|
|
2136
2119
|
size: "sm",
|
|
2137
2120
|
variant: "outline",
|
|
2138
2121
|
type: "danger",
|
|
2139
2122
|
icon: "trash",
|
|
2140
|
-
onClick: Z[
|
|
2123
|
+
onClick: Z[0] || (Z[0] = (L) => y(I.value.map((ze) => ze.id)))
|
|
2141
2124
|
}, {
|
|
2142
2125
|
default: a(() => [
|
|
2143
|
-
|
|
2126
|
+
z(k(e(b)("panel.delete")), 1)
|
|
2144
2127
|
]),
|
|
2145
2128
|
_: 1
|
|
2146
2129
|
})
|
|
@@ -2148,129 +2131,126 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2148
2131
|
]),
|
|
2149
2132
|
key: "0"
|
|
2150
2133
|
} : void 0
|
|
2151
|
-
]), 1032, ["data", "columns", "loading", "selectable", "row-class", "search-placeholder", "empty-text"])
|
|
2134
|
+
]), 1032, ["data", "columns", "loading", "selectable", "row-class", "search-placeholder", "empty-text", "cards-below"])
|
|
2152
2135
|
]),
|
|
2153
2136
|
_: 1
|
|
2154
2137
|
}, 8, ["modelValue", "items", "aria-label"])
|
|
2155
|
-
],
|
|
2138
|
+
], 512));
|
|
2156
2139
|
}
|
|
2157
|
-
}), pt = /* @__PURE__ */
|
|
2140
|
+
}), pt = /* @__PURE__ */ ie(ct, [["__scopeId", "data-v-aed84c27"]]), mt = ["onClick"], vt = { class: "wx-inbox-form__name" }, ft = /* @__PURE__ */ ae({
|
|
2158
2141
|
__name: "InboxPage",
|
|
2159
2142
|
props: {
|
|
2160
2143
|
base: { default: "/inbox" }
|
|
2161
2144
|
},
|
|
2162
|
-
setup(
|
|
2163
|
-
const
|
|
2145
|
+
setup(r) {
|
|
2146
|
+
const s = r, o = oe(), v = re(o), n = Le(), d = Oe(), m = xe();
|
|
2164
2147
|
de();
|
|
2165
|
-
const l = te("webx-inbox"),
|
|
2166
|
-
() =>
|
|
2167
|
-
),
|
|
2168
|
-
const
|
|
2169
|
-
return typeof
|
|
2170
|
-
}),
|
|
2171
|
-
function
|
|
2172
|
-
return
|
|
2173
|
-
}
|
|
2174
|
-
async function
|
|
2175
|
-
|
|
2148
|
+
const l = te("webx-inbox"), $ = me(), p = W([]), i = W(!0), O = nl("pane"), S = W(!0), T = W(!1), b = F(() => o.can("inbox.manage")), q = Re(nt), c = F(
|
|
2149
|
+
() => o.state.manifest?.modules.find((N) => N.id === "inbox")?.title ?? l("module.title")
|
|
2150
|
+
), U = F(() => {
|
|
2151
|
+
const N = n.query.form;
|
|
2152
|
+
return typeof N == "string" && N !== "" ? Number(N) : null;
|
|
2153
|
+
}), f = F(() => p.value.find((N) => N.id === U.value) ?? null);
|
|
2154
|
+
function I(N) {
|
|
2155
|
+
return pe(N.title, m.active.value, N.slug);
|
|
2156
|
+
}
|
|
2157
|
+
async function w() {
|
|
2158
|
+
i.value = !0;
|
|
2176
2159
|
try {
|
|
2177
|
-
|
|
2178
|
-
} catch (
|
|
2179
|
-
E.danger(
|
|
2160
|
+
p.value = await v.forms();
|
|
2161
|
+
} catch (N) {
|
|
2162
|
+
E.danger($(N));
|
|
2180
2163
|
} finally {
|
|
2181
|
-
|
|
2164
|
+
i.value = !1;
|
|
2182
2165
|
}
|
|
2183
2166
|
}
|
|
2184
|
-
|
|
2185
|
-
|
|
2167
|
+
w(), Se([p, f], () => {
|
|
2168
|
+
p.value.length === 0 || f.value !== null || d.replace({ query: { ...n.query, form: String(p.value[0].id) } });
|
|
2186
2169
|
});
|
|
2187
|
-
function
|
|
2188
|
-
|
|
2170
|
+
function P(N, K) {
|
|
2171
|
+
d.replace({ query: { ...n.query, form: String(N.id) } }), K();
|
|
2189
2172
|
}
|
|
2190
|
-
function
|
|
2191
|
-
|
|
2173
|
+
function M(N) {
|
|
2174
|
+
d.push(`${s.base}/forms/${N.id}`);
|
|
2192
2175
|
}
|
|
2193
|
-
function
|
|
2194
|
-
return
|
|
2195
|
-
{ key: "settings", icon: "settings", label: l("panel.settings"), run: () =>
|
|
2196
|
-
{ key: "duplicate", icon: "copy", label: l("panel.duplicate"), run: () =>
|
|
2176
|
+
function A(N) {
|
|
2177
|
+
return b.value ? [
|
|
2178
|
+
{ key: "settings", icon: "settings", label: l("panel.settings"), run: () => M(N) },
|
|
2179
|
+
{ key: "duplicate", icon: "copy", label: l("panel.duplicate"), run: () => g(N) },
|
|
2197
2180
|
// A form that has taken submissions is switched off, never deleted (§2.4). The line is
|
|
2198
2181
|
// left out rather than greyed: a menu is a list of what is possible.
|
|
2199
|
-
...
|
|
2182
|
+
...N.submissions_count === 0 ? [
|
|
2200
2183
|
{
|
|
2201
2184
|
key: "delete",
|
|
2202
2185
|
icon: "trash",
|
|
2203
2186
|
label: l("panel.delete"),
|
|
2204
2187
|
danger: !0,
|
|
2205
|
-
run: () =>
|
|
2188
|
+
run: () => Q(N)
|
|
2206
2189
|
}
|
|
2207
2190
|
] : []
|
|
2208
2191
|
] : [];
|
|
2209
2192
|
}
|
|
2210
|
-
async function
|
|
2211
|
-
const
|
|
2212
|
-
|
|
2193
|
+
async function C() {
|
|
2194
|
+
const N = await q({});
|
|
2195
|
+
N && (await w(), M(N));
|
|
2213
2196
|
}
|
|
2214
|
-
async function
|
|
2197
|
+
async function g(N) {
|
|
2215
2198
|
try {
|
|
2216
|
-
const
|
|
2217
|
-
E.success(l("panel.duplicated")), await
|
|
2218
|
-
} catch (
|
|
2219
|
-
E.danger(
|
|
2199
|
+
const K = await v.duplicateForm(N.id);
|
|
2200
|
+
E.success(l("panel.duplicated")), await w(), M(K);
|
|
2201
|
+
} catch (K) {
|
|
2202
|
+
E.danger($(K));
|
|
2220
2203
|
}
|
|
2221
2204
|
}
|
|
2222
|
-
async function
|
|
2223
|
-
if (await
|
|
2224
|
-
title: l("panel.delete-form-title", { form:
|
|
2205
|
+
async function Q(N) {
|
|
2206
|
+
if (await Ce({
|
|
2207
|
+
title: l("panel.delete-form-title", { form: I(N) }),
|
|
2225
2208
|
message: l("panel.delete-form-text"),
|
|
2226
2209
|
confirmText: l("panel.delete"),
|
|
2227
2210
|
cancelText: l("panel.cancel"),
|
|
2228
2211
|
tone: "danger"
|
|
2229
2212
|
}))
|
|
2230
2213
|
try {
|
|
2231
|
-
if (await v.removeForm(
|
|
2232
|
-
const
|
|
2233
|
-
delete
|
|
2214
|
+
if (await v.removeForm(N.id), E.success(l("panel.deleted")), U.value === N.id) {
|
|
2215
|
+
const D = { ...n.query };
|
|
2216
|
+
delete D.form, d.replace({ query: D });
|
|
2234
2217
|
}
|
|
2235
|
-
await
|
|
2236
|
-
} catch (
|
|
2237
|
-
E.danger(
|
|
2218
|
+
await w();
|
|
2219
|
+
} catch (D) {
|
|
2220
|
+
E.danger($(D));
|
|
2238
2221
|
}
|
|
2239
2222
|
}
|
|
2240
|
-
async function
|
|
2223
|
+
async function be() {
|
|
2241
2224
|
try {
|
|
2242
|
-
await v.sortForms(
|
|
2243
|
-
} catch (
|
|
2244
|
-
E.danger(
|
|
2225
|
+
await v.sortForms(p.value.map((N) => N.id));
|
|
2226
|
+
} catch (N) {
|
|
2227
|
+
E.danger($(N, l("panel.reorder-failed"))), await w();
|
|
2245
2228
|
}
|
|
2246
2229
|
}
|
|
2247
|
-
const
|
|
2248
|
-
|
|
2249
|
-
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
|
|
2253
|
-
|
|
2254
|
-
|
|
2255
|
-
}
|
|
2256
|
-
},
|
|
2257
|
-
{
|
|
2258
|
-
key: "new",
|
|
2259
|
-
label: l("panel.new-form"),
|
|
2260
|
-
icon: "plus",
|
|
2261
|
-
primary: !0,
|
|
2262
|
-
run: () => {
|
|
2263
|
-
A();
|
|
2264
|
-
}
|
|
2230
|
+
const he = F(() => {
|
|
2231
|
+
const N = [];
|
|
2232
|
+
return b.value && N.push({
|
|
2233
|
+
key: "statuses",
|
|
2234
|
+
label: l("panel.statuses"),
|
|
2235
|
+
icon: "tag",
|
|
2236
|
+
run: () => {
|
|
2237
|
+
d.push(`${s.base}/statuses`);
|
|
2265
2238
|
}
|
|
2266
|
-
|
|
2267
|
-
|
|
2268
|
-
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2239
|
+
}), o.can("inbox.update") && f.value !== null && N.push({
|
|
2240
|
+
key: "new-submission",
|
|
2241
|
+
label: l("panel.new-submission"),
|
|
2242
|
+
icon: "plus",
|
|
2243
|
+
primary: !0,
|
|
2244
|
+
run: () => {
|
|
2245
|
+
O.value?.create();
|
|
2246
|
+
}
|
|
2247
|
+
}), N;
|
|
2248
|
+
});
|
|
2249
|
+
return (N, K) => (u(), _(e(sl), {
|
|
2250
|
+
title: c.value,
|
|
2251
|
+
actions: he.value,
|
|
2252
|
+
card: !1
|
|
2253
|
+
}, Ie({
|
|
2274
2254
|
default: a(() => [
|
|
2275
2255
|
t(e(se), {
|
|
2276
2256
|
class: "wx-inbox",
|
|
@@ -2278,187 +2258,227 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2278
2258
|
}, {
|
|
2279
2259
|
default: a(() => [
|
|
2280
2260
|
t(e(kl), {
|
|
2281
|
-
open:
|
|
2282
|
-
"onUpdate:
|
|
2261
|
+
"filters-open": T.value,
|
|
2262
|
+
"onUpdate:filtersOpen": K[2] || (K[2] = (D) => T.value = D),
|
|
2283
2263
|
class: "wx-inbox__panes",
|
|
2284
|
-
"
|
|
2264
|
+
"filters-width": 270,
|
|
2285
2265
|
"detail-min": 420,
|
|
2286
|
-
"
|
|
2266
|
+
"filters-title": e(l)("panel.forms"),
|
|
2267
|
+
onFiltersInline: K[3] || (K[3] = (D) => S.value = D)
|
|
2287
2268
|
}, {
|
|
2288
|
-
|
|
2289
|
-
|
|
2269
|
+
filters: a(({ inline: D, close: x }) => [
|
|
2270
|
+
i.value ? (u(), _(e(Fe), {
|
|
2290
2271
|
key: 0,
|
|
2291
2272
|
class: "wx-inbox__loading",
|
|
2292
2273
|
rows: 5
|
|
2293
|
-
})) :
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2274
|
+
})) : (u(), j(ee, { key: 1 }, [
|
|
2275
|
+
!D && b.value ? (u(), _(e(le), {
|
|
2276
|
+
key: 0,
|
|
2277
|
+
class: "wx-inbox__new-form",
|
|
2278
|
+
variant: "outline",
|
|
2279
|
+
block: "",
|
|
2280
|
+
onClick: C
|
|
2281
|
+
}, {
|
|
2282
|
+
icon: a(() => [
|
|
2283
|
+
t(e(Ve), { name: "plus" })
|
|
2284
|
+
]),
|
|
2285
|
+
default: a(() => [
|
|
2286
|
+
z(" " + k(e(l)("panel.new-form")), 1)
|
|
2287
|
+
]),
|
|
2288
|
+
_: 1
|
|
2289
|
+
})) : H("", !0),
|
|
2290
|
+
t(e(Ze), {
|
|
2291
|
+
modelValue: p.value,
|
|
2292
|
+
"onUpdate:modelValue": K[1] || (K[1] = (h) => p.value = h),
|
|
2293
|
+
class: Je(["wx-inbox__forms", { "is-panel": !D }]),
|
|
2294
|
+
plain: "",
|
|
2295
|
+
size: "sm",
|
|
2296
|
+
"item-key": "id",
|
|
2297
|
+
"item-label": I,
|
|
2298
|
+
disabled: !b.value,
|
|
2299
|
+
title: D ? e(l)("panel.forms") : void 0,
|
|
2300
|
+
onMove: be
|
|
2301
|
+
}, Ie({
|
|
2302
|
+
default: a(({ item: h }) => [
|
|
2303
|
+
G("button", {
|
|
2304
|
+
type: "button",
|
|
2305
|
+
class: Je(["wx-inbox-form", { "is-current": h.id === U.value, "is-off": !h.is_enabled }]),
|
|
2306
|
+
onClick: (ue) => P(h, x)
|
|
2307
|
+
}, [
|
|
2308
|
+
G("span", vt, [
|
|
2309
|
+
t(e(J), {
|
|
2310
|
+
truncate: "",
|
|
2311
|
+
weight: "medium",
|
|
2312
|
+
tone: h.is_enabled ? "default" : "muted"
|
|
2313
|
+
}, {
|
|
2314
|
+
default: a(() => [
|
|
2315
|
+
z(k(I(h)), 1)
|
|
2316
|
+
]),
|
|
2317
|
+
_: 2
|
|
2318
|
+
}, 1032, ["tone"]),
|
|
2319
|
+
h.unread_count ? (u(), _(e(ll), {
|
|
2320
|
+
key: 0,
|
|
2321
|
+
class: "wx-inbox-form__count",
|
|
2322
|
+
type: "primary",
|
|
2323
|
+
value: h.unread_count,
|
|
2324
|
+
label: e(l)("panel.unread")
|
|
2325
|
+
}, null, 8, ["value", "label"])) : h.submissions_count ? (u(), _(e(ll), {
|
|
2326
|
+
key: 1,
|
|
2327
|
+
class: "wx-inbox-form__count",
|
|
2328
|
+
type: "neutral",
|
|
2329
|
+
value: h.submissions_count,
|
|
2330
|
+
label: e(l)("panel.submissions")
|
|
2331
|
+
}, null, 8, ["value", "label"])) : H("", !0)
|
|
2332
|
+
]),
|
|
2317
2333
|
t(e(J), {
|
|
2318
|
-
|
|
2319
|
-
|
|
2334
|
+
size: "sm",
|
|
2335
|
+
tone: "muted",
|
|
2336
|
+
truncate: ""
|
|
2320
2337
|
}, {
|
|
2321
2338
|
default: a(() => [
|
|
2322
|
-
|
|
2339
|
+
z(k(h.slug), 1)
|
|
2323
2340
|
]),
|
|
2324
2341
|
_: 2
|
|
2325
|
-
}, 1024)
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
|
|
2334
|
-
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
|
|
2341
|
-
|
|
2342
|
-
|
|
2343
|
-
|
|
2344
|
-
|
|
2345
|
-
value: B.submissions_count,
|
|
2346
|
-
label: e(l)("panel.submissions")
|
|
2347
|
-
}, null, 8, ["value", "label"])) : P("", !0)
|
|
2342
|
+
}, 1024)
|
|
2343
|
+
], 10, mt)
|
|
2344
|
+
]),
|
|
2345
|
+
actions: a(({ item: h }) => [
|
|
2346
|
+
t(e(Te), {
|
|
2347
|
+
actions: A(h),
|
|
2348
|
+
label: I(h)
|
|
2349
|
+
}, null, 8, ["actions", "label"])
|
|
2350
|
+
]),
|
|
2351
|
+
_: 2
|
|
2352
|
+
}, [
|
|
2353
|
+
D && b.value ? {
|
|
2354
|
+
name: "extra",
|
|
2355
|
+
fn: a(() => [
|
|
2356
|
+
t(e(ke), {
|
|
2357
|
+
icon: "plus",
|
|
2358
|
+
size: "sm",
|
|
2359
|
+
title: e(l)("panel.new-form"),
|
|
2360
|
+
onClick: C
|
|
2361
|
+
}, null, 8, ["title"])
|
|
2348
2362
|
]),
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
}, {
|
|
2354
|
-
default: a(() => [
|
|
2355
|
-
F(w(B.slug), 1)
|
|
2356
|
-
]),
|
|
2357
|
-
_: 2
|
|
2358
|
-
}, 1024)
|
|
2359
|
-
], 10, mt)
|
|
2360
|
-
]),
|
|
2361
|
-
actions: a(({ item: B }) => [
|
|
2362
|
-
t(e(ze), {
|
|
2363
|
-
actions: R(B),
|
|
2364
|
-
label: _(B)
|
|
2365
|
-
}, null, 8, ["actions", "label"])
|
|
2366
|
-
]),
|
|
2367
|
-
_: 1
|
|
2368
|
-
}, 8, ["modelValue", "disabled", "title"]))
|
|
2369
|
-
]),
|
|
2370
|
-
empty: a(() => [
|
|
2371
|
-
t(e(We), {
|
|
2372
|
-
description: e(l)("panel.choose-form")
|
|
2373
|
-
}, null, 8, ["description"])
|
|
2363
|
+
key: "0"
|
|
2364
|
+
} : void 0
|
|
2365
|
+
]), 1032, ["modelValue", "class", "disabled", "title"])
|
|
2366
|
+
], 64))
|
|
2374
2367
|
]),
|
|
2375
|
-
|
|
2376
|
-
|
|
2377
|
-
key:
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2368
|
+
list: a(() => [
|
|
2369
|
+
i.value ? (u(), _(e(Fe), {
|
|
2370
|
+
key: 0,
|
|
2371
|
+
class: "wx-inbox__loading",
|
|
2372
|
+
rows: 6
|
|
2373
|
+
})) : f.value ? (u(), _(pt, {
|
|
2374
|
+
ref_key: "pane",
|
|
2375
|
+
ref: O,
|
|
2376
|
+
key: f.value.id,
|
|
2377
|
+
form: f.value,
|
|
2378
|
+
base: s.base,
|
|
2379
|
+
onChanged: w
|
|
2380
|
+
}, null, 8, ["form", "base"])) : (u(), _(e(Be), {
|
|
2381
|
+
key: 2,
|
|
2382
|
+
title: e(l)("panel.no-forms"),
|
|
2383
|
+
description: e(l)("panel.no-forms-help")
|
|
2384
|
+
}, null, 8, ["title", "description"]))
|
|
2384
2385
|
]),
|
|
2385
2386
|
_: 1
|
|
2386
|
-
}, 8, ["open", "
|
|
2387
|
+
}, 8, ["filters-open", "filters-title"])
|
|
2387
2388
|
]),
|
|
2388
2389
|
_: 1
|
|
2389
2390
|
})
|
|
2390
2391
|
]),
|
|
2391
|
-
_:
|
|
2392
|
-
},
|
|
2392
|
+
_: 2
|
|
2393
|
+
}, [
|
|
2394
|
+
S.value ? void 0 : {
|
|
2395
|
+
name: "actions",
|
|
2396
|
+
fn: a(() => [
|
|
2397
|
+
t(e(le), {
|
|
2398
|
+
variant: "outline",
|
|
2399
|
+
onClick: K[0] || (K[0] = (D) => T.value = !0)
|
|
2400
|
+
}, {
|
|
2401
|
+
icon: a(() => [
|
|
2402
|
+
t(e(Ve), { name: "list" })
|
|
2403
|
+
]),
|
|
2404
|
+
default: a(() => [
|
|
2405
|
+
z(" " + k(e(l)("panel.forms")), 1)
|
|
2406
|
+
]),
|
|
2407
|
+
_: 1
|
|
2408
|
+
})
|
|
2409
|
+
]),
|
|
2410
|
+
key: "0"
|
|
2411
|
+
}
|
|
2412
|
+
]), 1032, ["title", "actions"]));
|
|
2393
2413
|
}
|
|
2394
2414
|
}), bt = { class: "wx-inbox-status-form" }, ht = { class: "wx-inbox-status-form__checks" }, yt = /* @__PURE__ */ ae({
|
|
2395
2415
|
__name: "StatusDialog",
|
|
2396
2416
|
props: {
|
|
2397
2417
|
status: {}
|
|
2398
2418
|
},
|
|
2399
|
-
setup(
|
|
2400
|
-
const
|
|
2419
|
+
setup(r) {
|
|
2420
|
+
const s = r, { resolve: o, dismiss: v, open: n } = Ee(), d = oe(), m = re(d);
|
|
2401
2421
|
de();
|
|
2402
|
-
const l = te("webx-inbox"),
|
|
2403
|
-
|
|
2404
|
-
() =>
|
|
2405
|
-
(
|
|
2406
|
-
|
|
2422
|
+
const l = te("webx-inbox"), $ = me(), p = W(""), i = W({}), O = W("default"), S = W(!1), T = W(!1), b = W(!1), q = W(!1), c = W({});
|
|
2423
|
+
Se(
|
|
2424
|
+
() => s.status,
|
|
2425
|
+
(w) => {
|
|
2426
|
+
p.value = w?.key ?? "", i.value = { ...w?.title ?? {} }, O.value = w?.color ?? "default", S.value = w?.is_default ?? !1, T.value = w?.is_spam ?? !1, b.value = w?.is_closed ?? !1, c.value = {};
|
|
2407
2427
|
},
|
|
2408
2428
|
{ immediate: !0 }
|
|
2409
2429
|
);
|
|
2410
|
-
const
|
|
2411
|
-
() => zl.map((
|
|
2430
|
+
const U = F(
|
|
2431
|
+
() => zl.map((w) => ({ value: w, label: l(`panel.color-${w}`) }))
|
|
2412
2432
|
);
|
|
2413
|
-
function
|
|
2414
|
-
return
|
|
2415
|
-
}
|
|
2416
|
-
async function
|
|
2417
|
-
|
|
2418
|
-
const
|
|
2419
|
-
key:
|
|
2420
|
-
title:
|
|
2421
|
-
color:
|
|
2422
|
-
is_default:
|
|
2433
|
+
function f(w) {
|
|
2434
|
+
return c.value[w]?.[0];
|
|
2435
|
+
}
|
|
2436
|
+
async function I() {
|
|
2437
|
+
q.value = !0, c.value = {};
|
|
2438
|
+
const w = {
|
|
2439
|
+
key: p.value.trim(),
|
|
2440
|
+
title: i.value,
|
|
2441
|
+
color: O.value,
|
|
2442
|
+
is_default: S.value,
|
|
2423
2443
|
is_spam: T.value,
|
|
2424
|
-
is_closed:
|
|
2444
|
+
is_closed: b.value
|
|
2425
2445
|
};
|
|
2426
2446
|
try {
|
|
2427
|
-
|
|
2428
|
-
|
|
2447
|
+
o(
|
|
2448
|
+
s.status === null ? await m.createStatus(w) : await m.saveStatus(s.status.id, w)
|
|
2429
2449
|
);
|
|
2430
|
-
} catch (
|
|
2431
|
-
const
|
|
2432
|
-
|
|
2450
|
+
} catch (P) {
|
|
2451
|
+
const M = P.body;
|
|
2452
|
+
M?.errors ? (c.value = M.errors, E.danger(l("panel.failed"))) : E.danger($(P));
|
|
2433
2453
|
} finally {
|
|
2434
|
-
|
|
2454
|
+
q.value = !1;
|
|
2435
2455
|
}
|
|
2436
2456
|
}
|
|
2437
|
-
return (
|
|
2457
|
+
return (w, P) => (u(), _(e(Pe), {
|
|
2438
2458
|
open: e(n),
|
|
2439
|
-
"onUpdate:open":
|
|
2440
|
-
title:
|
|
2459
|
+
"onUpdate:open": P[7] || (P[7] = (M) => ne(n) ? n.value = M : null),
|
|
2460
|
+
title: r.status ? e(l)("panel.settings") : e(l)("panel.new-status"),
|
|
2441
2461
|
width: 520
|
|
2442
2462
|
}, {
|
|
2443
2463
|
footer: a(() => [
|
|
2444
|
-
t(e(
|
|
2464
|
+
t(e(We), { size: "sm" }, {
|
|
2445
2465
|
default: a(() => [
|
|
2446
|
-
t(e(
|
|
2466
|
+
t(e(le), {
|
|
2447
2467
|
variant: "outline",
|
|
2448
|
-
onClick:
|
|
2468
|
+
onClick: P[6] || (P[6] = (M) => e(v)())
|
|
2449
2469
|
}, {
|
|
2450
2470
|
default: a(() => [
|
|
2451
|
-
|
|
2471
|
+
z(k(e(l)("panel.cancel")), 1)
|
|
2452
2472
|
]),
|
|
2453
2473
|
_: 1
|
|
2454
2474
|
}),
|
|
2455
|
-
t(e(
|
|
2475
|
+
t(e(le), {
|
|
2456
2476
|
type: "primary",
|
|
2457
|
-
loading:
|
|
2458
|
-
onClick:
|
|
2477
|
+
loading: q.value,
|
|
2478
|
+
onClick: I
|
|
2459
2479
|
}, {
|
|
2460
2480
|
default: a(() => [
|
|
2461
|
-
|
|
2481
|
+
z(k(e(l)("panel.save")), 1)
|
|
2462
2482
|
]),
|
|
2463
2483
|
_: 1
|
|
2464
2484
|
}, 8, ["loading"])
|
|
@@ -2467,62 +2487,62 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2467
2487
|
})
|
|
2468
2488
|
]),
|
|
2469
2489
|
default: a(() => [
|
|
2470
|
-
|
|
2471
|
-
t(e(
|
|
2490
|
+
G("div", bt, [
|
|
2491
|
+
t(e(B), {
|
|
2472
2492
|
label: e(l)("panel.title"),
|
|
2473
|
-
error:
|
|
2493
|
+
error: f("title"),
|
|
2474
2494
|
required: ""
|
|
2475
2495
|
}, {
|
|
2476
2496
|
default: a(() => [
|
|
2477
2497
|
t(e(X), {
|
|
2478
|
-
modelValue:
|
|
2479
|
-
"onUpdate:modelValue":
|
|
2498
|
+
modelValue: i.value,
|
|
2499
|
+
"onUpdate:modelValue": P[0] || (P[0] = (M) => i.value = M),
|
|
2480
2500
|
localized: ""
|
|
2481
2501
|
}, null, 8, ["modelValue"])
|
|
2482
2502
|
]),
|
|
2483
2503
|
_: 1
|
|
2484
2504
|
}, 8, ["label", "error"]),
|
|
2485
|
-
t(e(
|
|
2505
|
+
t(e(B), {
|
|
2486
2506
|
label: e(l)("panel.status-key"),
|
|
2487
|
-
error:
|
|
2507
|
+
error: f("key"),
|
|
2488
2508
|
required: ""
|
|
2489
2509
|
}, {
|
|
2490
2510
|
default: a(() => [
|
|
2491
2511
|
t(e(X), {
|
|
2492
|
-
modelValue:
|
|
2493
|
-
"onUpdate:modelValue":
|
|
2512
|
+
modelValue: p.value,
|
|
2513
|
+
"onUpdate:modelValue": P[1] || (P[1] = (M) => p.value = M),
|
|
2494
2514
|
placeholder: "in-progress"
|
|
2495
2515
|
}, null, 8, ["modelValue"])
|
|
2496
2516
|
]),
|
|
2497
2517
|
_: 1
|
|
2498
2518
|
}, 8, ["label", "error"]),
|
|
2499
|
-
t(e(
|
|
2519
|
+
t(e(B), {
|
|
2500
2520
|
label: e(l)("panel.status-color"),
|
|
2501
|
-
error:
|
|
2521
|
+
error: f("color")
|
|
2502
2522
|
}, {
|
|
2503
2523
|
default: a(() => [
|
|
2504
|
-
t(e(
|
|
2505
|
-
modelValue:
|
|
2506
|
-
"onUpdate:modelValue":
|
|
2507
|
-
options:
|
|
2524
|
+
t(e(fe), {
|
|
2525
|
+
modelValue: O.value,
|
|
2526
|
+
"onUpdate:modelValue": P[2] || (P[2] = (M) => O.value = M),
|
|
2527
|
+
options: U.value
|
|
2508
2528
|
}, null, 8, ["modelValue", "options"])
|
|
2509
2529
|
]),
|
|
2510
2530
|
_: 1
|
|
2511
2531
|
}, 8, ["label", "error"]),
|
|
2512
|
-
|
|
2513
|
-
t(e(
|
|
2514
|
-
modelValue:
|
|
2515
|
-
"onUpdate:modelValue":
|
|
2532
|
+
G("div", ht, [
|
|
2533
|
+
t(e(ve), {
|
|
2534
|
+
modelValue: S.value,
|
|
2535
|
+
"onUpdate:modelValue": P[3] || (P[3] = (M) => S.value = M),
|
|
2516
2536
|
label: e(l)("panel.status-default")
|
|
2517
2537
|
}, null, 8, ["modelValue", "label"]),
|
|
2518
|
-
t(e(
|
|
2538
|
+
t(e(ve), {
|
|
2519
2539
|
modelValue: T.value,
|
|
2520
|
-
"onUpdate:modelValue":
|
|
2540
|
+
"onUpdate:modelValue": P[4] || (P[4] = (M) => T.value = M),
|
|
2521
2541
|
label: e(l)("panel.status-spam")
|
|
2522
2542
|
}, null, 8, ["modelValue", "label"]),
|
|
2523
|
-
t(e(
|
|
2524
|
-
modelValue:
|
|
2525
|
-
"onUpdate:modelValue":
|
|
2543
|
+
t(e(ve), {
|
|
2544
|
+
modelValue: b.value,
|
|
2545
|
+
"onUpdate:modelValue": P[5] || (P[5] = (M) => b.value = M),
|
|
2526
2546
|
disabled: T.value,
|
|
2527
2547
|
label: e(l)("panel.status-closed")
|
|
2528
2548
|
}, null, 8, ["modelValue", "disabled", "label"])
|
|
@@ -2532,71 +2552,71 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2532
2552
|
_: 1
|
|
2533
2553
|
}, 8, ["open", "title"]));
|
|
2534
2554
|
}
|
|
2535
|
-
}), gt = /* @__PURE__ */
|
|
2555
|
+
}), gt = /* @__PURE__ */ ie(yt, [["__scopeId", "data-v-b520b53b"]]), xt = { class: "wx-inbox-statuses" }, _t = { class: "wx-inbox-status" }, wt = /* @__PURE__ */ ae({
|
|
2536
2556
|
__name: "StatusesPage",
|
|
2537
2557
|
props: {
|
|
2538
2558
|
base: { default: "/inbox" }
|
|
2539
2559
|
},
|
|
2540
|
-
setup(
|
|
2541
|
-
const
|
|
2560
|
+
setup(r) {
|
|
2561
|
+
const s = r, o = oe(), v = re(o), n = xe();
|
|
2542
2562
|
de();
|
|
2543
|
-
const
|
|
2544
|
-
function
|
|
2545
|
-
return
|
|
2563
|
+
const d = te("webx-inbox"), m = me(), l = W([]), $ = W(!0), p = o.can("inbox.manage"), i = Re(gt);
|
|
2564
|
+
function O(f) {
|
|
2565
|
+
return pe(f.title, n.active.value, f.key);
|
|
2546
2566
|
}
|
|
2547
|
-
async function
|
|
2548
|
-
|
|
2567
|
+
async function S() {
|
|
2568
|
+
$.value = !0;
|
|
2549
2569
|
try {
|
|
2550
2570
|
l.value = await v.statuses();
|
|
2551
|
-
} catch (
|
|
2552
|
-
E.danger(
|
|
2571
|
+
} catch (f) {
|
|
2572
|
+
E.danger(m(f));
|
|
2553
2573
|
} finally {
|
|
2554
|
-
|
|
2574
|
+
$.value = !1;
|
|
2555
2575
|
}
|
|
2556
2576
|
}
|
|
2557
|
-
|
|
2558
|
-
async function T(
|
|
2559
|
-
await
|
|
2577
|
+
S();
|
|
2578
|
+
async function T(f) {
|
|
2579
|
+
await i({ status: f }) && await S();
|
|
2560
2580
|
}
|
|
2561
|
-
async function
|
|
2562
|
-
if (await
|
|
2563
|
-
title:
|
|
2564
|
-
message:
|
|
2565
|
-
confirmText:
|
|
2566
|
-
cancelText:
|
|
2581
|
+
async function b(f) {
|
|
2582
|
+
if (await Ce({
|
|
2583
|
+
title: d("panel.delete-status-title", { status: O(f) }),
|
|
2584
|
+
message: d("panel.delete-status-text"),
|
|
2585
|
+
confirmText: d("panel.delete"),
|
|
2586
|
+
cancelText: d("panel.cancel"),
|
|
2567
2587
|
tone: "danger"
|
|
2568
2588
|
}))
|
|
2569
2589
|
try {
|
|
2570
|
-
await v.removeStatus(
|
|
2571
|
-
} catch (
|
|
2572
|
-
E.danger(
|
|
2590
|
+
await v.removeStatus(f.id), E.success(d("panel.deleted")), await S();
|
|
2591
|
+
} catch (w) {
|
|
2592
|
+
E.danger(m(w));
|
|
2573
2593
|
}
|
|
2574
2594
|
}
|
|
2575
|
-
function
|
|
2576
|
-
return
|
|
2577
|
-
{ key: "edit", icon: "edit", label:
|
|
2578
|
-
T(
|
|
2595
|
+
function q(f) {
|
|
2596
|
+
return p ? [
|
|
2597
|
+
{ key: "edit", icon: "edit", label: d("panel.settings"), run: () => {
|
|
2598
|
+
T(f);
|
|
2579
2599
|
} },
|
|
2580
2600
|
// A status with submissions in them cannot go: they would have nothing to be in. The
|
|
2581
2601
|
// line is left out rather than greyed, the way every list of the panel does it.
|
|
2582
|
-
...
|
|
2602
|
+
...f.submissions_count === 0 ? [
|
|
2583
2603
|
{
|
|
2584
2604
|
key: "delete",
|
|
2585
2605
|
icon: "trash",
|
|
2586
|
-
label:
|
|
2606
|
+
label: d("panel.delete"),
|
|
2587
2607
|
danger: !0,
|
|
2588
2608
|
run: () => {
|
|
2589
|
-
|
|
2609
|
+
b(f);
|
|
2590
2610
|
}
|
|
2591
2611
|
}
|
|
2592
2612
|
] : []
|
|
2593
2613
|
] : [];
|
|
2594
2614
|
}
|
|
2595
|
-
const
|
|
2596
|
-
() =>
|
|
2615
|
+
const c = F(
|
|
2616
|
+
() => p ? [
|
|
2597
2617
|
{
|
|
2598
2618
|
key: "new",
|
|
2599
|
-
label:
|
|
2619
|
+
label: d("panel.new-status"),
|
|
2600
2620
|
icon: "plus",
|
|
2601
2621
|
primary: !0,
|
|
2602
2622
|
run: () => {
|
|
@@ -2605,42 +2625,42 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2605
2625
|
}
|
|
2606
2626
|
] : []
|
|
2607
2627
|
);
|
|
2608
|
-
async function
|
|
2628
|
+
async function U() {
|
|
2609
2629
|
try {
|
|
2610
|
-
await v.sortStatuses(l.value.map((
|
|
2611
|
-
} catch (
|
|
2612
|
-
E.danger(
|
|
2630
|
+
await v.sortStatuses(l.value.map((f) => f.id));
|
|
2631
|
+
} catch (f) {
|
|
2632
|
+
E.danger(m(f, d("panel.reorder-failed"))), await S();
|
|
2613
2633
|
}
|
|
2614
2634
|
}
|
|
2615
|
-
return (
|
|
2616
|
-
t(e(
|
|
2617
|
-
title: e(
|
|
2618
|
-
back:
|
|
2619
|
-
"back-label": e(
|
|
2620
|
-
actions:
|
|
2635
|
+
return (f, I) => (u(), j("div", xt, [
|
|
2636
|
+
t(e(sl), {
|
|
2637
|
+
title: e(d)("panel.statuses"),
|
|
2638
|
+
back: s.base,
|
|
2639
|
+
"back-label": e(d)("panel.forms"),
|
|
2640
|
+
actions: c.value
|
|
2621
2641
|
}, {
|
|
2622
2642
|
default: a(() => [
|
|
2623
|
-
|
|
2643
|
+
!$.value && l.value.length === 0 ? (u(), _(e(Be), {
|
|
2624
2644
|
key: 0,
|
|
2625
|
-
title: e(
|
|
2626
|
-
}, null, 8, ["title"])) : (
|
|
2645
|
+
title: e(d)("panel.no-statuses")
|
|
2646
|
+
}, null, 8, ["title"])) : (u(), _(e(Ze), {
|
|
2627
2647
|
key: 1,
|
|
2628
2648
|
modelValue: l.value,
|
|
2629
|
-
"onUpdate:modelValue":
|
|
2649
|
+
"onUpdate:modelValue": I[0] || (I[0] = (w) => l.value = w),
|
|
2630
2650
|
plain: "",
|
|
2631
2651
|
"item-key": "id",
|
|
2632
|
-
"item-label":
|
|
2633
|
-
disabled: !e(
|
|
2634
|
-
"aria-label": e(
|
|
2635
|
-
onMove:
|
|
2652
|
+
"item-label": O,
|
|
2653
|
+
disabled: !e(p),
|
|
2654
|
+
"aria-label": e(d)("panel.statuses"),
|
|
2655
|
+
onMove: U
|
|
2636
2656
|
}, {
|
|
2637
|
-
default: a(({ item:
|
|
2638
|
-
|
|
2639
|
-
t(e(
|
|
2640
|
-
type:
|
|
2657
|
+
default: a(({ item: w }) => [
|
|
2658
|
+
G("div", _t, [
|
|
2659
|
+
t(e(Ue), {
|
|
2660
|
+
type: w.color
|
|
2641
2661
|
}, {
|
|
2642
2662
|
default: a(() => [
|
|
2643
|
-
|
|
2663
|
+
z(k(O(w)), 1)
|
|
2644
2664
|
]),
|
|
2645
2665
|
_: 2
|
|
2646
2666
|
}, 1032, ["type"]),
|
|
@@ -2650,27 +2670,27 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2650
2670
|
truncate: ""
|
|
2651
2671
|
}, {
|
|
2652
2672
|
default: a(() => [
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
], 64)) :
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
], 64)) :
|
|
2660
|
-
|
|
2661
|
-
], 64)) :
|
|
2662
|
-
|
|
2663
|
-
|
|
2664
|
-
], 64)) :
|
|
2673
|
+
G("code", null, k(w.key), 1),
|
|
2674
|
+
w.is_default ? (u(), j(ee, { key: 0 }, [
|
|
2675
|
+
z(" · " + k(e(d)("panel.status-default")), 1)
|
|
2676
|
+
], 64)) : H("", !0),
|
|
2677
|
+
w.is_spam ? (u(), j(ee, { key: 1 }, [
|
|
2678
|
+
z(" · " + k(e(d)("panel.status-spam")), 1)
|
|
2679
|
+
], 64)) : w.is_closed ? (u(), j(ee, { key: 2 }, [
|
|
2680
|
+
z(" · " + k(e(d)("panel.status-closed")), 1)
|
|
2681
|
+
], 64)) : H("", !0),
|
|
2682
|
+
w.submissions_count ? (u(), j(ee, { key: 3 }, [
|
|
2683
|
+
z(" · " + k(e(d)("panel.in-use")) + " (" + k(w.submissions_count) + ") ", 1)
|
|
2684
|
+
], 64)) : H("", !0)
|
|
2665
2685
|
]),
|
|
2666
2686
|
_: 2
|
|
2667
2687
|
}, 1024)
|
|
2668
2688
|
])
|
|
2669
2689
|
]),
|
|
2670
|
-
actions: a(({ item:
|
|
2671
|
-
t(e(
|
|
2672
|
-
actions:
|
|
2673
|
-
label:
|
|
2690
|
+
actions: a(({ item: w }) => [
|
|
2691
|
+
t(e(Te), {
|
|
2692
|
+
actions: q(w),
|
|
2693
|
+
label: O(w)
|
|
2674
2694
|
}, null, 8, ["actions", "label"])
|
|
2675
2695
|
]),
|
|
2676
2696
|
_: 1
|
|
@@ -2680,90 +2700,90 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2680
2700
|
}, 8, ["title", "back", "back-label", "actions"])
|
|
2681
2701
|
]));
|
|
2682
2702
|
}
|
|
2683
|
-
}), kt = /* @__PURE__ */
|
|
2703
|
+
}), kt = /* @__PURE__ */ ie(wt, [["__scopeId", "data-v-f94bf140"]]), Vt = { class: "wx-submission" }, $t = {
|
|
2684
2704
|
key: 1,
|
|
2685
2705
|
class: "wx-submission__panes"
|
|
2686
|
-
}, Ut = { class: "wx-submission__main" }, St = { class: "wx-submission__value" }, Ct = { class: "wx-submission__files" }, zt = { class: "wx-submission__by" }, Tt = { class: "wx-submission__fields" },
|
|
2706
|
+
}, Ut = { class: "wx-submission__main" }, St = { class: "wx-submission__value" }, Ct = { class: "wx-submission__files" }, zt = { class: "wx-submission__by" }, Tt = { class: "wx-submission__fields" }, Ft = ["href"], Wt = {
|
|
2687
2707
|
key: 1,
|
|
2688
2708
|
class: "wx-submission__detail"
|
|
2689
|
-
}, qt = { class: "wx-submission__aside" }, At = { class: "wx-submission__fields" }, It = { class: "wx-submission__field" }, Nt = { class: "wx-submission__field" },
|
|
2709
|
+
}, qt = { class: "wx-submission__aside" }, At = { class: "wx-submission__fields" }, It = { class: "wx-submission__field" }, Nt = { class: "wx-submission__field" }, Dt = /* @__PURE__ */ ae({
|
|
2690
2710
|
__name: "SubmissionPage",
|
|
2691
2711
|
props: {
|
|
2692
2712
|
base: { default: "/inbox" }
|
|
2693
2713
|
},
|
|
2694
|
-
setup(
|
|
2695
|
-
const
|
|
2714
|
+
setup(r) {
|
|
2715
|
+
const s = r, o = oe(), v = re(o), n = Le(), d = Oe(), m = xe();
|
|
2696
2716
|
de();
|
|
2697
|
-
const l = te("webx-inbox"),
|
|
2717
|
+
const l = te("webx-inbox"), $ = te("webx-admin"), p = me(), i = W(null), O = W([]), S = W([]), T = W(!0), b = F(() => o.can("inbox.update")), q = F(() => Number(n.params.id)), c = F(() => ({
|
|
2698
2718
|
view: typeof n.query.view == "string" ? n.query.view : void 0,
|
|
2699
2719
|
search: typeof n.query.search == "string" ? n.query.search : void 0,
|
|
2700
2720
|
assignee: typeof n.query.assignee == "string" ? n.query.assignee : void 0
|
|
2701
|
-
})),
|
|
2702
|
-
() =>
|
|
2703
|
-
),
|
|
2704
|
-
() =>
|
|
2721
|
+
})), U = F(() => ({ path: s.base, query: { ...n.query } })), f = F(
|
|
2722
|
+
() => O.value.map((y) => ({ value: y.id, label: w(y) }))
|
|
2723
|
+
), I = F(
|
|
2724
|
+
() => S.value.map((y) => ({ value: y.id, label: y.name }))
|
|
2705
2725
|
);
|
|
2706
|
-
function
|
|
2707
|
-
return
|
|
2708
|
-
}
|
|
2709
|
-
const
|
|
2710
|
-
const
|
|
2711
|
-
return
|
|
2712
|
-
}),
|
|
2713
|
-
if (
|
|
2714
|
-
const
|
|
2715
|
-
return `mailto:${
|
|
2726
|
+
function w(y) {
|
|
2727
|
+
return pe(y.title, m.active.value, y.key);
|
|
2728
|
+
}
|
|
2729
|
+
const P = F(() => l("panel.submission", { id: String(q.value) })), M = F(() => {
|
|
2730
|
+
const y = i.value?.form;
|
|
2731
|
+
return y === void 0 ? "" : pe(y.title ?? {}, m.active.value, y.slug ?? "");
|
|
2732
|
+
}), A = F(() => (i.value?.values ?? []).find((R) => R.type === "email" && (R.value ?? "") !== "")?.value ?? null), C = F(() => {
|
|
2733
|
+
if (A.value === null) return null;
|
|
2734
|
+
const y = encodeURIComponent(`${M.value} — ${P.value}`);
|
|
2735
|
+
return `mailto:${A.value}?subject=${y}`;
|
|
2716
2736
|
});
|
|
2717
|
-
async function
|
|
2737
|
+
async function g() {
|
|
2718
2738
|
T.value = !0;
|
|
2719
2739
|
try {
|
|
2720
|
-
|
|
2721
|
-
} catch (
|
|
2722
|
-
E.danger(
|
|
2740
|
+
i.value = await v.submission(q.value, c.value);
|
|
2741
|
+
} catch (y) {
|
|
2742
|
+
E.danger(p(y)), d.replace(U.value);
|
|
2723
2743
|
} finally {
|
|
2724
2744
|
T.value = !1;
|
|
2725
2745
|
}
|
|
2726
2746
|
}
|
|
2727
|
-
async function
|
|
2747
|
+
async function Q() {
|
|
2728
2748
|
try {
|
|
2729
|
-
|
|
2730
|
-
} catch (
|
|
2731
|
-
E.danger(
|
|
2749
|
+
O.value = await v.statuses(), b.value && (S.value = await v.recipients());
|
|
2750
|
+
} catch (y) {
|
|
2751
|
+
E.danger(p(y));
|
|
2732
2752
|
}
|
|
2733
2753
|
}
|
|
2734
|
-
|
|
2735
|
-
|
|
2736
|
-
}, { immediate: !0 }),
|
|
2737
|
-
async function
|
|
2754
|
+
Se(q, () => {
|
|
2755
|
+
g();
|
|
2756
|
+
}, { immediate: !0 }), Q();
|
|
2757
|
+
async function be(y) {
|
|
2738
2758
|
try {
|
|
2739
|
-
|
|
2740
|
-
} catch (
|
|
2741
|
-
E.danger(
|
|
2759
|
+
i.value = await v.saveSubmission(q.value, y), E.success(l("panel.saved"));
|
|
2760
|
+
} catch (Y) {
|
|
2761
|
+
E.danger(p(Y)), await g();
|
|
2742
2762
|
}
|
|
2743
2763
|
}
|
|
2744
|
-
function
|
|
2745
|
-
typeof
|
|
2764
|
+
function he(y) {
|
|
2765
|
+
typeof y == "number" && be({ status_id: y });
|
|
2746
2766
|
}
|
|
2747
|
-
function
|
|
2748
|
-
|
|
2767
|
+
function N(y) {
|
|
2768
|
+
be({ assignee_id: typeof y == "number" ? y : null });
|
|
2749
2769
|
}
|
|
2750
|
-
const
|
|
2751
|
-
const
|
|
2752
|
-
return
|
|
2770
|
+
const K = F(() => {
|
|
2771
|
+
const y = [];
|
|
2772
|
+
return C.value && y.push({
|
|
2753
2773
|
key: "reply",
|
|
2754
2774
|
label: l("panel.reply"),
|
|
2755
2775
|
icon: "mail",
|
|
2756
2776
|
primary: !0,
|
|
2757
|
-
href:
|
|
2777
|
+
href: C.value,
|
|
2758
2778
|
target: "_self"
|
|
2759
|
-
}),
|
|
2779
|
+
}), b.value && i.value !== null && y.push(
|
|
2760
2780
|
{
|
|
2761
2781
|
key: "unread",
|
|
2762
2782
|
icon: "eye-off",
|
|
2763
2783
|
label: l("panel.mark-unread"),
|
|
2764
2784
|
menu: !0,
|
|
2765
2785
|
run: () => {
|
|
2766
|
-
|
|
2786
|
+
D();
|
|
2767
2787
|
}
|
|
2768
2788
|
},
|
|
2769
2789
|
{
|
|
@@ -2772,20 +2792,20 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2772
2792
|
label: l("panel.delete"),
|
|
2773
2793
|
danger: !0,
|
|
2774
2794
|
run: () => {
|
|
2775
|
-
|
|
2795
|
+
x();
|
|
2776
2796
|
}
|
|
2777
2797
|
}
|
|
2778
|
-
),
|
|
2798
|
+
), y;
|
|
2779
2799
|
});
|
|
2780
|
-
async function
|
|
2800
|
+
async function D() {
|
|
2781
2801
|
try {
|
|
2782
|
-
await v.massSubmissions({ ids: [
|
|
2783
|
-
} catch (
|
|
2784
|
-
E.danger(
|
|
2802
|
+
await v.massSubmissions({ ids: [q.value], action: "unread" }), d.push(U.value);
|
|
2803
|
+
} catch (y) {
|
|
2804
|
+
E.danger(p(y));
|
|
2785
2805
|
}
|
|
2786
2806
|
}
|
|
2787
|
-
async function
|
|
2788
|
-
if (await
|
|
2807
|
+
async function x() {
|
|
2808
|
+
if (await Ce({
|
|
2789
2809
|
title: l("panel.delete-submission-title"),
|
|
2790
2810
|
message: l("panel.delete-submission-text"),
|
|
2791
2811
|
confirmText: l("panel.delete"),
|
|
@@ -2793,94 +2813,94 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2793
2813
|
tone: "danger"
|
|
2794
2814
|
}))
|
|
2795
2815
|
try {
|
|
2796
|
-
await v.removeSubmission(
|
|
2797
|
-
} catch (
|
|
2798
|
-
E.danger(
|
|
2816
|
+
await v.removeSubmission(q.value), E.success(l("panel.deleted")), d.push(U.value);
|
|
2817
|
+
} catch (Y) {
|
|
2818
|
+
E.danger(p(Y));
|
|
2799
2819
|
}
|
|
2800
2820
|
}
|
|
2801
|
-
function
|
|
2802
|
-
|
|
2821
|
+
function h(y) {
|
|
2822
|
+
y !== null && d.push({ path: `${s.base}/submissions/${y}`, query: { ...n.query } });
|
|
2803
2823
|
}
|
|
2804
|
-
function
|
|
2805
|
-
const
|
|
2806
|
-
return
|
|
2824
|
+
function ue(y) {
|
|
2825
|
+
const Y = O.value.find((R) => R.key === y);
|
|
2826
|
+
return Y === void 0 ? y : w(Y);
|
|
2807
2827
|
}
|
|
2808
|
-
function
|
|
2809
|
-
switch (
|
|
2828
|
+
function ye(y) {
|
|
2829
|
+
switch (y.type) {
|
|
2810
2830
|
case "created":
|
|
2811
2831
|
return l("panel.event-created");
|
|
2812
2832
|
case "status":
|
|
2813
|
-
return l("panel.event-status", { to:
|
|
2833
|
+
return l("panel.event-status", { to: ue(y.to ?? "") });
|
|
2814
2834
|
case "assignee":
|
|
2815
|
-
return
|
|
2835
|
+
return y.to === null || y.to === "" ? l("panel.event-unassigned") : l("panel.event-assignee", { to: y.to });
|
|
2816
2836
|
case "note":
|
|
2817
2837
|
return l("panel.event-note");
|
|
2818
2838
|
case "notified":
|
|
2819
2839
|
return l("panel.event-notified");
|
|
2820
2840
|
default:
|
|
2821
|
-
return
|
|
2841
|
+
return y.type;
|
|
2822
2842
|
}
|
|
2823
2843
|
}
|
|
2824
|
-
function
|
|
2825
|
-
return `${Math.max(1, Math.round(
|
|
2844
|
+
function qe(y) {
|
|
2845
|
+
return `${Math.max(1, Math.round(y / 1024))} KB`;
|
|
2826
2846
|
}
|
|
2827
|
-
const
|
|
2828
|
-
const
|
|
2829
|
-
typeof
|
|
2830
|
-
for (const [
|
|
2831
|
-
|
|
2832
|
-
return typeof
|
|
2847
|
+
const He = F(() => {
|
|
2848
|
+
const y = i.value?.meta ?? {}, Y = [];
|
|
2849
|
+
typeof y.page == "string" && y.page !== "" && Y.push({ label: l("panel.meta-page"), value: y.page, link: !0 }), typeof y.referrer == "string" && y.referrer !== "" && Y.push({ label: l("panel.meta-referrer"), value: y.referrer, link: !0 });
|
|
2850
|
+
for (const [R, Ge] of Object.entries(y.utm ?? {}))
|
|
2851
|
+
Y.push({ label: R, value: String(Ge) });
|
|
2852
|
+
return typeof y.locale == "string" && y.locale !== "" && Y.push({ label: l("panel.meta-locale"), value: y.locale }), typeof y.ip == "string" && y.ip !== "" && Y.push({ label: l("panel.meta-ip"), value: y.ip }), typeof y.user_agent == "string" && y.user_agent !== "" && Y.push({ label: l("panel.meta-agent"), value: y.user_agent }), Y;
|
|
2833
2853
|
});
|
|
2834
|
-
return (
|
|
2835
|
-
t(e(
|
|
2836
|
-
title:
|
|
2837
|
-
subtitle:
|
|
2838
|
-
back:
|
|
2839
|
-
actions:
|
|
2854
|
+
return (y, Y) => (u(), j("div", Vt, [
|
|
2855
|
+
t(e(Ye), {
|
|
2856
|
+
title: P.value,
|
|
2857
|
+
subtitle: M.value,
|
|
2858
|
+
back: U.value,
|
|
2859
|
+
actions: K.value
|
|
2840
2860
|
}, {
|
|
2841
2861
|
extra: a(() => [
|
|
2842
|
-
t(e(
|
|
2862
|
+
t(e(ke), {
|
|
2843
2863
|
icon: "chevron-left",
|
|
2844
2864
|
size: "lg",
|
|
2845
2865
|
title: e(l)("panel.previous"),
|
|
2846
|
-
disabled: !
|
|
2847
|
-
onClick:
|
|
2866
|
+
disabled: !i.value?.previous_id,
|
|
2867
|
+
onClick: Y[0] || (Y[0] = (R) => h(i.value?.previous_id ?? null))
|
|
2848
2868
|
}, null, 8, ["title", "disabled"]),
|
|
2849
|
-
t(e(
|
|
2869
|
+
t(e(ke), {
|
|
2850
2870
|
icon: "chevron-right",
|
|
2851
2871
|
size: "lg",
|
|
2852
2872
|
title: e(l)("panel.next"),
|
|
2853
|
-
disabled: !
|
|
2854
|
-
onClick:
|
|
2873
|
+
disabled: !i.value?.next_id,
|
|
2874
|
+
onClick: Y[1] || (Y[1] = (R) => h(i.value?.next_id ?? null))
|
|
2855
2875
|
}, null, 8, ["title", "disabled"])
|
|
2856
2876
|
]),
|
|
2857
2877
|
_: 1
|
|
2858
2878
|
}, 8, ["title", "subtitle", "back", "actions"]),
|
|
2859
|
-
T.value ? (
|
|
2879
|
+
T.value ? (u(), _(e(Fe), {
|
|
2860
2880
|
key: 0,
|
|
2861
2881
|
rows: 6
|
|
2862
|
-
})) :
|
|
2863
|
-
|
|
2882
|
+
})) : i.value ? (u(), j("div", $t, [
|
|
2883
|
+
G("div", Ut, [
|
|
2864
2884
|
t(e(se), {
|
|
2865
2885
|
title: e(l)("panel.answers")
|
|
2866
2886
|
}, {
|
|
2867
2887
|
default: a(() => [
|
|
2868
|
-
|
|
2888
|
+
i.value.values.length === 0 ? (u(), _(e(Be), {
|
|
2869
2889
|
key: 0,
|
|
2870
2890
|
size: "sm",
|
|
2871
2891
|
description: e(l)("panel.no-answers")
|
|
2872
|
-
}, null, 8, ["description"])) : (
|
|
2892
|
+
}, null, 8, ["description"])) : (u(), _(e(tl), {
|
|
2873
2893
|
key: 1,
|
|
2874
2894
|
columns: 1,
|
|
2875
2895
|
layout: "vertical"
|
|
2876
2896
|
}, {
|
|
2877
2897
|
default: a(() => [
|
|
2878
|
-
(
|
|
2879
|
-
key:
|
|
2880
|
-
label:
|
|
2898
|
+
(u(!0), j(ee, null, we(i.value.values, (R) => (u(), _(e(Ae), {
|
|
2899
|
+
key: R.id,
|
|
2900
|
+
label: R.label ?? R.name
|
|
2881
2901
|
}, {
|
|
2882
2902
|
default: a(() => [
|
|
2883
|
-
|
|
2903
|
+
G("p", St, k(R.value || "—"), 1)
|
|
2884
2904
|
]),
|
|
2885
2905
|
_: 2
|
|
2886
2906
|
}, 1032, ["label"]))), 128))
|
|
@@ -2890,47 +2910,47 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2890
2910
|
]),
|
|
2891
2911
|
_: 1
|
|
2892
2912
|
}, 8, ["title"]),
|
|
2893
|
-
|
|
2913
|
+
i.value.files.length > 0 ? (u(), _(e(se), {
|
|
2894
2914
|
key: 0,
|
|
2895
2915
|
title: e(l)("panel.attachments")
|
|
2896
2916
|
}, {
|
|
2897
2917
|
default: a(() => [
|
|
2898
|
-
|
|
2899
|
-
(
|
|
2900
|
-
key:
|
|
2901
|
-
name:
|
|
2902
|
-
type:
|
|
2903
|
-
"download-url":
|
|
2918
|
+
G("div", Ct, [
|
|
2919
|
+
(u(!0), j(ee, null, we(i.value.files, (R) => (u(), _(e(Vl), {
|
|
2920
|
+
key: R.id,
|
|
2921
|
+
name: R.name,
|
|
2922
|
+
type: R.mime ?? void 0,
|
|
2923
|
+
"download-url": R.url,
|
|
2904
2924
|
"download-label": e(l)("panel.download"),
|
|
2905
2925
|
size: "sm"
|
|
2906
2926
|
}, {
|
|
2907
2927
|
meta: a(() => [
|
|
2908
|
-
|
|
2928
|
+
z(k(qe(R.size)), 1)
|
|
2909
2929
|
]),
|
|
2910
2930
|
_: 2
|
|
2911
2931
|
}, 1032, ["name", "type", "download-url", "download-label"]))), 128))
|
|
2912
2932
|
])
|
|
2913
2933
|
]),
|
|
2914
2934
|
_: 1
|
|
2915
|
-
}, 8, ["title"])) :
|
|
2935
|
+
}, 8, ["title"])) : H("", !0),
|
|
2916
2936
|
t(e(se), { class: "wx-submission__more" }, {
|
|
2917
2937
|
default: a(() => [
|
|
2918
2938
|
t(e(Qe), {
|
|
2919
2939
|
variant: "pill",
|
|
2920
|
-
"aria-label":
|
|
2940
|
+
"aria-label": P.value
|
|
2921
2941
|
}, {
|
|
2922
2942
|
default: a(() => [
|
|
2923
2943
|
t(e(ge), {
|
|
2924
2944
|
value: "notes",
|
|
2925
|
-
label: e(
|
|
2945
|
+
label: e($)("notes.title")
|
|
2926
2946
|
}, {
|
|
2927
2947
|
default: a(() => [
|
|
2928
2948
|
t(e(ml), {
|
|
2929
|
-
id:
|
|
2949
|
+
id: i.value.id,
|
|
2930
2950
|
type: "inbox_submission",
|
|
2931
2951
|
title: "",
|
|
2932
|
-
can:
|
|
2933
|
-
onChange:
|
|
2952
|
+
can: b.value,
|
|
2953
|
+
onChange: g
|
|
2934
2954
|
}, null, 8, ["id", "can"])
|
|
2935
2955
|
]),
|
|
2936
2956
|
_: 1
|
|
@@ -2942,8 +2962,8 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2942
2962
|
default: a(() => [
|
|
2943
2963
|
t(e($l), { size: "sm" }, {
|
|
2944
2964
|
default: a(() => [
|
|
2945
|
-
(
|
|
2946
|
-
key:
|
|
2965
|
+
(u(!0), j(ee, null, we(i.value.events, (R) => (u(), _(e(Ul), {
|
|
2966
|
+
key: R.id
|
|
2947
2967
|
}, {
|
|
2948
2968
|
default: a(() => [
|
|
2949
2969
|
t(e(J), {
|
|
@@ -2952,22 +2972,22 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2952
2972
|
class: "wx-submission__event"
|
|
2953
2973
|
}, {
|
|
2954
2974
|
default: a(() => [
|
|
2955
|
-
|
|
2975
|
+
z(k(ye(R)), 1)
|
|
2956
2976
|
]),
|
|
2957
2977
|
_: 2
|
|
2958
2978
|
}, 1024),
|
|
2959
|
-
|
|
2979
|
+
G("p", zt, [
|
|
2960
2980
|
t(e(J), {
|
|
2961
2981
|
size: "sm",
|
|
2962
2982
|
tone: "muted"
|
|
2963
2983
|
}, {
|
|
2964
2984
|
default: a(() => [
|
|
2965
|
-
|
|
2985
|
+
z(k(R.author?.name ?? e(l)("panel.system")), 1)
|
|
2966
2986
|
]),
|
|
2967
2987
|
_: 2
|
|
2968
2988
|
}, 1024),
|
|
2969
|
-
t(e(
|
|
2970
|
-
value:
|
|
2989
|
+
t(e(Ne), {
|
|
2990
|
+
value: R.created_at
|
|
2971
2991
|
}, null, 8, ["value"])
|
|
2972
2992
|
])
|
|
2973
2993
|
]),
|
|
@@ -2984,8 +3004,8 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2984
3004
|
label: e(l)("panel.details")
|
|
2985
3005
|
}, {
|
|
2986
3006
|
default: a(() => [
|
|
2987
|
-
|
|
2988
|
-
t(e(
|
|
3007
|
+
G("div", Tt, [
|
|
3008
|
+
t(e(tl), {
|
|
2989
3009
|
columns: 1,
|
|
2990
3010
|
layout: "vertical",
|
|
2991
3011
|
size: "sm"
|
|
@@ -2995,8 +3015,8 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
2995
3015
|
label: e(l)("panel.received")
|
|
2996
3016
|
}, {
|
|
2997
3017
|
default: a(() => [
|
|
2998
|
-
t(e(
|
|
2999
|
-
value:
|
|
3018
|
+
t(e(Ne), {
|
|
3019
|
+
value: i.value.created_at,
|
|
3000
3020
|
tone: "default"
|
|
3001
3021
|
}, null, 8, ["value"])
|
|
3002
3022
|
]),
|
|
@@ -3006,59 +3026,59 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
3006
3026
|
label: e(l)("panel.meta-source")
|
|
3007
3027
|
}, {
|
|
3008
3028
|
default: a(() => [
|
|
3009
|
-
t(e(
|
|
3010
|
-
type:
|
|
3029
|
+
t(e(Ue), {
|
|
3030
|
+
type: i.value.source === "panel" ? "info" : "default"
|
|
3011
3031
|
}, {
|
|
3012
3032
|
default: a(() => [
|
|
3013
|
-
|
|
3033
|
+
z(k(i.value.source === "panel" ? e(l)("panel.source-panel") : e(l)("panel.source-web")), 1)
|
|
3014
3034
|
]),
|
|
3015
3035
|
_: 1
|
|
3016
3036
|
}, 8, ["type"])
|
|
3017
3037
|
]),
|
|
3018
3038
|
_: 1
|
|
3019
3039
|
}, 8, ["label"]),
|
|
3020
|
-
(
|
|
3021
|
-
key:
|
|
3022
|
-
label:
|
|
3040
|
+
(u(!0), j(ee, null, we(He.value, (R) => (u(), _(e(Ae), {
|
|
3041
|
+
key: R.label,
|
|
3042
|
+
label: R.label
|
|
3023
3043
|
}, {
|
|
3024
3044
|
default: a(() => [
|
|
3025
|
-
|
|
3045
|
+
R.link ? (u(), j("a", {
|
|
3026
3046
|
key: 0,
|
|
3027
|
-
href:
|
|
3047
|
+
href: R.value,
|
|
3028
3048
|
target: "_blank",
|
|
3029
3049
|
rel: "noreferrer"
|
|
3030
|
-
},
|
|
3050
|
+
}, k(R.value), 9, Ft)) : (u(), j("span", Wt, k(R.value), 1))
|
|
3031
3051
|
]),
|
|
3032
3052
|
_: 2
|
|
3033
3053
|
}, 1032, ["label"]))), 128))
|
|
3034
3054
|
]),
|
|
3035
3055
|
_: 1
|
|
3036
3056
|
}),
|
|
3037
|
-
|
|
3057
|
+
i.value.notify_error ? (u(), _(e(De), {
|
|
3038
3058
|
key: 0,
|
|
3039
3059
|
type: "warning",
|
|
3040
3060
|
closable: !1
|
|
3041
3061
|
}, {
|
|
3042
3062
|
default: a(() => [
|
|
3043
|
-
|
|
3063
|
+
z(k(e(l)("panel.notify-failed")), 1)
|
|
3044
3064
|
]),
|
|
3045
3065
|
_: 1
|
|
3046
|
-
})) :
|
|
3066
|
+
})) : i.value.notified_at ? (u(), _(e(J), {
|
|
3047
3067
|
key: 1,
|
|
3048
3068
|
size: "sm",
|
|
3049
3069
|
tone: "muted"
|
|
3050
3070
|
}, {
|
|
3051
3071
|
default: a(() => [
|
|
3052
|
-
|
|
3072
|
+
z(k(e(l)("panel.notified")), 1)
|
|
3053
3073
|
]),
|
|
3054
3074
|
_: 1
|
|
3055
|
-
})) : (
|
|
3075
|
+
})) : (u(), _(e(J), {
|
|
3056
3076
|
key: 2,
|
|
3057
3077
|
size: "sm",
|
|
3058
3078
|
tone: "muted"
|
|
3059
3079
|
}, {
|
|
3060
3080
|
default: a(() => [
|
|
3061
|
-
|
|
3081
|
+
z(k(e(l)("panel.not-notified")), 1)
|
|
3062
3082
|
]),
|
|
3063
3083
|
_: 1
|
|
3064
3084
|
}))
|
|
@@ -3073,44 +3093,44 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
3073
3093
|
_: 1
|
|
3074
3094
|
})
|
|
3075
3095
|
]),
|
|
3076
|
-
|
|
3096
|
+
G("aside", qt, [
|
|
3077
3097
|
t(e(se), null, {
|
|
3078
3098
|
default: a(() => [
|
|
3079
|
-
|
|
3080
|
-
|
|
3099
|
+
G("div", At, [
|
|
3100
|
+
G("label", It, [
|
|
3081
3101
|
t(e(J), {
|
|
3082
3102
|
size: "sm",
|
|
3083
3103
|
tone: "muted"
|
|
3084
3104
|
}, {
|
|
3085
3105
|
default: a(() => [
|
|
3086
|
-
|
|
3106
|
+
z(k(e(l)("panel.status")), 1)
|
|
3087
3107
|
]),
|
|
3088
3108
|
_: 1
|
|
3089
3109
|
}),
|
|
3090
|
-
t(e(
|
|
3091
|
-
"model-value":
|
|
3092
|
-
options:
|
|
3093
|
-
disabled: !
|
|
3094
|
-
"onUpdate:modelValue":
|
|
3110
|
+
t(e(fe), {
|
|
3111
|
+
"model-value": i.value.status?.id ?? null,
|
|
3112
|
+
options: f.value,
|
|
3113
|
+
disabled: !b.value,
|
|
3114
|
+
"onUpdate:modelValue": he
|
|
3095
3115
|
}, null, 8, ["model-value", "options", "disabled"])
|
|
3096
3116
|
]),
|
|
3097
|
-
|
|
3117
|
+
G("label", Nt, [
|
|
3098
3118
|
t(e(J), {
|
|
3099
3119
|
size: "sm",
|
|
3100
3120
|
tone: "muted"
|
|
3101
3121
|
}, {
|
|
3102
3122
|
default: a(() => [
|
|
3103
|
-
|
|
3123
|
+
z(k(e(l)("panel.assignee")), 1)
|
|
3104
3124
|
]),
|
|
3105
3125
|
_: 1
|
|
3106
3126
|
}),
|
|
3107
|
-
t(e(
|
|
3108
|
-
"model-value":
|
|
3109
|
-
options:
|
|
3110
|
-
disabled: !
|
|
3127
|
+
t(e(fe), {
|
|
3128
|
+
"model-value": i.value.assignee?.id ?? null,
|
|
3129
|
+
options: I.value,
|
|
3130
|
+
disabled: !b.value,
|
|
3111
3131
|
clearable: "",
|
|
3112
3132
|
placeholder: e(l)("panel.unassigned"),
|
|
3113
|
-
"onUpdate:modelValue":
|
|
3133
|
+
"onUpdate:modelValue": N
|
|
3114
3134
|
}, null, 8, ["model-value", "options", "disabled", "placeholder"])
|
|
3115
3135
|
])
|
|
3116
3136
|
])
|
|
@@ -3118,39 +3138,39 @@ const Ol = /* @__PURE__ */ ae({
|
|
|
3118
3138
|
_: 1
|
|
3119
3139
|
})
|
|
3120
3140
|
])
|
|
3121
|
-
])) :
|
|
3141
|
+
])) : H("", !0)
|
|
3122
3142
|
]));
|
|
3123
3143
|
}
|
|
3124
|
-
}),
|
|
3125
|
-
function Rt(
|
|
3126
|
-
const
|
|
3144
|
+
}), Mt = /* @__PURE__ */ ie(Dt, [["__scopeId", "data-v-2163fca6"]]);
|
|
3145
|
+
function Rt(r = {}) {
|
|
3146
|
+
const s = r.path ?? "/inbox";
|
|
3127
3147
|
return {
|
|
3128
3148
|
id: "inbox",
|
|
3129
|
-
path:
|
|
3130
|
-
landing:
|
|
3149
|
+
path: s,
|
|
3150
|
+
landing: r.landing ?? !0,
|
|
3131
3151
|
routes: [
|
|
3132
3152
|
// The section's own path travels as a prop, so a panel that mounted it somewhere else
|
|
3133
3153
|
// still links between its screens correctly.
|
|
3134
|
-
{ path:
|
|
3154
|
+
{ path: s, name: "webx.inbox", component: ft, props: { base: s } },
|
|
3135
3155
|
{
|
|
3136
|
-
path: `${
|
|
3156
|
+
path: `${s}/statuses`,
|
|
3137
3157
|
name: "webx.inbox.statuses",
|
|
3138
3158
|
component: kt,
|
|
3139
|
-
props: { base:
|
|
3159
|
+
props: { base: s }
|
|
3140
3160
|
},
|
|
3141
3161
|
{
|
|
3142
|
-
path: `${
|
|
3162
|
+
path: `${s}/forms/:id(\\d+)`,
|
|
3143
3163
|
name: "webx.inbox.form",
|
|
3144
3164
|
component: lt,
|
|
3145
|
-
props: { base:
|
|
3165
|
+
props: { base: s }
|
|
3146
3166
|
},
|
|
3147
3167
|
// A submission has an address of its own, not a dialog over the list (§11): it goes in
|
|
3148
3168
|
// the mail to whoever deals with it, it gets pasted into a chat, an agent links to it.
|
|
3149
3169
|
{
|
|
3150
|
-
path: `${
|
|
3170
|
+
path: `${s}/submissions/:id(\\d+)`,
|
|
3151
3171
|
name: "webx.inbox.submission",
|
|
3152
|
-
component:
|
|
3153
|
-
props: { base:
|
|
3172
|
+
component: Mt,
|
|
3173
|
+
props: { base: s }
|
|
3154
3174
|
}
|
|
3155
3175
|
]
|
|
3156
3176
|
};
|
|
@@ -3158,15 +3178,15 @@ function Rt(i = {}) {
|
|
|
3158
3178
|
export {
|
|
3159
3179
|
Cl as FIELD_TYPES,
|
|
3160
3180
|
zl as STATUS_COLORS,
|
|
3161
|
-
|
|
3181
|
+
Ol as WxInboxFieldList,
|
|
3162
3182
|
lt as WxInboxFormEditor,
|
|
3163
3183
|
ft as WxInboxPage,
|
|
3164
3184
|
kt as WxInboxStatusesPage,
|
|
3165
3185
|
pt as WxInboxSubmissionList,
|
|
3166
|
-
|
|
3186
|
+
Mt as WxInboxSubmissionPage,
|
|
3167
3187
|
re as createInboxApi,
|
|
3168
3188
|
Rt as inbox,
|
|
3169
3189
|
Sl as inboxMessages,
|
|
3170
|
-
|
|
3190
|
+
ce as option
|
|
3171
3191
|
};
|
|
3172
3192
|
//# sourceMappingURL=index.js.map
|