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