@cling-se/widget 0.17.3 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/AddClientCallout-Bod9Eqx4.js +101 -0
  3. package/dist/AnswerModal-a2cyKFbt.js +3371 -0
  4. package/dist/AttachmentItem-DBUqckCS.js +171 -0
  5. package/dist/BaseUpload-DrWzuvbS.js +6503 -0
  6. package/dist/BlockMedia-DuE_K9hR.js +103 -0
  7. package/dist/CCallout-CM1VsH30.js +104 -0
  8. package/dist/{CCurrencyDropdown-CXXQu8th.js → CCurrencyDropdown-C_lAaq4P.js} +91 -53
  9. package/dist/CDropdownItem-DMUAJ90n.js +749 -0
  10. package/dist/CFormField.vue_vue_type_script_setup_true_lang-BqAyWe3T.js +292 -0
  11. package/dist/{CPhoneFormat-BtBGl8b4.js → CPhoneFormat-Dnn_cKk7.js} +13 -21
  12. package/dist/CPhoneInput-DuGkDiv-.js +207 -0
  13. package/dist/CPriceInput-B7DYzKcF.js +142 -0
  14. package/dist/CSelect-BZZDr27O.js +98 -0
  15. package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-D2jDhnYI.js +51 -0
  16. package/dist/ClientAutocomplete-DuaJ5zDf.js +532 -0
  17. package/dist/ClientModal-CaMSjLkD.js +1188 -0
  18. package/dist/ColorPicker-BISZPQ6j.js +1408 -0
  19. package/dist/CompanyModal-ClTcmU4Y.js +250 -0
  20. package/dist/ContentWrapper-Bj7jbWU0.js +265 -0
  21. package/dist/CoverBlockSettings-AXyiLxrF.js +861 -0
  22. package/dist/DocAnswer-Bu09V33D.js +33 -0
  23. package/dist/DocDetails-B6-2LKsO.js +452 -0
  24. package/dist/DocForm-CFN8LWSd.js +6772 -0
  25. package/dist/DocFormSend-D1CUhy4n.js +171 -0
  26. package/dist/DocLinks-CuliFqtN.js +36 -0
  27. package/dist/DocModalBase-BxKsnwN-.js +29 -0
  28. package/dist/DocPrint-B_HJ_RET.js +399 -0
  29. package/dist/DocReceipt-D-A1TaTI.js +341 -0
  30. package/dist/DocSendReminder-BKTJonzh.js +181 -0
  31. package/dist/{DocTextEditor-yD9Dt_um.js → DocTextEditor-CEPcJT2o.js} +7907 -5579
  32. package/dist/DocTimeline-CF9S4YDZ.js +537 -0
  33. package/dist/DocumentClient-7mbq2QA4.js +90 -0
  34. package/dist/DocumentLayout-DkFlHgW6.js +1434 -0
  35. package/dist/DocumentLogotype-BTYMdpNi.js +162 -0
  36. package/dist/DocumentVoided-CWr5WMUv.js +33 -0
  37. package/dist/EmbedInput-SevVEpwc.js +156 -0
  38. package/dist/EmbedSettings-YMbUmp1O.js +103 -0
  39. package/dist/ErrorCallout-CQo2iF9c.js +34 -0
  40. package/dist/FilePreviewModal-C0xBeoAz.js +202 -0
  41. package/dist/Flag-BObij6SN.js +41 -0
  42. package/dist/HeaderSettings-C77pR78n.js +720 -0
  43. package/dist/ImageSelectModal-DKdU-0uq.js +119 -0
  44. package/dist/ImageUploadWrapper-BGkS5Cll.js +1585 -0
  45. package/dist/Index-B3y-jq9s.js +1098 -0
  46. package/dist/Index-B41pUREi.js +47 -0
  47. package/dist/Index-BEyeS1OG.js +52 -0
  48. package/dist/Index-BG5j8ZFP.js +93 -0
  49. package/dist/Index-BOT65yQR.js +68 -0
  50. package/dist/Index-BQNl-cXP.js +28 -0
  51. package/dist/Index-BY6xsS7C.js +38 -0
  52. package/dist/Index-Bh0Xv5ry.js +163 -0
  53. package/dist/Index-Bn4FSQcx.js +228 -0
  54. package/dist/Index-BrRIAede.js +87 -0
  55. package/dist/Index-C-6um0kX.js +76 -0
  56. package/dist/{Index-C_aIQ908.js → Index-C-gHa5xk.js} +319 -214
  57. package/dist/Index-C0wcjKCH.js +629 -0
  58. package/dist/Index-C6BbUFYw.js +160 -0
  59. package/dist/Index-C8xwJ0m1.js +200 -0
  60. package/dist/Index-CKgFEJF4.js +140 -0
  61. package/dist/{Index-Dfq7egc1.js → Index-CQwmu4f1.js} +47 -60
  62. package/dist/Index-CXchTpBa.js +74 -0
  63. package/dist/{Index-Ch9r5yhG.js → Index-CYoRt8PA.js} +9 -17
  64. package/dist/Index-CZZNQ4q5.js +39 -0
  65. package/dist/Index-CkaAs5ms.js +136 -0
  66. package/dist/Index-CtpXaBz8.js +363 -0
  67. package/dist/Index-CxDsSGtZ.js +126 -0
  68. package/dist/Index-DFkTBm02.js +102 -0
  69. package/dist/Index-DP3ll8F-.js +70 -0
  70. package/dist/{Index-RWMPRDAE.js → Index-DPDzMKQa.js} +10 -18
  71. package/dist/Index-DvxSig3z.js +25 -0
  72. package/dist/Index-Dzrn3Y6p.js +16 -0
  73. package/dist/{Index-CRiATiQn.js → Index-LQb0omFE.js} +10 -18
  74. package/dist/Index-Mt4mSaNT.js +4 -0
  75. package/dist/Index-_xN_cczo.js +3477 -0
  76. package/dist/Index-gAz45qgR.js +21 -0
  77. package/dist/Index-xXLFalgR.js +49 -0
  78. package/dist/Index-zyZRPz3H.js +28 -0
  79. package/dist/Index.vue_vue_type_script_lang-Ddo1wo-D.js +671 -0
  80. package/dist/InputToggleRow-CokEYwm2.js +99 -0
  81. package/dist/ManualPopover-Dukly7GP.js +65 -0
  82. package/dist/MediaWrapper-B8msCrQm.js +18 -0
  83. package/dist/{NotBindingText-CC7TxUqg.js → NotBindingText-DcQd8Eej.js} +13 -17
  84. package/dist/PackageGroup-clUIUoik.js +1060 -0
  85. package/dist/PdfTerms-DpzMVRfN.js +34 -0
  86. package/dist/PdfViewer-CSf4Rtbj.js +392 -0
  87. package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6KSjjMA.js +17 -0
  88. package/dist/PriceHeader-Dyweu8aH.js +488 -0
  89. package/dist/{SearchApi-G2Hvp0Dd.js → SearchApi-Y1fDQn0u.js} +37 -49
  90. package/dist/SendForm-B9l24WwR.js +6689 -0
  91. package/dist/Setup-DyzbPFM4.js +47 -0
  92. package/dist/{SmartList-BynTuXtB.js → SmartList-CWGKoAJh.js} +16 -24
  93. package/dist/Sortable.vue_vue_type_script_setup_true_lang-C2Gwp6Q-.js +1349 -0
  94. package/dist/{TermsSettings-cA5YAO77.js → TermsSettings-BeQH307A.js} +169 -56
  95. package/dist/ThemeColorRow-DFIsPy55.js +105 -0
  96. package/dist/ToggleBinding-DlH4y1IM.js +44 -0
  97. package/dist/UploadModal-BZ0mPBBB.js +134 -0
  98. package/dist/VideoPlayerInput-DBxcTUb7.js +134 -0
  99. package/dist/VideoPlayerSettings-Dg1OxjOa.js +78 -0
  100. package/dist/VideoSelectModal-BhbanMix.js +217 -0
  101. package/dist/{anime.es-BrPTThYb.js → anime.es-4wvNItHq.js} +205 -201
  102. package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
  103. package/dist/{dom-Ds4ypDrd.js → dom-CkTGWrfu.js} +3 -6
  104. package/dist/{focusDrawerMixin-CximZA1J.js → focusDrawerMixin-BVbTYOGr.js} +1 -1
  105. package/dist/{formDrawerState-CkNGdxn5.js → formDrawerState-CogZ-GVm.js} +2 -2
  106. package/dist/helpers-B4GUxtdD.js +46 -0
  107. package/dist/index-BZDey7B-.js +268 -0
  108. package/dist/index-Bd8_ZHHq.js +188 -0
  109. package/dist/index-BvyoYp1e.js +508 -0
  110. package/dist/index-CJZoubA3.js +3525 -0
  111. package/dist/index-D7yQWP4d.js +125 -0
  112. package/dist/index-D8hGHka6.js +513 -0
  113. package/dist/index-Dxy4tf7x.js +149 -0
  114. package/dist/index.es.js +2 -5
  115. package/dist/index.umd.js +303 -1486
  116. package/dist/main-Bn5XkQPb.js +57570 -0
  117. package/dist/mapFormMixin-C7FJLnbO.js +1528 -0
  118. package/dist/omit-DrWpFvRJ.js +56 -0
  119. package/dist/{publicSenderState-CGEm9EYe.js → publicSenderState-tdtCFPMx.js} +4 -4
  120. package/dist/splitpanes-BApidgjj.js +342 -0
  121. package/dist/template-CHdf2K2I.js +1572 -0
  122. package/dist/tippy.esm-Co6FYzEM.js +1994 -0
  123. package/dist/useTermsModal-VDnO1Lro.js +87 -0
  124. package/dist/{utils-Dr4AcaE9.js → utils-DZkn0Q9c.js} +8 -11
  125. package/dist/validation-CqBkar3f.js +40 -0
  126. package/dist/widget.css +1 -0
  127. package/package.json +20 -25
  128. package/dist/AddClientCallout-Br6IhwGH.js +0 -48
  129. package/dist/AnswerModal-CsWltR6j.js +0 -3879
  130. package/dist/AttachmentItem-BG7FuSCD.js +0 -85
  131. package/dist/BaseDatePicker-PSNBtUIh.js +0 -3187
  132. package/dist/BaseUpload-BfEurAAV.js +0 -1977
  133. package/dist/BlockMedia-Bo3OfNSU.js +0 -76
  134. package/dist/CCallout-CAjM8-1X.js +0 -58
  135. package/dist/CDropdownItem-CN7gSfgY.js +0 -640
  136. package/dist/CFormField-Clvcf2Jh.js +0 -240
  137. package/dist/CPhoneInput-CEHXh5jM.js +0 -138
  138. package/dist/CPriceInput-D2c07SXp.js +0 -116
  139. package/dist/CSelect-Cz2IPzxS.js +0 -91
  140. package/dist/CSkeleton-AsnvnD-m.js +0 -55
  141. package/dist/ClientAutocomplete-CZ55-DKe.js +0 -438
  142. package/dist/ClientModal-CgUhWZ5L.js +0 -666
  143. package/dist/ColorPicker-IFGHqH-u.js +0 -2879
  144. package/dist/CompanyModal-TLSBFo3U.js +0 -147
  145. package/dist/ContentWrapper-HClxKPuT.js +0 -190
  146. package/dist/CoverBlockSettings-D99hAa6e.js +0 -659
  147. package/dist/DocAnswer-CTV_Bpt7.js +0 -36
  148. package/dist/DocDetails-CQe5htXj.js +0 -263
  149. package/dist/DocForm-6Efv5_oz.js +0 -5017
  150. package/dist/DocFormSend-DbXcklxU.js +0 -146
  151. package/dist/DocLinks-BO545zbL.js +0 -38
  152. package/dist/DocModalBase-DXHNJ-6i.js +0 -28
  153. package/dist/DocPrint-Bf2U4FQN.js +0 -240
  154. package/dist/DocReceipt-CWXvC7bY.js +0 -217
  155. package/dist/DocSendReminder-CRzBM2NJ.js +0 -140
  156. package/dist/DocTimeline-DGVOk8-2.js +0 -485
  157. package/dist/DocumentClient-Das9BaJ7.js +0 -136
  158. package/dist/DocumentLayout-4q8rmTVT.js +0 -4880
  159. package/dist/DocumentLogotype-DLncJJAB.js +0 -92
  160. package/dist/DocumentVoided-CcI9lX27.js +0 -25
  161. package/dist/EmbedInput-BPdy0lGS.js +0 -117
  162. package/dist/EmbedSettings-L2iwYLQK.js +0 -74
  163. package/dist/ErrorCallout-Ds_tBT02.js +0 -27
  164. package/dist/FilePreviewModal-hxUu330p.js +0 -81
  165. package/dist/Flag-1-HcT5Dz.js +0 -46
  166. package/dist/HeaderSettings-C27fMugK.js +0 -440
  167. package/dist/ImageSelectModal-BKDIyxF4.js +0 -86
  168. package/dist/ImageUploadWrapper-BiYzUQur.js +0 -1604
  169. package/dist/Index-5BOWxcPG.js +0 -26
  170. package/dist/Index-B1Odktov.js +0 -754
  171. package/dist/Index-B3d5BjEn.js +0 -25
  172. package/dist/Index-B3sSU_4X.js +0 -54
  173. package/dist/Index-B5Dqsh3K.js +0 -150
  174. package/dist/Index-B6aO1c_w.js +0 -62
  175. package/dist/Index-BGfICxJQ.js +0 -643
  176. package/dist/Index-BHopC0hv.js +0 -24
  177. package/dist/Index-BJXcSmp_.js +0 -55
  178. package/dist/Index-BQe6QjQZ.js +0 -25
  179. package/dist/Index-BmXx_x6t.js +0 -77
  180. package/dist/Index-C692qMTG.js +0 -294
  181. package/dist/Index-CEvbw-3i.js +0 -41
  182. package/dist/Index-CYSULnpn.js +0 -32
  183. package/dist/Index-CdtYzwAM.js +0 -107
  184. package/dist/Index-CetF2FW0.js +0 -230
  185. package/dist/Index-Cv6XLM20.js +0 -73
  186. package/dist/Index-Cwy8ff76.js +0 -154
  187. package/dist/Index-D34z4UEY.js +0 -84
  188. package/dist/Index-DNCei-lp.js +0 -56
  189. package/dist/Index-DUbxgIYB.js +0 -2445
  190. package/dist/Index-DVwn_LLf.js +0 -28
  191. package/dist/Index-Dla-mesV.js +0 -146
  192. package/dist/Index-KtUkOPI2.js +0 -58
  193. package/dist/Index-LjnOTVJk.js +0 -66
  194. package/dist/Index-ky1SRtfY.js +0 -94
  195. package/dist/Index-mceZW2NX.js +0 -41
  196. package/dist/Index-tD3hZjh8.js +0 -144
  197. package/dist/Index-vM5kDtC2.js +0 -33
  198. package/dist/InputToggleRow-BmDuSbE2.js +0 -57
  199. package/dist/ManualPopover-CQfjPvFe.js +0 -60
  200. package/dist/MediaWrapper-DDzcjR6V.js +0 -23
  201. package/dist/PackageGroup-mAGXfZDv.js +0 -704
  202. package/dist/PdfTerms-BH_Nwf2h.js +0 -31
  203. package/dist/PdfViewer-mBLxI8bA.js +0 -383
  204. package/dist/PlainHtml-B7gUNNZd.js +0 -27
  205. package/dist/PriceHeader-DClYMPcq.js +0 -338
  206. package/dist/SendForm-Cxv_m8Rq.js +0 -1023
  207. package/dist/Setup-B90VDZTG.js +0 -50
  208. package/dist/ThemeColorRow-D-Z7w4Wk.js +0 -69
  209. package/dist/ToggleBinding-DOeTcWzi.js +0 -42
  210. package/dist/UploadModal-DOPLVEpV.js +0 -95
  211. package/dist/VideoPlayerInput-1zG06elO.js +0 -97
  212. package/dist/VideoPlayerSettings-O-4rAYYh.js +0 -61
  213. package/dist/VideoSelectModal-DzqFrqCg.js +0 -104
  214. package/dist/answerDocumentMixin-HBiNWYCH.js +0 -51
  215. package/dist/debounce-Ch1d3526.js +0 -84
  216. package/dist/formValidationMixin-D_MzsHsR.js +0 -49
  217. package/dist/index-BNdbPq4J.js +0 -492
  218. package/dist/index-BXzugeJ6.js +0 -81
  219. package/dist/index-C5wcxrC6.js +0 -167
  220. package/dist/index-CgDOs7t4.js +0 -2700
  221. package/dist/index-Cj-_2coz.js +0 -351
  222. package/dist/index-DpqV5y0K.js +0 -102
  223. package/dist/main-BL_yzf2r.js +0 -57357
  224. package/dist/mapFormMixin-Cu_vkTP-.js +0 -3028
  225. package/dist/omit-Dfe_H1Ft.js +0 -31
  226. package/dist/simplebar.min-CRlLD1Oz.js +0 -71
  227. package/dist/splitpanes-BHUVsCZF.js +0 -382
  228. package/dist/style.css +0 -4
  229. package/dist/throttle-BX_w77tW.js +0 -18
  230. package/dist/tippy.esm-n4arfVzA.js +0 -1805
  231. package/dist/vuedraggable.umd-DW4PJoZ3.js +0 -3161
  232. package/dist/vuex.esm-DKGl8mcw.js +0 -467
@@ -1,666 +0,0 @@
1
- import { C as v } from "./ClientAutocomplete-CZ55-DKe.js";
2
- import { n as c, ai as y, M as p, al as C, t as b, I as _, b as l, d as $, c as x, g as m, am as w, ab as k } from "./main-BL_yzf2r.js";
3
- import { C as S, a as N, w as f } from "./CDropdownItem-CN7gSfgY.js";
4
- import { C as I } from "./CFormField-Clvcf2Jh.js";
5
- import { C as F } from "./CPhoneInput-CEHXh5jM.js";
6
- import { v as r } from "./index-BNdbPq4J.js";
7
- import { m as g, b as M, a as R } from "./vuex.esm-DKGl8mcw.js";
8
- import { o as z } from "./omit-Dfe_H1Ft.js";
9
- const O = {
10
- name: "CRadio",
11
- mixins: [y]
12
- };
13
- var q = function() {
14
- var e = this, t = e._self._c;
15
- return t("label", { ref: "label", staticClass: "b-radio radio", class: [`is-${e.size}`, { "is-disabled": e.disabled }], attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(i) {
16
- return !i.type.indexOf("key") && e._k(i.keyCode, "enter", 13, i.key, "Enter") ? null : (i.preventDefault(), e.$refs.label.click());
17
- } } }, [t("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, required: e.required, name: e.name, type: "radio" }, domProps: { value: e.nativeValue, checked: e._q(e.computedValue, e.nativeValue) }, on: { click: function(i) {
18
- i.stopPropagation();
19
- }, change: function(i) {
20
- e.computedValue = e.nativeValue;
21
- } } }), t("span", { staticClass: "check", class: `is-${e.type}` }), t("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
22
- }, A = [], D = /* @__PURE__ */ c(
23
- O,
24
- q,
25
- A,
26
- !1,
27
- null,
28
- null
29
- );
30
- const V = D.exports;
31
- function h(a) {
32
- if (typeof a > "u")
33
- throw Error("Missing param inputParam");
34
- let e = a;
35
- Number.isInteger(e) && (e = e.toString());
36
- let t = 0;
37
- const i = e.length, n = i % 2;
38
- let s, o;
39
- for (s = 0; s < i; s += 1)
40
- o = parseInt(e.charAt(s), 10), s % 2 === n && (o *= 2), o > 9 && (o -= 9), t += o;
41
- return t % 10 === 0;
42
- }
43
- function u(a) {
44
- let e = a.replace(/ /g, "");
45
- return e = e.replace(/-/g, ""), !h(e) || (e = [e.slice(0, 6), "-", e.slice(6)].join(""), !e.match(/^(\d{6})-(\d{4})$/)) ? !1 : e;
46
- }
47
- function d(a) {
48
- if (typeof a > "u" || a === null || a === "")
49
- return !1;
50
- let e = a.trim().replace(/[^0-9]+/g, "");
51
- if (e.length !== 10 && e.length !== 12)
52
- return !1;
53
- if (e.length === 10) {
54
- const n = e.substring(0, 2), s = (/* @__PURE__ */ new Date()).getFullYear(), o = parseInt(
55
- s.toString().substring(2, 4),
56
- 10
57
- );
58
- parseInt(n, 10) === 19 || parseInt(n, 10) === 20 || (parseInt(n, 10) >= 0 && parseInt(n, 10) <= o ? e = `20${e}` : e = `19${e}`);
59
- }
60
- return (/* @__PURE__ */ new Date()).getFullYear() - parseInt(e.substring(0, 4), 10) < 16 ? !1 : h(e.substring(2)) ? e : !1;
61
- }
62
- const B = {
63
- sv: {
64
- title: "Mottagare",
65
- updateButton: "Spara mottagare",
66
- individual: "Privatperson",
67
- reference: "Referens",
68
- workAddressSubLabel: "Där arbetet utförs",
69
- showMore: "Visa fler fält",
70
- seperateWorkAddress: {
71
- false: "Arbetsadress som ovan",
72
- true: "Annan"
73
- },
74
- placeholders: {
75
- name: "Mottagarens namn",
76
- companyName: "Företagets namn",
77
- socialNo: "10 eller 12 siffror",
78
- orgNo: "Företagets org-nr",
79
- reference: "Er referens",
80
- cellphone: "Mobilnummer",
81
- address: "Gatuadress"
82
- },
83
- validations: {
84
- name: {
85
- required: "Vem är din kund?"
86
- },
87
- orgNo: {
88
- personalNumber: "Personnumret är inte giltigt"
89
- },
90
- realOrgNo: {
91
- realOrgNo: "Organisationsnumret är inte giltigt"
92
- },
93
- reference: {
94
- required: "Vem är din referens?"
95
- },
96
- email: {
97
- required: "E-post saknas",
98
- email: "E-posten är ogiltig"
99
- }
100
- },
101
- signMethod: {
102
- button: {
103
- title: "Standard - knapptryck",
104
- content: "Bevisnivå: IP-adress, tidpunkt och enhet."
105
- },
106
- bankId: {
107
- title: "BankId",
108
- content: "Samma säkerhetsgrad som bankerna har."
109
- },
110
- signature: {
111
- title: "Standard",
112
- content: "Bevisnivå: IP-adress, tidpunkt och enhet."
113
- },
114
- inPerson: {
115
- title: "Fysisk underskrift",
116
- content: "Signatur på utskrivet dokument"
117
- }
118
- }
119
- },
120
- en: {
121
- title: "Recipient",
122
- updateButton: "Save recipient",
123
- individual: "Individual",
124
- reference: "Contact",
125
- workAddressSubLabel: "Where work is going to be performed",
126
- showMore: "Show additional fields",
127
- seperateWorkAddress: {
128
- false: "Work address same as above",
129
- true: "Other"
130
- },
131
- placeholders: {
132
- name: "Recipient name",
133
- companyName: "Company name",
134
- socialNo: "10 or 12 numbers",
135
- orgNo: "Company registration number",
136
- reference: "Name",
137
- cellphone: "Cellphone",
138
- address: "Street"
139
- },
140
- validations: {
141
- name: {
142
- required: "Who's your contact person?"
143
- },
144
- orgNo: {
145
- personalNumber: "Invalid social security number"
146
- },
147
- realOrgNo: {
148
- realOrgNo: "Invalid organisation number"
149
- },
150
- reference: {
151
- required: "Missing contact name"
152
- },
153
- email: {
154
- required: "Email missing",
155
- email: "Invalid email"
156
- }
157
- },
158
- signMethod: {
159
- button: {
160
- title: "Standard - button",
161
- content: "Level of proof: IP address, timestamp and device."
162
- },
163
- bankId: {
164
- title: "BankID",
165
- content: "Same level of proof as the banks use."
166
- },
167
- signature: {
168
- title: "Signature",
169
- content: "Level of proof: IP address, timestamp and device."
170
- },
171
- inPerson: {
172
- title: "In person",
173
- content: "Signature on print document"
174
- }
175
- }
176
- }
177
- }, { mapFields: P } = p({
178
- getterType: "forms/getField",
179
- mutationType: "forms/updateField"
180
- }), E = {
181
- name: "FormClient",
182
- i18nOptions: {
183
- namespaces: "formClient",
184
- messages: B
185
- },
186
- components: {
187
- ClientAutocomplete: v,
188
- Animation: C,
189
- CCheckbox: b,
190
- CDropdown: S,
191
- CDropdownItem: N,
192
- CField: I,
193
- CPhoneInput: F,
194
- CRadio: V
195
- },
196
- mixins: [f],
197
- props: {
198
- requireReference: {
199
- type: Boolean,
200
- default: !0
201
- },
202
- searchEnabled: {
203
- type: Boolean,
204
- default: !1
205
- },
206
- validateOrgNo: {
207
- type: Boolean,
208
- default: !1
209
- },
210
- simpleForm: {
211
- type: Boolean,
212
- default: !1
213
- },
214
- inputFocusOnMount: {
215
- type: String,
216
- default: ""
217
- },
218
- // Optional field with prop sync, if within the context of documents
219
- documentRole: {
220
- type: String,
221
- default: ""
222
- },
223
- // Optional field with prop sync, if within the context of documents
224
- answerMethod: {
225
- type: Object,
226
- default: null
227
- },
228
- signOptions: {
229
- type: Array,
230
- default: () => []
231
- },
232
- isPublicForm: {
233
- type: Boolean,
234
- default: !1
235
- }
236
- },
237
- validations() {
238
- return [
239
- this.name,
240
- this.orgNo,
241
- this.reference,
242
- this.email,
243
- this.cellphone
244
- ].some((e) => !!e) ? {
245
- orgNo: {
246
- personalNumber(e) {
247
- return !this.validateOrgNo || !e ? !0 : this.isIndivid ? d(e) : u(e) || d(e);
248
- }
249
- },
250
- reference: {
251
- required: r.requiredIf((e) => e.requireReference && !e.isIndivid)
252
- },
253
- email: {
254
- email: r.email
255
- }
256
- } : {
257
- name: {
258
- required: r.required
259
- },
260
- orgNo: {
261
- required: r.requiredIf((e) => e.type === "company")
262
- },
263
- cellphone: {
264
- required: r.requiredIf((e) => !e.isIndivid)
265
- },
266
- reference: {
267
- required: r.requiredIf((e) => !e.isIndivid)
268
- },
269
- email: {
270
- required: r.requiredIf((e) => !e.isIndivid)
271
- }
272
- };
273
- },
274
- computed: {
275
- ...P({
276
- id: "endCustomer.id",
277
- type: "endCustomer.customerType",
278
- name: "endCustomer.name",
279
- realOrgNo: "endCustomer.org_no",
280
- reference: "endCustomer.reference",
281
- email: "endCustomer.email",
282
- street: "endCustomer.street",
283
- zip: "endCustomer.zip",
284
- city: "endCustomer.city",
285
- cellphone: "endCustomer.cellphone",
286
- cellphoneRegion: "endCustomer.cellphoneRegion",
287
- separateWorkAddress: "endCustomer.separateWorkAddress",
288
- workStreet: "endCustomer.workStreet",
289
- workZip: "endCustomer.workZip",
290
- workCity: "endCustomer.workCity",
291
- reverseVat: "endCustomer.reverseVat",
292
- doUpdateEndCustomer: "endCustomer.doUpdateEndCustomer"
293
- }),
294
- ...g({
295
- isPosting: "endCustomers/isPosting",
296
- companyRegion: "application/companyRegion",
297
- feature: "application/feature"
298
- }),
299
- messages() {
300
- return {
301
- name: {
302
- required: this.$t("validations.name.required")
303
- },
304
- orgNo: {
305
- personalNumber: this.$t("validations.orgNo.personalNumber")
306
- },
307
- realOrgNo: {
308
- personalNumber: this.$t("validations.realOrgNo.realOrgNo")
309
- },
310
- reference: {
311
- required: this.$t("validations.reference.required")
312
- },
313
- email: {
314
- required: this.$t("validations.email.required"),
315
- email: this.$t("validations.email.email")
316
- }
317
- };
318
- },
319
- orgNo: {
320
- get() {
321
- return this.realOrgNo;
322
- },
323
- set(a) {
324
- const e = this.isIndivid ? d(a) : u(a) || d(a);
325
- return this.validateOrgNo && e ? (this.realOrgNo = e, !0) : (this.realOrgNo = a, !0);
326
- }
327
- },
328
- isIndivid() {
329
- return this.type === "individual";
330
- }
331
- },
332
- watch: {
333
- type(a) {
334
- _.setItem("defaultClientType", a);
335
- }
336
- },
337
- mounted() {
338
- this.$refs[this.inputFocusOnMount] ? this.$refs[this.inputFocusOnMount].$el.querySelector("input").focus() : this.$refs.name.$el.querySelector("input").focus();
339
- },
340
- methods: {
341
- validateForm() {
342
- return this.$v.$touch(), this.$v.$invalid ? !1 : (this.$emit("submit", !0), !0);
343
- }
344
- }
345
- };
346
- var W = function() {
347
- var e = this, t = e._self._c;
348
- return t("div", { staticClass: "form-client" }, [e.simpleForm ? t("form", { on: { submit: function(i) {
349
- return i.preventDefault(), e.validateForm.apply(null, arguments);
350
- } } }, [t("div", { staticClass: "space-between flex flex-wrap items-center pb-6" }, [t("div", { staticClass: "flex-grow", staticStyle: { "font-weight": "600", "font-size": "20px" } }, [e._v(" " + e._s(e.$t("_common:recipient").capitalize()) + " ")]), t("div", { staticClass: "type-toggle" }, [t("div", { staticClass: "type-toggle-button", class: { active: e.type === "individual" }, on: { click: function(i) {
351
- e.type = "individual";
352
- } } }, [e._v(" " + e._s(e.$t("individual")) + " ")]), t("div", { staticClass: "type-toggle-button", class: { active: e.type === "company" }, on: { click: function(i) {
353
- e.type = "company";
354
- } } }, [e._v(" " + e._s(e.$t("_common:company").capitalize()) + " ")])])]), t("CField", { staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { label: e.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(), validator: e.$v.name, messages: e.messages.name, "label-position": "inside" } }, [t("ClientAutocomplete", { ref: "name", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"), "search-enabled": e.searchEnabled, "show-loading": !0 }, on: { setClient: function(i) {
355
- return e.$emit("setClient", i);
356
- } }, model: { value: e.name, callback: function(i) {
357
- e.name = i;
358
- }, expression: "name" } })], 1), t("Animation", [e.isIndivid ? e._e() : t("CField", { staticClass: "pb-4", attrs: { validator: e.$v.reference, messages: e.messages.reference, label: e.$t("reference").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "reference", attrs: { placeholder: e.$t("placeholders.reference") }, model: { value: e.reference, callback: function(i) {
359
- e.reference = i;
360
- }, expression: "reference" } })], 1)], 1), t("CField", { staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { validator: e.$v.email, messages: e.messages.email, label: e.$t("_common:email").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "email", attrs: { placeholder: e.$t("_common:email").capitalize() }, model: { value: e.email, callback: function(i) {
361
- e.email = typeof i == "string" ? i.trim() : i;
362
- }, expression: "email" } })], 1), t("CPhoneInput", { ref: "cellphone", staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { label: e.$t("_common:cellphone").capitalize(), placeholder: e.$t("placeholders.cellphone"), region: e.cellphoneRegion, "default-region": e.companyRegion, "label-position": "inside" }, on: { "update:region": function(i) {
363
- e.cellphoneRegion = i;
364
- } }, model: { value: e.cellphone, callback: function(i) {
365
- e.cellphone = i;
366
- }, expression: "cellphone" } }), e.documentRole ? t("CDropdown", { staticStyle: { "margin-bottom": "calc(1 * var(--rem))" }, attrs: { expanded: "" }, scopedSlots: e._u([{ key: "trigger", fn: function() {
367
- return [t("CButton", { staticClass: "is-left", staticStyle: { width: "100%" }, attrs: { "dropdown-icon": !0, "icon-props": {
368
- stroke: "hsl(0, 0%, 50%)"
369
- }, "icon-left": e.documentRole === "signee" ? "pen-tool" : "eye", type: "none", pattern: "secondary" } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)) + " ")]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.label`)) + " ")])])])];
370
- }, proxy: !0 }], null, !1, 251902115) }, e._l(["signee", "recipient", "approver"], function(i) {
371
- return t("CDropdownItem", { key: i, attrs: { "icon-left": i === "signee" ? "pen-tool" : "eye", "icon-props": {
372
- stroke: "hsl(0, 0%, 50%)"
373
- } }, on: { click: function(n) {
374
- return e.$emit("update:document-role", i);
375
- } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${i}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${i}.label`)) + " ")])])]);
376
- }), 1) : e._e(), t("CButton", { attrs: { type: "secondary", pattern: "tertiary", size: "small", "icon-left": "arrow-right" }, on: { click: function(i) {
377
- return e.$emit("show-more");
378
- } } }, [e._v(" " + e._s(e.$t("showMore").capitalize()) + " ")]), t("CButton", { staticClass: "mt-4", staticStyle: { padding: "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: { loading: e.isPosting, "native-type": "submit", type: "secondary", wide: "", size: "medium" } }, [e._v(" " + e._s(e.$t("updateButton")) + " ")])], 1) : t("div", { class: { "column-only": e.windowWidth <= 600 } }, [t("div", { staticClass: "flex items-center justify-center", staticStyle: { "margin-bottom": "calc(2.5 * var(--rem))" } }, [t("div", { staticClass: "type-toggle" }, [t("div", { staticClass: "type-toggle-button", class: { active: e.type === "individual" }, on: { click: function(i) {
379
- e.type = "individual";
380
- } } }, [e._v(" " + e._s(e.$t("individual")) + " ")]), t("div", { staticClass: "type-toggle-button", class: { active: e.type === "company" }, on: { click: function(i) {
381
- e.type = "company";
382
- } } }, [e._v(" " + e._s(e.$t("_common:company").capitalize()) + " ")])])]), t("CField", { staticClass: "flex", attrs: { grouped: "" } }, [t("CField", { attrs: { label: e.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(), validator: e.$v.name, messages: e.messages.name, "label-position": "inside", expanded: "" } }, [t("ClientAutocomplete", { ref: "name", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"), "show-loading": !0, "search-enabled": e.searchEnabled }, on: { setClient: function(i) {
383
- return e.$emit("setClient", i);
384
- } }, model: { value: e.name, callback: function(i) {
385
- e.name = i;
386
- }, expression: "name" } })], 1), t("CField", { attrs: { label: e.isIndivid ? e.$t("_common:socialNo").capitalize() : e.$t("_common:orgNoShort").capitalize(), validator: e.$v.orgNo, messages: e.isIndivid ? e.messages.orgNo : e.messages.realOrgNo, "label-position": "inside", expanded: "" } }, [t("CInput", { ref: "orgNo", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.socialNo") : e.$t("placeholders.orgNo") }, model: { value: e.orgNo, callback: function(i) {
387
- e.orgNo = i;
388
- }, expression: "orgNo" } })], 1)], 1), t("Animation", [e.type && !e.isIndivid ? t("CField", { staticClass: "pb-4", attrs: { validator: e.$v.reference, messages: e.messages.reference, label: e.$t("_common:reference").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "reference", attrs: { placeholder: e.$t("placeholders.reference") }, model: { value: e.reference, callback: function(i) {
389
- e.reference = i;
390
- }, expression: "reference" } })], 1) : e._e(), e.type && !e.isIndivid && e.feature("reverseVat") && e.feature("regionSE") ? t("CField", { staticStyle: { "padding-left": "0.5em", "margin-bottom": "calc(2 * var(--rem))" } }, [t("CCheckbox", { attrs: { size: "normal" }, model: { value: e.reverseVat, callback: function(i) {
391
- e.reverseVat = i;
392
- }, expression: "reverseVat" } }, [e._v(" " + e._s(e.$t("_common:vat.reverseVat")) + " ")])], 1) : e._e()], 1), t("CField", { staticClass: "flex", attrs: { grouped: "" } }, [t("CField", { staticClass: "flex-1", attrs: { validator: e.$v.email, messages: e.messages.email, label: e.$t("_common:email").capitalize(), "label-position": "inside", expanded: "" } }, [t("CInput", { ref: "email", attrs: { placeholder: e.$t("_common:email").capitalize() }, model: { value: e.email, callback: function(i) {
393
- e.email = typeof i == "string" ? i.trim() : i;
394
- }, expression: "email" } })], 1), t("CPhoneInput", { staticClass: "flex-1", staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { label: e.$t("_common:cellphone").capitalize(), placeholder: e.$t("placeholders.cellphone"), region: e.cellphoneRegion, "default-region": e.companyRegion, "label-position": "inside" }, on: { "update:region": function(i) {
395
- e.cellphoneRegion = i;
396
- } }, model: { value: e.cellphone, callback: function(i) {
397
- e.cellphone = i;
398
- }, expression: "cellphone" } })], 1), t("CField", { attrs: { label: e.$t("_common:address").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "street", attrs: { placeholder: e.$t("placeholders.address") }, model: { value: e.street, callback: function(i) {
399
- e.street = i;
400
- }, expression: "street" } })], 1), t("CField", { staticClass: "force-two flex", attrs: { grouped: "" } }, [t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "zip", attrs: { placeholder: e.$t("_common:zip").capitalize() }, model: { value: e.zip, callback: function(i) {
401
- e.zip = i;
402
- }, expression: "zip" } })], 1), t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "city", attrs: { placeholder: e.$t("_common:city").capitalize() }, model: { value: e.city, callback: function(i) {
403
- e.city = i;
404
- }, expression: "city" } })], 1)], 1), t("CField", { staticClass: "flex" }, [t("CRadio", { staticStyle: { "margin-bottom": "0.5em" }, attrs: { "native-value": !1, type: "secondary", size: "small" }, model: { value: e.separateWorkAddress, callback: function(i) {
405
- e.separateWorkAddress = i;
406
- }, expression: "separateWorkAddress" } }, [e._v(" " + e._s(e.$t("seperateWorkAddress.false")) + " ")]), t("CRadio", { staticStyle: { "margin-bottom": "0.5em" }, attrs: { "native-value": !0, type: "secondary", size: "small" }, model: { value: e.separateWorkAddress, callback: function(i) {
407
- e.separateWorkAddress = i;
408
- }, expression: "separateWorkAddress" } }, [e._v(" " + e._s(e.$t("seperateWorkAddress.true")) + " ")])], 1), t("Animation", [e.type && e.separateWorkAddress ? t("div", [t("CField", { attrs: { label: e.$t("_common:addressWork").capitalize() + ` ( ${e.$t("workAddressSubLabel")} )` } }, [t("CInput", { ref: "workStreet", attrs: { placeholder: e.$t("placeholders.address") }, model: { value: e.workStreet, callback: function(i) {
409
- e.workStreet = i;
410
- }, expression: "workStreet" } })], 1), t("CField", { staticClass: "force-two flex", attrs: { grouped: "" } }, [t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "workZip", attrs: { placeholder: e.$t("_common:zip").capitalize(), expanded: "" }, model: { value: e.workZip, callback: function(i) {
411
- e.workZip = i;
412
- }, expression: "workZip" } })], 1), t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "workCity", attrs: { placeholder: e.$t("_common:city").capitalize(), expanded: "" }, model: { value: e.workCity, callback: function(i) {
413
- e.workCity = i;
414
- }, expression: "workCity" } })], 1)], 1)], 1) : e._e()]), e.documentRole || e.answerMethod ? t("CField", { staticClass: "flex pt-4", attrs: { grouped: "" } }, [e.documentRole ? t("div", { staticClass: "dropdown-field-wrapper flex min-w-0 flex-col" }, [t("div", { staticClass: "my-1 text-sm text-gray-600" }, [e._v(" " + e._s(e.$t("_common:documentRole.title")) + " ")]), t("CDropdown", { staticStyle: { "margin-bottom": "calc(1 * var(--rem))" }, attrs: { expanded: "" }, scopedSlots: e._u([{ key: "trigger", fn: function() {
415
- return [t("CButton", { staticClass: "is-left", attrs: { "dropdown-icon": !0, "icon-props": {
416
- stroke: "hsl(0, 0%, 50%)"
417
- }, "icon-left": e.documentRole === "signee" ? "pen-tool" : "eye", type: "none", pattern: "secondary", expanded: "" } }, [t("div", { staticClass: "py-1 leading-5" }, [t("div", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)) + " ")]), t("div", { staticClass: "text-xs opacity-70" }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.label`)) + " ")])])])];
418
- }, proxy: !0 }], null, !1, 3591348405) }, e._l(["signee", "recipient", "approver"], function(i) {
419
- return t("CDropdownItem", { key: i, attrs: { "icon-left": i === "signee" ? "pen-tool" : "eye", "icon-props": {
420
- stroke: "hsl(0, 0%, 50%)"
421
- } }, on: { click: function(n) {
422
- return e.$emit("update:document-role", i);
423
- } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${i}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${i}.label`)) + " ")])])]);
424
- }), 1)], 1) : e._e(), e.answerMethod ? t("div", { staticClass: "dropdown-field-wrapper flex min-w-0 flex-col" }, [t("div", { staticClass: "my-1 text-sm text-gray-600" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + " ")]), t("CDropdown", { staticStyle: { "margin-bottom": "calc(1 * var(--rem))" }, attrs: { expanded: "" }, scopedSlots: e._u([{ key: "trigger", fn: function() {
425
- return [t("CButton", { staticClass: "is-left", attrs: { "dropdown-icon": !0, type: "none", pattern: "secondary", expanded: "" } }, [t("div", { staticClass: "max-w-[calc(16_*_var(--rem))] py-1 leading-5" }, [t("div", [e._v(e._s(e.$t(`signMethod.${e.answerMethod.accept}.title`)))]), t("div", { staticClass: "truncate text-xs opacity-70" }, [e._v(" " + e._s(e.$t(`signMethod.${e.answerMethod.accept}.content`)) + " ")])])])];
426
- }, proxy: !0 }], null, !1, 2465514337) }, e._l(e.signOptions, function(i) {
427
- return t("CDropdownItem", { key: i, on: { click: function(n) {
428
- return e.$emit("update:answer-method", {
429
- ...e.answerMethod,
430
- accept: i
431
- });
432
- } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`signMethod.${i}.title`)))]), t("div", { staticClass: "max-w-[calc(12_*_var(--rem))] truncate", staticStyle: { "font-size": "12px", opacity: "0.7", "text-wrap": "wrap" } }, [e._v(" " + e._s(e.$t(`signMethod.${i}.content`)) + " ")])])]);
433
- }), 1)], 1) : e._e()]) : e._e(), t("div", { staticStyle: { "margin-top": "calc(3 * var(--rem))" } }, [t("CButton", { staticStyle: { padding: "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: { loading: e.isPosting, type: "secondary", wide: "" }, on: { click: e.validateForm } }, [e._v(e._s(e.$t("updateButton")))])], 1)], 1)]);
434
- }, T = [], L = /* @__PURE__ */ c(
435
- E,
436
- W,
437
- T,
438
- !1,
439
- null,
440
- "3ff2febb"
441
- );
442
- const j = L.exports, { mapFields: Z } = p({
443
- getterType: "forms/getField",
444
- mutationType: "forms/updateField"
445
- }), U = {
446
- name: "ClientModal",
447
- i18nOptions: {
448
- namespaces: "clientModal",
449
- messages: {
450
- en: {
451
- unsavedDialog: {
452
- title: "Unsaved changes",
453
- message: "Are you sure you want to cancel?",
454
- cancel: "No",
455
- submit: "Yes"
456
- },
457
- removeDialog: {
458
- title: "Remove recipient",
459
- message: "Would you like to remove recipient from the document?"
460
- }
461
- },
462
- sv: {
463
- unsavedDialog: {
464
- title: "Osparade ändringar",
465
- message: "Är du säker på att du vill avbryta?",
466
- cancel: "Stanna kvar",
467
- submit: "Ja, stäng"
468
- },
469
- removeDialog: {
470
- title: "Ta bort mottagare",
471
- message: "Vill du ta bort mottagaren från dokumentet?"
472
- }
473
- }
474
- }
475
- },
476
- components: {
477
- FormClient: j
478
- },
479
- mixins: [f],
480
- props: {
481
- documentClientIndex: {
482
- type: Number,
483
- default: 0
484
- },
485
- signOrder: {
486
- type: Number,
487
- default: 0
488
- },
489
- inputFocusOnMount: {
490
- type: String,
491
- default: ""
492
- },
493
- forceExpand: {
494
- type: Boolean,
495
- default: !1
496
- },
497
- signOptions: {
498
- type: Array,
499
- default: () => ["signature", "inPerson"]
500
- },
501
- setFormValue: {
502
- type: Function,
503
- required: !0
504
- },
505
- removeFormValue: {
506
- type: Function,
507
- required: !0
508
- },
509
- // Optional prop if this modal is mounted from public form
510
- isPublicForm: {
511
- type: Boolean,
512
- default: !1
513
- }
514
- },
515
- data() {
516
- var e;
517
- let a = l(this.formData, "data.defaultAnswerMethod.accept") || "signature";
518
- return (e = this.signOptions) != null && e.length && !this.signOptions.includes(a) && ([a] = this.signOptions), {
519
- storedNewClient: {
520
- documentRole: "signee",
521
- answerMethod: {
522
- accept: a,
523
- deny: "button"
524
- }
525
- },
526
- isLoading: !1,
527
- hasChanged: !1,
528
- showMore: !1
529
- };
530
- },
531
- computed: {
532
- ...Z({
533
- endCustomer: "endCustomer"
534
- }),
535
- ...M("forms", {
536
- formData: (a) => a.document2
537
- }),
538
- ...g({
539
- can: "application/can",
540
- feature: "application/feature",
541
- defaultClientType: "endCustomers/defaultClientType"
542
- }),
543
- validateOrgNo() {
544
- return !!(this.feature("bankId") || this.isPublicForm && $[x.brand].defaultRegion === "SE");
545
- },
546
- existsOnDocument() {
547
- return !!l(this.formData, `clients[${this.documentClientIndex}]`);
548
- }
549
- },
550
- created() {
551
- this.forceExpand && (this.showMore = !0);
552
- const a = l(
553
- this.formData,
554
- `clients[${this.documentClientIndex}]`,
555
- {}
556
- );
557
- this.loadForm(a), ["endCustomer", "storedNewClient"].forEach(
558
- (e) => this.$watch(e, {
559
- deep: !0,
560
- handler() {
561
- this.hasChanged = !0;
562
- }
563
- })
564
- );
565
- },
566
- methods: {
567
- ...R({
568
- saveClient: m.FORM_SUBMIT_ENDCUSTOMER,
569
- showMessage: m.SHOW_MESSAGE
570
- }),
571
- omit: z,
572
- loadForm(a = {}) {
573
- this.storedNewClient = Object.assign(this.storedNewClient, a), this.endCustomer = w({
574
- type: this.defaultClientType(),
575
- ...a
576
- });
577
- },
578
- async onSave() {
579
- this.isLoading = !0;
580
- let a = l(this.endCustomer, "id");
581
- if (!this.isPublicForm) {
582
- let e = !1;
583
- this.endCustomer && (this.endCustomer.id ? this.can("endCustomers", "modify", this.endCustomer.id) && (e = !0) : this.can("endCustomers", "create") && (e = !0)), e && (a = await this.saveClient());
584
- }
585
- this.setFormValue({
586
- key: `clients[${this.documentClientIndex}]`,
587
- value: k(
588
- { ...this.endCustomer, ...a && { id: a } },
589
- { ...this.storedNewClient, signOrder: this.signOrder }
590
- )
591
- }), this.$emit("close"), this.isLoading = !1;
592
- },
593
- removeClient() {
594
- this.showMessage({
595
- displayType: "dialog",
596
- type: "danger",
597
- title: this.$t("removeDialog.title"),
598
- message: this.$t("removeDialog.message"),
599
- actions: {
600
- cancel: {
601
- text: this.$t("_common:cancel"),
602
- callback: "cancel"
603
- },
604
- submit: {
605
- text: this.$t("_common:remove"),
606
- callback: () => {
607
- this.removeFormValue(`clients[${this.documentClientIndex}]`), this.$emit("close");
608
- }
609
- }
610
- }
611
- });
612
- },
613
- close() {
614
- return !this.hasChanged || !this.showMore ? this.$emit("close") : this.showMessage({
615
- displayType: "dialog",
616
- type: "danger",
617
- title: this.$t("unsavedDialog.title"),
618
- message: this.$t("unsavedDialog.message"),
619
- actions: {
620
- cancel: {
621
- text: this.$t("unsavedDialog.cancel"),
622
- callback: "cancel"
623
- },
624
- submit: {
625
- text: this.$t("unsavedDialog.submit"),
626
- callback: () => this.$emit("close")
627
- }
628
- }
629
- });
630
- }
631
- }
632
- };
633
- var Y = function() {
634
- var e = this, t = e._self._c;
635
- return t("div", { staticClass: "font-primary fixed inset-0 z-[1000] grid place-items-center overflow-auto bg-black bg-opacity-10 max-sm:block max-sm:min-h-full max-sm:w-full max-sm:overflow-auto sm:py-4", on: { "&click": function(i) {
636
- return i.target !== i.currentTarget ? null : e.close.apply(null, arguments);
637
- } } }, [t("div", { staticClass: "max-sm:h-initial relative mx-auto flex flex-col items-center rounded-xl bg-white p-10 text-lg max-sm:min-h-full max-sm:w-full max-sm:rounded-none max-sm:pt-16" }, [t("CButton", { staticClass: "z-2 absolute right-4 top-4", class: e.showMore ? "" : "sm:!hidden", attrs: { pattern: "tertiary", type: "none", circle: "", icon: "x" }, on: { click: e.close } }), t("FormClient", { staticClass: "max-w-full p-0", class: [e.showMore ? "w-[520px]" : "w-[360px]"], attrs: { "search-enabled": !0, "require-reference": !1, "simple-form": !e.showMore, "input-focus-on-mount": e.inputFocusOnMount, "document-role": e.storedNewClient.documentRole, "answer-method": e.storedNewClient.answerMethod, "sign-options": e.signOptions, "validate-org-no": e.validateOrgNo, "is-public-form": e.isPublicForm }, on: { "update:documentRole": function(i) {
638
- return e.$set(e.storedNewClient, "documentRole", i);
639
- }, "update:document-role": function(i) {
640
- return e.$set(e.storedNewClient, "documentRole", i);
641
- }, "update:answerMethod": function(i) {
642
- return e.$set(e.storedNewClient, "answerMethod", i);
643
- }, "update:answer-method": function(i) {
644
- return e.$set(e.storedNewClient, "answerMethod", i);
645
- }, setClient: function(i) {
646
- e.loadForm(e.omit(i, ["answerMethod"]));
647
- }, submit: e.onSave, "show-more": function(i) {
648
- e.showMore = !0;
649
- } } }), e.existsOnDocument && e.mq === "sm" ? t("CButton", { staticClass: "mt-4 text-sm", attrs: { type: "danger", pattern: "secondary", wide: "" }, on: { click: e.removeClient } }, [e._v(" " + e._s(e.$t("_common:remove")) + " ")]) : e._e()], 1)]);
650
- }, G = [], H = /* @__PURE__ */ c(
651
- U,
652
- Y,
653
- G,
654
- !1,
655
- null,
656
- null
657
- );
658
- const J = H.exports, se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
659
- __proto__: null,
660
- default: J
661
- }, Symbol.toStringTag, { value: "Module" }));
662
- export {
663
- J as C,
664
- V as a,
665
- se as b
666
- };