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