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