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