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