@cling-se/widget 0.15.2 → 0.15.5
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/README.md +43 -43
- package/dist/{AddClientCallout-CSxN7XFh.js → AddClientCallout-CrZF5j7A.js} +15 -13
- package/dist/{AnswerModal-DEwMlsT8.js → AnswerModal-C3r9vyki.js} +71 -71
- package/dist/{AttachmentItem-R7YMKqQ2.js → AttachmentItem-BVXrxCnv.js} +20 -13
- package/dist/{BaseDatePicker-Bd1maWgF.js → BaseDatePicker-DxL2l3QC.js} +561 -557
- package/dist/{BaseUpload-C9Jd1JBo.js → BaseUpload-B7259IaQ.js} +3 -3
- package/dist/{BlockMedia-CUCZYVdZ.js → BlockMedia-BSKtZMwa.js} +2 -2
- package/dist/{CCallout-_k7FPbsE.js → CCallout-BNvM6gNJ.js} +4 -5
- package/dist/{CCurrencyDropdown-DejfeYVY.js → CCurrencyDropdown-xmqmb8gW.js} +24 -20
- package/dist/{CDropdownItem-b6ZzOnv-.js → CDropdownItem-DiLisSei.js} +139 -37
- package/dist/{CFormField-BjGICSv5.js → CFormField-DcZVdj3a.js} +3 -4
- package/dist/{CPhoneFormat-Bf2fgYtr.js → CPhoneFormat-BeYxRN0i.js} +1 -1
- package/dist/CPhoneInput-UzZkxbC6.js +138 -0
- package/dist/{CPriceInput-myrETXfz.js → CPriceInput-C2y_3PM7.js} +20 -16
- package/dist/CSelect-BmP1UsQA.js +91 -0
- package/dist/CSkeleton-BNbft-NE.js +55 -0
- package/dist/ClientAutocomplete-BnredOme.js +438 -0
- package/dist/{ClientModal-DSmFJ9bu.js → ClientModal-DNcf4APF.js} +92 -51
- package/dist/{ColorPicker-B1MJicqo.js → ColorPicker-BupC4jvI.js} +2 -2
- package/dist/{CompanyModal-BXs3aAYm.js → CompanyModal-Bh8mEHE1.js} +25 -19
- package/dist/{ContentWrapper-BKWZy4Bp.js → ContentWrapper-Bs3nrJda.js} +63 -55
- package/dist/CoverBlockSettings-WYZsCdky.js +659 -0
- package/dist/{DocAnswer-CaoTYUNh.js → DocAnswer--FfsnnTB.js} +2 -2
- package/dist/{DocDetails-C9EEpNg2.js → DocDetails-Ce7bj-qO.js} +43 -39
- package/dist/{DocForm-Dww8Ust9.js → DocForm-FR_Vlq_C.js} +801 -755
- package/dist/{DocFormSend-DKAqaT50.js → DocFormSend-DcSv3JNg.js} +18 -15
- package/dist/{DocLinks-DFUO03dk.js → DocLinks-Bvhc62aJ.js} +2 -2
- package/dist/{DocModalBase-QZosNhiK.js → DocModalBase-DkfUBRi3.js} +2 -2
- package/dist/{DocPrint--T278pDE.js → DocPrint-BrKY6rOy.js} +3 -3
- package/dist/{DocReceipt-CPg45_I7.js → DocReceipt-oGrM6t_k.js} +29 -22
- package/dist/{DocSendReminder-DQAaiUrs.js → DocSendReminder-veEC_yHK.js} +19 -16
- package/dist/{DocTextEditor-CM1f8eMD.js → DocTextEditor-CNRwxPEx.js} +72 -70
- package/dist/{DocTimeline-Ce0OZgGP.js → DocTimeline-e2Xf_QZ7.js} +38 -34
- package/dist/{DocumentClient-DHU-Rg3r.js → DocumentClient-Dx4Uyxkh.js} +5 -5
- package/dist/{DocumentLayout-GYCBw2F_.js → DocumentLayout-DmjmsTcx.js} +1506 -1538
- package/dist/{DocumentLogotype-Cilc0ElE.js → DocumentLogotype-ddYHM9wn.js} +25 -20
- package/dist/{DocumentVoided-BH8pkv85.js → DocumentVoided-WCk7XuxH.js} +1 -1
- package/dist/{EmbedInput-lMSVQSey.js → EmbedInput-CMueXdFs.js} +25 -21
- package/dist/{EmbedSettings-D65Y2AZL.js → EmbedSettings-BRuLCWr0.js} +13 -11
- package/dist/{ErrorCallout-BBNHzuhf.js → ErrorCallout-CDtZceLU.js} +6 -6
- package/dist/{FilePreviewModal-iPIuaIor.js → FilePreviewModal-BzAUuY58.js} +3 -3
- package/dist/Flag-DkJgyDQK.js +46 -0
- package/dist/{HeaderSettings-WKUIBCfF.js → HeaderSettings-CoKK5Mbt.js} +159 -110
- package/dist/{ImageSelectModal-BTMFM3o9.js → ImageSelectModal-De64vGSr.js} +15 -13
- package/dist/{ImageUploadWrapper-BaLjUZF5.js → ImageUploadWrapper-CE6KTze0.js} +3 -3
- package/dist/{Index-DS1PwlDq.js → Index-50KxppUS.js} +4 -4
- package/dist/{Index-DJeZiYxr.js → Index-B7vVIRFn.js} +7 -7
- package/dist/{Index-ivhPuQy5.js → Index-BUQ75xOU.js} +6 -6
- package/dist/{Index-BUEXgHEE.js → Index-BVKCCkQY.js} +57 -50
- package/dist/{Index-BBTn35Kj.js → Index-BiGT3iEX.js} +21 -17
- package/dist/{Index-B-UWz1IM.js → Index-BoDKKVvL.js} +4 -4
- package/dist/{Index-DrSgVUyo.js → Index-BotY9nbP.js} +2 -2
- package/dist/{Index-B-YqdbQX.js → Index-BwaJW9CY.js} +3 -3
- package/dist/{Index-BepvyGqo.js → Index-ByqCyUgx.js} +9 -9
- package/dist/{Index-Bsv15ctO.js → Index-C7pge7E9.js} +23 -21
- package/dist/{Index-CEaZgZqg.js → Index-CBRJ-AZi.js} +2 -2
- package/dist/{Index-GrrsUUz1.js → Index-CFQMtx5w.js} +5 -5
- package/dist/{Index-CtQo0b8t.js → Index-CJKyHWiO.js} +15 -15
- package/dist/{Index-Dv1fkHWQ.js → Index-CK_5l1kP.js} +2 -2
- package/dist/{Index-BVt3pj58.js → Index-CLc_11Bc.js} +276 -232
- package/dist/{Index-cPIqnY80.js → Index-CTokKHJA.js} +5 -5
- package/dist/Index-Cf45UGbc.js +28 -0
- package/dist/{Index-B51tj7qY.js → Index-CfLPq-yA.js} +5 -5
- package/dist/{Index-B_ta4yT_.js → Index-Ci7y3O0G.js} +7 -7
- package/dist/{Index-ZKkQzVOj.js → Index-CmV8oF4Q.js} +4 -4
- package/dist/{Index-C6tGNKAk.js → Index-CoRuYEYW.js} +5 -5
- package/dist/Index-CtKNyVUB.js +56 -0
- package/dist/{Index-rL3fz1Ew.js → Index-DCf6_Zd2.js} +2 -2
- package/dist/{Index-CEHhYmLe.js → Index-DGdlZzVO.js} +7 -7
- package/dist/{Index-B5XaBVyJ.js → Index-DbKB8sTh.js} +18 -12
- package/dist/{Index-9PMrT3eB.js → Index-DgBOq2MJ.js} +3 -3
- package/dist/{Index-BBOJRRgx.js → Index-DvNxOHHu.js} +6 -6
- package/dist/{Index-DS7xellB.js → Index-M2Mce2_m.js} +124 -123
- package/dist/{Index-2PGn8Pnv.js → Index-QMkjG7hk.js} +4 -4
- package/dist/{Index-oKRUWCcJ.js → Index-QmX5pv-V.js} +17 -15
- package/dist/{Index-0aZtDWyk.js → Index-h5xDFYM9.js} +4 -4
- package/dist/{Index-CtZMlBfK.js → Index-hkGYloih.js} +5 -5
- package/dist/{Index-DK3b6Cv-.js → Index-q3gLm4b1.js} +6 -6
- package/dist/{Index-BQ3kapHk.js → Index-sqI1TF7Z.js} +2 -2
- package/dist/{InputToggleRow-CJF0vwk3.js → InputToggleRow-DLFIMIdx.js} +2 -2
- package/dist/{ManualPopover-CEF7LMpn.js → ManualPopover-Cf8DotlW.js} +13 -11
- package/dist/{MediaWrapper-CM6vWCoZ.js → MediaWrapper-BgWmA3kS.js} +3 -3
- package/dist/{NotBindingText-Cee9yA0M.js → NotBindingText-DhsHxvkX.js} +2 -2
- package/dist/{PackageGroup-CFXogKPM.js → PackageGroup-EbOSxv69.js} +26 -20
- package/dist/PdfTerms-im6uTd5E.js +31 -0
- package/dist/{PdfViewer-Cd0Jm2VB.js → PdfViewer-DY0rcZjo.js} +22 -22
- package/dist/{PlainHtml-CucWAcOU.js → PlainHtml-o031pfp-.js} +1 -1
- package/dist/{PriceHeader-DdMZUaq5.js → PriceHeader-NdFa0Sqs.js} +15 -15
- package/dist/{SearchApi-knNqVduO.js → SearchApi-Bw5E9IPj.js} +2 -2
- package/dist/SendForm-BDY5VDkS.js +1023 -0
- package/dist/{Setup-7HIAWuiK.js → Setup-BsYqPmOm.js} +1 -1
- package/dist/{SmartList-cSmGbybV.js → SmartList-CP2wHig-.js} +1 -1
- package/dist/{TermsSettings-CAB-08E3.js → TermsSettings-CUlSayCJ.js} +20 -13
- package/dist/{ThemeColorRow-DxcMvBGq.js → ThemeColorRow-D3fav4Sl.js} +14 -12
- package/dist/ToggleBinding-B715OVl2.js +42 -0
- package/dist/{UploadModal-CvoSMExA.js → UploadModal-THDJ-UNp.js} +6 -6
- package/dist/{VideoPlayerInput-X5baUH3q.js → VideoPlayerInput-Cm3KoRnR.js} +15 -11
- package/dist/{VideoPlayerSettings-DsIvpufB.js → VideoPlayerSettings-BFAjczuw.js} +3 -3
- package/dist/VideoSelectModal-CzO8EMg9.js +104 -0
- package/dist/{answerDocumentMixin-B8HB1WAX.js → answerDocumentMixin-D12xJRhx.js} +3 -3
- package/dist/{debounce-B2lqFJg2.js → debounce-DLiv1sQX.js} +16 -16
- package/dist/{focusDrawerMixin-B2djM7ql.js → focusDrawerMixin-khaScuSu.js} +1 -1
- package/dist/{formDrawerState-CchCpZRc.js → formDrawerState-CJ6kjaD_.js} +1 -1
- package/dist/{formValidationMixin-Dz9Mabvi.js → formValidationMixin-Bri1WflH.js} +1 -1
- package/dist/{index-Dk6sZCYv.js → index-B0Zu30kF.js} +2 -2
- package/dist/{index-twnaU4rC.js → index-C1Ngv-v3.js} +1 -1
- package/dist/{index-BCrDgR_4.js → index-CMT3coT-.js} +785 -2001
- package/dist/{index-H1Kx9sJM.js → index-DJOUQneq.js} +42 -38
- package/dist/{index-BaGtbWcA.js → index-DLa3QER7.js} +18 -17
- package/dist/{index-kV9OZ5y0.js → index-Dygy9XlG.js} +1 -1
- package/dist/index.es.js +10 -10
- package/dist/index.umd.js +179 -175
- package/dist/{main-CerYX9PA.js → main-U22_wtg0.js} +13008 -11358
- package/dist/{mapFormMixin-Hj1Y7rVt.js → mapFormMixin-BZf4RJIE.js} +1 -1
- package/dist/omit-RBXmF_Fo.js +31 -0
- package/dist/{publicSenderState-t7Gu53cA.js → publicSenderState-DKuvxj4_.js} +1 -1
- package/dist/regions-BdZt9Srn.js +1250 -0
- package/dist/simplebar.min-Bnrne5ZK.js +71 -0
- package/dist/style.css +2 -2
- package/dist/{throttle-B8hI9bkk.js → throttle-Fkuqk26x.js} +2 -2
- package/dist/{tinycolor-BaK26Ky-.js → tinycolor-BZ8wGctU.js} +1 -1
- package/dist/{tippy.esm-BuWRbveV.js → tippy.esm-BJe845c1.js} +246 -240
- package/dist/{utils-Pmm0DT8o.js → utils-BOWVR87A.js} +1 -1
- package/dist/{vuedraggable.umd-Besz6Tlv.js → vuedraggable.umd-CJL8TWxZ.js} +1 -1
- package/package.json +2 -11
- package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
- package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
- package/dist/ClientAutocomplete-DyXQEfcS.js +0 -78
- package/dist/CoverBlockSettings-7Ivt9zN0.js +0 -275
- package/dist/Flag-CwnrA4SV.js +0 -114
- package/dist/Index-B0pgh8nR.js +0 -21
- package/dist/Index-Ccx9wHcb.js +0 -52
- package/dist/PdfTerms-ChtDfzne.js +0 -36
- package/dist/ToggleBinding-CTTYdrkp.js +0 -38
- package/dist/VideoSelectModal-VMcSU3bM.js +0 -100
- package/dist/formComponentsInstall-CdjgjI6y.js +0 -2495
- package/dist/omit-DGBewD2h.js +0 -31
|
@@ -0,0 +1,1023 @@
|
|
|
1
|
+
import { m as d } from "./mapFormMixin-BZf4RJIE.js";
|
|
2
|
+
import { I as S, a as w } from "./index-CMT3coT-.js";
|
|
3
|
+
import { aB as u, h as $, n as o, b as l, aC as b, v as k, z as D, aD as g, aE as M } from "./main-U22_wtg0.js";
|
|
4
|
+
import { B as f } from "./BaseDatePicker-DxL2l3QC.js";
|
|
5
|
+
import { C as h, a as y, b as F } from "./CDropdownItem-DiLisSei.js";
|
|
6
|
+
import { E as A } from "./ErrorCallout-CDtZceLU.js";
|
|
7
|
+
import { C as O, a as I } from "./ClientModal-DNcf4APF.js";
|
|
8
|
+
import { s as B } from "./simplebar.min-Bnrne5ZK.js";
|
|
9
|
+
import { b as P, m as c } from "./vuex.esm-DKGl8mcw.js";
|
|
10
|
+
import V from "./AddClientCallout-CrZF5j7A.js";
|
|
11
|
+
function _(n, e) {
|
|
12
|
+
const t = new Date(n.getTime());
|
|
13
|
+
return t.setDate(
|
|
14
|
+
n.getDate() + (7 + e - n.getDay() - 1) % 7 + 1
|
|
15
|
+
), t.setHours(8, 0, 0, 0), t;
|
|
16
|
+
}
|
|
17
|
+
function C(n) {
|
|
18
|
+
const e = new Date(n.getTime());
|
|
19
|
+
return e.setDate(e.getDate() + 1), e.setHours(10, 0, 0, 0), e;
|
|
20
|
+
}
|
|
21
|
+
let p = C(/* @__PURE__ */ new Date()), v = _(/* @__PURE__ */ new Date(), 1);
|
|
22
|
+
const R = {
|
|
23
|
+
name: "DocumentSendLater",
|
|
24
|
+
i18nOptions: {
|
|
25
|
+
namespaces: "documentSendLater",
|
|
26
|
+
messages: {
|
|
27
|
+
en: {
|
|
28
|
+
title: "Schedule Delivery",
|
|
29
|
+
tomorrowMorning: "Tomorrow morning",
|
|
30
|
+
mondayMorning: "Monday morning",
|
|
31
|
+
custom: {
|
|
32
|
+
title: "Set time & date",
|
|
33
|
+
invalid: "Time & date can't be in the past"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
sv: {
|
|
37
|
+
title: "Skicka med schemaläggning",
|
|
38
|
+
tomorrowMorning: "Imorgon förmiddag",
|
|
39
|
+
mondayMorning: "Måndag morgon",
|
|
40
|
+
custom: {
|
|
41
|
+
title: "Välj datum & tid",
|
|
42
|
+
invalid: "Välj en tid & datum längre fram i tiden."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
components: {
|
|
48
|
+
BaseDatePicker: f
|
|
49
|
+
},
|
|
50
|
+
props: {
|
|
51
|
+
_document: {
|
|
52
|
+
type: Object,
|
|
53
|
+
default: () => ({})
|
|
54
|
+
},
|
|
55
|
+
setFormValue: {
|
|
56
|
+
type: Function,
|
|
57
|
+
required: !0
|
|
58
|
+
},
|
|
59
|
+
removeFormValue: {
|
|
60
|
+
type: Function,
|
|
61
|
+
required: !0
|
|
62
|
+
},
|
|
63
|
+
onSaveDocument: {
|
|
64
|
+
type: Function,
|
|
65
|
+
required: !0
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
data() {
|
|
69
|
+
return {
|
|
70
|
+
sendAt: u(/* @__PURE__ */ new Date(), 5).toISOString(),
|
|
71
|
+
showCustom: !1,
|
|
72
|
+
backupSentFlag: !1
|
|
73
|
+
// needed since doc/project flags not instant on double clicks
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
validations: {
|
|
77
|
+
sendAt: {
|
|
78
|
+
minValue: (n) => n > u(/* @__PURE__ */ new Date(), 2).toISOString()
|
|
79
|
+
// two minutes as safety
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
computed: {
|
|
83
|
+
...P("forms", {
|
|
84
|
+
formData: (n) => n.document2.data
|
|
85
|
+
}),
|
|
86
|
+
...c({
|
|
87
|
+
deliveryTypes: "forms/deliveryTypes",
|
|
88
|
+
isPostingDocument: "documents2/isPosting",
|
|
89
|
+
feature: "application/feature"
|
|
90
|
+
}),
|
|
91
|
+
tomorrowMorning() {
|
|
92
|
+
return p.toISOString();
|
|
93
|
+
},
|
|
94
|
+
mondayMorning() {
|
|
95
|
+
return v.toISOString();
|
|
96
|
+
},
|
|
97
|
+
reminderDeliveryTypes() {
|
|
98
|
+
const n = ["email"];
|
|
99
|
+
return this.feature("sms") && n.push("sms"), this.deliveryTypes ? [
|
|
100
|
+
...this.deliveryTypes.sms && this.feature("sms") ? ["sms"] : [],
|
|
101
|
+
...this.deliveryTypes.email ? ["email"] : []
|
|
102
|
+
] : n;
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
created() {
|
|
106
|
+
p = C(/* @__PURE__ */ new Date()), v = _(/* @__PURE__ */ new Date(), 1);
|
|
107
|
+
},
|
|
108
|
+
methods: {
|
|
109
|
+
setTime(n) {
|
|
110
|
+
const e = n.split(":"), t = new Date(this.sendAt).setHours(e[0], e[1]);
|
|
111
|
+
t && (this.sendAt = new Date(t).toISOString());
|
|
112
|
+
},
|
|
113
|
+
setDate(n) {
|
|
114
|
+
const e = new Date(this.sendAt), t = new Date(n).setHours(e.getHours(), e.getMinutes());
|
|
115
|
+
this.sendAt = new Date(t).toISOString();
|
|
116
|
+
},
|
|
117
|
+
async onSendAt(n) {
|
|
118
|
+
try {
|
|
119
|
+
if (this.$v.$invalid || this.isPostingDocument || this.backupSentFlag)
|
|
120
|
+
return;
|
|
121
|
+
this.backupSentFlag = !0;
|
|
122
|
+
const e = {
|
|
123
|
+
type: "first",
|
|
124
|
+
status: "new",
|
|
125
|
+
sendDays: 0,
|
|
126
|
+
sendAt: n,
|
|
127
|
+
deliveryTypes: this.reminderDeliveryTypes,
|
|
128
|
+
tries: 0
|
|
129
|
+
}, t = this.formData.reminders.findIndex(
|
|
130
|
+
(i) => i.type === "first"
|
|
131
|
+
), s = t >= 0 ? `data.reminders[${t}]` : "data.reminders";
|
|
132
|
+
this.setFormValue({ key: s, value: e }), await this.onSaveDocument({ doSend: !0 }), this.backupSentFlag = !1;
|
|
133
|
+
} catch (e) {
|
|
134
|
+
$(e);
|
|
135
|
+
} finally {
|
|
136
|
+
this.backupSentFlag = !1;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
var z = function() {
|
|
142
|
+
var e = this, t = e._self._c;
|
|
143
|
+
return t("div", { staticClass: "overflow-hidden rounded-xl bg-white" }, [t("div", { staticClass: "px-6 pb-3 pt-8" }, [t("div", { staticClass: "text-md text-center font-semibold" }, [e._v(" " + e._s(e.$t("title")) + " ")]), t("div", { staticClass: "pt-8" }, e._l([
|
|
144
|
+
[e.tomorrowMorning, "tomorrowMorning"],
|
|
145
|
+
[e.mondayMorning, "mondayMorning"]
|
|
146
|
+
], function(s, i) {
|
|
147
|
+
return t("div", { key: i, staticClass: "mb-4 flex cursor-pointer select-none items-center justify-between rounded-md border border-gray-200 bg-gray-50 p-4 text-sm hover:border-gray-300 hover:bg-gray-100 active:border-gray-400 active:bg-gray-200", on: { click: () => e.onSendAt(s[0]) } }, [t("div", { staticClass: "font-medium" }, [e._v(e._s(e.$t(s[1])))]), t("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$formatDate(s[0], "p, d MMM")) + " ")])]);
|
|
148
|
+
}), 0)]), t("div", { staticClass: "border-t border-gray-200 bg-gray-100 px-8 py-6", class: e.showCustom ? "" : "cursor-pointer hover:bg-gray-200", on: { click: function(s) {
|
|
149
|
+
e.showCustom = !0;
|
|
150
|
+
} } }, [t("div", { staticClass: "flex items-center text-sm" }, [t("CIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar", size: "18" } }), t("div", { staticClass: "font-medium", domProps: { textContent: e._s(e.$t("custom.title")) } })], 1), t("Animation", [t("div", { directives: [{ name: "show", rawName: "v-show", value: e.showCustom, expression: "showCustom" }], staticClass: "mt-4" }, [t("div", { staticClass: "grid grid-cols-2 gap-4" }, [t("BaseDatePicker", { attrs: { value: e.sendAt }, on: { input: e.setDate } }), t("CInput", { attrs: { value: e.$formatDate(e.sendAt, "HH:mm"), type: "time" }, on: { input: e.setTime } })], 1), e.$v.$invalid ? t("div", { staticClass: "error-wrapper" }, [t("CIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar" } }), e._v(" " + e._s(e.$t("custom.invalid")) + " ")], 1) : e._e(), t("CButton", { staticStyle: { "margin-top": "calc(1.5 * var(--rem))" }, attrs: { loading: e.isPostingDocument, type: "secondary", wide: "" }, on: { click: function(s) {
|
|
151
|
+
return e.onSendAt(e.sendAt);
|
|
152
|
+
} } }, [e._v(" " + e._s(e.$t("_common:send")) + " " + e._s(e.$formatDate(e.sendAt, "d MMM - p")) + " ")])], 1)])], 1)]);
|
|
153
|
+
}, T = [], E = /* @__PURE__ */ o(
|
|
154
|
+
R,
|
|
155
|
+
z,
|
|
156
|
+
T,
|
|
157
|
+
!1,
|
|
158
|
+
null,
|
|
159
|
+
"09b0e21d"
|
|
160
|
+
);
|
|
161
|
+
const N = E.exports, L = {
|
|
162
|
+
sv: {
|
|
163
|
+
title: "Skicka dokument",
|
|
164
|
+
nameLabel: "Dokumentnamn",
|
|
165
|
+
namePlaceholder: "Namn",
|
|
166
|
+
sendAs: "Skicka som",
|
|
167
|
+
validityPeriod: "Giltighetstid",
|
|
168
|
+
manualDelivery: "Manuell leverans",
|
|
169
|
+
manualDeliveryTooltip: "Skicka ut dokument till din mottagare själv. Du kan dela en länk eller en PDF.",
|
|
170
|
+
scheduledTooltip: "Schemalägg utskick",
|
|
171
|
+
clientsAreMissingContactInfo: "En eller flera mottagare saknar e-post eller mobiltelefon-nr. Dokumentet kommer inte att kunna skickas till dem.",
|
|
172
|
+
missingDeliveryMethod: "Välj en eller fler leveransmetoder",
|
|
173
|
+
sendButton: "Skicka dokument",
|
|
174
|
+
signMethod: {
|
|
175
|
+
title: "Signeringsmetod",
|
|
176
|
+
tooltip: "Hur ska din mottagare signera?",
|
|
177
|
+
button: {
|
|
178
|
+
title: "Standard - knapptryck",
|
|
179
|
+
content: "Bevisnivå: IP-adress, tidpunkt och enhet."
|
|
180
|
+
},
|
|
181
|
+
bankId: {
|
|
182
|
+
title: "BankId",
|
|
183
|
+
content: "Samma säkerhetsgrad som bankerna har."
|
|
184
|
+
},
|
|
185
|
+
signature: {
|
|
186
|
+
title: "Standard",
|
|
187
|
+
content: "Bevisnivå: IP-adress, tidpunkt och enhet."
|
|
188
|
+
},
|
|
189
|
+
inPerson: {
|
|
190
|
+
title: "Fysisk underskrift",
|
|
191
|
+
content: "Signatur på utskrivet dokument"
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
en: {
|
|
196
|
+
title: "Send document",
|
|
197
|
+
nameLabel: "Document name",
|
|
198
|
+
namePlaceholder: "Name",
|
|
199
|
+
sendAs: "Send as",
|
|
200
|
+
validityPeriod: "Expiration",
|
|
201
|
+
manualDelivery: "Manual delivery",
|
|
202
|
+
manualDeliveryTooltip: "Share the document with your recipient yourself. You can share a link or a PDF.",
|
|
203
|
+
scheduledTooltip: "Schedule delivery",
|
|
204
|
+
clientsAreMissingContactInfo: "Note that one or more recipients are missing an email or cellphone number. The document will not be sent to them.",
|
|
205
|
+
missingDeliveryMethod: "Please select one or more delivery methods",
|
|
206
|
+
sendButton: "Send document",
|
|
207
|
+
signMethod: {
|
|
208
|
+
title: "Signing method",
|
|
209
|
+
tooltip: "How do you want your client to sign?",
|
|
210
|
+
button: {
|
|
211
|
+
title: "Standard - button",
|
|
212
|
+
content: "Level of proof: IP address, timestamp and device."
|
|
213
|
+
},
|
|
214
|
+
bankId: {
|
|
215
|
+
title: "BankID",
|
|
216
|
+
content: "Same level of proof as the banks use."
|
|
217
|
+
},
|
|
218
|
+
signature: {
|
|
219
|
+
title: "Signature",
|
|
220
|
+
content: "Level of proof: IP address, timestamp and device."
|
|
221
|
+
},
|
|
222
|
+
inPerson: {
|
|
223
|
+
title: "In person",
|
|
224
|
+
content: "Signature on print document"
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}, j = {
|
|
229
|
+
sv: {
|
|
230
|
+
addFirstButton: "Lägg till mottagare",
|
|
231
|
+
addButton: "Lägg till mottagare",
|
|
232
|
+
signOrder: {
|
|
233
|
+
label: "Signeringsordning",
|
|
234
|
+
tooltip: "Signeringsordning låter dig bestämma i vilken ordning dina mottagare tar emot och signerar dokumentet."
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
en: {
|
|
238
|
+
addFirstButton: "Add recipient",
|
|
239
|
+
addButton: "Add recipient",
|
|
240
|
+
signOrder: {
|
|
241
|
+
label: "Signing order",
|
|
242
|
+
tooltip: "Signing order lets you decide the order in which your recipients receive and sign your documents."
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
}, H = {
|
|
246
|
+
name: "ClientSendListItem",
|
|
247
|
+
components: {
|
|
248
|
+
CDropdown: h
|
|
249
|
+
},
|
|
250
|
+
props: {
|
|
251
|
+
client: {
|
|
252
|
+
type: Object,
|
|
253
|
+
default: () => ({})
|
|
254
|
+
},
|
|
255
|
+
isOrder: {
|
|
256
|
+
type: Boolean,
|
|
257
|
+
default: !1
|
|
258
|
+
},
|
|
259
|
+
isSender: {
|
|
260
|
+
type: Boolean,
|
|
261
|
+
default: !1
|
|
262
|
+
},
|
|
263
|
+
compact: {
|
|
264
|
+
type: Boolean,
|
|
265
|
+
default: !1
|
|
266
|
+
},
|
|
267
|
+
allowEditClients: {
|
|
268
|
+
type: Boolean,
|
|
269
|
+
default: !0
|
|
270
|
+
},
|
|
271
|
+
rightButton: {
|
|
272
|
+
// TODO temporary in order to disable sender sign for widget context
|
|
273
|
+
type: Boolean,
|
|
274
|
+
default: !0
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
data() {
|
|
278
|
+
return {
|
|
279
|
+
isHover: !1,
|
|
280
|
+
isDropdownOpen: !1
|
|
281
|
+
};
|
|
282
|
+
},
|
|
283
|
+
methods: {
|
|
284
|
+
onClick() {
|
|
285
|
+
var n;
|
|
286
|
+
if (this.rightButton && this.isSender)
|
|
287
|
+
return (n = this.$refs.dropdown) == null ? void 0 : n.toggle();
|
|
288
|
+
this.allowEditClients && this.$emit("open");
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
};
|
|
292
|
+
var q = function() {
|
|
293
|
+
var s;
|
|
294
|
+
var e = this, t = e._self._c;
|
|
295
|
+
return t("div", { staticClass: "rc-card flex items-center", class: {
|
|
296
|
+
"is-hover": e.isHover,
|
|
297
|
+
"has-controls": e.isOrder
|
|
298
|
+
}, staticStyle: { "padding-left": "8px" }, on: { click: e.onClick, "&mouseover": function(i) {
|
|
299
|
+
e.isHover = !0;
|
|
300
|
+
}, "&mouseleave": function(i) {
|
|
301
|
+
e.isHover = !1;
|
|
302
|
+
} } }, [e.compact ? t("div", { staticStyle: { "font-size": "14px" } }, [t("div", [e._v(e._s(e.client.name || e.client.companyName))]), e.client.name && e.client.companyName ? t("div", { staticStyle: { "font-size": "12px", "font-weight": "500" } }, [e._v(" " + e._s(e.client.companyName) + " ")]) : e._e(), e.client.documentRole ? t("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "13px", "margin-top": "4px" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.isOrder ? t("div", { staticClass: "compact-order" }, [t("CIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-up" }, on: { click: function(i) {
|
|
303
|
+
return i.preventDefault(), i.stopPropagation(), e.$emit("move", -1);
|
|
304
|
+
} } }), t("div", { staticClass: "rc-order", staticStyle: { width: "20px", height: "20px" } }, [e._v(" " + e._s(e.client.signOrder) + " ")]), t("CIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-down" }, on: { click: function(i) {
|
|
305
|
+
return i.preventDefault(), i.stopPropagation(), e.$emit("move", 1);
|
|
306
|
+
} } })], 1) : e._e()]) : [t("div", { staticStyle: { width: "34px", flex: "0 0 34px", display: "inline-flex", "justify-content": "center" } }, [e.isOrder ? t("div", { staticStyle: { position: "relative", display: "inline-block" } }, [t("CButton", { staticClass: "rc-order__button up", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "minus" }, on: { click: function(i) {
|
|
307
|
+
return i.preventDefault(), i.stopPropagation(), e.$emit("move", -1);
|
|
308
|
+
} } }), t("CButton", { staticClass: "rc-order__button down", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "plus" }, on: { click: function(i) {
|
|
309
|
+
return i.preventDefault(), i.stopPropagation(), e.$emit("move", 1);
|
|
310
|
+
} } }), t("div", { staticClass: "rc-order" }, [e._v(" " + e._s(e.client.signOrder) + " ")])], 1) : t("CIcon", { staticClass: "text-primary-500", staticStyle: { "margin-right": "8px", flex: "0 0 18px" }, attrs: { type: e.isSender ? "send" : ["signee", "approver"].includes(e.client.documentRole) ? "pen-tool" : "eye", size: "18" } })], 1), t("div", { staticClass: "rc-data truncate-text" }, [e.client.name || e.client.companyName ? t("div", { staticStyle: { "font-weight": "500" } }, [e._v(" " + e._s(e.client.name || e.client.companyName) + " ")]) : e.isSender ? t("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:empty", { thing: e.$t("_common:reference") })) + " ")]) : t("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:missing", { thing: e.$t("_common:name") })) + " ")]), t("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "12px" } }, [e.isSender ? [e.isSender ? t("span", [e._v(" " + e._s(e.$t("_common:documentRole.sender.description")) + " ")]) : e._e(), e.client.documentRole === "signee" ? t("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e()] : [((s = e.client.answerMethod) == null ? void 0 : s.accept) === "inPerson" ? t("span", { staticClass: "text-red-500" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + ": "), t("span", [e._v(" " + e._s(e.$t("_common:signMethod.inPerson")) + " ")])]) : e._e(), e.client.documentRole ? t("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.client.email ? t("span", [e._v(e._s(e.client.email))]) : e._e(), e.client.cellphone ? t("span", [e._v(e._s(e.client.cellphone))]) : e._e()]], 2)])], e.rightButton ? t("transition", { attrs: { name: "fade-100" } }, [e.isHover || e.isDropdownOpen ? [e.isSender ? t("CDropdown", { ref: "dropdown", staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { position: "is-bottom-left", "menu-styling": {
|
|
311
|
+
minWidth: "220px"
|
|
312
|
+
}, "append-to-body": "" }, on: { "active-change": function(i) {
|
|
313
|
+
e.isDropdownOpen = i;
|
|
314
|
+
} }, nativeOn: { click: function(i) {
|
|
315
|
+
i.stopPropagation();
|
|
316
|
+
} }, scopedSlots: e._u([{ key: "trigger", fn: function() {
|
|
317
|
+
return [t("CButton", { attrs: { circle: "", size: "small", type: "none", pattern: "secondary", raised: "", icon: "more-horizontal" } })];
|
|
318
|
+
}, proxy: !0 }], null, !1, 383536082) }, [e._t("dropdownOptions")], 2) : e.allowEditClients ? t("CButton", { staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { circle: "", size: "small", icon: "x", type: "none", pattern: "secondary", raised: "" }, on: { click: function(i) {
|
|
319
|
+
return i.stopPropagation(), e.$emit("remove");
|
|
320
|
+
} } }) : e._e()] : e._e()], 2) : e._e()], 2);
|
|
321
|
+
}, K = [], W = /* @__PURE__ */ o(
|
|
322
|
+
H,
|
|
323
|
+
q,
|
|
324
|
+
K,
|
|
325
|
+
!1,
|
|
326
|
+
null,
|
|
327
|
+
"3c817872"
|
|
328
|
+
);
|
|
329
|
+
const x = W.exports, G = {
|
|
330
|
+
name: "SenderBlockItem",
|
|
331
|
+
i18nOptions: {
|
|
332
|
+
namespaces: "senderBlockItem",
|
|
333
|
+
messages: {
|
|
334
|
+
en: {
|
|
335
|
+
toggle: {
|
|
336
|
+
label: "Sign the document",
|
|
337
|
+
description: "Toggle to add your own signature to the document."
|
|
338
|
+
}
|
|
339
|
+
},
|
|
340
|
+
sv: {
|
|
341
|
+
toggle: {
|
|
342
|
+
label: "Signera dokumentet",
|
|
343
|
+
description: "Aktivera för att lägga till din signatur på dokumentet."
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
},
|
|
348
|
+
components: {
|
|
349
|
+
RecipientBlockItem: x,
|
|
350
|
+
CDropdownItem: y
|
|
351
|
+
},
|
|
352
|
+
mixins: [
|
|
353
|
+
d(["senderClient"], {
|
|
354
|
+
useEmit: !1,
|
|
355
|
+
setFnName: "setFormValue"
|
|
356
|
+
})
|
|
357
|
+
],
|
|
358
|
+
inject: {
|
|
359
|
+
allowSenderSign: {
|
|
360
|
+
default: !0
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
props: {
|
|
364
|
+
setFormValue: {
|
|
365
|
+
type: Function,
|
|
366
|
+
required: !0
|
|
367
|
+
},
|
|
368
|
+
defaultAddSenderClient: {
|
|
369
|
+
type: Boolean,
|
|
370
|
+
default: !1
|
|
371
|
+
}
|
|
372
|
+
},
|
|
373
|
+
data() {
|
|
374
|
+
return {
|
|
375
|
+
senderClientData: null
|
|
376
|
+
};
|
|
377
|
+
},
|
|
378
|
+
computed: {
|
|
379
|
+
...c({
|
|
380
|
+
feature: "application/feature"
|
|
381
|
+
})
|
|
382
|
+
},
|
|
383
|
+
created() {
|
|
384
|
+
this.generateSenderClient(), this._document.id || this._document.isDirty("senderClient") ? this.toggleSenderSign(!!this.senderClient) : this.defaultAddSenderClient && this.toggleSenderSign(!0);
|
|
385
|
+
},
|
|
386
|
+
methods: {
|
|
387
|
+
get: l,
|
|
388
|
+
generateSenderClient() {
|
|
389
|
+
const { company: n, user: e } = this._document.sender || {}, t = l(
|
|
390
|
+
this._document,
|
|
391
|
+
"data.defaultAnswerMethod"
|
|
392
|
+
);
|
|
393
|
+
this.senderClientData = {
|
|
394
|
+
...b(),
|
|
395
|
+
documentRole: "recipient",
|
|
396
|
+
...t && { answerMethod: t },
|
|
397
|
+
...this.senderClient,
|
|
398
|
+
// latest sender values in the document
|
|
399
|
+
type: "company",
|
|
400
|
+
companyName: n.name,
|
|
401
|
+
name: e.name,
|
|
402
|
+
email: e.email,
|
|
403
|
+
cellphone: e.cellphone
|
|
404
|
+
};
|
|
405
|
+
},
|
|
406
|
+
toggleSenderSign(n) {
|
|
407
|
+
this.senderClientData.documentRole = n ? "signee" : "recipient", this.senderClient = n ? this.senderClientData : null, this._document.setDirty("senderClient");
|
|
408
|
+
},
|
|
409
|
+
setSenderMethod(n) {
|
|
410
|
+
const e = {
|
|
411
|
+
...this.senderClient,
|
|
412
|
+
answerMethod: {
|
|
413
|
+
accept: n,
|
|
414
|
+
deny: "button"
|
|
415
|
+
}
|
|
416
|
+
};
|
|
417
|
+
this.senderClient = e, this.senderClientData = { ...e };
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
var Y = function() {
|
|
422
|
+
var e = this, t = e._self._c;
|
|
423
|
+
return e.senderClientData ? t("RecipientBlockItem", { staticClass: "first-of-group last-of-group", staticStyle: { display: "inline-flex", width: "auto", "padding-right": "2em", "min-width": "220px" }, attrs: { client: e.senderClientData, "right-button": e.allowSenderSign, "is-sender": !0 }, scopedSlots: e._u([{ key: "dropdownOptions", fn: function() {
|
|
424
|
+
return [t("CDropdownItem", { attrs: { value: !!e.senderClient, "close-on-click": !1, toggle: "" }, on: { input: e.toggleSenderSign } }, [e._v(" " + e._s(e.$t("toggle.label")) + " ")]), e.senderClient ? [t("CDropdownItem", { attrs: { separator: "" } }), t("div", { staticClass: "text-gray-400", staticStyle: { "font-size": "13px", padding: "calc(0.5 * var(--rem)) 0 calc(0.25 * var(--rem))", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + " ")]), e._l([
|
|
425
|
+
"login",
|
|
426
|
+
"signature",
|
|
427
|
+
...e.feature("bankId") ? ["bankId"] : []
|
|
428
|
+
], function(s) {
|
|
429
|
+
return t("CDropdownItem", { key: s, attrs: { "icon-right": e.get(e.senderClient, "answerMethod.accept") === s ? "check" : "" }, on: { click: function(i) {
|
|
430
|
+
return e.setSenderMethod(s);
|
|
431
|
+
} } }, [e._v(" " + e._s(e.$t(`_common:signMethod.${s}`)) + " ")]);
|
|
432
|
+
})] : t("div", { staticClass: "bg-gray-100 text-gray-700", staticStyle: { padding: "calc(0.5 * var(--rem))", margin: "calc(0.5 * var(--rem))", "font-size": "13px", "border-radius": "4px", "line-height": "1.25", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("toggle.description")) + " ")])];
|
|
433
|
+
}, proxy: !0 }], null, !1, 407561968) }) : e._e();
|
|
434
|
+
}, J = [], Q = /* @__PURE__ */ o(
|
|
435
|
+
G,
|
|
436
|
+
Y,
|
|
437
|
+
J,
|
|
438
|
+
!1,
|
|
439
|
+
null,
|
|
440
|
+
"427538ca"
|
|
441
|
+
);
|
|
442
|
+
const X = Q.exports, Z = {
|
|
443
|
+
name: "RecipientBlock",
|
|
444
|
+
i18nOptions: {
|
|
445
|
+
namespaces: "recipientBlock",
|
|
446
|
+
messages: j
|
|
447
|
+
},
|
|
448
|
+
components: {
|
|
449
|
+
AddClientCallout: V,
|
|
450
|
+
RecipientBlockItem: x,
|
|
451
|
+
SenderBlockItem: X,
|
|
452
|
+
CSwitch: F
|
|
453
|
+
},
|
|
454
|
+
mixins: [
|
|
455
|
+
d(["clients"], {
|
|
456
|
+
useEmit: !1,
|
|
457
|
+
setFnName: "setFormValue"
|
|
458
|
+
})
|
|
459
|
+
],
|
|
460
|
+
props: {
|
|
461
|
+
compact: {
|
|
462
|
+
type: Boolean,
|
|
463
|
+
default: !1
|
|
464
|
+
},
|
|
465
|
+
setFormValue: {
|
|
466
|
+
type: Function,
|
|
467
|
+
required: !0
|
|
468
|
+
},
|
|
469
|
+
removeFormValue: {
|
|
470
|
+
type: Function,
|
|
471
|
+
required: !0
|
|
472
|
+
},
|
|
473
|
+
defaultAddSenderClient: {
|
|
474
|
+
type: Boolean,
|
|
475
|
+
default: !1
|
|
476
|
+
},
|
|
477
|
+
allowEditClients: {
|
|
478
|
+
type: Boolean,
|
|
479
|
+
default: !0
|
|
480
|
+
},
|
|
481
|
+
isPublicForm: {
|
|
482
|
+
type: Boolean,
|
|
483
|
+
default: !1
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
computed: {
|
|
487
|
+
sortedClients() {
|
|
488
|
+
return [...this.clients].map((n, e) => ({ ...n, index: e })).sort((n, e) => n.signOrder - e.signOrder);
|
|
489
|
+
},
|
|
490
|
+
maxSignOrder() {
|
|
491
|
+
if (!this.useSignOrder || this.sortedClients.length === 0)
|
|
492
|
+
return 0;
|
|
493
|
+
const { signOrder: n } = this.sortedClients[this.sortedClients.length - 1];
|
|
494
|
+
return n;
|
|
495
|
+
},
|
|
496
|
+
useSignOrder() {
|
|
497
|
+
return l(this._document, "useSignOrder", !1);
|
|
498
|
+
},
|
|
499
|
+
getView() {
|
|
500
|
+
return k.value;
|
|
501
|
+
}
|
|
502
|
+
},
|
|
503
|
+
methods: {
|
|
504
|
+
onMoveRecipient({ index: n, direction: e }) {
|
|
505
|
+
this.clients = D(this.clients).set(
|
|
506
|
+
{
|
|
507
|
+
...this.clients[n],
|
|
508
|
+
signOrder: Math.max(this.clients[n].signOrder + e, 0)
|
|
509
|
+
},
|
|
510
|
+
n
|
|
511
|
+
);
|
|
512
|
+
},
|
|
513
|
+
toggleSignOrder(n) {
|
|
514
|
+
let e = [];
|
|
515
|
+
if (n) {
|
|
516
|
+
const t = !this.clients.every(
|
|
517
|
+
({ signOrder: s }) => !s
|
|
518
|
+
);
|
|
519
|
+
this.clients = this.clients.map((s, i) => ({
|
|
520
|
+
...s,
|
|
521
|
+
signOrder: t ? s.signOrder : i + 1
|
|
522
|
+
}));
|
|
523
|
+
} else
|
|
524
|
+
e = l(this._document, "template.reminders", []), e.length || (e = g.default);
|
|
525
|
+
this.setFormValue({ key: "data.reminders", value: e }), this.setFormValue({ key: "useSignOrder", value: n });
|
|
526
|
+
},
|
|
527
|
+
removeClient(n) {
|
|
528
|
+
this.removeFormValue(`clients[${n}]`);
|
|
529
|
+
},
|
|
530
|
+
openClientModal(n = 0) {
|
|
531
|
+
var t;
|
|
532
|
+
const e = l(this, `clients[${n}].signOrder`);
|
|
533
|
+
this.$modal.show(O, {
|
|
534
|
+
documentClientIndex: n,
|
|
535
|
+
...this.useSignOrder && {
|
|
536
|
+
signOrder: M(e) === "number" ? e : this.maxSignOrder + 1
|
|
537
|
+
},
|
|
538
|
+
signOptions: (t = this._document) == null ? void 0 : t.signOptions,
|
|
539
|
+
setFormValue: this.setFormValue,
|
|
540
|
+
removeFormValue: this.removeFormValue,
|
|
541
|
+
isPublicForm: this.isPublicForm
|
|
542
|
+
});
|
|
543
|
+
},
|
|
544
|
+
setClient(n) {
|
|
545
|
+
this.setFormValue({ key: `clients[${this.clients.length}]`, value: n });
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
};
|
|
549
|
+
var U = function() {
|
|
550
|
+
var e = this, t = e._self._c;
|
|
551
|
+
return t("div", [e.compact ? e._e() : [t("div", { staticClass: "pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:from").capitalize()) + ": ")]), t("SenderBlockItem", { attrs: { _document: e._document, _value: { senderClient: "senderClient" }, "set-form-value": e.setFormValue, "default-add-sender-client": e.defaultAddSenderClient } })], t("div", { staticClass: "block-title flex pb-0.5 pt-2 text-xs text-gray-500", class: { "block-title__line": !e.compact } }, [e.compact ? e._e() : t("div", { staticClass: "font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:to").capitalize()) + ": ")]), e.clients && e.clients.length ? t("div", { staticClass: "ml-auto inline-flex items-center justify-end" }, [t("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signOrder.tooltip"), expression: "$t('signOrder.tooltip')" }], staticClass: "mr-1", attrs: { type: "info", size: "14" } }), t("div", { staticClass: "mr-2 font-medium" }, [e._v(" " + e._s(e.$t("signOrder.label")) + " ")]), t("CSwitch", { staticClass: "!mr-0", attrs: { value: e.useSignOrder, size: "tiny", type: "success" }, on: { input: e.toggleSignOrder } })], 1) : e._e()]), e.clients && e.clients.length ? [e.useSignOrder ? t("transition-group", { staticClass: "list-move", attrs: { name: "list-move" } }, [e._l(e.sortedClients, function(s, i) {
|
|
552
|
+
return [i > 0 && s.signOrder !== e.sortedClients[i - 1].signOrder ? t("div", { key: i, staticClass: "h-2 pl-6" }, [t("div", { staticClass: "bg-primary-500 h-full w-0.5 rounded-sm" })]) : e._e(), t("div", { key: s._uniqueId, staticClass: "mb-0.5 mt-px" }, [t("RecipientBlockItem", { class: {
|
|
553
|
+
"first-of-group": i === 0 || i > 0 && s.signOrder !== e.sortedClients[i - 1].signOrder,
|
|
554
|
+
"last-of-group": i === e.sortedClients.length - 1 || e.sortedClients[i + 1] && s.signOrder !== e.sortedClients[i + 1].signOrder
|
|
555
|
+
}, attrs: { client: s, "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients }, on: { move: function(a) {
|
|
556
|
+
return e.onMoveRecipient({ index: s.index, direction: a });
|
|
557
|
+
}, open: function(a) {
|
|
558
|
+
return e.openClientModal(s.index);
|
|
559
|
+
}, remove: function(a) {
|
|
560
|
+
return e.removeClient(s.index);
|
|
561
|
+
} } })], 1)];
|
|
562
|
+
})], 2) : e._l(e.clients, function(s, i) {
|
|
563
|
+
return t("RecipientBlockItem", { key: s._uniqueId, staticClass: "mb-0.5 mt-px", class: {
|
|
564
|
+
"first-of-group": i === 0,
|
|
565
|
+
"last-of-group": i === e.clients.length - 1
|
|
566
|
+
}, attrs: { "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients, client: s }, on: { open: function(a) {
|
|
567
|
+
return e.openClientModal(i);
|
|
568
|
+
}, remove: function(a) {
|
|
569
|
+
return e.removeClient(i);
|
|
570
|
+
} } });
|
|
571
|
+
}), !e.compact && e.allowEditClients ? t("CButton", { staticClass: "is-thinner !text-sm", attrs: { type: "secondary", pattern: "tertiary", "icon-left": "plus", size: "normal" }, on: { click: function(s) {
|
|
572
|
+
return e.openClientModal(e.clients.length);
|
|
573
|
+
} } }, [e._v(" " + e._s(e.$t("addButton")) + " ")]) : e._e()] : (e.getView === "widget" || e.viewSettings.isPublicForm) && e.allowEditClients ? t("CButton", { staticClass: "!px-4 font-medium", attrs: { type: "secondary", raised: "", size: "small", taller: "", "icon-left": "person" }, on: { click: function(s) {
|
|
574
|
+
return e.openClientModal(e.clients.length);
|
|
575
|
+
} } }, [e._v(" " + e._s(e.$t("addFirstButton")) + " ")]) : !e.compact && e.allowEditClients ? t("AddClientCallout", { attrs: { compact: !0 }, on: { add: function(s) {
|
|
576
|
+
return e.openClientModal(e.clients.length);
|
|
577
|
+
}, setClient: e.setClient } }) : e._e()], 2);
|
|
578
|
+
}, ee = [], te = /* @__PURE__ */ o(
|
|
579
|
+
Z,
|
|
580
|
+
U,
|
|
581
|
+
ee,
|
|
582
|
+
!1,
|
|
583
|
+
null,
|
|
584
|
+
"d8baf10e"
|
|
585
|
+
);
|
|
586
|
+
const ne = te.exports, se = {
|
|
587
|
+
name: "DocumentSendReminderItem",
|
|
588
|
+
props: {
|
|
589
|
+
label: {
|
|
590
|
+
type: String,
|
|
591
|
+
required: !0
|
|
592
|
+
},
|
|
593
|
+
value: {
|
|
594
|
+
type: [Number, String],
|
|
595
|
+
default: 0
|
|
596
|
+
},
|
|
597
|
+
done: {
|
|
598
|
+
type: Boolean,
|
|
599
|
+
default: !1
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
};
|
|
603
|
+
var ie = function() {
|
|
604
|
+
var e = this, t = e._self._c;
|
|
605
|
+
return t("div", { staticClass: "mb-4 flex min-h-[2.5em] select-none items-center rounded-md bg-gray-100 px-4 py-2 text-sm font-medium" }, [t("div", { staticClass: "mr-6 flex-auto select-none text-gray-700" }, [e._v(" " + e._s(e.label) + " ")]), t("div", { staticClass: "flex flex-nowrap items-center justify-center text-sm" }, [e.done ? t("span", { staticClass: "text-green-500" }, [t("CIcon", { attrs: { type: "check", size: "18" } }), e._v(" " + e._s(e.$t("sent")) + " ")], 1) : [t("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "minus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
|
|
606
|
+
e.$emit("input", Math.max(e.value - 1, 0));
|
|
607
|
+
} } }), t("div", { staticClass: "min-w-[8ch] py-4 text-center text-sm font-medium text-gray-800" }, [e.value ? [e._v(" " + e._s(e.$tc("day", { count: Number(e.value) })) + " ")] : t("span", { staticClass: "text-xs text-gray-500" }, [e._v(" " + e._s(e.$t("disabled").capitalize()) + " ")])], 2), t("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "plus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
|
|
608
|
+
return e.$emit("input", e.value + 1);
|
|
609
|
+
} } })]], 2)]);
|
|
610
|
+
}, re = [], ae = /* @__PURE__ */ o(
|
|
611
|
+
se,
|
|
612
|
+
ie,
|
|
613
|
+
re,
|
|
614
|
+
!1,
|
|
615
|
+
null,
|
|
616
|
+
null
|
|
617
|
+
);
|
|
618
|
+
const oe = ae.exports, le = {
|
|
619
|
+
name: "DocumentSendReminders",
|
|
620
|
+
i18nOptions: {
|
|
621
|
+
namespaces: "documentSendReminders",
|
|
622
|
+
messages: {
|
|
623
|
+
en: {
|
|
624
|
+
description: "Edit when smart reminders should be sent to client",
|
|
625
|
+
notViewed: "Not viewed after",
|
|
626
|
+
notAnswered: "No reply after",
|
|
627
|
+
expires: "When expiration date is within"
|
|
628
|
+
},
|
|
629
|
+
sv: {
|
|
630
|
+
description: "Ställ in när smarta påminnelser ska skickas ut till mottagaren",
|
|
631
|
+
notViewed: "Inte öppnat efter",
|
|
632
|
+
notAnswered: "Inte svarat efter",
|
|
633
|
+
expires: "När giltighetstiden är inom"
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
},
|
|
637
|
+
components: {
|
|
638
|
+
DocumentSendReminderItem: oe
|
|
639
|
+
},
|
|
640
|
+
mixins: [d()],
|
|
641
|
+
props: {
|
|
642
|
+
setFormValue: {
|
|
643
|
+
type: Function,
|
|
644
|
+
required: !0
|
|
645
|
+
},
|
|
646
|
+
removeFormValue: {
|
|
647
|
+
type: Function,
|
|
648
|
+
required: !0
|
|
649
|
+
}
|
|
650
|
+
},
|
|
651
|
+
computed: {
|
|
652
|
+
reminders() {
|
|
653
|
+
const n = {
|
|
654
|
+
first: null,
|
|
655
|
+
notViewed: null,
|
|
656
|
+
notAnswered: null,
|
|
657
|
+
expires: null
|
|
658
|
+
};
|
|
659
|
+
return this._document.reminders.forEach((e, t) => {
|
|
660
|
+
e.type === "first" ? n.first = { ...e, index: t } : e.type === "viewed" ? n.notViewed = { ...e, index: t } : e.type === "expires" ? n.expires = { ...e, index: t } : n.notAnswered = { ...e, index: t };
|
|
661
|
+
}), n;
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
methods: {
|
|
665
|
+
getDefaultReminders() {
|
|
666
|
+
if (!this._document.template)
|
|
667
|
+
return [];
|
|
668
|
+
const n = this._document.template.getDefaultData({
|
|
669
|
+
path: "properties.data.properties.reminders"
|
|
670
|
+
});
|
|
671
|
+
return n && Array.isArray(n) ? n : [];
|
|
672
|
+
},
|
|
673
|
+
setReminder(n, e) {
|
|
674
|
+
let t = "sendDays";
|
|
675
|
+
if (typeof e == "string" && (t = "sendAt"), !e) {
|
|
676
|
+
this.removeFormValue(`data.reminders[${n.index}]`);
|
|
677
|
+
return;
|
|
678
|
+
}
|
|
679
|
+
if (typeof n == "string") {
|
|
680
|
+
let s = this.getDefaultReminders().find(
|
|
681
|
+
(i) => i.type === n
|
|
682
|
+
);
|
|
683
|
+
if (s || (s = g.default.find((i) => i.type === n)), !s)
|
|
684
|
+
throw new Error("Could not find default reminder");
|
|
685
|
+
s[t] = e, this.setFormValue({ key: "data.reminders", value: s });
|
|
686
|
+
return;
|
|
687
|
+
}
|
|
688
|
+
this.setFormValue({
|
|
689
|
+
key: `data.reminders[${n.index}].${t}`,
|
|
690
|
+
value: e
|
|
691
|
+
});
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
};
|
|
695
|
+
var de = function() {
|
|
696
|
+
var e = this, t = e._self._c;
|
|
697
|
+
return t("div", { staticStyle: { "background-color": "white", "border-radius": "calc(0.5 * var(--rem))", padding: "calc(2 * var(--rem))", "font-size": "16px" } }, [t("div", { staticStyle: { "font-size": "1.25em", "font-weight": "700", "margin-bottom": "0.25em", "text-align": "center" } }, [e._v(" " + e._s(e.$t("_common:reminder_plural").capitalize()) + " ")]), t("div", { staticClass: "text-center text-gray-600", staticStyle: { "max-width": "calc(20 * var(--rem))", margin: "0 auto calc(2 * var(--rem)) auto" } }, [e._v(" " + e._s(e.$t("description")) + " ")]), e._l([
|
|
698
|
+
{ type: "notViewed", fallbackKey: "viewed" },
|
|
699
|
+
{ type: "notAnswered", fallbackKey: "reminder" },
|
|
700
|
+
{ type: "expires", fallbackKey: "expires" }
|
|
701
|
+
], function(s, i) {
|
|
702
|
+
return t("DocumentSendReminderItem", { key: i, attrs: { label: e.$t(s.type), value: e.reminders[s.type] ? e.reminders[s.type].sendDays : 0, done: e.reminders[s.type] && e.reminders[s.type].status === "successful" }, on: { input: function(a) {
|
|
703
|
+
return e.setReminder(e.reminders[s.type] || s.fallbackKey, a);
|
|
704
|
+
} } });
|
|
705
|
+
}), t("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { "margin-top": "calc(2.5 * var(--rem))" } }, [t("CButton", { attrs: { type: "secondary", expanded: "" }, on: { click: function(s) {
|
|
706
|
+
return e.$emit("close");
|
|
707
|
+
} } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])], 1)], 2);
|
|
708
|
+
}, ce = [], me = /* @__PURE__ */ o(
|
|
709
|
+
le,
|
|
710
|
+
de,
|
|
711
|
+
ce,
|
|
712
|
+
!1,
|
|
713
|
+
null,
|
|
714
|
+
null
|
|
715
|
+
);
|
|
716
|
+
const ue = me.exports, pe = {
|
|
717
|
+
name: "SendForm",
|
|
718
|
+
i18nOptions: {
|
|
719
|
+
namespaces: "sendForm",
|
|
720
|
+
messages: L
|
|
721
|
+
},
|
|
722
|
+
components: {
|
|
723
|
+
Simplebar: B,
|
|
724
|
+
BaseDatePicker: f,
|
|
725
|
+
RecipientBlock: ne,
|
|
726
|
+
ErrorCallout: A,
|
|
727
|
+
IsPremiumPreStep: S,
|
|
728
|
+
IsPremium: w,
|
|
729
|
+
CDropdown: h,
|
|
730
|
+
CDropdownItem: y,
|
|
731
|
+
CRadio: I
|
|
732
|
+
},
|
|
733
|
+
mixins: [
|
|
734
|
+
d(
|
|
735
|
+
["expiresAt", "clients", "defaultAnswerMethod", "reminders", "name"],
|
|
736
|
+
{
|
|
737
|
+
useEmit: !1,
|
|
738
|
+
setFnName: "setFormValue"
|
|
739
|
+
}
|
|
740
|
+
)
|
|
741
|
+
],
|
|
742
|
+
props: {
|
|
743
|
+
showName: {
|
|
744
|
+
type: Boolean,
|
|
745
|
+
default: !0
|
|
746
|
+
},
|
|
747
|
+
showSave: {
|
|
748
|
+
type: Boolean,
|
|
749
|
+
default: !0
|
|
750
|
+
},
|
|
751
|
+
showSchedule: {
|
|
752
|
+
type: Boolean,
|
|
753
|
+
default: !0
|
|
754
|
+
},
|
|
755
|
+
allowManualDelivery: {
|
|
756
|
+
type: Boolean,
|
|
757
|
+
default: !0
|
|
758
|
+
},
|
|
759
|
+
allowEditClients: {
|
|
760
|
+
type: Boolean,
|
|
761
|
+
default: !0
|
|
762
|
+
},
|
|
763
|
+
setFormValue: {
|
|
764
|
+
type: Function,
|
|
765
|
+
required: !0
|
|
766
|
+
},
|
|
767
|
+
removeFormValue: {
|
|
768
|
+
type: Function,
|
|
769
|
+
required: !0
|
|
770
|
+
},
|
|
771
|
+
useScroll: {
|
|
772
|
+
type: Boolean,
|
|
773
|
+
default: !1
|
|
774
|
+
},
|
|
775
|
+
onSaveDocument: {
|
|
776
|
+
type: Function,
|
|
777
|
+
required: !0
|
|
778
|
+
}
|
|
779
|
+
},
|
|
780
|
+
data() {
|
|
781
|
+
return {
|
|
782
|
+
localIsPosting: !1,
|
|
783
|
+
clientHoverIndex: null
|
|
784
|
+
};
|
|
785
|
+
},
|
|
786
|
+
computed: {
|
|
787
|
+
...c({
|
|
788
|
+
deliveryTypes: "forms/deliveryTypes",
|
|
789
|
+
isPostingDocument: "documents2/isPosting",
|
|
790
|
+
documentSenderSign: "settings/documentSenderSign",
|
|
791
|
+
// todo: could be moved to load form action
|
|
792
|
+
getCompanySetting: "settings/getCompanySetting",
|
|
793
|
+
feature: "application/feature"
|
|
794
|
+
}),
|
|
795
|
+
isPosting() {
|
|
796
|
+
return this.isPostingDocument || this.localIsPosting;
|
|
797
|
+
},
|
|
798
|
+
isPublicForm() {
|
|
799
|
+
return !!(this.viewSettings && this.viewSettings.isPublicForm);
|
|
800
|
+
},
|
|
801
|
+
useSignOrder() {
|
|
802
|
+
var n;
|
|
803
|
+
return ((n = this._document) == null ? void 0 : n.useSignOrder) || !1;
|
|
804
|
+
},
|
|
805
|
+
noOfReminders() {
|
|
806
|
+
return Object.values(this.reminders || []).reduce(
|
|
807
|
+
(n, e) => e && (e.sendDays || e.sendAt) && e.type !== "first" ? n + 1 : n,
|
|
808
|
+
0
|
|
809
|
+
);
|
|
810
|
+
},
|
|
811
|
+
smsActivated() {
|
|
812
|
+
return this.deliveryTypes.sms;
|
|
813
|
+
},
|
|
814
|
+
emailActivated() {
|
|
815
|
+
return this.deliveryTypes.email;
|
|
816
|
+
},
|
|
817
|
+
isManualDelivery() {
|
|
818
|
+
return !this.smsActivated && !this.emailActivated;
|
|
819
|
+
},
|
|
820
|
+
sendTypesText() {
|
|
821
|
+
return this.emailActivated || this.smsActivated ? [
|
|
822
|
+
...this.emailActivated ? [this.$t("_common:email").capitalize()] : [],
|
|
823
|
+
...this.smsActivated ? [this.$t("_common:sms")] : []
|
|
824
|
+
].join(" & ") : this._document.isDirty("isManualDelivery") && this.clients.length ? this.$t("manualDelivery") : " ";
|
|
825
|
+
},
|
|
826
|
+
clientsAreMissingContactInfo() {
|
|
827
|
+
return this.isManualDelivery ? !1 : this.clients.some((n) => !(n.email || n.cellphone));
|
|
828
|
+
},
|
|
829
|
+
signMethods() {
|
|
830
|
+
var n, e;
|
|
831
|
+
return ((e = (n = this._document.signOptions) == null ? void 0 : n.filter((t) => t !== "inPerson")) == null ? void 0 : e.map((t) => ({
|
|
832
|
+
value: t,
|
|
833
|
+
title: this.$t(`signMethod.${t}.title`),
|
|
834
|
+
content: this.$t(`signMethod.${t}.content`)
|
|
835
|
+
}))) || [];
|
|
836
|
+
}
|
|
837
|
+
},
|
|
838
|
+
created() {
|
|
839
|
+
var n;
|
|
840
|
+
if (!this.expiresAt && !this._document.isDirty("expiresAt")) {
|
|
841
|
+
const e = this.getCompanySetting("defaultExpireDays");
|
|
842
|
+
if (e && Number.isInteger(e) && e > 0) {
|
|
843
|
+
const t = /* @__PURE__ */ new Date();
|
|
844
|
+
t.setDate(t.getDate() + e), this.setField({
|
|
845
|
+
field: "expiresAt",
|
|
846
|
+
value: t.toISOString(),
|
|
847
|
+
options: { ignoreChanges: !0 }
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
}
|
|
851
|
+
if (((n = this.defaultAnswerMethod) == null ? void 0 : n.accept) === "button") {
|
|
852
|
+
const [e] = this._document.signOptions || ["signature"];
|
|
853
|
+
this.setAnswerMethod(e, { ignoreChanges: !0 });
|
|
854
|
+
}
|
|
855
|
+
},
|
|
856
|
+
validations() {
|
|
857
|
+
const n = {
|
|
858
|
+
clients: {
|
|
859
|
+
required: (e) => e && e.length
|
|
860
|
+
}
|
|
861
|
+
};
|
|
862
|
+
return !this.allowManualDelivery && this.clients.length && (n.isManualDelivery = {
|
|
863
|
+
checked: (e) => !e
|
|
864
|
+
}), n;
|
|
865
|
+
},
|
|
866
|
+
methods: {
|
|
867
|
+
async doSaveDocument({ doSend: n }) {
|
|
868
|
+
try {
|
|
869
|
+
this.localIsPosting = !0, await this.onSaveDocument({ doSend: n });
|
|
870
|
+
} finally {
|
|
871
|
+
this.localIsPosting = !1;
|
|
872
|
+
}
|
|
873
|
+
},
|
|
874
|
+
async doSendDocument() {
|
|
875
|
+
var n;
|
|
876
|
+
this.$v.$touch(), !this.$v.$invalid && (["denied", "expired", "voided"].includes((n = this._document) == null ? void 0 : n.status) && this.resetDeniedDocument(), await this.doSaveDocument({ doSend: !0 }));
|
|
877
|
+
},
|
|
878
|
+
setDeliveryMethod(n, e) {
|
|
879
|
+
const t = this.deliveryTypes;
|
|
880
|
+
t[n] = e;
|
|
881
|
+
const s = Object.keys(t).filter((i) => t[i]);
|
|
882
|
+
(this.clients || []).forEach((i, a) => {
|
|
883
|
+
this.setFormValue({
|
|
884
|
+
key: `clients[${a}].deliveryTypes`,
|
|
885
|
+
value: s
|
|
886
|
+
});
|
|
887
|
+
});
|
|
888
|
+
},
|
|
889
|
+
setAnswerMethod(n, e = {}) {
|
|
890
|
+
this.setField({
|
|
891
|
+
field: "defaultAnswerMethod",
|
|
892
|
+
value: { ...this.defaultAnswerMethod, accept: n },
|
|
893
|
+
options: e
|
|
894
|
+
}), (this.clients || []).forEach((t, s) => {
|
|
895
|
+
var i;
|
|
896
|
+
((i = t.answerMethod) == null ? void 0 : i.accept) !== "inPerson" && this.setField({
|
|
897
|
+
key: `clients[${s}].answerMethod.accept`,
|
|
898
|
+
value: n,
|
|
899
|
+
options: e
|
|
900
|
+
});
|
|
901
|
+
});
|
|
902
|
+
},
|
|
903
|
+
openReminders() {
|
|
904
|
+
this.useSignOrder || this.$modal.show(
|
|
905
|
+
ue,
|
|
906
|
+
{
|
|
907
|
+
_document: this._document,
|
|
908
|
+
setFormValue: this.setFormValue,
|
|
909
|
+
removeFormValue: this.removeFormValue
|
|
910
|
+
},
|
|
911
|
+
{
|
|
912
|
+
adaptive: !0,
|
|
913
|
+
height: "auto",
|
|
914
|
+
width: "90%",
|
|
915
|
+
maxWidth: 360
|
|
916
|
+
}
|
|
917
|
+
);
|
|
918
|
+
},
|
|
919
|
+
openSendLater() {
|
|
920
|
+
this.$v.$touch(), !this.$v.$invalid && this.$modal.show(
|
|
921
|
+
N,
|
|
922
|
+
{
|
|
923
|
+
_document: this._document,
|
|
924
|
+
setFormValue: this.setFormValue,
|
|
925
|
+
removeFormValue: this.removeFormValue,
|
|
926
|
+
onSaveDocument: this.doSaveDocument
|
|
927
|
+
},
|
|
928
|
+
{
|
|
929
|
+
adaptive: !0,
|
|
930
|
+
height: "auto",
|
|
931
|
+
width: "90%",
|
|
932
|
+
maxWidth: 360
|
|
933
|
+
}
|
|
934
|
+
);
|
|
935
|
+
},
|
|
936
|
+
resetDeniedDocument() {
|
|
937
|
+
(this.clients || []).forEach((n, e) => {
|
|
938
|
+
this.setFormValue({ key: `clients[${e}].answer`, value: null });
|
|
939
|
+
}), this.setFormValue({ key: "data.rejectReasons", value: [] }), this.setFormValue({ key: "status", value: "sent" });
|
|
940
|
+
},
|
|
941
|
+
shouldShowUpgradeModal({ canUseBankId: n, canUseSms: e }) {
|
|
942
|
+
var t;
|
|
943
|
+
return !!(this.smsActivated && !e || ((t = this.defaultAnswerMethod) == null ? void 0 : t.accept) === "bankId" && !n);
|
|
944
|
+
}
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
var ve = function() {
|
|
948
|
+
var e = this, t = e._self._c;
|
|
949
|
+
return t("IsPremium", { scopedSlots: e._u([{ key: "default", fn: function({ canUseBankId: s, canUseSms: i }) {
|
|
950
|
+
var a;
|
|
951
|
+
return [t("div", { staticClass: "@container flex h-full flex-col" }, [t(e.useScroll ? "Simplebar" : "div", { tag: "component", staticClass: "main-container" }, [t("div", { staticClass: "@md:px-8 @md:pb-8 @xl:px-16 @xl:pb-16 relative px-4 pb-4 pt-6" }, [t("div", { staticClass: "pb-4 text-lg font-bold" }, [e._v(" " + e._s(e.$t("title")) + " ")]), e.showName ? t("div", { staticClass: "mb-6" }, [t("div", { staticClass: "pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("nameLabel")) + " ")]), t("CInput", { attrs: { placeholder: e.$t("namePlaceholder"), filled: "" }, model: { value: e.name, callback: function(r) {
|
|
952
|
+
e.name = r;
|
|
953
|
+
}, expression: "name" } })], 1) : e._e(), t("div", { staticClass: "mb-6" }, [t("RecipientBlock", { attrs: { _value: {
|
|
954
|
+
clients: "clients"
|
|
955
|
+
}, _document: e._document, "set-form-value": e.setFormValue, "remove-form-value": e.removeFormValue, "default-add-sender-client": e.documentSenderSign, "allow-edit-clients": e.allowEditClients, "is-public-form": e.isPublicForm } })], 1), e._t("default"), e.defaultAnswerMethod && e.signMethods.length > 1 ? t("div", { staticClass: "mb-8" }, [t("div", { staticClass: "block-title pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("signMethod.title")) + " "), t("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signMethod.tooltip"), expression: "$t('signMethod.tooltip')" }], staticClass: "ml-px text-gray-500", attrs: { type: "info", size: "14" } })], 1), t("div", { staticClass: "cb-card-group" }, e._l(e.signMethods, function(r) {
|
|
956
|
+
return t("div", { key: r.value, staticClass: "cb-card flex border-2 border-transparent hover:border-gray-300/30 hover:bg-gray-200", class: {
|
|
957
|
+
checked: e.defaultAnswerMethod.accept === r.value
|
|
958
|
+
}, on: { click: function(m) {
|
|
959
|
+
e.defaultAnswerMethod.accept !== r.value && e.setAnswerMethod(r.value);
|
|
960
|
+
} } }, [t("CRadio", { staticClass: "sign-radio pointer-events-none mr-3", attrs: { value: e.defaultAnswerMethod.accept, "native-value": r.value, type: "secondary", size: "small" } }), t("div", { staticClass: "flex-grow" }, [t("div", { staticClass: "cb-card-title flex items-center justify-between" }, [e._v(" " + e._s(r.title) + " "), r.value === "bankId" && !s ? t("div", { staticClass: "bg-primary-500 ml-2 rounded-full px-1.5 py-1 text-[10px] font-semibold leading-none text-white" }, [e._v(" Pro ")]) : e._e()]), t("div", { directives: [{ name: "show", rawName: "v-show", value: e.defaultAnswerMethod.accept === r.value, expression: "defaultAnswerMethod.accept === signMethod.value" }], staticClass: "cb-card-body" }, [e._v(" " + e._s(r.content) + " ")])])], 1);
|
|
961
|
+
}), 0)]) : e._e(), t("div", { staticClass: "grid items-center gap-2", staticStyle: { "grid-template-columns": "repeat(auto-fit, minmax(200px, 1fr))" } }, [t("div", [t("BaseDatePicker", { staticClass: "psuedo-input relative", attrs: { "custom-el": !0, direction: "end", tabindex: "0" }, model: { value: e.expiresAt, callback: function(r) {
|
|
962
|
+
e.expiresAt = r;
|
|
963
|
+
}, expression: "expiresAt" } }, [t("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("validityPeriod")))]), t("div", [e._v(" " + e._s(e.expiresAt ? e.$formatDate(e.expiresAt) : e.$t("_common:disabled").capitalize()) + " ")]), e.expiresAt ? t("CButton", { staticClass: "absolute right-3 top-3 z-10", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(r) {
|
|
964
|
+
r.preventDefault(), r.stopPropagation(), e.expiresAt = void 0, e._document.setDirty("expiresAt");
|
|
965
|
+
} } }) : e._e()], 1)], 1), t("CDropdown", { staticStyle: { flex: "1 0 200px" }, attrs: { disabled: !e.clients.length, "mobile-label": e.$t("sendAs"), expanded: "" }, scopedSlots: e._u([{ key: "trigger", fn: function() {
|
|
966
|
+
return [t("div", { staticClass: "psuedo-input", attrs: { tabindex: "0" } }, [t("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("sendAs")))]), t("div", { domProps: { innerHTML: e._s(e.sendTypesText) } })])];
|
|
967
|
+
}, proxy: !0 }], null, !0) }, [t("CDropdownItem", { attrs: { value: e.emailActivated, "close-on-click": !1, toggle: "" }, on: { click: function(r) {
|
|
968
|
+
return e.setDeliveryMethod("email", !e.emailActivated);
|
|
969
|
+
} } }, [e._v(" " + e._s(e.$t("_common:email").capitalize()) + " ")]), e.feature("sms") ? t("CDropdownItem", { attrs: { value: e.smsActivated, "close-on-click": !1, toggle: "" }, on: { click: function(r) {
|
|
970
|
+
return e.setDeliveryMethod("sms", !e.smsActivated);
|
|
971
|
+
} } }, [e._v(" " + e._s(e.$t("_common:sms")) + " "), i ? e._e() : t("div", { staticClass: "bg-primary-500 ml-2 rounded-full px-1.5 py-1 text-[10px] font-semibold leading-none text-white" }, [e._v(" Pro ")])]) : e._e(), e.allowManualDelivery ? t("CDropdownItem", { attrs: { value: "", tooltip: {
|
|
972
|
+
content: e.$t("manualDeliveryTooltip")
|
|
973
|
+
} }, domProps: { textContent: e._s(e.$t("manualDelivery")) }, on: { click: () => {
|
|
974
|
+
e.setDeliveryMethod("sms", !1), e.setDeliveryMethod("email", !1), e._document.setDirty("isManualDelivery");
|
|
975
|
+
} } }) : e._e()], 1), !e.useSignOrder && !e.isManualDelivery ? t("div", { staticClass: "psuedo-input relative", attrs: { tabindex: "0" }, on: { click: e.openReminders } }, [t("div", { staticClass: "psuedo-input-label" }, [e._v(" " + e._s(e.$t("_common:reminder_plural").capitalize()) + " ")]), t("div", [e._v(" " + e._s(e.noOfReminders ? `${e.noOfReminders} ${e.$i18n.lang === "sv" ? e.$t("_common:unitType.unit") : ""}` : e.$t("_common:disabled").capitalize()) + " ")]), e.noOfReminders ? t("CButton", { staticClass: "absolute right-3 top-3", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(r) {
|
|
976
|
+
r.preventDefault(), r.stopPropagation(), e.reminders = [];
|
|
977
|
+
} } }) : e._e()], 1) : e._e()], 1), e.clientsAreMissingContactInfo || (a = e.$v.isManualDelivery) != null && a.$invalid ? t("ErrorCallout", { attrs: { message: e.clientsAreMissingContactInfo ? e.$t("clientsAreMissingContactInfo") : e.$t("missingDeliveryMethod"), size: "small" } }) : e._e(), e._t("content")], 2)]), t("div", { staticClass: "@md:px-8 @xl:px-16 px-4 pb-4" }, [e._t("send", function() {
|
|
978
|
+
return [t("IsPremiumPreStep", { attrs: { feature: "bankIdAndSms" }, scopedSlots: e._u([{ key: "default", fn: function({ onClick: r }) {
|
|
979
|
+
return [t("div", { staticClass: "flex" }, [e.showSave ? t("CButton", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("_common:save", {
|
|
980
|
+
thing: e.$t("_common:document").toLowerCase()
|
|
981
|
+
}), expression: `
|
|
982
|
+
$t('_common:save', {
|
|
983
|
+
thing: $t('_common:document').toLowerCase()
|
|
984
|
+
})
|
|
985
|
+
` }], staticClass: "mr-2 w-12", attrs: { loading: e.isPosting, type: "none", icon: "save", pattern: "secondary" }, on: { click: function(m) {
|
|
986
|
+
return e.doSaveDocument({ doSend: !1 });
|
|
987
|
+
} } }) : e._e(), e.showSchedule && !e.useSignOrder && !e.isManualDelivery ? t("CButton", { staticClass: "@md:w-auto mr-2 w-12", staticStyle: { padding: "14px 16px", "border-radius": "8px", height: "initial", "font-size": "14px", "font-weight": "600" }, attrs: { disabled: e.isPosting || !e.clients.length, type: "none", pattern: "secondary" }, on: { click: e.openSendLater } }, [t("span", { staticClass: "@md:!block !hidden", domProps: { textContent: e._s(e.$t("scheduledTooltip")) } }), t("CIcon", { staticClass: "@md:!hidden", attrs: { type: "calendar", size: "16" } })], 1) : e._e(), t("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$v.$invalid ? {
|
|
988
|
+
content: e.clients.length ? e.$t("missingDeliveryMethod") : e.$t(
|
|
989
|
+
"components:account.documentForm.clients.errorMessage"
|
|
990
|
+
)
|
|
991
|
+
} : {}, expression: `
|
|
992
|
+
$v.$invalid
|
|
993
|
+
? {
|
|
994
|
+
content: !clients.length
|
|
995
|
+
? $t(
|
|
996
|
+
'components:account.documentForm.clients.errorMessage'
|
|
997
|
+
)
|
|
998
|
+
: $t('missingDeliveryMethod')
|
|
999
|
+
}
|
|
1000
|
+
: {}
|
|
1001
|
+
` }], staticClass: "flex-auto" }, [t("CButton", { staticStyle: { padding: "14px 16px", "border-radius": "8px", height: "100%", "font-size": "14px", "font-weight": "600", "box-shadow": "0 2px 4px -1px rgba(0, 0, 0, 0.1)" }, attrs: { disabled: e.$v.$invalid, loading: e.isPosting, type: "secondary", wide: "" }, on: { click: function(m) {
|
|
1002
|
+
e.shouldShowUpgradeModal({ canUseBankId: s, canUseSms: i }) ? r({
|
|
1003
|
+
data: {
|
|
1004
|
+
bankIdBlocked: !s,
|
|
1005
|
+
smsBlocked: !i
|
|
1006
|
+
}
|
|
1007
|
+
}) : e.doSendDocument();
|
|
1008
|
+
} } }, [e._v(" " + e._s(e.$t("sendButton")) + " ")])], 1)], 1)];
|
|
1009
|
+
} }], null, !0) })];
|
|
1010
|
+
}), e._t("footer")], 2)], 1)];
|
|
1011
|
+
} }], null, !0) });
|
|
1012
|
+
}, ge = [], fe = /* @__PURE__ */ o(
|
|
1013
|
+
pe,
|
|
1014
|
+
ve,
|
|
1015
|
+
ge,
|
|
1016
|
+
!1,
|
|
1017
|
+
null,
|
|
1018
|
+
"69a6a565"
|
|
1019
|
+
);
|
|
1020
|
+
const De = fe.exports;
|
|
1021
|
+
export {
|
|
1022
|
+
De as S
|
|
1023
|
+
};
|