@webx-ui/module-inbox 0.8.0 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FieldDialog.d.ts +5 -1
- package/dist/FormEditorPage-HsbIZcG_.js +843 -0
- package/dist/FormEditorPage-HsbIZcG_.js.map +1 -0
- package/dist/FormNotifications.d.ts +19 -13
- package/dist/{InboxPage-CCYXnZed.js → InboxPage-Dd_8TGGg.js} +2 -2
- package/dist/{InboxPage-CCYXnZed.js.map → InboxPage-Dd_8TGGg.js.map} +1 -1
- package/dist/{StatusesPage-Mra8TB7G.js → StatusesPage-DKJmpZoG.js} +2 -2
- package/dist/{StatusesPage-Mra8TB7G.js.map → StatusesPage-DKJmpZoG.js.map} +1 -1
- package/dist/{SubmissionPage-DVNKYpWH.js → SubmissionPage-BoE9jEhj.js} +176 -208
- package/dist/SubmissionPage-BoE9jEhj.js.map +1 -0
- package/dist/{index-BQj2UlUS.js → index-Dxbb2lUM.js} +691 -641
- package/dist/index-Dxbb2lUM.js.map +1 -0
- package/dist/index.js +1 -1
- package/dist/style.css +1 -1
- package/dist/types.d.ts +16 -3
- package/package.json +3 -3
- package/dist/FormEditorPage-BoHzlFfz.js +0 -786
- package/dist/FormEditorPage-BoHzlFfz.js.map +0 -1
- package/dist/SubmissionPage-DVNKYpWH.js.map +0 -1
- package/dist/index-BQj2UlUS.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { inject as Qe, defineComponent as
|
|
2
|
-
import { useLocales as
|
|
3
|
-
import { useAdmin as
|
|
4
|
-
import { useRoute as
|
|
5
|
-
const
|
|
1
|
+
import { inject as Qe, defineComponent as ne, useModel as We, computed as T, ref as C, watch as ve, openBlock as m, createElementBlock as D, createElementVNode as G, toDisplayString as I, createCommentVNode as N, createBlock as w, unref as e, withCtx as d, createTextVNode as E, createVNode as i, mergeModels as Fe, nextTick as Je, isRef as Be, Fragment as Q, renderList as Pe, useTemplateRef as et, createSlots as Oe, defineAsyncComponent as xe } from "vue";
|
|
2
|
+
import { useLocales as se, localizedValue as de, WxBadge as be, WxAction as Me, WxAutocomplete as tt, useModal as De, WxDialog as Le, WxAlert as Ce, WxSkeleton as lt, WxFormItem as M, WxTextarea as at, WxSelect as ye, WxRadioGroup as nt, WxCheckboxGroup as st, WxCheckbox as le, WxDatePicker as Ne, WxInput as Z, WxSpace as He, WxButton as te, toast as Y, useElementWidth as ot, createModal as Xe, WxTabs as it, WxTable as ut, WxEntityCard as rt, WxAvatar as Ee, WxIcon as ge, WxTooltip as dt, WxText as ee, confirm as Ge, WxLocales as ct, WxRichText as qe, WxInputNumber as re, WxTagsInput as mt, WxCard as pt, WxEmpty as ft, WxSortableList as ht } from "@webx-ui/core";
|
|
3
|
+
import { useAdmin as oe, i18nKey as vt, useTranslate as ae, createRelationsApi as bt, useErrorText as we, rowMenuWidth as yt, WxScreenHead as gt, WxRowMenu as Ue, WxDate as ze, WxFilterChips as xt, slugify as wt } from "@webx-ui/module-admin";
|
|
4
|
+
import { useRoute as kt, useRouter as _t } from "vue-router";
|
|
5
|
+
const Vt = {
|
|
6
6
|
module: {
|
|
7
7
|
title: "Inbox"
|
|
8
8
|
},
|
|
@@ -42,8 +42,8 @@ const _t = {
|
|
|
42
42
|
"thank-you-heading": "Heading",
|
|
43
43
|
"thank-you-text": "Text",
|
|
44
44
|
"submit-text": "Text on the button",
|
|
45
|
-
redirect: "
|
|
46
|
-
"redirect-help": "
|
|
45
|
+
redirect: "Instead of the thank-you, go to",
|
|
46
|
+
"redirect-help": "A page of the site opens in the language the form was sent in, or in the main one when it has no translation. Nowhere — the thank-you takes the form’s place.",
|
|
47
47
|
recipients: "Who is written to",
|
|
48
48
|
"recipients-help": "Nobody here means nobody is told. The submission is kept either way.",
|
|
49
49
|
"no-recipients": "Nobody yet.",
|
|
@@ -52,12 +52,17 @@ const _t = {
|
|
|
52
52
|
remove: "Remove",
|
|
53
53
|
"remove-recipient-title": "Remove this recipient?",
|
|
54
54
|
"remove-recipient-text": "They stop being told when something arrives.",
|
|
55
|
-
"email-field": "
|
|
56
|
-
"email-field-help": "A reply to the
|
|
55
|
+
"email-field": "Field with the visitor’s address",
|
|
56
|
+
"email-field-help": "A reply to the letter goes to this address.",
|
|
57
|
+
"email-field-help-channels": "A reply to the letter goes to this address; in channels it is {{reply_to}}.",
|
|
58
|
+
"notify-via": "How to tell about a submission",
|
|
59
|
+
"via-email": "By letter to addresses",
|
|
60
|
+
"via-channels": "Through notification channels",
|
|
57
61
|
"notify-through": "Notify through",
|
|
58
|
-
"notify-through-help": "Channels of the Notifications section: Telegram, e-mail and others. A submission from the site goes to each of them by its own template
|
|
62
|
+
"notify-through-help": "Channels of the Notifications section: Telegram, e-mail and others. A submission from the site goes to each of them by its own template.",
|
|
59
63
|
"pick-channels": "Add a channel",
|
|
60
64
|
"no-channels": "No channels chosen.",
|
|
65
|
+
"no-channels-yet": "No channels yet.",
|
|
61
66
|
"set-up-channels": "Set up channels",
|
|
62
67
|
channels: "Channels",
|
|
63
68
|
"channels-none": "Nothing was sent through channels.",
|
|
@@ -198,7 +203,9 @@ const _t = {
|
|
|
198
203
|
cancel: "Cancel",
|
|
199
204
|
save: "Save",
|
|
200
205
|
name: "Name",
|
|
201
|
-
"name-help": "
|
|
206
|
+
"name-help": "Needed for variables in notifications — {{field.:name}} — and for integrations. Usually there is no need to change it.",
|
|
207
|
+
"name-renamed": "Templates of notification channels that use {{field.:old}} stop working — change them to {{field.:new}}. Answers already received stay with the field.",
|
|
208
|
+
advanced: "Advanced",
|
|
202
209
|
type: "Type",
|
|
203
210
|
title: "Label",
|
|
204
211
|
placeholder: "Placeholder",
|
|
@@ -250,34 +257,34 @@ const _t = {
|
|
|
250
257
|
unknown: "The Inbox has no form “:slug”. It has: :forms.",
|
|
251
258
|
"unknown-none": "The Inbox has no form “:slug” — it has no forms yet."
|
|
252
259
|
}
|
|
253
|
-
},
|
|
254
|
-
function
|
|
260
|
+
}, Re = /* @__PURE__ */ new WeakSet();
|
|
261
|
+
function ce() {
|
|
255
262
|
try {
|
|
256
|
-
const { i18n: a } =
|
|
257
|
-
|
|
263
|
+
const { i18n: a } = oe();
|
|
264
|
+
Re.has(a) || (a.defaults("webx-inbox", Vt), Re.add(a));
|
|
258
265
|
} catch {
|
|
259
266
|
}
|
|
260
267
|
}
|
|
261
|
-
function
|
|
262
|
-
const a = Qe(
|
|
268
|
+
function Tt() {
|
|
269
|
+
const a = Qe(vt, null), n = se();
|
|
263
270
|
return (c) => {
|
|
264
271
|
const y = a?.state.locale;
|
|
265
|
-
return (y === void 0 ? void 0 : c.title[y]) ||
|
|
272
|
+
return (y === void 0 ? void 0 : c.title[y]) || de(c.title, n.active.value, c.key);
|
|
266
273
|
};
|
|
267
274
|
}
|
|
268
|
-
const
|
|
275
|
+
const $t = { class: "wx-inbox-form-field" }, St = {
|
|
269
276
|
key: 0,
|
|
270
277
|
class: "wx-inbox-form-field__chosen"
|
|
271
|
-
},
|
|
278
|
+
}, At = { class: "wx-inbox-form-field__text" }, Ct = { class: "wx-inbox-form-field__title" }, Nt = {
|
|
272
279
|
key: 0,
|
|
273
280
|
class: "wx-inbox-form-field__slug"
|
|
274
|
-
},
|
|
281
|
+
}, Ut = {
|
|
275
282
|
key: 1,
|
|
276
283
|
class: "wx-inbox-form-field__empty"
|
|
277
|
-
},
|
|
284
|
+
}, Wt = { class: "wx-inbox-form-field__search" }, Ft = /* @__PURE__ */ ne({
|
|
278
285
|
name: "WxInboxFormField",
|
|
279
286
|
__name: "FormField",
|
|
280
|
-
props: /* @__PURE__ */
|
|
287
|
+
props: /* @__PURE__ */ Fe({
|
|
281
288
|
disabled: { type: Boolean, default: !1 },
|
|
282
289
|
placeholder: { default: void 0 },
|
|
283
290
|
emptyText: { default: void 0 }
|
|
@@ -287,105 +294,105 @@ const Tt = { class: "wx-inbox-form-field" }, $t = {
|
|
|
287
294
|
}),
|
|
288
295
|
emits: ["update:modelValue"],
|
|
289
296
|
setup(a) {
|
|
290
|
-
const n = a, c =
|
|
291
|
-
|
|
292
|
-
const y =
|
|
293
|
-
function
|
|
294
|
-
const
|
|
295
|
-
for (const
|
|
296
|
-
l.value =
|
|
297
|
+
const n = a, c = We(a, "modelValue");
|
|
298
|
+
ce();
|
|
299
|
+
const y = oe(), b = ae("webx-inbox"), B = bt(y, "inbox-form"), t = T(() => typeof c.value == "string" ? c.value.trim() : ""), l = C(/* @__PURE__ */ new Map()), g = C(/* @__PURE__ */ new Set()), q = C([]), z = C(!1), $ = C("");
|
|
300
|
+
function S(k) {
|
|
301
|
+
const x = new Map(l.value);
|
|
302
|
+
for (const _ of k) _.slug && x.set(_.slug, _);
|
|
303
|
+
l.value = x;
|
|
297
304
|
}
|
|
298
|
-
async function
|
|
305
|
+
async function A(k) {
|
|
299
306
|
if (!(k === "" || l.value.has(k) || g.value.has(k)))
|
|
300
307
|
try {
|
|
301
|
-
const
|
|
302
|
-
|
|
308
|
+
const x = await B.search(k);
|
|
309
|
+
S(x), x.some((_) => _.slug === k) || (g.value = /* @__PURE__ */ new Set([...g.value, k]));
|
|
303
310
|
} catch {
|
|
304
311
|
}
|
|
305
312
|
}
|
|
306
|
-
|
|
307
|
-
|
|
313
|
+
ve(t, (k) => {
|
|
314
|
+
A(k);
|
|
308
315
|
}, { immediate: !0 });
|
|
309
|
-
const v =
|
|
310
|
-
() =>
|
|
316
|
+
const v = T(() => t.value === "" ? null : l.value.get(t.value) ?? null), L = T(() => t.value === "" ? null : v.value === null ? g.value.has(t.value) ? b("relations.field-missing") : null : v.value.visible ? null : b("relations.field-off")), p = T(
|
|
317
|
+
() => q.value.filter((k) => k.slug && k.slug !== t.value).map((k) => ({
|
|
311
318
|
value: k.title,
|
|
312
|
-
description: [k.slug, k.visible ? null : b("relations.field-off")].filter((
|
|
319
|
+
description: [k.slug, k.visible ? null : b("relations.field-off")].filter((x) => typeof x == "string" && x !== "").join(" · "),
|
|
313
320
|
id: k.slug
|
|
314
321
|
}))
|
|
315
322
|
);
|
|
316
|
-
async function
|
|
317
|
-
|
|
323
|
+
async function U(k) {
|
|
324
|
+
z.value = !0;
|
|
318
325
|
try {
|
|
319
|
-
const
|
|
320
|
-
|
|
326
|
+
const x = await B.search(k);
|
|
327
|
+
q.value = x, S(x);
|
|
321
328
|
} catch {
|
|
322
|
-
|
|
329
|
+
q.value = [];
|
|
323
330
|
} finally {
|
|
324
|
-
|
|
331
|
+
z.value = !1;
|
|
325
332
|
}
|
|
326
333
|
}
|
|
327
|
-
function
|
|
328
|
-
|
|
334
|
+
function V() {
|
|
335
|
+
q.value.length === 0 && !z.value && U($.value);
|
|
329
336
|
}
|
|
330
|
-
function
|
|
337
|
+
function W(k) {
|
|
331
338
|
typeof k.id != "string" || k.id === "" || (c.value = k.id, Je(() => {
|
|
332
|
-
|
|
339
|
+
$.value = "";
|
|
333
340
|
}));
|
|
334
341
|
}
|
|
335
342
|
function P() {
|
|
336
343
|
c.value = null;
|
|
337
344
|
}
|
|
338
|
-
const X =
|
|
339
|
-
return (k,
|
|
340
|
-
t.value !== "" ? (
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
v.value ? (
|
|
345
|
+
const X = T(() => n.placeholder ?? b("relations.field-search"));
|
|
346
|
+
return (k, x) => (m(), D("div", $t, [
|
|
347
|
+
t.value !== "" ? (m(), D("div", St, [
|
|
348
|
+
G("span", At, [
|
|
349
|
+
G("span", Ct, I(v.value?.title ?? t.value), 1),
|
|
350
|
+
v.value ? (m(), D("span", Nt, I(t.value), 1)) : N("", !0)
|
|
344
351
|
]),
|
|
345
|
-
|
|
352
|
+
L.value ? (m(), w(e(be), {
|
|
346
353
|
key: 0,
|
|
347
354
|
type: "warning"
|
|
348
355
|
}, {
|
|
349
|
-
default:
|
|
350
|
-
|
|
356
|
+
default: d(() => [
|
|
357
|
+
E(I(L.value), 1)
|
|
351
358
|
]),
|
|
352
359
|
_: 1
|
|
353
|
-
})) :
|
|
354
|
-
n.disabled ?
|
|
360
|
+
})) : N("", !0),
|
|
361
|
+
n.disabled ? N("", !0) : (m(), w(e(Me), {
|
|
355
362
|
key: 1,
|
|
356
363
|
type: "remove",
|
|
357
364
|
size: "sm",
|
|
358
365
|
title: e(b)("relations.field-remove"),
|
|
359
366
|
onClick: P
|
|
360
367
|
}, null, 8, ["title"]))
|
|
361
|
-
])) : (
|
|
362
|
-
|
|
368
|
+
])) : (m(), D("p", Ut, I(n.emptyText ?? e(b)("relations.field-empty")), 1)),
|
|
369
|
+
G("div", Wt, [
|
|
363
370
|
i(e(tt), {
|
|
364
|
-
modelValue:
|
|
365
|
-
"onUpdate:modelValue":
|
|
366
|
-
options:
|
|
371
|
+
modelValue: $.value,
|
|
372
|
+
"onUpdate:modelValue": x[0] || (x[0] = (_) => $.value = _),
|
|
373
|
+
options: p.value,
|
|
367
374
|
remote: "",
|
|
368
375
|
teleport: "",
|
|
369
|
-
loading:
|
|
376
|
+
loading: z.value,
|
|
370
377
|
"loading-text": e(b)("relations.field-searching"),
|
|
371
378
|
"empty-text": e(b)("relations.field-nothing"),
|
|
372
379
|
placeholder: X.value,
|
|
373
380
|
"aria-label": X.value,
|
|
374
381
|
disabled: n.disabled,
|
|
375
|
-
onSearch:
|
|
376
|
-
onOpen:
|
|
377
|
-
onSelect:
|
|
382
|
+
onSearch: U,
|
|
383
|
+
onOpen: V,
|
|
384
|
+
onSelect: W
|
|
378
385
|
}, null, 8, ["modelValue", "options", "loading", "loading-text", "empty-text", "placeholder", "aria-label", "disabled"])
|
|
379
386
|
])
|
|
380
387
|
]));
|
|
381
388
|
}
|
|
382
|
-
}),
|
|
389
|
+
}), me = (a, n) => {
|
|
383
390
|
const c = a.__vccOpts || a;
|
|
384
391
|
for (const [y, b] of n)
|
|
385
392
|
c[y] = b;
|
|
386
393
|
return c;
|
|
387
|
-
}, It = /* @__PURE__ */
|
|
388
|
-
function
|
|
394
|
+
}, It = /* @__PURE__ */ me(Ft, [["__scopeId", "data-v-91f60441"]]);
|
|
395
|
+
function nl(a = {}) {
|
|
389
396
|
const n = a.path ?? "/inbox";
|
|
390
397
|
return {
|
|
391
398
|
id: "inbox",
|
|
@@ -397,19 +404,19 @@ function al(a = {}) {
|
|
|
397
404
|
{
|
|
398
405
|
path: n,
|
|
399
406
|
name: "webx.inbox",
|
|
400
|
-
component: () => import("./InboxPage-
|
|
407
|
+
component: () => import("./InboxPage-Dd_8TGGg.js"),
|
|
401
408
|
props: { base: n }
|
|
402
409
|
},
|
|
403
410
|
{
|
|
404
411
|
path: `${n}/statuses`,
|
|
405
412
|
name: "webx.inbox.statuses",
|
|
406
|
-
component: () => import("./StatusesPage-
|
|
413
|
+
component: () => import("./StatusesPage-DKJmpZoG.js"),
|
|
407
414
|
props: { base: n }
|
|
408
415
|
},
|
|
409
416
|
{
|
|
410
417
|
path: `${n}/forms/:id(\\d+)`,
|
|
411
418
|
name: "webx.inbox.form",
|
|
412
|
-
component: () => import("./FormEditorPage-
|
|
419
|
+
component: () => import("./FormEditorPage-HsbIZcG_.js"),
|
|
413
420
|
props: { base: n }
|
|
414
421
|
},
|
|
415
422
|
// A submission has an address of its own, not a dialog over the list (§11): it goes in
|
|
@@ -417,7 +424,7 @@ function al(a = {}) {
|
|
|
417
424
|
{
|
|
418
425
|
path: `${n}/submissions/:id(\\d+)`,
|
|
419
426
|
name: "webx.inbox.submission",
|
|
420
|
-
component: () => import("./SubmissionPage-
|
|
427
|
+
component: () => import("./SubmissionPage-BoE9jEhj.js"),
|
|
421
428
|
props: { base: n }
|
|
422
429
|
}
|
|
423
430
|
],
|
|
@@ -428,16 +435,16 @@ function al(a = {}) {
|
|
|
428
435
|
}
|
|
429
436
|
};
|
|
430
437
|
}
|
|
431
|
-
const
|
|
432
|
-
function
|
|
438
|
+
const he = /* @__PURE__ */ new WeakMap();
|
|
439
|
+
function ke(a) {
|
|
433
440
|
const n = `${a.apiPath}/inbox`, c = (t) => t.data, y = () => {
|
|
434
|
-
}, b = (t) => (
|
|
435
|
-
function
|
|
436
|
-
const t =
|
|
441
|
+
}, b = (t) => (he.delete(a.http), t);
|
|
442
|
+
function B() {
|
|
443
|
+
const t = he.get(a.http);
|
|
437
444
|
if (t !== void 0)
|
|
438
445
|
return t.then((g) => [...g]);
|
|
439
446
|
const l = a.http.get(`${n}/statuses`).then(c);
|
|
440
|
-
return
|
|
447
|
+
return he.set(a.http, l), l.catch(() => he.delete(a.http)), l.then((g) => [...g]);
|
|
441
448
|
}
|
|
442
449
|
return {
|
|
443
450
|
forms: () => a.http.get(`${n}/forms`).then(c),
|
|
@@ -452,13 +459,13 @@ function ye(a) {
|
|
|
452
459
|
saveField: (t, l) => a.http.put(`${n}/fields/${t}`, l).then(c),
|
|
453
460
|
removeField: (t) => a.http.delete(`${n}/fields/${t}`).then(y),
|
|
454
461
|
sortFields: (t, l) => a.http.post(`${n}/forms/${t}/fields/sorting`, { ids: l }).then(y),
|
|
455
|
-
statuses:
|
|
462
|
+
statuses: B,
|
|
456
463
|
createStatus: (t) => a.http.post(`${n}/statuses`, t).then(c).then(b),
|
|
457
464
|
saveStatus: (t, l) => a.http.put(`${n}/statuses/${t}`, l).then(c).then(b),
|
|
458
465
|
removeStatus: (t) => a.http.delete(`${n}/statuses/${t}`).then(y).then(b),
|
|
459
466
|
sortStatuses: (t) => a.http.post(`${n}/statuses/sorting`, { ids: t }).then(y).then(b),
|
|
460
467
|
recipients: () => a.http.get(`${n}/recipients`).then(c),
|
|
461
|
-
submissions: (t, l = {}) => a.http.get(`${n}/forms/${t}/submissions`, { query:
|
|
468
|
+
submissions: (t, l = {}) => a.http.get(`${n}/forms/${t}/submissions`, { query: Ae(l) }).then((g) => ({
|
|
462
469
|
...g.meta,
|
|
463
470
|
data: g.data,
|
|
464
471
|
columns: g.columns,
|
|
@@ -466,7 +473,7 @@ function ye(a) {
|
|
|
466
473
|
// Optional on the wire: a server from before placements answers without them.
|
|
467
474
|
placements: g.placements ?? []
|
|
468
475
|
})),
|
|
469
|
-
submission: (t, l = {}) => a.http.get(`${n}/submissions/${t}`, { query:
|
|
476
|
+
submission: (t, l = {}) => a.http.get(`${n}/submissions/${t}`, { query: Ae(l) }).then(c),
|
|
470
477
|
createSubmission: (t, l) => a.http.post(`${n}/forms/${t}/submissions`, { fields: l }).then(c),
|
|
471
478
|
saveSubmission: (t, l) => a.http.put(`${n}/submissions/${t}`, l).then(c),
|
|
472
479
|
removeSubmission: (t) => a.http.delete(`${n}/submissions/${t}`).then(y),
|
|
@@ -474,14 +481,14 @@ function ye(a) {
|
|
|
474
481
|
massSubmissions: (t) => a.http.post(`${n}/submissions/mass`, t).then(c),
|
|
475
482
|
exportUrl: (t, l = {}) => {
|
|
476
483
|
const g = new URLSearchParams();
|
|
477
|
-
for (const [
|
|
478
|
-
|
|
479
|
-
const
|
|
480
|
-
return `${n}/forms/${t}/submissions/export${
|
|
484
|
+
for (const [z, $] of Object.entries(Ae(l)))
|
|
485
|
+
$ != null && $ !== "" && g.set(z, String($));
|
|
486
|
+
const q = g.toString();
|
|
487
|
+
return `${n}/forms/${t}/submissions/export${q === "" ? "" : `?${q}`}`;
|
|
481
488
|
}
|
|
482
489
|
};
|
|
483
490
|
}
|
|
484
|
-
function
|
|
491
|
+
function Ae(a) {
|
|
485
492
|
return {
|
|
486
493
|
view: a.view === void 0 || a.view === "" ? void 0 : a.view,
|
|
487
494
|
search: a.search === void 0 || a.search === "" ? void 0 : a.search,
|
|
@@ -493,7 +500,7 @@ function ke(a) {
|
|
|
493
500
|
};
|
|
494
501
|
}
|
|
495
502
|
function sl(a, n, c) {
|
|
496
|
-
return
|
|
503
|
+
return T({
|
|
497
504
|
get: () => a.value[n] ?? c,
|
|
498
505
|
set: (y) => {
|
|
499
506
|
const b = { ...a.value };
|
|
@@ -501,84 +508,84 @@ function sl(a, n, c) {
|
|
|
501
508
|
}
|
|
502
509
|
});
|
|
503
510
|
}
|
|
504
|
-
const
|
|
511
|
+
const Et = { class: "wx-inbox-by-hand" }, qt = /* @__PURE__ */ ne({
|
|
505
512
|
__name: "SubmissionCreateDialog",
|
|
506
513
|
props: {
|
|
507
514
|
form: {}
|
|
508
515
|
},
|
|
509
516
|
setup(a) {
|
|
510
|
-
const n = a, { resolve: c, dismiss: y, open: b } =
|
|
511
|
-
|
|
512
|
-
const g =
|
|
513
|
-
function
|
|
514
|
-
return v.value[`fields.${
|
|
517
|
+
const n = a, { resolve: c, dismiss: y, open: b } = De(), B = oe(), t = ke(B), l = se();
|
|
518
|
+
ce();
|
|
519
|
+
const g = ae("webx-inbox"), q = we(), z = C([]), $ = C(!0), S = C(!1), A = C({}), v = C({}), L = T(() => z.value.filter((x) => x.type !== "file")), p = T(() => z.value.some((x) => x.type === "file"));
|
|
520
|
+
function U(x) {
|
|
521
|
+
return v.value[`fields.${x.key}`]?.[0];
|
|
515
522
|
}
|
|
516
|
-
function
|
|
517
|
-
return
|
|
523
|
+
function V(x) {
|
|
524
|
+
return de(x.title, l.active.value, x.key);
|
|
518
525
|
}
|
|
519
|
-
function
|
|
520
|
-
return
|
|
521
|
-
|
|
526
|
+
function W(x, _ = "") {
|
|
527
|
+
return de(
|
|
528
|
+
x,
|
|
522
529
|
l.active.value,
|
|
523
|
-
|
|
530
|
+
_
|
|
524
531
|
);
|
|
525
532
|
}
|
|
526
|
-
function P(
|
|
527
|
-
return (
|
|
528
|
-
value:
|
|
529
|
-
label:
|
|
533
|
+
function P(x) {
|
|
534
|
+
return (x.options.choices ?? []).map((_) => ({
|
|
535
|
+
value: _.value,
|
|
536
|
+
label: W(_.label, _.value)
|
|
530
537
|
}));
|
|
531
538
|
}
|
|
532
539
|
async function X() {
|
|
533
540
|
try {
|
|
534
|
-
const
|
|
535
|
-
|
|
536
|
-
for (const
|
|
537
|
-
|
|
538
|
-
} catch (
|
|
539
|
-
|
|
541
|
+
const x = await t.form(n.form.id);
|
|
542
|
+
z.value = (x.fields ?? []).filter((_) => _.is_enabled);
|
|
543
|
+
for (const _ of z.value)
|
|
544
|
+
A.value[_.key] = _.type === "checkbox" ? [] : _.type === "consent" ? !1 : "";
|
|
545
|
+
} catch (x) {
|
|
546
|
+
Y.danger(q(x));
|
|
540
547
|
} finally {
|
|
541
|
-
|
|
548
|
+
$.value = !1;
|
|
542
549
|
}
|
|
543
550
|
}
|
|
544
551
|
X();
|
|
545
552
|
async function k() {
|
|
546
|
-
|
|
553
|
+
S.value = !0, v.value = {};
|
|
547
554
|
try {
|
|
548
|
-
c(await t.createSubmission(n.form.id,
|
|
549
|
-
} catch (
|
|
550
|
-
const
|
|
551
|
-
|
|
555
|
+
c(await t.createSubmission(n.form.id, A.value));
|
|
556
|
+
} catch (x) {
|
|
557
|
+
const _ = x.body;
|
|
558
|
+
_?.errors ? (v.value = _.errors, Y.danger(g("panel.failed"))) : Y.danger(q(x));
|
|
552
559
|
} finally {
|
|
553
|
-
|
|
560
|
+
S.value = !1;
|
|
554
561
|
}
|
|
555
562
|
}
|
|
556
|
-
return (
|
|
563
|
+
return (x, _) => (m(), w(e(Le), {
|
|
557
564
|
open: e(b),
|
|
558
|
-
"onUpdate:open":
|
|
565
|
+
"onUpdate:open": _[1] || (_[1] = (u) => Be(b) ? b.value = u : null),
|
|
559
566
|
title: e(g)("panel.new-submission-title"),
|
|
560
567
|
width: 560
|
|
561
568
|
}, {
|
|
562
|
-
footer:
|
|
563
|
-
i(e(
|
|
564
|
-
default:
|
|
565
|
-
i(e(
|
|
569
|
+
footer: d(() => [
|
|
570
|
+
i(e(He), { size: "sm" }, {
|
|
571
|
+
default: d(() => [
|
|
572
|
+
i(e(te), {
|
|
566
573
|
variant: "outline",
|
|
567
|
-
onClick:
|
|
574
|
+
onClick: _[0] || (_[0] = (u) => e(y)())
|
|
568
575
|
}, {
|
|
569
|
-
default:
|
|
570
|
-
|
|
576
|
+
default: d(() => [
|
|
577
|
+
E(I(e(g)("panel.cancel")), 1)
|
|
571
578
|
]),
|
|
572
579
|
_: 1
|
|
573
580
|
}),
|
|
574
|
-
i(e(
|
|
581
|
+
i(e(te), {
|
|
575
582
|
type: "primary",
|
|
576
|
-
loading:
|
|
577
|
-
disabled:
|
|
583
|
+
loading: S.value,
|
|
584
|
+
disabled: $.value,
|
|
578
585
|
onClick: k
|
|
579
586
|
}, {
|
|
580
|
-
default:
|
|
581
|
-
|
|
587
|
+
default: d(() => [
|
|
588
|
+
E(I(e(g)("panel.save")), 1)
|
|
582
589
|
]),
|
|
583
590
|
_: 1
|
|
584
591
|
}, 8, ["loading", "disabled"])
|
|
@@ -586,90 +593,90 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
586
593
|
_: 1
|
|
587
594
|
})
|
|
588
595
|
]),
|
|
589
|
-
default:
|
|
590
|
-
|
|
591
|
-
i(e(
|
|
596
|
+
default: d(() => [
|
|
597
|
+
G("div", Et, [
|
|
598
|
+
i(e(Ce), {
|
|
592
599
|
type: "info",
|
|
593
600
|
closable: !1
|
|
594
601
|
}, {
|
|
595
|
-
default:
|
|
596
|
-
|
|
602
|
+
default: d(() => [
|
|
603
|
+
E(I(e(g)("panel.new-submission-help")), 1)
|
|
597
604
|
]),
|
|
598
605
|
_: 1
|
|
599
606
|
}),
|
|
600
|
-
|
|
607
|
+
$.value ? (m(), w(e(lt), {
|
|
601
608
|
key: 0,
|
|
602
609
|
rows: 4
|
|
603
|
-
})) : (
|
|
604
|
-
(
|
|
605
|
-
key:
|
|
606
|
-
label:
|
|
607
|
-
help:
|
|
608
|
-
error:
|
|
609
|
-
required:
|
|
610
|
+
})) : (m(), D(Q, { key: 1 }, [
|
|
611
|
+
(m(!0), D(Q, null, Pe(L.value, (u) => (m(), w(e(M), {
|
|
612
|
+
key: u.id,
|
|
613
|
+
label: V(u),
|
|
614
|
+
help: W(u.help),
|
|
615
|
+
error: U(u),
|
|
616
|
+
required: u.is_required
|
|
610
617
|
}, {
|
|
611
|
-
default:
|
|
612
|
-
|
|
618
|
+
default: d(() => [
|
|
619
|
+
u.type === "textarea" ? (m(), w(e(at), {
|
|
613
620
|
key: 0,
|
|
614
|
-
modelValue:
|
|
615
|
-
"onUpdate:modelValue": (
|
|
616
|
-
rows:
|
|
617
|
-
placeholder:
|
|
618
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "rows", "placeholder"])) :
|
|
621
|
+
modelValue: A.value[u.key],
|
|
622
|
+
"onUpdate:modelValue": (R) => A.value[u.key] = R,
|
|
623
|
+
rows: u.options.rows ?? 4,
|
|
624
|
+
placeholder: W(u.placeholder)
|
|
625
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "rows", "placeholder"])) : u.type === "select" ? (m(), w(e(ye), {
|
|
619
626
|
key: 1,
|
|
620
|
-
modelValue:
|
|
621
|
-
"onUpdate:modelValue": (
|
|
622
|
-
options: P(
|
|
627
|
+
modelValue: A.value[u.key],
|
|
628
|
+
"onUpdate:modelValue": (R) => A.value[u.key] = R,
|
|
629
|
+
options: P(u),
|
|
623
630
|
clearable: "",
|
|
624
|
-
placeholder:
|
|
625
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder"])) :
|
|
631
|
+
placeholder: W(u.placeholder)
|
|
632
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "options", "placeholder"])) : u.type === "radio" ? (m(), w(e(nt), {
|
|
626
633
|
key: 2,
|
|
627
|
-
modelValue:
|
|
628
|
-
"onUpdate:modelValue": (
|
|
629
|
-
options: P(
|
|
630
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) :
|
|
634
|
+
modelValue: A.value[u.key],
|
|
635
|
+
"onUpdate:modelValue": (R) => A.value[u.key] = R,
|
|
636
|
+
options: P(u)
|
|
637
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : u.type === "checkbox" ? (m(), w(e(st), {
|
|
631
638
|
key: 3,
|
|
632
|
-
modelValue:
|
|
633
|
-
"onUpdate:modelValue": (
|
|
634
|
-
options: P(
|
|
635
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) :
|
|
639
|
+
modelValue: A.value[u.key],
|
|
640
|
+
"onUpdate:modelValue": (R) => A.value[u.key] = R,
|
|
641
|
+
options: P(u)
|
|
642
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "options"])) : u.type === "consent" ? (m(), w(e(le), {
|
|
636
643
|
key: 4,
|
|
637
|
-
modelValue:
|
|
638
|
-
"onUpdate:modelValue": (
|
|
639
|
-
label:
|
|
640
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) :
|
|
644
|
+
modelValue: A.value[u.key],
|
|
645
|
+
"onUpdate:modelValue": (R) => A.value[u.key] = R,
|
|
646
|
+
label: W(u.options.text, V(u))
|
|
647
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "label"])) : u.type === "date" ? (m(), w(e(Ne), {
|
|
641
648
|
key: 5,
|
|
642
|
-
modelValue:
|
|
643
|
-
"onUpdate:modelValue": (
|
|
644
|
-
placeholder:
|
|
645
|
-
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (
|
|
649
|
+
modelValue: A.value[u.key],
|
|
650
|
+
"onUpdate:modelValue": (R) => A.value[u.key] = R,
|
|
651
|
+
placeholder: W(u.placeholder)
|
|
652
|
+
}, null, 8, ["modelValue", "onUpdate:modelValue", "placeholder"])) : (m(), w(e(Z), {
|
|
646
653
|
key: 6,
|
|
647
|
-
modelValue:
|
|
648
|
-
"onUpdate:modelValue": (
|
|
649
|
-
type:
|
|
650
|
-
placeholder:
|
|
651
|
-
maxlength:
|
|
654
|
+
modelValue: A.value[u.key],
|
|
655
|
+
"onUpdate:modelValue": (R) => A.value[u.key] = R,
|
|
656
|
+
type: u.type === "email" ? "email" : u.type === "tel" ? "tel" : "text",
|
|
657
|
+
placeholder: W(u.placeholder),
|
|
658
|
+
maxlength: u.options.maxlength
|
|
652
659
|
}, null, 8, ["modelValue", "onUpdate:modelValue", "type", "placeholder", "maxlength"]))
|
|
653
660
|
]),
|
|
654
661
|
_: 2
|
|
655
662
|
}, 1032, ["label", "help", "error", "required"]))), 128)),
|
|
656
|
-
|
|
663
|
+
p.value ? (m(), w(e(Ce), {
|
|
657
664
|
key: 0,
|
|
658
665
|
type: "warning",
|
|
659
666
|
closable: !1
|
|
660
667
|
}, {
|
|
661
|
-
default:
|
|
662
|
-
|
|
668
|
+
default: d(() => [
|
|
669
|
+
E(I(e(g)("panel.no-files-by-hand")), 1)
|
|
663
670
|
]),
|
|
664
671
|
_: 1
|
|
665
|
-
})) :
|
|
672
|
+
})) : N("", !0)
|
|
666
673
|
], 64))
|
|
667
674
|
])
|
|
668
675
|
]),
|
|
669
676
|
_: 1
|
|
670
677
|
}, 8, ["open", "title"]));
|
|
671
678
|
}
|
|
672
|
-
}),
|
|
679
|
+
}), zt = /* @__PURE__ */ me(qt, [["__scopeId", "data-v-72006299"]]), Rt = { class: "wx-submissions__mass" }, Bt = { class: "wx-submissions__state" }, Pt = 640, Ot = /* @__PURE__ */ ne({
|
|
673
680
|
__name: "SubmissionList",
|
|
674
681
|
props: {
|
|
675
682
|
form: {},
|
|
@@ -677,36 +684,36 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
677
684
|
},
|
|
678
685
|
emits: ["changed"],
|
|
679
686
|
setup(a, { expose: n, emit: c }) {
|
|
680
|
-
const y = a, b = c,
|
|
681
|
-
|
|
682
|
-
const
|
|
687
|
+
const y = a, b = c, B = oe(), t = ke(B), l = kt(), g = _t(), q = se();
|
|
688
|
+
ce();
|
|
689
|
+
const z = et("root"), $ = ot(z), S = T(() => $.value > 0 && $.value < Pt), A = T(() => S.value ? Number.POSITIVE_INFINITY : 0), v = ae("webx-inbox"), L = ae("webx-admin"), p = we(), U = C(null), V = C([]), W = C(!1), P = C([]), X = C(!1), k = T(() => B.can("inbox.update")), x = Xe(zt), _ = T({
|
|
683
690
|
get: () => typeof l.query.view == "string" && l.query.view !== "" ? l.query.view : "all",
|
|
684
691
|
set: (o) => {
|
|
685
692
|
g.replace({
|
|
686
693
|
query: { ...l.query, view: o === "all" ? void 0 : o, page: void 0 }
|
|
687
694
|
});
|
|
688
695
|
}
|
|
689
|
-
}),
|
|
690
|
-
view:
|
|
696
|
+
}), u = T(() => ({
|
|
697
|
+
view: _.value,
|
|
691
698
|
search: typeof l.query.search == "string" ? l.query.search : "",
|
|
692
699
|
assignee: typeof l.query.assignee == "string" ? l.query.assignee : null,
|
|
693
700
|
placement: typeof l.query.placement == "string" ? l.query.placement : null,
|
|
694
701
|
sort: typeof l.query.sort == "string" ? l.query.sort : null,
|
|
695
702
|
page: Number(l.query.page ?? 1) || 1
|
|
696
|
-
})),
|
|
697
|
-
() => (
|
|
703
|
+
})), R = T(
|
|
704
|
+
() => (U.value?.placements ?? []).map(
|
|
698
705
|
(o) => o === null ? { value: "none", label: v("panel.placement-none") } : { value: o, label: o }
|
|
699
706
|
)
|
|
700
|
-
),
|
|
701
|
-
() =>
|
|
702
|
-
),
|
|
703
|
-
const o =
|
|
707
|
+
), _e = T(
|
|
708
|
+
() => R.value.length > 1 || u.value.placement !== null
|
|
709
|
+
), ie = T(() => {
|
|
710
|
+
const o = u.value.placement;
|
|
704
711
|
if (o === null) return [];
|
|
705
|
-
const
|
|
712
|
+
const F = R.value.find((h) => h.value === o)?.label ?? (o === "none" ? v("panel.placement-none") : o);
|
|
706
713
|
return [
|
|
707
714
|
{
|
|
708
715
|
key: "placement",
|
|
709
|
-
label: `${v("panel.meta-placement")}: ${
|
|
716
|
+
label: `${v("panel.meta-placement")}: ${F}`,
|
|
710
717
|
clear: () => K(void 0)
|
|
711
718
|
}
|
|
712
719
|
];
|
|
@@ -720,29 +727,29 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
720
727
|
}
|
|
721
728
|
});
|
|
722
729
|
}
|
|
723
|
-
const
|
|
724
|
-
const o =
|
|
730
|
+
const pe = T(() => {
|
|
731
|
+
const o = U.value?.counts, F = [
|
|
725
732
|
{ value: "all", label: v("panel.view-all"), badge: o?.all || void 0 },
|
|
726
733
|
{ value: "unread", label: v("panel.view-unread"), badge: o?.unread || void 0 }
|
|
727
734
|
];
|
|
728
|
-
for (const h of
|
|
729
|
-
|
|
735
|
+
for (const h of V.value)
|
|
736
|
+
F.push({
|
|
730
737
|
value: h.key,
|
|
731
|
-
label:
|
|
738
|
+
label: j(h),
|
|
732
739
|
badge: o?.statuses[h.key] || void 0
|
|
733
740
|
});
|
|
734
|
-
return
|
|
741
|
+
return F;
|
|
735
742
|
});
|
|
736
|
-
function
|
|
737
|
-
const h =
|
|
743
|
+
function O(o, F) {
|
|
744
|
+
const h = U.value?.columns?.[F];
|
|
738
745
|
return h ? o.values[h.key] ?? "" : "";
|
|
739
746
|
}
|
|
740
|
-
const
|
|
741
|
-
const o =
|
|
742
|
-
return
|
|
743
|
-
...o.map((
|
|
744
|
-
key: `values.${
|
|
745
|
-
label:
|
|
747
|
+
const Ve = T(() => {
|
|
748
|
+
const o = U.value?.columns ?? [];
|
|
749
|
+
return S.value ? [{ key: "card", label: "" }] : [
|
|
750
|
+
...o.map((F, h) => ({
|
|
751
|
+
key: `values.${F.key}`,
|
|
752
|
+
label: F.label,
|
|
746
753
|
sortable: !0,
|
|
747
754
|
// The first answer is what the row is recognised by and stays at any width; every one
|
|
748
755
|
// after it is worth less than the room it takes, so it goes a step sooner. The steps are
|
|
@@ -769,62 +776,62 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
769
776
|
},
|
|
770
777
|
{ key: "actions", label: "", width: yt, align: "right", hideOnCards: !0 }
|
|
771
778
|
];
|
|
772
|
-
}),
|
|
773
|
-
() =>
|
|
774
|
-
),
|
|
775
|
-
() =>
|
|
776
|
-
),
|
|
777
|
-
function
|
|
778
|
-
return
|
|
779
|
+
}), Te = T(
|
|
780
|
+
() => u.value.view === "all" && u.value.search === "" && u.value.assignee === null && u.value.placement === null ? v("panel.submissions-empty") : v("panel.submissions-none")
|
|
781
|
+
), fe = T(
|
|
782
|
+
() => V.value.map((o) => ({ value: o.id, label: j(o) }))
|
|
783
|
+
), j = Tt();
|
|
784
|
+
function $e() {
|
|
785
|
+
return de(y.form.title, q.active.value, y.form.slug);
|
|
779
786
|
}
|
|
780
|
-
async function
|
|
781
|
-
|
|
787
|
+
async function f(o) {
|
|
788
|
+
W.value = !0;
|
|
782
789
|
try {
|
|
783
|
-
|
|
784
|
-
view:
|
|
785
|
-
search: o?.search ??
|
|
786
|
-
assignee:
|
|
787
|
-
placement:
|
|
790
|
+
U.value = await t.submissions(y.form.id, {
|
|
791
|
+
view: u.value.view,
|
|
792
|
+
search: o?.search ?? u.value.search,
|
|
793
|
+
assignee: u.value.assignee,
|
|
794
|
+
placement: u.value.placement,
|
|
788
795
|
sort: o?.sort ? `${o.sort.order === "desc" ? "-" : ""}${o.sort.key}` : null,
|
|
789
|
-
page: o?.page ??
|
|
796
|
+
page: o?.page ?? u.value.page,
|
|
790
797
|
per_page: o?.perPage
|
|
791
798
|
});
|
|
792
|
-
} catch (
|
|
793
|
-
|
|
799
|
+
} catch (F) {
|
|
800
|
+
Y.danger(p(F));
|
|
794
801
|
} finally {
|
|
795
|
-
|
|
802
|
+
W.value = !1;
|
|
796
803
|
}
|
|
797
804
|
}
|
|
798
|
-
function
|
|
799
|
-
const
|
|
805
|
+
function s(o) {
|
|
806
|
+
const F = {
|
|
800
807
|
...l.query,
|
|
801
808
|
search: o.search === "" ? void 0 : o.search,
|
|
802
809
|
sort: o.sort === null ? void 0 : `${o.sort.order === "desc" ? "-" : ""}${o.sort.key}`,
|
|
803
810
|
page: o.page === 1 ? void 0 : String(o.page)
|
|
804
811
|
};
|
|
805
|
-
g.replace({ query:
|
|
812
|
+
g.replace({ query: F }), f(o);
|
|
806
813
|
}
|
|
807
|
-
|
|
808
|
-
P.value = [],
|
|
809
|
-
}),
|
|
810
|
-
async function
|
|
814
|
+
ve([() => y.form.id, _, () => u.value.assignee, () => u.value.placement], () => {
|
|
815
|
+
P.value = [], f();
|
|
816
|
+
}), r();
|
|
817
|
+
async function r() {
|
|
811
818
|
try {
|
|
812
|
-
|
|
819
|
+
V.value = await t.statuses();
|
|
813
820
|
} catch (o) {
|
|
814
|
-
|
|
821
|
+
Y.danger(p(o));
|
|
815
822
|
}
|
|
816
823
|
}
|
|
817
|
-
function
|
|
824
|
+
function H(o) {
|
|
818
825
|
g.push({ path: `${y.base}/submissions/${o.id}`, query: { ...l.query } });
|
|
819
826
|
}
|
|
820
|
-
function
|
|
827
|
+
function J(o) {
|
|
821
828
|
return k.value ? [
|
|
822
829
|
{
|
|
823
830
|
key: "read",
|
|
824
831
|
icon: o.is_read ? "eye-off" : "eye",
|
|
825
832
|
label: o.is_read ? v("panel.mark-unread") : v("panel.mark-read"),
|
|
826
833
|
run: () => {
|
|
827
|
-
|
|
834
|
+
Se([o.id], o.is_read ? "unread" : "read");
|
|
828
835
|
}
|
|
829
836
|
},
|
|
830
837
|
{
|
|
@@ -833,179 +840,179 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
833
840
|
label: v("panel.delete"),
|
|
834
841
|
danger: !0,
|
|
835
842
|
run: () => {
|
|
836
|
-
|
|
843
|
+
Ie([o.id]);
|
|
837
844
|
}
|
|
838
845
|
}
|
|
839
846
|
] : [];
|
|
840
847
|
}
|
|
841
848
|
async function Ye(o) {
|
|
842
|
-
typeof o == "number" && (X.value = !0, await
|
|
843
|
-
P.value.map((
|
|
849
|
+
typeof o == "number" && (X.value = !0, await Se(
|
|
850
|
+
P.value.map((F) => F.id),
|
|
844
851
|
"status",
|
|
845
852
|
o
|
|
846
853
|
), X.value = !1);
|
|
847
854
|
}
|
|
848
|
-
async function
|
|
849
|
-
await
|
|
855
|
+
async function Ie(o) {
|
|
856
|
+
await Ge({
|
|
850
857
|
title: o.length === 1 ? v("panel.delete-submission-title") : v("panel.delete-selected-title", { count: o.length }),
|
|
851
858
|
message: v("panel.delete-submission-text"),
|
|
852
859
|
confirmText: v("panel.delete"),
|
|
853
860
|
cancelText: v("panel.cancel"),
|
|
854
861
|
tone: "danger"
|
|
855
|
-
}) && await
|
|
862
|
+
}) && await Se(o, "delete");
|
|
856
863
|
}
|
|
857
|
-
async function
|
|
864
|
+
async function Se(o, F, h) {
|
|
858
865
|
if (o.length !== 0)
|
|
859
866
|
try {
|
|
860
|
-
await t.massSubmissions({ ids: o, action:
|
|
861
|
-
} catch (
|
|
862
|
-
|
|
867
|
+
await t.massSubmissions({ ids: o, action: F, status_id: h }), P.value = [], await f(), b("changed");
|
|
868
|
+
} catch (ue) {
|
|
869
|
+
Y.danger(p(ue));
|
|
863
870
|
}
|
|
864
871
|
}
|
|
865
872
|
async function je() {
|
|
866
|
-
const o = await
|
|
867
|
-
o && (
|
|
873
|
+
const o = await x({ form: y.form });
|
|
874
|
+
o && (Y.success(v("panel.created")), await f(), b("changed"), g.push({ path: `${y.base}/submissions/${o.id}`, query: { ...l.query } }));
|
|
868
875
|
}
|
|
869
|
-
const Ke =
|
|
876
|
+
const Ke = T(
|
|
870
877
|
() => t.exportUrl(y.form.id, {
|
|
871
|
-
view:
|
|
872
|
-
search:
|
|
873
|
-
assignee:
|
|
874
|
-
placement:
|
|
875
|
-
sort:
|
|
878
|
+
view: u.value.view,
|
|
879
|
+
search: u.value.search,
|
|
880
|
+
assignee: u.value.assignee,
|
|
881
|
+
placement: u.value.placement,
|
|
882
|
+
sort: u.value.sort
|
|
876
883
|
})
|
|
877
|
-
), Ze =
|
|
884
|
+
), Ze = T(() => [
|
|
878
885
|
{ key: "export", label: v("panel.export"), icon: "download", href: Ke.value }
|
|
879
886
|
]);
|
|
880
|
-
return n({ create: je }), (o,
|
|
887
|
+
return n({ create: je }), (o, F) => (m(), D("div", {
|
|
881
888
|
ref_key: "root",
|
|
882
|
-
ref:
|
|
889
|
+
ref: z,
|
|
883
890
|
class: "wx-submissions"
|
|
884
891
|
}, [
|
|
885
892
|
i(e(gt), {
|
|
886
893
|
class: "wx-submissions__head",
|
|
887
894
|
level: 3,
|
|
888
|
-
title:
|
|
895
|
+
title: $e(),
|
|
889
896
|
subtitle: a.form.slug,
|
|
890
897
|
actions: Ze.value
|
|
891
898
|
}, null, 8, ["title", "subtitle", "actions"]),
|
|
892
899
|
i(e(it), {
|
|
893
|
-
modelValue:
|
|
894
|
-
"onUpdate:modelValue":
|
|
900
|
+
modelValue: _.value,
|
|
901
|
+
"onUpdate:modelValue": F[2] || (F[2] = (h) => _.value = h),
|
|
895
902
|
class: "wx-submissions__views",
|
|
896
|
-
items:
|
|
903
|
+
items: pe.value,
|
|
897
904
|
"collapse-below": 560,
|
|
898
905
|
"aria-label": e(v)("panel.status")
|
|
899
906
|
}, {
|
|
900
|
-
default:
|
|
907
|
+
default: d(() => [
|
|
901
908
|
i(e(ut), {
|
|
902
|
-
data:
|
|
903
|
-
columns:
|
|
909
|
+
data: U.value,
|
|
910
|
+
columns: Ve.value,
|
|
904
911
|
"row-key": "id",
|
|
905
912
|
searchable: "",
|
|
906
913
|
clickable: "",
|
|
907
914
|
hover: "",
|
|
908
915
|
flush: "",
|
|
909
|
-
loading:
|
|
916
|
+
loading: W.value,
|
|
910
917
|
"loading-text": e(v)("panel.loading"),
|
|
911
918
|
selectable: k.value,
|
|
912
|
-
"select-row-label": e(
|
|
913
|
-
"select-all-label": e(
|
|
919
|
+
"select-row-label": e(L)("filters.select-row"),
|
|
920
|
+
"select-all-label": e(L)("filters.select-all"),
|
|
914
921
|
"row-class": (h) => h.is_read ? void 0 : "is-unread",
|
|
915
922
|
"search-placeholder": e(v)("panel.search-submissions"),
|
|
916
|
-
"empty-text":
|
|
917
|
-
"cards-below":
|
|
918
|
-
"filters-count":
|
|
919
|
-
onRowClick:
|
|
920
|
-
onStateChange:
|
|
921
|
-
onSelectionChange:
|
|
922
|
-
},
|
|
923
|
-
"cell-status":
|
|
924
|
-
|
|
925
|
-
h.status ? (
|
|
923
|
+
"empty-text": Te.value,
|
|
924
|
+
"cards-below": A.value,
|
|
925
|
+
"filters-count": ie.value.length,
|
|
926
|
+
onRowClick: H,
|
|
927
|
+
onStateChange: s,
|
|
928
|
+
onSelectionChange: F[1] || (F[1] = (h, ue) => P.value = ue)
|
|
929
|
+
}, Oe({
|
|
930
|
+
"cell-status": d(({ row: h }) => [
|
|
931
|
+
G("div", Bt, [
|
|
932
|
+
h.status ? (m(), w(e(be), {
|
|
926
933
|
key: 0,
|
|
927
934
|
type: h.status.color
|
|
928
935
|
}, {
|
|
929
|
-
default:
|
|
930
|
-
|
|
936
|
+
default: d(() => [
|
|
937
|
+
E(I(e(j)(h.status)), 1)
|
|
931
938
|
]),
|
|
932
939
|
_: 2
|
|
933
|
-
}, 1032, ["type"])) :
|
|
934
|
-
h.assignee ? (
|
|
940
|
+
}, 1032, ["type"])) : N("", !0),
|
|
941
|
+
h.assignee ? (m(), w(e(Ee), {
|
|
935
942
|
key: 1,
|
|
936
943
|
name: h.assignee.name,
|
|
937
944
|
title: h.assignee.name,
|
|
938
945
|
size: "xs",
|
|
939
946
|
tone: "auto"
|
|
940
|
-
}, null, 8, ["name", "title"])) :
|
|
941
|
-
h.files_count > 0 ? (
|
|
947
|
+
}, null, 8, ["name", "title"])) : N("", !0),
|
|
948
|
+
h.files_count > 0 ? (m(), w(e(dt), {
|
|
942
949
|
key: 2,
|
|
943
950
|
content: e(v)("panel.attachments")
|
|
944
951
|
}, {
|
|
945
|
-
default:
|
|
946
|
-
i(e(
|
|
952
|
+
default: d(() => [
|
|
953
|
+
i(e(ge), {
|
|
947
954
|
name: "file",
|
|
948
955
|
size: "sm"
|
|
949
956
|
})
|
|
950
957
|
]),
|
|
951
958
|
_: 1
|
|
952
|
-
}, 8, ["content"])) :
|
|
959
|
+
}, 8, ["content"])) : N("", !0)
|
|
953
960
|
])
|
|
954
961
|
]),
|
|
955
|
-
"cell-created_at":
|
|
956
|
-
i(e(
|
|
962
|
+
"cell-created_at": d(({ row: h }) => [
|
|
963
|
+
i(e(ze), {
|
|
957
964
|
value: h.created_at,
|
|
958
965
|
compact: ""
|
|
959
966
|
}, null, 8, ["value"])
|
|
960
967
|
]),
|
|
961
|
-
"cell-card":
|
|
968
|
+
"cell-card": d(({ row: h }) => [
|
|
962
969
|
i(e(rt), {
|
|
963
970
|
variant: "plain",
|
|
964
971
|
shape: "circle",
|
|
965
|
-
title:
|
|
972
|
+
title: O(h, 0)
|
|
966
973
|
}, {
|
|
967
|
-
subtitle:
|
|
968
|
-
|
|
974
|
+
subtitle: d(() => [
|
|
975
|
+
E(I(O(h, 1)), 1)
|
|
969
976
|
]),
|
|
970
|
-
meta:
|
|
971
|
-
h.status ? (
|
|
977
|
+
meta: d(() => [
|
|
978
|
+
h.status ? (m(), w(e(be), {
|
|
972
979
|
key: 0,
|
|
973
980
|
type: h.status.color,
|
|
974
981
|
size: "sm"
|
|
975
982
|
}, {
|
|
976
|
-
default:
|
|
977
|
-
|
|
983
|
+
default: d(() => [
|
|
984
|
+
E(I(e(j)(h.status)), 1)
|
|
978
985
|
]),
|
|
979
986
|
_: 2
|
|
980
|
-
}, 1032, ["type"])) :
|
|
981
|
-
h.assignee ? (
|
|
987
|
+
}, 1032, ["type"])) : N("", !0),
|
|
988
|
+
h.assignee ? (m(), w(e(Ee), {
|
|
982
989
|
key: 1,
|
|
983
990
|
name: h.assignee.name,
|
|
984
991
|
title: h.assignee.name,
|
|
985
992
|
size: "xs",
|
|
986
993
|
tone: "auto"
|
|
987
|
-
}, null, 8, ["name", "title"])) :
|
|
988
|
-
h.files_count > 0 ? (
|
|
994
|
+
}, null, 8, ["name", "title"])) : N("", !0),
|
|
995
|
+
h.files_count > 0 ? (m(), w(e(ge), {
|
|
989
996
|
key: 2,
|
|
990
997
|
name: "file",
|
|
991
998
|
size: "sm"
|
|
992
|
-
})) :
|
|
993
|
-
i(e(
|
|
999
|
+
})) : N("", !0),
|
|
1000
|
+
i(e(ze), {
|
|
994
1001
|
value: h.created_at
|
|
995
1002
|
}, null, 8, ["value"])
|
|
996
1003
|
]),
|
|
997
1004
|
_: 2
|
|
998
1005
|
}, 1032, ["title"])
|
|
999
1006
|
]),
|
|
1000
|
-
"card-actions":
|
|
1001
|
-
i(e(
|
|
1002
|
-
actions:
|
|
1007
|
+
"card-actions": d(({ row: h }) => [
|
|
1008
|
+
i(e(Ue), {
|
|
1009
|
+
actions: J(h),
|
|
1003
1010
|
label: String(h.id)
|
|
1004
1011
|
}, null, 8, ["actions", "label"])
|
|
1005
1012
|
]),
|
|
1006
|
-
"cell-actions":
|
|
1007
|
-
i(e(
|
|
1008
|
-
actions:
|
|
1013
|
+
"cell-actions": d(({ row: h }) => [
|
|
1014
|
+
i(e(Ue), {
|
|
1015
|
+
actions: J(h),
|
|
1009
1016
|
label: String(h.id)
|
|
1010
1017
|
}, null, 8, ["actions", "label"])
|
|
1011
1018
|
]),
|
|
@@ -1013,35 +1020,34 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1013
1020
|
}, [
|
|
1014
1021
|
P.value.length > 0 ? {
|
|
1015
1022
|
name: "actions",
|
|
1016
|
-
fn:
|
|
1017
|
-
|
|
1018
|
-
i(e(
|
|
1023
|
+
fn: d(() => [
|
|
1024
|
+
G("div", Rt, [
|
|
1025
|
+
i(e(ee), {
|
|
1019
1026
|
size: "sm",
|
|
1020
1027
|
weight: "medium"
|
|
1021
1028
|
}, {
|
|
1022
|
-
default:
|
|
1023
|
-
|
|
1029
|
+
default: d(() => [
|
|
1030
|
+
E(I(e(v)("panel.selected", { count: P.value.length })), 1)
|
|
1024
1031
|
]),
|
|
1025
1032
|
_: 1
|
|
1026
1033
|
}),
|
|
1027
|
-
i(e(
|
|
1034
|
+
i(e(ye), {
|
|
1028
1035
|
"model-value": null,
|
|
1029
|
-
options:
|
|
1036
|
+
options: fe.value,
|
|
1030
1037
|
placeholder: e(v)("panel.move-to"),
|
|
1031
1038
|
disabled: X.value,
|
|
1032
1039
|
size: "sm",
|
|
1033
1040
|
style: { width: "180px" },
|
|
1034
1041
|
"onUpdate:modelValue": Ye
|
|
1035
1042
|
}, null, 8, ["options", "placeholder", "disabled"]),
|
|
1036
|
-
i(e(
|
|
1043
|
+
i(e(te), {
|
|
1037
1044
|
size: "sm",
|
|
1038
1045
|
variant: "outline",
|
|
1039
1046
|
type: "danger",
|
|
1040
|
-
|
|
1041
|
-
onClick: N[0] || (N[0] = (h) => Ae(P.value.map((ne) => ne.id)))
|
|
1047
|
+
onClick: F[0] || (F[0] = (h) => Ie(P.value.map((ue) => ue.id)))
|
|
1042
1048
|
}, {
|
|
1043
|
-
default:
|
|
1044
|
-
|
|
1049
|
+
default: d(() => [
|
|
1050
|
+
E(I(e(v)("panel.delete")), 1)
|
|
1045
1051
|
]),
|
|
1046
1052
|
_: 1
|
|
1047
1053
|
})
|
|
@@ -1049,16 +1055,16 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1049
1055
|
]),
|
|
1050
1056
|
key: "0"
|
|
1051
1057
|
} : void 0,
|
|
1052
|
-
|
|
1058
|
+
_e.value ? {
|
|
1053
1059
|
name: "filters",
|
|
1054
|
-
fn:
|
|
1055
|
-
i(e(
|
|
1060
|
+
fn: d(() => [
|
|
1061
|
+
i(e(M), {
|
|
1056
1062
|
label: e(v)("panel.meta-placement")
|
|
1057
1063
|
}, {
|
|
1058
|
-
default:
|
|
1059
|
-
i(e(
|
|
1060
|
-
"model-value":
|
|
1061
|
-
options:
|
|
1064
|
+
default: d(() => [
|
|
1065
|
+
i(e(ye), {
|
|
1066
|
+
"model-value": u.value.placement,
|
|
1067
|
+
options: R.value,
|
|
1062
1068
|
placeholder: e(v)("panel.any-placement"),
|
|
1063
1069
|
clearable: "",
|
|
1064
1070
|
size: "sm",
|
|
@@ -1070,10 +1076,10 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1070
1076
|
]),
|
|
1071
1077
|
key: "1"
|
|
1072
1078
|
} : void 0,
|
|
1073
|
-
|
|
1079
|
+
ie.value.length > 0 ? {
|
|
1074
1080
|
name: "applied",
|
|
1075
|
-
fn:
|
|
1076
|
-
i(e(xt), { filters:
|
|
1081
|
+
fn: d(() => [
|
|
1082
|
+
i(e(xt), { filters: ie.value }, null, 8, ["filters"])
|
|
1077
1083
|
]),
|
|
1078
1084
|
key: "2"
|
|
1079
1085
|
} : void 0
|
|
@@ -1083,9 +1089,9 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1083
1089
|
}, 8, ["modelValue", "items", "aria-label"])
|
|
1084
1090
|
], 512));
|
|
1085
1091
|
}
|
|
1086
|
-
}),
|
|
1092
|
+
}), ol = /* @__PURE__ */ me(Ot, [["__scopeId", "data-v-f6cb49f1"]]), Mt = /* @__PURE__ */ ne({
|
|
1087
1093
|
__name: "LocalizedRichText",
|
|
1088
|
-
props: /* @__PURE__ */
|
|
1094
|
+
props: /* @__PURE__ */ Fe({
|
|
1089
1095
|
placeholder: { default: void 0 },
|
|
1090
1096
|
minHeight: { default: "160px" }
|
|
1091
1097
|
}, {
|
|
@@ -1094,10 +1100,10 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1094
1100
|
}),
|
|
1095
1101
|
emits: ["update:modelValue"],
|
|
1096
1102
|
setup(a) {
|
|
1097
|
-
const n =
|
|
1103
|
+
const n = We(a, "modelValue"), c = a, y = se(), b = T(() => {
|
|
1098
1104
|
const t = y.active.value;
|
|
1099
1105
|
return y.list.value.some((g) => g.code === t) ? t : y.list.value[0]?.code ?? "";
|
|
1100
|
-
}),
|
|
1106
|
+
}), B = T({
|
|
1101
1107
|
get: () => {
|
|
1102
1108
|
const t = n.value;
|
|
1103
1109
|
return typeof t == "string" ? b.value === "" || b.value === y.list.value[0]?.code ? t : "" : t[b.value] ?? "";
|
|
@@ -1111,25 +1117,25 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1111
1117
|
n.value = { ...l, [b.value]: t };
|
|
1112
1118
|
}
|
|
1113
1119
|
});
|
|
1114
|
-
return (t, l) => e(y).list.value.length > 0 ? (
|
|
1115
|
-
default:
|
|
1116
|
-
i(e(
|
|
1117
|
-
modelValue:
|
|
1118
|
-
"onUpdate:modelValue": l[0] || (l[0] = (g) =>
|
|
1120
|
+
return (t, l) => e(y).list.value.length > 0 ? (m(), w(e(ct), { key: 0 }, {
|
|
1121
|
+
default: d(() => [
|
|
1122
|
+
i(e(qe), {
|
|
1123
|
+
modelValue: B.value,
|
|
1124
|
+
"onUpdate:modelValue": l[0] || (l[0] = (g) => B.value = g),
|
|
1119
1125
|
placeholder: c.placeholder,
|
|
1120
1126
|
"min-height": c.minHeight
|
|
1121
1127
|
}, null, 8, ["modelValue", "placeholder", "min-height"])
|
|
1122
1128
|
]),
|
|
1123
1129
|
_: 1
|
|
1124
|
-
})) : (
|
|
1130
|
+
})) : (m(), w(e(qe), {
|
|
1125
1131
|
key: 1,
|
|
1126
|
-
modelValue:
|
|
1127
|
-
"onUpdate:modelValue": l[1] || (l[1] = (g) =>
|
|
1132
|
+
modelValue: B.value,
|
|
1133
|
+
"onUpdate:modelValue": l[1] || (l[1] = (g) => B.value = g),
|
|
1128
1134
|
placeholder: c.placeholder,
|
|
1129
1135
|
"min-height": c.minHeight
|
|
1130
1136
|
}, null, 8, ["modelValue", "placeholder", "min-height"]));
|
|
1131
1137
|
}
|
|
1132
|
-
}),
|
|
1138
|
+
}), Dt = [
|
|
1133
1139
|
"text",
|
|
1134
1140
|
"email",
|
|
1135
1141
|
"tel",
|
|
@@ -1141,108 +1147,133 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1141
1147
|
"date",
|
|
1142
1148
|
"file",
|
|
1143
1149
|
"hidden"
|
|
1144
|
-
],
|
|
1150
|
+
], il = ["default", "primary", "success", "warning", "info", "danger"], Lt = { class: "wx-inbox-field-form" }, Ht = {
|
|
1145
1151
|
key: 2,
|
|
1146
1152
|
class: "wx-inbox-choices"
|
|
1147
|
-
}, Xt = { class: "wx-inbox-field-form__row" }, Gt = { class: "wx-inbox-field-form__checks" }, Yt = /* @__PURE__ */
|
|
1153
|
+
}, Xt = { class: "wx-inbox-field-form__row" }, Gt = { class: "wx-inbox-field-form__checks" }, Yt = { class: "wx-inbox-field-form__advanced" }, jt = /* @__PURE__ */ ne({
|
|
1148
1154
|
__name: "FieldDialog",
|
|
1149
1155
|
props: {
|
|
1150
1156
|
field: {},
|
|
1151
|
-
form: {}
|
|
1157
|
+
form: {},
|
|
1158
|
+
taken: { default: () => [] }
|
|
1152
1159
|
},
|
|
1153
1160
|
setup(a) {
|
|
1154
|
-
const n = a, { resolve: c, dismiss: y, open: b } =
|
|
1155
|
-
|
|
1156
|
-
const l =
|
|
1157
|
-
|
|
1161
|
+
const n = a, { resolve: c, dismiss: y, open: b } = De(), B = oe(), t = ke(B);
|
|
1162
|
+
ce();
|
|
1163
|
+
const l = ae("webx-inbox"), g = we(), q = C(!1), z = C({}), $ = C(""), S = C("text"), A = C({}), v = C({}), L = C({}), p = C({}), U = C(!1), V = se(), W = C(!0), P = C(!1), X = C(!0), k = C(!1);
|
|
1164
|
+
ve(
|
|
1158
1165
|
() => n.field,
|
|
1159
|
-
(
|
|
1160
|
-
|
|
1166
|
+
(f) => {
|
|
1167
|
+
$.value = f?.name ?? "", S.value = f?.type ?? "text", A.value = { ...f?.title ?? {} }, v.value = { ...f?.placeholder ?? {} }, L.value = { ...f?.help ?? {} }, p.value = { ...f?.options ?? {} }, W.value = f?.is_enabled ?? !0, P.value = f?.is_required ?? !1, X.value = f?.is_fullsize ?? !0, k.value = f?.in_table ?? !1, U.value = f !== null, z.value = {};
|
|
1161
1168
|
},
|
|
1162
1169
|
{ immediate: !0 }
|
|
1163
1170
|
);
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
)
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
+
function x(f) {
|
|
1172
|
+
const s = f ?? {}, r = s[V.active.value];
|
|
1173
|
+
return typeof r == "string" && r.trim() !== "" ? r : Object.values(s).find((H) => typeof H == "string" && H.trim() !== "") ?? "";
|
|
1174
|
+
}
|
|
1175
|
+
function _(f) {
|
|
1176
|
+
let s = wt(f, "_").slice(0, 60).replace(/_+$/, "");
|
|
1177
|
+
if (s === "") return "";
|
|
1178
|
+
/^[a-z]/.test(s) || (s = `field_${s}`);
|
|
1179
|
+
let r = s;
|
|
1180
|
+
for (let H = 2; n.taken.includes(r); H++) r = `${s}_${H}`;
|
|
1181
|
+
return r;
|
|
1182
|
+
}
|
|
1183
|
+
ve(
|
|
1184
|
+
() => x(A.value),
|
|
1185
|
+
(f) => {
|
|
1186
|
+
U.value || ($.value = _(f));
|
|
1187
|
+
}
|
|
1188
|
+
);
|
|
1189
|
+
function u(f) {
|
|
1190
|
+
$.value = f, U.value = f.trim() !== "", U.value || ($.value = _(x(A.value)));
|
|
1191
|
+
}
|
|
1192
|
+
const R = T(() => {
|
|
1193
|
+
const f = n.field?.name ?? "", s = $.value.trim();
|
|
1194
|
+
return f !== "" && s !== "" && s !== f ? f : null;
|
|
1195
|
+
}), _e = T(
|
|
1196
|
+
() => Dt.map((f) => ({ value: f, label: l(`fields.type-${f}`) }))
|
|
1197
|
+
), ie = T(() => ["select", "radio", "checkbox"].includes(S.value)), K = T(
|
|
1198
|
+
() => Array.isArray(p.value.choices) ? p.value.choices : []
|
|
1199
|
+
), pe = T({
|
|
1200
|
+
get: () => Array.isArray(p.value.extensions) ? p.value.extensions : [],
|
|
1201
|
+
set: (f) => O(
|
|
1171
1202
|
"extensions",
|
|
1172
|
-
|
|
1203
|
+
f.map((s) => s.replace(/^\./, ""))
|
|
1173
1204
|
)
|
|
1174
1205
|
});
|
|
1175
|
-
function
|
|
1176
|
-
|
|
1206
|
+
function O(f, s) {
|
|
1207
|
+
p.value = { ...p.value, [f]: s };
|
|
1177
1208
|
}
|
|
1178
|
-
function
|
|
1179
|
-
|
|
1209
|
+
function Ve() {
|
|
1210
|
+
O("choices", [...K.value, { value: "", label: {} }]);
|
|
1180
1211
|
}
|
|
1181
|
-
function
|
|
1182
|
-
|
|
1212
|
+
function Te(f) {
|
|
1213
|
+
O(
|
|
1183
1214
|
"choices",
|
|
1184
|
-
|
|
1215
|
+
K.value.filter((s, r) => r !== f)
|
|
1185
1216
|
);
|
|
1186
1217
|
}
|
|
1187
|
-
function
|
|
1188
|
-
|
|
1218
|
+
function fe(f, s) {
|
|
1219
|
+
O(
|
|
1189
1220
|
"choices",
|
|
1190
|
-
|
|
1221
|
+
K.value.map((r, H) => H === f ? { ...r, ...s } : r)
|
|
1191
1222
|
);
|
|
1192
1223
|
}
|
|
1193
|
-
function
|
|
1194
|
-
return
|
|
1224
|
+
function j(f) {
|
|
1225
|
+
return z.value[f]?.[0];
|
|
1195
1226
|
}
|
|
1196
|
-
async function
|
|
1197
|
-
|
|
1198
|
-
const
|
|
1199
|
-
name:
|
|
1200
|
-
type:
|
|
1201
|
-
title:
|
|
1227
|
+
async function $e() {
|
|
1228
|
+
q.value = !0, z.value = {};
|
|
1229
|
+
const f = {
|
|
1230
|
+
name: $.value.trim() === "" ? null : $.value.trim(),
|
|
1231
|
+
type: S.value,
|
|
1232
|
+
title: A.value,
|
|
1202
1233
|
placeholder: v.value,
|
|
1203
|
-
help:
|
|
1204
|
-
options:
|
|
1205
|
-
is_enabled:
|
|
1206
|
-
is_required:
|
|
1207
|
-
is_fullsize:
|
|
1208
|
-
in_table:
|
|
1234
|
+
help: L.value,
|
|
1235
|
+
options: p.value,
|
|
1236
|
+
is_enabled: W.value,
|
|
1237
|
+
is_required: P.value,
|
|
1238
|
+
is_fullsize: X.value,
|
|
1239
|
+
in_table: k.value
|
|
1209
1240
|
};
|
|
1210
1241
|
try {
|
|
1211
1242
|
c(
|
|
1212
|
-
n.field === null ? await t.createField(n.form.id,
|
|
1243
|
+
n.field === null ? await t.createField(n.form.id, f) : await t.saveField(n.field.id, f)
|
|
1213
1244
|
);
|
|
1214
|
-
} catch (
|
|
1215
|
-
const
|
|
1216
|
-
|
|
1245
|
+
} catch (s) {
|
|
1246
|
+
const r = s.body;
|
|
1247
|
+
r?.errors ? (z.value = r.errors, Y.danger(l("panel.failed"))) : Y.danger(g(s));
|
|
1217
1248
|
} finally {
|
|
1218
|
-
|
|
1249
|
+
q.value = !1;
|
|
1219
1250
|
}
|
|
1220
1251
|
}
|
|
1221
|
-
return (
|
|
1252
|
+
return (f, s) => (m(), w(e(Le), {
|
|
1222
1253
|
open: e(b),
|
|
1223
|
-
"onUpdate:open":
|
|
1254
|
+
"onUpdate:open": s[21] || (s[21] = (r) => Be(b) ? b.value = r : null),
|
|
1224
1255
|
title: a.field ? e(l)("fields.edit-field") : e(l)("fields.new-field"),
|
|
1225
1256
|
width: 720
|
|
1226
1257
|
}, {
|
|
1227
|
-
footer:
|
|
1228
|
-
i(e(
|
|
1229
|
-
default:
|
|
1230
|
-
i(e(
|
|
1258
|
+
footer: d(() => [
|
|
1259
|
+
i(e(He), { size: "sm" }, {
|
|
1260
|
+
default: d(() => [
|
|
1261
|
+
i(e(te), {
|
|
1231
1262
|
variant: "outline",
|
|
1232
|
-
onClick:
|
|
1263
|
+
onClick: s[20] || (s[20] = (r) => e(y)())
|
|
1233
1264
|
}, {
|
|
1234
|
-
default:
|
|
1235
|
-
|
|
1265
|
+
default: d(() => [
|
|
1266
|
+
E(I(e(l)("fields.cancel")), 1)
|
|
1236
1267
|
]),
|
|
1237
1268
|
_: 1
|
|
1238
1269
|
}),
|
|
1239
|
-
i(e(
|
|
1270
|
+
i(e(te), {
|
|
1240
1271
|
type: "primary",
|
|
1241
|
-
loading:
|
|
1242
|
-
onClick:
|
|
1272
|
+
loading: q.value,
|
|
1273
|
+
onClick: $e
|
|
1243
1274
|
}, {
|
|
1244
|
-
default:
|
|
1245
|
-
|
|
1275
|
+
default: d(() => [
|
|
1276
|
+
E(I(e(l)("fields.save")), 1)
|
|
1246
1277
|
]),
|
|
1247
1278
|
_: 1
|
|
1248
1279
|
}, 8, ["loading"])
|
|
@@ -1250,314 +1281,330 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1250
1281
|
_: 1
|
|
1251
1282
|
})
|
|
1252
1283
|
]),
|
|
1253
|
-
default:
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
i(e(L), {
|
|
1269
|
-
label: e(l)("fields.name"),
|
|
1270
|
-
help: e(l)("fields.name-help"),
|
|
1271
|
-
error: K("name")
|
|
1272
|
-
}, {
|
|
1273
|
-
default: u(() => [
|
|
1274
|
-
i(e(j), {
|
|
1275
|
-
modelValue: W.value,
|
|
1276
|
-
"onUpdate:modelValue": r[1] || (r[1] = (d) => W.value = d),
|
|
1277
|
-
placeholder: "email"
|
|
1278
|
-
}, null, 8, ["modelValue"])
|
|
1279
|
-
]),
|
|
1280
|
-
_: 1
|
|
1281
|
-
}, 8, ["label", "help", "error"])
|
|
1282
|
-
]),
|
|
1283
|
-
i(e(L), {
|
|
1284
|
+
default: d(() => [
|
|
1285
|
+
G("div", Lt, [
|
|
1286
|
+
i(e(M), {
|
|
1287
|
+
label: e(l)("fields.type")
|
|
1288
|
+
}, {
|
|
1289
|
+
default: d(() => [
|
|
1290
|
+
i(e(ye), {
|
|
1291
|
+
modelValue: S.value,
|
|
1292
|
+
"onUpdate:modelValue": s[0] || (s[0] = (r) => S.value = r),
|
|
1293
|
+
options: _e.value
|
|
1294
|
+
}, null, 8, ["modelValue", "options"])
|
|
1295
|
+
]),
|
|
1296
|
+
_: 1
|
|
1297
|
+
}, 8, ["label"]),
|
|
1298
|
+
i(e(M), {
|
|
1284
1299
|
label: e(l)("fields.title"),
|
|
1285
|
-
error:
|
|
1300
|
+
error: j("title"),
|
|
1286
1301
|
required: ""
|
|
1287
1302
|
}, {
|
|
1288
|
-
default:
|
|
1289
|
-
i(e(
|
|
1290
|
-
modelValue:
|
|
1291
|
-
"onUpdate:modelValue":
|
|
1303
|
+
default: d(() => [
|
|
1304
|
+
i(e(Z), {
|
|
1305
|
+
modelValue: A.value,
|
|
1306
|
+
"onUpdate:modelValue": s[1] || (s[1] = (r) => A.value = r),
|
|
1292
1307
|
localized: ""
|
|
1293
1308
|
}, null, 8, ["modelValue"])
|
|
1294
1309
|
]),
|
|
1295
1310
|
_: 1
|
|
1296
1311
|
}, 8, ["label", "error"]),
|
|
1297
|
-
|
|
1298
|
-
|
|
1312
|
+
S.value !== "hidden" ? (m(), D(Q, { key: 0 }, [
|
|
1313
|
+
S.value !== "consent" ? (m(), w(e(M), {
|
|
1299
1314
|
key: 0,
|
|
1300
1315
|
label: e(l)("fields.placeholder")
|
|
1301
1316
|
}, {
|
|
1302
|
-
default:
|
|
1303
|
-
i(e(
|
|
1317
|
+
default: d(() => [
|
|
1318
|
+
i(e(Z), {
|
|
1304
1319
|
modelValue: v.value,
|
|
1305
|
-
"onUpdate:modelValue":
|
|
1320
|
+
"onUpdate:modelValue": s[2] || (s[2] = (r) => v.value = r),
|
|
1306
1321
|
localized: ""
|
|
1307
1322
|
}, null, 8, ["modelValue"])
|
|
1308
1323
|
]),
|
|
1309
1324
|
_: 1
|
|
1310
|
-
}, 8, ["label"])) :
|
|
1311
|
-
i(e(
|
|
1325
|
+
}, 8, ["label"])) : N("", !0),
|
|
1326
|
+
i(e(M), {
|
|
1312
1327
|
label: e(l)("fields.help")
|
|
1313
1328
|
}, {
|
|
1314
|
-
default:
|
|
1315
|
-
i(e(
|
|
1316
|
-
modelValue:
|
|
1317
|
-
"onUpdate:modelValue":
|
|
1329
|
+
default: d(() => [
|
|
1330
|
+
i(e(Z), {
|
|
1331
|
+
modelValue: L.value,
|
|
1332
|
+
"onUpdate:modelValue": s[3] || (s[3] = (r) => L.value = r),
|
|
1318
1333
|
localized: ""
|
|
1319
1334
|
}, null, 8, ["modelValue"])
|
|
1320
1335
|
]),
|
|
1321
1336
|
_: 1
|
|
1322
1337
|
}, 8, ["label"])
|
|
1323
|
-
], 64)) :
|
|
1324
|
-
|
|
1338
|
+
], 64)) : N("", !0),
|
|
1339
|
+
S.value === "consent" ? (m(), w(e(M), {
|
|
1325
1340
|
key: 1,
|
|
1326
1341
|
label: e(l)("fields.consent-text"),
|
|
1327
1342
|
help: e(l)("fields.consent-text-help")
|
|
1328
1343
|
}, {
|
|
1329
|
-
default:
|
|
1330
|
-
i(
|
|
1331
|
-
"model-value":
|
|
1344
|
+
default: d(() => [
|
|
1345
|
+
i(Mt, {
|
|
1346
|
+
"model-value": p.value.text ?? {},
|
|
1332
1347
|
"min-height": "100px",
|
|
1333
|
-
"onUpdate:modelValue":
|
|
1348
|
+
"onUpdate:modelValue": s[4] || (s[4] = (r) => O("text", r))
|
|
1334
1349
|
}, null, 8, ["model-value"])
|
|
1335
1350
|
]),
|
|
1336
1351
|
_: 1
|
|
1337
|
-
}, 8, ["label", "help"])) :
|
|
1338
|
-
|
|
1339
|
-
i(e(
|
|
1352
|
+
}, 8, ["label", "help"])) : N("", !0),
|
|
1353
|
+
ie.value ? (m(), D("div", Ht, [
|
|
1354
|
+
i(e(ee), {
|
|
1340
1355
|
size: "sm",
|
|
1341
1356
|
weight: "medium"
|
|
1342
1357
|
}, {
|
|
1343
|
-
default:
|
|
1344
|
-
|
|
1358
|
+
default: d(() => [
|
|
1359
|
+
E(I(e(l)("fields.choices")), 1)
|
|
1345
1360
|
]),
|
|
1346
1361
|
_: 1
|
|
1347
1362
|
}),
|
|
1348
|
-
|
|
1363
|
+
K.value.length === 0 ? (m(), w(e(ee), {
|
|
1349
1364
|
key: 0,
|
|
1350
1365
|
size: "sm",
|
|
1351
1366
|
tone: "placeholder"
|
|
1352
1367
|
}, {
|
|
1353
|
-
default:
|
|
1354
|
-
|
|
1368
|
+
default: d(() => [
|
|
1369
|
+
E(I(e(l)("fields.no-choices")), 1)
|
|
1355
1370
|
]),
|
|
1356
1371
|
_: 1
|
|
1357
|
-
})) :
|
|
1358
|
-
(
|
|
1359
|
-
key:
|
|
1372
|
+
})) : N("", !0),
|
|
1373
|
+
(m(!0), D(Q, null, Pe(K.value, (r, H) => (m(), D("div", {
|
|
1374
|
+
key: H,
|
|
1360
1375
|
class: "wx-inbox-choices__row"
|
|
1361
1376
|
}, [
|
|
1362
|
-
i(e(
|
|
1363
|
-
"model-value":
|
|
1377
|
+
i(e(Z), {
|
|
1378
|
+
"model-value": r.value,
|
|
1364
1379
|
placeholder: e(l)("fields.choice-value"),
|
|
1365
|
-
"onUpdate:modelValue": (
|
|
1380
|
+
"onUpdate:modelValue": (J) => fe(H, { value: String(J) })
|
|
1366
1381
|
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
|
|
1367
|
-
i(e(
|
|
1368
|
-
"model-value":
|
|
1382
|
+
i(e(Z), {
|
|
1383
|
+
"model-value": r.label,
|
|
1369
1384
|
localized: "",
|
|
1370
1385
|
placeholder: e(l)("fields.choice-label"),
|
|
1371
|
-
"onUpdate:modelValue": (
|
|
1386
|
+
"onUpdate:modelValue": (J) => fe(H, { label: J })
|
|
1372
1387
|
}, null, 8, ["model-value", "placeholder", "onUpdate:modelValue"]),
|
|
1373
|
-
i(e(
|
|
1388
|
+
i(e(Me), {
|
|
1374
1389
|
icon: "trash",
|
|
1375
1390
|
title: e(l)("fields.delete"),
|
|
1376
|
-
onClick: (
|
|
1391
|
+
onClick: (J) => Te(H)
|
|
1377
1392
|
}, null, 8, ["title", "onClick"])
|
|
1378
1393
|
]))), 128)),
|
|
1379
|
-
i(e(
|
|
1394
|
+
i(e(te), {
|
|
1380
1395
|
variant: "outline",
|
|
1381
1396
|
size: "sm",
|
|
1382
|
-
onClick:
|
|
1397
|
+
onClick: Ve
|
|
1383
1398
|
}, {
|
|
1384
|
-
icon:
|
|
1385
|
-
i(e(
|
|
1399
|
+
icon: d(() => [
|
|
1400
|
+
i(e(ge), { name: "plus" })
|
|
1386
1401
|
]),
|
|
1387
|
-
default:
|
|
1388
|
-
|
|
1402
|
+
default: d(() => [
|
|
1403
|
+
E(" " + I(e(l)("fields.add-choice")), 1)
|
|
1389
1404
|
]),
|
|
1390
1405
|
_: 1
|
|
1391
1406
|
}),
|
|
1392
|
-
|
|
1407
|
+
j("options.choices") ? (m(), w(e(ee), {
|
|
1393
1408
|
key: 1,
|
|
1394
1409
|
size: "sm",
|
|
1395
1410
|
tone: "danger"
|
|
1396
1411
|
}, {
|
|
1397
|
-
default:
|
|
1398
|
-
|
|
1412
|
+
default: d(() => [
|
|
1413
|
+
E(I(j("options.choices")), 1)
|
|
1399
1414
|
]),
|
|
1400
1415
|
_: 1
|
|
1401
|
-
})) :
|
|
1402
|
-
])) :
|
|
1403
|
-
|
|
1404
|
-
|
|
1416
|
+
})) : N("", !0)
|
|
1417
|
+
])) : N("", !0),
|
|
1418
|
+
G("div", Xt, [
|
|
1419
|
+
S.value === "textarea" ? (m(), w(e(M), {
|
|
1405
1420
|
key: 0,
|
|
1406
1421
|
label: e(l)("fields.rows")
|
|
1407
1422
|
}, {
|
|
1408
|
-
default:
|
|
1409
|
-
i(e(
|
|
1410
|
-
"model-value":
|
|
1423
|
+
default: d(() => [
|
|
1424
|
+
i(e(re), {
|
|
1425
|
+
"model-value": p.value.rows ?? 5,
|
|
1411
1426
|
min: 2,
|
|
1412
1427
|
max: 30,
|
|
1413
|
-
"onUpdate:modelValue":
|
|
1428
|
+
"onUpdate:modelValue": s[5] || (s[5] = (r) => O("rows", r))
|
|
1414
1429
|
}, null, 8, ["model-value"])
|
|
1415
1430
|
]),
|
|
1416
1431
|
_: 1
|
|
1417
|
-
}, 8, ["label"])) :
|
|
1418
|
-
["text", "email", "textarea"].includes(
|
|
1432
|
+
}, 8, ["label"])) : N("", !0),
|
|
1433
|
+
["text", "email", "textarea"].includes(S.value) ? (m(), w(e(M), {
|
|
1419
1434
|
key: 1,
|
|
1420
1435
|
label: e(l)("fields.maxlength")
|
|
1421
1436
|
}, {
|
|
1422
|
-
default:
|
|
1423
|
-
i(e(
|
|
1424
|
-
"model-value":
|
|
1437
|
+
default: d(() => [
|
|
1438
|
+
i(e(re), {
|
|
1439
|
+
"model-value": p.value.maxlength ?? null,
|
|
1425
1440
|
min: 1,
|
|
1426
1441
|
max: 2e4,
|
|
1427
|
-
"onUpdate:modelValue":
|
|
1442
|
+
"onUpdate:modelValue": s[6] || (s[6] = (r) => O("maxlength", r))
|
|
1428
1443
|
}, null, 8, ["model-value"])
|
|
1429
1444
|
]),
|
|
1430
1445
|
_: 1
|
|
1431
|
-
}, 8, ["label"])) :
|
|
1432
|
-
|
|
1446
|
+
}, 8, ["label"])) : N("", !0),
|
|
1447
|
+
S.value === "tel" ? (m(), w(e(M), {
|
|
1433
1448
|
key: 2,
|
|
1434
1449
|
label: e(l)("fields.pattern"),
|
|
1435
1450
|
help: e(l)("fields.pattern-help")
|
|
1436
1451
|
}, {
|
|
1437
|
-
default:
|
|
1438
|
-
i(e(
|
|
1439
|
-
"model-value":
|
|
1440
|
-
"onUpdate:modelValue":
|
|
1452
|
+
default: d(() => [
|
|
1453
|
+
i(e(Z), {
|
|
1454
|
+
"model-value": p.value.pattern ?? "",
|
|
1455
|
+
"onUpdate:modelValue": s[7] || (s[7] = (r) => O("pattern", r))
|
|
1441
1456
|
}, null, 8, ["model-value"])
|
|
1442
1457
|
]),
|
|
1443
1458
|
_: 1
|
|
1444
|
-
}, 8, ["label", "help"])) :
|
|
1445
|
-
|
|
1446
|
-
i(e(
|
|
1459
|
+
}, 8, ["label", "help"])) : N("", !0),
|
|
1460
|
+
S.value === "date" ? (m(), D(Q, { key: 3 }, [
|
|
1461
|
+
i(e(M), {
|
|
1447
1462
|
label: e(l)("fields.earliest")
|
|
1448
1463
|
}, {
|
|
1449
|
-
default:
|
|
1450
|
-
i(e(
|
|
1464
|
+
default: d(() => [
|
|
1465
|
+
i(e(Ne), {
|
|
1451
1466
|
clearable: "",
|
|
1452
|
-
"model-value":
|
|
1453
|
-
"onUpdate:modelValue":
|
|
1467
|
+
"model-value": p.value.min ?? null,
|
|
1468
|
+
"onUpdate:modelValue": s[8] || (s[8] = (r) => O("min", r))
|
|
1454
1469
|
}, null, 8, ["model-value"])
|
|
1455
1470
|
]),
|
|
1456
1471
|
_: 1
|
|
1457
1472
|
}, 8, ["label"]),
|
|
1458
|
-
i(e(
|
|
1473
|
+
i(e(M), {
|
|
1459
1474
|
label: e(l)("fields.latest")
|
|
1460
1475
|
}, {
|
|
1461
|
-
default:
|
|
1462
|
-
i(e(
|
|
1476
|
+
default: d(() => [
|
|
1477
|
+
i(e(Ne), {
|
|
1463
1478
|
clearable: "",
|
|
1464
|
-
"model-value":
|
|
1465
|
-
"onUpdate:modelValue":
|
|
1479
|
+
"model-value": p.value.max ?? null,
|
|
1480
|
+
"onUpdate:modelValue": s[9] || (s[9] = (r) => O("max", r))
|
|
1466
1481
|
}, null, 8, ["model-value"])
|
|
1467
1482
|
]),
|
|
1468
1483
|
_: 1
|
|
1469
1484
|
}, 8, ["label"])
|
|
1470
|
-
], 64)) :
|
|
1471
|
-
|
|
1472
|
-
i(e(
|
|
1485
|
+
], 64)) : N("", !0),
|
|
1486
|
+
S.value === "checkbox" ? (m(), D(Q, { key: 4 }, [
|
|
1487
|
+
i(e(M), {
|
|
1473
1488
|
label: e(l)("fields.min-choices")
|
|
1474
1489
|
}, {
|
|
1475
|
-
default:
|
|
1476
|
-
i(e(
|
|
1477
|
-
"model-value":
|
|
1490
|
+
default: d(() => [
|
|
1491
|
+
i(e(re), {
|
|
1492
|
+
"model-value": p.value.min ?? null,
|
|
1478
1493
|
min: 0,
|
|
1479
|
-
"onUpdate:modelValue":
|
|
1494
|
+
"onUpdate:modelValue": s[10] || (s[10] = (r) => O("min", r))
|
|
1480
1495
|
}, null, 8, ["model-value"])
|
|
1481
1496
|
]),
|
|
1482
1497
|
_: 1
|
|
1483
1498
|
}, 8, ["label"]),
|
|
1484
|
-
i(e(
|
|
1499
|
+
i(e(M), {
|
|
1485
1500
|
label: e(l)("fields.max-choices")
|
|
1486
1501
|
}, {
|
|
1487
|
-
default:
|
|
1488
|
-
i(e(
|
|
1489
|
-
"model-value":
|
|
1502
|
+
default: d(() => [
|
|
1503
|
+
i(e(re), {
|
|
1504
|
+
"model-value": p.value.max ?? null,
|
|
1490
1505
|
min: 0,
|
|
1491
|
-
"onUpdate:modelValue":
|
|
1506
|
+
"onUpdate:modelValue": s[11] || (s[11] = (r) => O("max", r))
|
|
1492
1507
|
}, null, 8, ["model-value"])
|
|
1493
1508
|
]),
|
|
1494
1509
|
_: 1
|
|
1495
1510
|
}, 8, ["label"])
|
|
1496
|
-
], 64)) :
|
|
1497
|
-
|
|
1511
|
+
], 64)) : N("", !0),
|
|
1512
|
+
S.value === "file" ? (m(), w(e(M), {
|
|
1498
1513
|
key: 5,
|
|
1499
1514
|
label: e(l)("fields.max-size")
|
|
1500
1515
|
}, {
|
|
1501
|
-
default:
|
|
1502
|
-
i(e(
|
|
1503
|
-
"model-value":
|
|
1516
|
+
default: d(() => [
|
|
1517
|
+
i(e(re), {
|
|
1518
|
+
"model-value": p.value.max_size ?? null,
|
|
1504
1519
|
min: 1,
|
|
1505
|
-
"onUpdate:modelValue":
|
|
1520
|
+
"onUpdate:modelValue": s[12] || (s[12] = (r) => O("max_size", r))
|
|
1506
1521
|
}, null, 8, ["model-value"])
|
|
1507
1522
|
]),
|
|
1508
1523
|
_: 1
|
|
1509
|
-
}, 8, ["label"])) :
|
|
1524
|
+
}, 8, ["label"])) : N("", !0)
|
|
1510
1525
|
]),
|
|
1511
|
-
|
|
1512
|
-
i(e(
|
|
1526
|
+
S.value === "file" ? (m(), D(Q, { key: 3 }, [
|
|
1527
|
+
i(e(M), {
|
|
1513
1528
|
label: e(l)("fields.extensions"),
|
|
1514
1529
|
help: e(l)("fields.extensions-help")
|
|
1515
1530
|
}, {
|
|
1516
|
-
default:
|
|
1531
|
+
default: d(() => [
|
|
1517
1532
|
i(e(mt), {
|
|
1518
|
-
modelValue:
|
|
1519
|
-
"onUpdate:modelValue":
|
|
1533
|
+
modelValue: pe.value,
|
|
1534
|
+
"onUpdate:modelValue": s[13] || (s[13] = (r) => pe.value = r)
|
|
1520
1535
|
}, null, 8, ["modelValue"])
|
|
1521
1536
|
]),
|
|
1522
1537
|
_: 1
|
|
1523
1538
|
}, 8, ["label", "help"]),
|
|
1524
|
-
i(e(
|
|
1525
|
-
"model-value": !!
|
|
1539
|
+
i(e(le), {
|
|
1540
|
+
"model-value": !!p.value.multiple,
|
|
1526
1541
|
label: e(l)("fields.multiple"),
|
|
1527
|
-
"onUpdate:modelValue":
|
|
1542
|
+
"onUpdate:modelValue": s[14] || (s[14] = (r) => O("multiple", r))
|
|
1528
1543
|
}, null, 8, ["model-value", "label"])
|
|
1529
|
-
], 64)) :
|
|
1530
|
-
|
|
1531
|
-
i(e(
|
|
1532
|
-
modelValue:
|
|
1533
|
-
"onUpdate:modelValue":
|
|
1544
|
+
], 64)) : N("", !0),
|
|
1545
|
+
G("div", Gt, [
|
|
1546
|
+
i(e(le), {
|
|
1547
|
+
modelValue: W.value,
|
|
1548
|
+
"onUpdate:modelValue": s[15] || (s[15] = (r) => W.value = r),
|
|
1534
1549
|
label: e(l)("fields.is-enabled")
|
|
1535
1550
|
}, null, 8, ["modelValue", "label"]),
|
|
1536
|
-
i(e(
|
|
1537
|
-
modelValue:
|
|
1538
|
-
"onUpdate:modelValue":
|
|
1551
|
+
i(e(le), {
|
|
1552
|
+
modelValue: P.value,
|
|
1553
|
+
"onUpdate:modelValue": s[16] || (s[16] = (r) => P.value = r),
|
|
1539
1554
|
label: e(l)("fields.is-required")
|
|
1540
1555
|
}, null, 8, ["modelValue", "label"]),
|
|
1541
|
-
|
|
1556
|
+
S.value !== "hidden" ? (m(), w(e(le), {
|
|
1542
1557
|
key: 0,
|
|
1543
|
-
modelValue:
|
|
1544
|
-
"onUpdate:modelValue":
|
|
1558
|
+
modelValue: X.value,
|
|
1559
|
+
"onUpdate:modelValue": s[17] || (s[17] = (r) => X.value = r),
|
|
1545
1560
|
label: e(l)("fields.is-fullsize")
|
|
1546
|
-
}, null, 8, ["modelValue", "label"])) :
|
|
1547
|
-
i(e(
|
|
1548
|
-
modelValue:
|
|
1549
|
-
"onUpdate:modelValue":
|
|
1561
|
+
}, null, 8, ["modelValue", "label"])) : N("", !0),
|
|
1562
|
+
i(e(le), {
|
|
1563
|
+
modelValue: k.value,
|
|
1564
|
+
"onUpdate:modelValue": s[18] || (s[18] = (r) => k.value = r),
|
|
1550
1565
|
label: e(l)("fields.in-table")
|
|
1551
1566
|
}, null, 8, ["modelValue", "label"])
|
|
1567
|
+
]),
|
|
1568
|
+
G("section", Yt, [
|
|
1569
|
+
i(e(ee), {
|
|
1570
|
+
size: "sm",
|
|
1571
|
+
weight: "medium",
|
|
1572
|
+
tone: "muted"
|
|
1573
|
+
}, {
|
|
1574
|
+
default: d(() => [
|
|
1575
|
+
E(I(e(l)("fields.advanced")), 1)
|
|
1576
|
+
]),
|
|
1577
|
+
_: 1
|
|
1578
|
+
}),
|
|
1579
|
+
i(e(M), {
|
|
1580
|
+
label: e(l)("fields.name"),
|
|
1581
|
+
help: e(l)("fields.name-help", { name: $.value.trim() || "name" }),
|
|
1582
|
+
error: j("name")
|
|
1583
|
+
}, {
|
|
1584
|
+
default: d(() => [
|
|
1585
|
+
i(e(Z), {
|
|
1586
|
+
"model-value": $.value,
|
|
1587
|
+
placeholder: "phone",
|
|
1588
|
+
"onUpdate:modelValue": s[19] || (s[19] = (r) => u(String(r ?? "")))
|
|
1589
|
+
}, null, 8, ["model-value"])
|
|
1590
|
+
]),
|
|
1591
|
+
_: 1
|
|
1592
|
+
}, 8, ["label", "help", "error"]),
|
|
1593
|
+
R.value ? (m(), w(e(Ce), {
|
|
1594
|
+
key: 0,
|
|
1595
|
+
type: "warning",
|
|
1596
|
+
variant: "soft",
|
|
1597
|
+
description: e(l)("fields.name-renamed", { old: R.value, new: $.value.trim() })
|
|
1598
|
+
}, null, 8, ["description"])) : N("", !0)
|
|
1552
1599
|
])
|
|
1553
1600
|
])
|
|
1554
1601
|
]),
|
|
1555
1602
|
_: 1
|
|
1556
1603
|
}, 8, ["open", "title"]));
|
|
1557
1604
|
}
|
|
1558
|
-
}),
|
|
1605
|
+
}), Kt = /* @__PURE__ */ me(jt, [["__scopeId", "data-v-0b8e6619"]]), Zt = { class: "wx-inbox-field" }, Qt = { class: "wx-inbox-field__name" }, Jt = /* @__PURE__ */ ne({
|
|
1559
1606
|
__name: "FieldList",
|
|
1560
|
-
props: /* @__PURE__ */
|
|
1607
|
+
props: /* @__PURE__ */ Fe({
|
|
1561
1608
|
form: {},
|
|
1562
1609
|
canManage: { type: Boolean }
|
|
1563
1610
|
}, {
|
|
@@ -1566,43 +1613,43 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1566
1613
|
}),
|
|
1567
1614
|
emits: ["update:modelValue"],
|
|
1568
1615
|
setup(a) {
|
|
1569
|
-
const n = a, c =
|
|
1570
|
-
|
|
1571
|
-
const t =
|
|
1572
|
-
function
|
|
1573
|
-
return
|
|
1616
|
+
const n = a, c = We(a, "modelValue"), y = oe(), b = ke(y), B = se();
|
|
1617
|
+
ce();
|
|
1618
|
+
const t = ae("webx-inbox"), l = we(), g = Xe(Kt);
|
|
1619
|
+
function q(p) {
|
|
1620
|
+
return de(p.title, B.active.value, p.key);
|
|
1574
1621
|
}
|
|
1575
|
-
function
|
|
1622
|
+
function z(p) {
|
|
1576
1623
|
return [
|
|
1577
|
-
t(`fields.type-${
|
|
1578
|
-
...
|
|
1579
|
-
...
|
|
1580
|
-
...
|
|
1624
|
+
t(`fields.type-${p.type}`),
|
|
1625
|
+
...p.is_required ? [t("fields.is-required")] : [],
|
|
1626
|
+
...p.in_table ? [t("fields.in-table")] : [],
|
|
1627
|
+
...p.is_fullsize ? [] : [t("fields.is-fullsize")]
|
|
1581
1628
|
];
|
|
1582
1629
|
}
|
|
1583
|
-
const
|
|
1584
|
-
async function
|
|
1585
|
-
const
|
|
1586
|
-
|
|
1630
|
+
const $ = T(() => c.value.length === 0);
|
|
1631
|
+
async function S(p) {
|
|
1632
|
+
const U = c.value.filter((W) => W.id !== p?.id).map((W) => W.key), V = await g({ field: p, form: n.form, taken: U });
|
|
1633
|
+
V && (c.value = p === null ? [...c.value, V] : c.value.map((W) => W.id === V.id ? V : W));
|
|
1587
1634
|
}
|
|
1588
|
-
async function
|
|
1589
|
-
if (await
|
|
1590
|
-
title: t("fields.delete-title", { field:
|
|
1635
|
+
async function A(p) {
|
|
1636
|
+
if (await Ge({
|
|
1637
|
+
title: t("fields.delete-title", { field: q(p) }),
|
|
1591
1638
|
message: t("fields.delete-text"),
|
|
1592
1639
|
confirmText: t("fields.delete"),
|
|
1593
1640
|
cancelText: t("fields.cancel"),
|
|
1594
1641
|
tone: "danger"
|
|
1595
1642
|
}))
|
|
1596
1643
|
try {
|
|
1597
|
-
await b.removeField(
|
|
1598
|
-
} catch (
|
|
1599
|
-
|
|
1644
|
+
await b.removeField(p.id), c.value = c.value.filter((V) => V.id !== p.id), Y.success(t("panel.deleted"));
|
|
1645
|
+
} catch (V) {
|
|
1646
|
+
Y.danger(l(V));
|
|
1600
1647
|
}
|
|
1601
1648
|
}
|
|
1602
|
-
function v(
|
|
1649
|
+
function v(p) {
|
|
1603
1650
|
return n.canManage ? [
|
|
1604
1651
|
{ key: "edit", icon: "edit", label: t("fields.edit"), run: () => {
|
|
1605
|
-
|
|
1652
|
+
S(p);
|
|
1606
1653
|
} },
|
|
1607
1654
|
{
|
|
1608
1655
|
key: "delete",
|
|
@@ -1610,80 +1657,83 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1610
1657
|
label: t("fields.delete"),
|
|
1611
1658
|
danger: !0,
|
|
1612
1659
|
run: () => {
|
|
1613
|
-
|
|
1660
|
+
A(p);
|
|
1614
1661
|
}
|
|
1615
1662
|
}
|
|
1616
1663
|
] : [];
|
|
1617
1664
|
}
|
|
1618
|
-
async function
|
|
1665
|
+
async function L() {
|
|
1619
1666
|
try {
|
|
1620
1667
|
await b.sortFields(
|
|
1621
1668
|
n.form.id,
|
|
1622
|
-
c.value.map((
|
|
1669
|
+
c.value.map((p) => p.id)
|
|
1623
1670
|
);
|
|
1624
|
-
} catch (
|
|
1625
|
-
|
|
1671
|
+
} catch (p) {
|
|
1672
|
+
Y.danger(l(p, t("panel.reorder-failed")));
|
|
1626
1673
|
}
|
|
1627
1674
|
}
|
|
1628
|
-
return (
|
|
1675
|
+
return (p, U) => (m(), w(e(pt), {
|
|
1629
1676
|
title: e(t)("panel.tab-fields")
|
|
1630
|
-
},
|
|
1631
|
-
default:
|
|
1632
|
-
|
|
1677
|
+
}, Oe({
|
|
1678
|
+
default: d(() => [
|
|
1679
|
+
$.value ? (m(), w(e(ft), {
|
|
1633
1680
|
key: 0,
|
|
1634
1681
|
title: e(t)("fields.no-fields"),
|
|
1635
1682
|
description: e(t)("fields.no-fields-help")
|
|
1636
|
-
}, null, 8, ["title", "description"])) : (
|
|
1683
|
+
}, null, 8, ["title", "description"])) : (m(), w(e(ht), {
|
|
1637
1684
|
key: 1,
|
|
1638
1685
|
modelValue: c.value,
|
|
1639
|
-
"onUpdate:modelValue":
|
|
1686
|
+
"onUpdate:modelValue": U[1] || (U[1] = (V) => c.value = V),
|
|
1640
1687
|
plain: "",
|
|
1641
1688
|
"item-key": "id",
|
|
1642
|
-
"item-label":
|
|
1689
|
+
"item-label": q,
|
|
1643
1690
|
"drag-label": e(t)("panel.reorder"),
|
|
1644
1691
|
disabled: !a.canManage,
|
|
1645
1692
|
"aria-label": e(t)("panel.tab-fields"),
|
|
1646
|
-
onMove:
|
|
1693
|
+
onMove: L
|
|
1647
1694
|
}, {
|
|
1648
|
-
default:
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
i(e(
|
|
1695
|
+
default: d(({ item: V }) => [
|
|
1696
|
+
G("div", Zt, [
|
|
1697
|
+
G("div", Qt, [
|
|
1698
|
+
i(e(ee), {
|
|
1652
1699
|
weight: "medium",
|
|
1653
1700
|
truncate: ""
|
|
1654
1701
|
}, {
|
|
1655
|
-
default:
|
|
1656
|
-
|
|
1702
|
+
default: d(() => [
|
|
1703
|
+
E(I(q(V)), 1)
|
|
1657
1704
|
]),
|
|
1658
1705
|
_: 2
|
|
1659
1706
|
}, 1024),
|
|
1660
|
-
|
|
1707
|
+
V.is_enabled ? N("", !0) : (m(), w(e(be), {
|
|
1661
1708
|
key: 0,
|
|
1662
1709
|
type: "default"
|
|
1663
1710
|
}, {
|
|
1664
|
-
default:
|
|
1665
|
-
|
|
1711
|
+
default: d(() => [
|
|
1712
|
+
E(I(e(t)("panel.off")), 1)
|
|
1666
1713
|
]),
|
|
1667
1714
|
_: 1
|
|
1668
1715
|
}))
|
|
1669
1716
|
]),
|
|
1670
|
-
i(e(
|
|
1717
|
+
i(e(ee), {
|
|
1671
1718
|
size: "sm",
|
|
1672
1719
|
tone: "muted",
|
|
1673
1720
|
truncate: ""
|
|
1674
1721
|
}, {
|
|
1675
|
-
default:
|
|
1676
|
-
|
|
1677
|
-
|
|
1722
|
+
default: d(() => [
|
|
1723
|
+
V.name ? (m(), D(Q, { key: 0 }, [
|
|
1724
|
+
G("code", null, I(V.name), 1),
|
|
1725
|
+
U[2] || (U[2] = E(" · ", -1))
|
|
1726
|
+
], 64)) : N("", !0),
|
|
1727
|
+
E(I(z(V).join(" · ")), 1)
|
|
1678
1728
|
]),
|
|
1679
1729
|
_: 2
|
|
1680
1730
|
}, 1024)
|
|
1681
1731
|
])
|
|
1682
1732
|
]),
|
|
1683
|
-
actions:
|
|
1684
|
-
i(e(
|
|
1685
|
-
actions: v(
|
|
1686
|
-
label:
|
|
1733
|
+
actions: d(({ item: V }) => [
|
|
1734
|
+
i(e(Ue), {
|
|
1735
|
+
actions: v(V),
|
|
1736
|
+
label: q(V)
|
|
1687
1737
|
}, null, 8, ["actions", "label"])
|
|
1688
1738
|
]),
|
|
1689
1739
|
_: 1
|
|
@@ -1693,17 +1743,17 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1693
1743
|
}, [
|
|
1694
1744
|
a.canManage ? {
|
|
1695
1745
|
name: "extra",
|
|
1696
|
-
fn:
|
|
1697
|
-
i(e(
|
|
1746
|
+
fn: d(() => [
|
|
1747
|
+
i(e(te), {
|
|
1698
1748
|
type: "primary",
|
|
1699
1749
|
size: "sm",
|
|
1700
|
-
onClick:
|
|
1750
|
+
onClick: U[0] || (U[0] = (V) => S(null))
|
|
1701
1751
|
}, {
|
|
1702
|
-
icon:
|
|
1703
|
-
i(e(
|
|
1752
|
+
icon: d(() => [
|
|
1753
|
+
i(e(ge), { name: "plus" })
|
|
1704
1754
|
]),
|
|
1705
|
-
default:
|
|
1706
|
-
|
|
1755
|
+
default: d(() => [
|
|
1756
|
+
E(" " + I(e(t)("fields.new-field")), 1)
|
|
1707
1757
|
]),
|
|
1708
1758
|
_: 1
|
|
1709
1759
|
})
|
|
@@ -1712,24 +1762,24 @@ const Ft = { class: "wx-inbox-by-hand" }, Et = /* @__PURE__ */ ae({
|
|
|
1712
1762
|
} : void 0
|
|
1713
1763
|
]), 1032, ["title"]));
|
|
1714
1764
|
}
|
|
1715
|
-
}),
|
|
1765
|
+
}), ul = /* @__PURE__ */ me(Jt, [["__scopeId", "data-v-5d9f662e"]]), rl = xe(() => import("./InboxPage-Dd_8TGGg.js")), dl = xe(() => import("./FormEditorPage-HsbIZcG_.js")), cl = xe(() => import("./StatusesPage-DKJmpZoG.js")), ml = xe(() => import("./SubmissionPage-BoE9jEhj.js"));
|
|
1716
1766
|
export {
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1767
|
+
ul as F,
|
|
1768
|
+
ol as S,
|
|
1769
|
+
dl as W,
|
|
1770
|
+
me as _,
|
|
1771
|
+
Mt as a,
|
|
1772
|
+
il as b,
|
|
1773
|
+
ke as c,
|
|
1774
|
+
Tt as d,
|
|
1775
|
+
Dt as e,
|
|
1726
1776
|
It as f,
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1777
|
+
rl as g,
|
|
1778
|
+
cl as h,
|
|
1779
|
+
ml as i,
|
|
1780
|
+
nl as j,
|
|
1781
|
+
Vt as k,
|
|
1732
1782
|
sl as o,
|
|
1733
|
-
|
|
1783
|
+
ce as u
|
|
1734
1784
|
};
|
|
1735
|
-
//# sourceMappingURL=index-
|
|
1785
|
+
//# sourceMappingURL=index-Dxbb2lUM.js.map
|