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