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