@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
@@ -0,0 +1,160 @@
1
+ import { m as C } from "./mapFormMixin-C7FJLnbO.js";
2
+ import { V as F } from "./PdfViewer-CSf4Rtbj.js";
3
+ import { _ as I, z as g, p as P, D as h, o as n, b as t, E as V, G as x, n as f, s as a, d as p, v as d, w as v, F as y, B as b, f as m, c as z, e as u } from "./main-Bn5XkQPb.js";
4
+ const S = {
5
+ i18nOptions: {
6
+ namespaces: "pdfBlock",
7
+ messages: {
8
+ en: {
9
+ embedded: "Embedded",
10
+ numOfPages: "- {{numPages}} pages",
11
+ upload: "Upload PDF"
12
+ },
13
+ sv: {
14
+ embedded: "Inbäddat",
15
+ numOfPages: "- {{numPages}} sidor",
16
+ upload: "Ladda upp en pdf"
17
+ }
18
+ }
19
+ },
20
+ name: "Pdf",
21
+ components: {
22
+ PdfViewer: F,
23
+ FileIcon: g(
24
+ () => import("./Index-Mt4mSaNT.js")
25
+ ),
26
+ BaseUpload: g(
27
+ () => import("./BaseUpload-DrWzuvbS.js")
28
+ )
29
+ },
30
+ mixins: [C(["file"])],
31
+ inject: {
32
+ isPdf: {
33
+ default: !1
34
+ },
35
+ _firstBlock: {
36
+ default: !1
37
+ },
38
+ _lastBlock: {
39
+ default: !1
40
+ }
41
+ },
42
+ data() {
43
+ return {
44
+ uploadProgress: null,
45
+ isHover: !1,
46
+ numPages: null,
47
+ maxFileSize: 1e3 * 1e3 * 30
48
+ // 30 MB
49
+ };
50
+ },
51
+ computed: {
52
+ showControls() {
53
+ return !this.file || this.isHover || this.uploadProgress !== null;
54
+ },
55
+ // Fetch the file from API instead of AWS directly
56
+ fileUrl() {
57
+ if (!this.file || !this.file.url) return null;
58
+ if (this.file.url.startsWith(P.api.baseUrl)) return this.file.url;
59
+ try {
60
+ const { hostname: e } = new URL(this.file.url);
61
+ if (Object.keys(h).some(
62
+ (i) => e.includes(h[i].domain)
63
+ )) return this.file.url;
64
+ } catch {
65
+ }
66
+ return `${P.api.baseUrl}/public/fileProxy?url=${encodeURIComponent(
67
+ this.file.url
68
+ )}`;
69
+ }
70
+ },
71
+ methods: {
72
+ onUploadSuccess(e) {
73
+ const { id: s, displayName: i, url: c, mime: o } = e.response;
74
+ if (!s) throw new Error("Could not read id from uploaded file");
75
+ this.file = {
76
+ fileId: s,
77
+ name: i,
78
+ mime: o,
79
+ url: c
80
+ }, this.$refs.uploader.remove(e), this.uploadProgress = null;
81
+ }
82
+ }
83
+ }, E = { class: "flex-auto pl-4" }, N = { class: "text-sm text-gray-600" }, _ = { key: 1 };
84
+ function D(e, s, i, c, o, r) {
85
+ const k = u("FileIcon"), B = u("CButton"), w = u("BaseUpload"), U = u("PdfViewer");
86
+ return n(), t("div", {
87
+ style: { position: "relative" },
88
+ class: "font-inter print-no-margin",
89
+ onMouseover: s[2] || (s[2] = (l) => o.isHover = !0),
90
+ onMouseleave: s[3] || (s[3] = (l) => o.isHover = !1)
91
+ }, [
92
+ e.canEdit ? V((n(), t("div", {
93
+ key: 0,
94
+ class: f([!!e.file && "absolute left-0 right-0 top-2 z-10", "chapter-spacing-x pointer-events-none mx-auto flex max-w-full items-center justify-center"])
95
+ }, [
96
+ a("div", {
97
+ class: f([!!e.file && "border border-gray-200 !p-2 shadow-lg", "pointer-events-auto flex w-full max-w-[95%] items-center rounded-lg bg-gray-100 !p-4 text-left"])
98
+ }, [
99
+ p(k, { mime: "application/pdf" }),
100
+ a("div", E, [
101
+ s[4] || (s[4] = a("div", { class: "font-medium" }, "PDF", -1)),
102
+ a("div", N, d(e.$t("embedded")) + " " + d(o.numPages ? e.$t("numOfPages", { numPages: o.numPages }) : ""), 1)
103
+ ]),
104
+ p(w, {
105
+ ref: "uploader",
106
+ "autostart-upload": !0,
107
+ "background-drop": !1,
108
+ extensions: "pdf",
109
+ accept: "application/pdf",
110
+ "max-size": o.maxFileSize,
111
+ onInput: s[0] || (s[0] = ([l]) => o.uploadProgress = l ? parseInt(l.progress, 10) : null),
112
+ onUploadSuccess: r.onUploadSuccess,
113
+ style: { display: "contents" }
114
+ }, {
115
+ default: v(({ openFilePicker: l }) => [
116
+ p(B, {
117
+ type: e.file ? "none" : "secondary",
118
+ pattern: e.file ? "secondary" : "primary",
119
+ disabled: o.uploadProgress !== null,
120
+ style: { "z-index": "2" },
121
+ onClick: l
122
+ }, {
123
+ default: v(() => [
124
+ o.uploadProgress !== null ? (n(), t(y, { key: 0 }, [
125
+ b(d(`${o.uploadProgress}% ${e.$t("_common:uploading")}`), 1)
126
+ ], 64)) : (n(), t(y, { key: 1 }, [
127
+ b(d(e.file ? e.$t("_common:change", { thing: e.$t("_common:file") }) : e.$t("upload")), 1)
128
+ ], 64))
129
+ ]),
130
+ _: 2
131
+ }, 1032, ["type", "pattern", "disabled", "onClick"])
132
+ ]),
133
+ _: 1
134
+ }, 8, ["max-size", "onUploadSuccess"])
135
+ ], 2)
136
+ ], 2)), [
137
+ [x, r.showControls]
138
+ ]) : m("", !0),
139
+ e.file ? (n(), t("div", _, [
140
+ a("div", {
141
+ class: f({
142
+ "break-before-page": r.isPdf && !r._firstBlock,
143
+ "break-after-page": r.isPdf && !r._lastBlock
144
+ })
145
+ }, [
146
+ e.file && e.file.url ? (n(), z(U, {
147
+ key: 0,
148
+ src: r.fileUrl,
149
+ toolbar: !e.canEdit,
150
+ "doc-file-path": `${e._value.file}.url`,
151
+ onNumPages: s[1] || (s[1] = (l) => o.numPages = l)
152
+ }, null, 8, ["src", "toolbar", "doc-file-path"])) : m("", !0)
153
+ ], 2)
154
+ ])) : m("", !0)
155
+ ], 32);
156
+ }
157
+ const M = /* @__PURE__ */ I(S, [["render", D]]);
158
+ export {
159
+ M as default
160
+ };
@@ -0,0 +1,200 @@
1
+ import { m as P } from "./mapFormMixin-C7FJLnbO.js";
2
+ import { f as C } from "./focusDrawerMixin-BVbTYOGr.js";
3
+ import { z as c, X as S, _ as g, o as a, b as d, F as y, k as w, c as l, ap as h, w as f, l as _, d as k, f as z, $ as b, e as p } from "./main-Bn5XkQPb.js";
4
+ import { M as H, g as I } from "./splitpanes-BApidgjj.js";
5
+ const M = {
6
+ name: "HeaderItems",
7
+ components: {
8
+ MediaWrapper: c(() => import("./MediaWrapper-B8msCrQm.js")),
9
+ ContentWrapper: c(() => import("./ContentWrapper-Bj7jbWU0.js")),
10
+ Splitpanes: H,
11
+ Pane: I
12
+ },
13
+ emits: ["input"],
14
+ mixins: [P(["layout", "items", "baseStyle"])],
15
+ props: {
16
+ showControls: {
17
+ type: Boolean,
18
+ default: !1
19
+ }
20
+ },
21
+ computed: {
22
+ forceHorizontal() {
23
+ return this.device === "mobile";
24
+ },
25
+ canResize() {
26
+ return this.device === "desktop" || this.device === "tablet";
27
+ },
28
+ useSplitPane() {
29
+ return this.canEdit && this.canResize;
30
+ }
31
+ },
32
+ created() {
33
+ ["layout", "useSplitPane"].forEach(
34
+ (e) => this.$watch(e, {
35
+ immediate: !0,
36
+ handler: this.addNoDragClass
37
+ })
38
+ );
39
+ },
40
+ methods: {
41
+ addNoDragClass() {
42
+ !this.useSplitPane || !["vertical", "horizontal"].includes(this.layout) || setTimeout(() => {
43
+ var s;
44
+ const e = ((s = this.$el) == null ? void 0 : s.nextElementSibling) || this.$el, t = e == null ? void 0 : e.querySelector(".splitpanes__splitter");
45
+ t && !t.classList.contains("no-drag") && t.classList.add("no-drag");
46
+ }, 0);
47
+ },
48
+ onResize: S(function([{ size: t }]) {
49
+ const s = Math.round(t), v = 100 - s;
50
+ this.items = this.items.map((r, o) => ({ ...r, size: [s, v][o] }));
51
+ }, 100)
52
+ }
53
+ }, N = {
54
+ key: 0,
55
+ style: { position: "relative", "min-height": "calc(100 * var(--vh, 1vh))" }
56
+ };
57
+ function R(e, t, s, v, r, o) {
58
+ return e.layout === "center" ? (a(), d("div", N, [
59
+ (a(!0), d(y, null, w(e.items, (n, i) => (a(), l(h(`${n.type}Wrapper`), {
60
+ key: i,
61
+ size: n.size,
62
+ _document: e._document,
63
+ _value: { ...e._value, item: `${e._value.items}.${i}` },
64
+ "has-hover": s.showControls,
65
+ class: "item",
66
+ style: { position: "absolute", left: "0", top: "0", right: "0", bottom: "0" },
67
+ onInput: t[0] || (t[0] = (u) => e.$emit("input", u))
68
+ }, null, 40, ["size", "_document", "_value", "has-hover"]))), 128))
69
+ ])) : (a(), l(h(o.useSplitPane ? "splitpanes" : "div"), {
70
+ key: 1,
71
+ horizontal: o.forceHorizontal ? !0 : e.layout === "horizontal",
72
+ vertical: o.forceHorizontal ? !1 : e.layout === "vertical",
73
+ style: _(
74
+ !e.canEdit && {
75
+ "flex-direction": o.forceHorizontal || e.layout === "horizontal" ? "column" : "row"
76
+ }
77
+ ),
78
+ class: "layout-wrapper",
79
+ onResize: o.onResize
80
+ }, {
81
+ default: f(() => [
82
+ (a(!0), d(y, null, w(e.items, (n, i) => (a(), l(h(o.useSplitPane ? "pane" : "div"), {
83
+ key: i,
84
+ size: n.size,
85
+ style: _(
86
+ !o.useSplitPane && {
87
+ flex: `1 1 ${n.size}%`
88
+ }
89
+ )
90
+ }, {
91
+ default: f(() => [
92
+ (a(), l(h(`${n.type}Wrapper`), {
93
+ _document: e._document,
94
+ _value: { ...e._value, item: `${e._value.items}.${i}` },
95
+ "has-hover": s.showControls,
96
+ class: "item",
97
+ onInput: t[1] || (t[1] = (u) => e.$emit("input", u))
98
+ }, null, 40, ["_document", "_value", "has-hover"]))
99
+ ]),
100
+ _: 2
101
+ }, 1032, ["size", "style"]))), 128))
102
+ ]),
103
+ _: 1
104
+ }, 40, ["horizontal", "vertical", "style", "onResize"]));
105
+ }
106
+ const B = /* @__PURE__ */ g(M, [["render", R], ["__scopeId", "data-v-fe42e792"]]), D = {
107
+ name: "HeaderBlock",
108
+ components: {
109
+ PriceHeader: c(() => import("./PriceHeader-Dyweu8aH.js")),
110
+ HeaderSettings: c(() => import("./HeaderSettings-C77pR78n.js")),
111
+ HeaderItems: B
112
+ },
113
+ emits: ["input"],
114
+ mixins: [P(["header"]), C],
115
+ data() {
116
+ return {
117
+ showControls: !1
118
+ };
119
+ },
120
+ computed: {
121
+ layout() {
122
+ var e;
123
+ return (e = this.header) == null ? void 0 : e.layout;
124
+ },
125
+ items() {
126
+ var e;
127
+ return ((e = this.header) == null ? void 0 : e.items) || [];
128
+ },
129
+ mediaPath() {
130
+ const e = this.items.findIndex(({ type: t }) => t === "media");
131
+ return e !== -1 ? `${this._value.header}.items.${e}.media` : "";
132
+ },
133
+ contentPath() {
134
+ const e = this.items.findIndex(({ type: t }) => t === "content");
135
+ return e !== -1 ? `${this._value.header}.items.${e}` : "";
136
+ }
137
+ }
138
+ };
139
+ function E(e, t, s, v, r, o) {
140
+ const n = p("PriceHeader"), i = p("HeaderItems"), u = p("HeaderSettings"), $ = p("portal");
141
+ return a(), d("div", b(e.$attrs, {
142
+ class: [{
143
+ "has-parent-nav": e.viewSettings.isForm,
144
+ "has-hover": r.showControls
145
+ }, "header-root"],
146
+ onMouseoverPassive: t[2] || (t[2] = (m) => r.showControls = !0),
147
+ onMouseleavePassive: t[3] || (t[3] = (m) => r.showControls = !1)
148
+ }), [
149
+ o.layout === "price" ? (a(), l(n, {
150
+ key: 0,
151
+ _document: e._document,
152
+ _value: {
153
+ media: o.mediaPath,
154
+ backgroundColor: `${o.contentPath}.media.backgroundColor`,
155
+ documentName: `${o.contentPath}.value.documentName`,
156
+ showLogo: `${o.contentPath}.value.showLogo`,
157
+ logotype: `${o.contentPath}.value.logotype`,
158
+ showPriceSummary: `${e._value.header}.showPriceSummary`
159
+ },
160
+ "has-hover": r.showControls,
161
+ onInput: t[0] || (t[0] = (m) => e.$emit("input", m))
162
+ }, null, 8, ["_document", "_value", "has-hover"])) : (a(), l(i, {
163
+ key: 1,
164
+ _document: e._document,
165
+ _value: {
166
+ layout: `${e._value.header}.layout`,
167
+ items: `${e._value.header}.items`,
168
+ baseStyle: `${e._value.header}.baseStyle`
169
+ },
170
+ "show-controls": r.showControls,
171
+ onInput: t[1] || (t[1] = (m) => e.$emit("input", m))
172
+ }, null, 8, ["_document", "_value", "show-controls"])),
173
+ e.isForm ? (a(), d(y, { key: 2 }, [
174
+ e.showDrawer ? (a(), l($, {
175
+ key: 0,
176
+ to: "drawer-content"
177
+ }, {
178
+ default: f(() => [
179
+ k(u, {
180
+ _document: e._document,
181
+ _value: {
182
+ layout: `${e._value.header}.layout`,
183
+ items: `${e._value.header}.items`,
184
+ showPriceSummary: `${e._value.header}.showPriceSummary`,
185
+ media: o.mediaPath,
186
+ backgroundColor: `${o.contentPath}.media.backgroundColor`,
187
+ textAlign: `${e._value.header}.baseStyle.textAlign`,
188
+ textColor: `${e._value.header}.baseStyle.textColor`
189
+ }
190
+ }, null, 8, ["_document", "_value"])
191
+ ]),
192
+ _: 1
193
+ })) : z("", !0)
194
+ ], 64)) : z("", !0)
195
+ ], 16);
196
+ }
197
+ const V = /* @__PURE__ */ g(D, [["render", E]]);
198
+ export {
199
+ V as default
200
+ };
@@ -0,0 +1,140 @@
1
+ import { m as c } from "./mapFormMixin-C7FJLnbO.js";
2
+ import { I as g } from "./InputToggleRow-CokEYwm2.js";
3
+ import { C as P } from "./CPriceInput-B7DYzKcF.js";
4
+ import { _ as f, e as u, o as p, b as d, s as k, v as t, f as $, d as a, w as n, B as m } from "./main-Bn5XkQPb.js";
5
+ const v = {
6
+ i18nOptions: {
7
+ namespaces: "ExtraWorkConstructionPricingListEdit",
8
+ messages: {
9
+ sv: {
10
+ workPrice: "Arbete",
11
+ managementPrice: "Arbetsledning",
12
+ entrepreneurMarkupPercentage: "Påslag för underentreprenader",
13
+ miscMarkupPercentage: "Påslag för material, varor och övrigt"
14
+ },
15
+ en: {
16
+ workPrice: "Work",
17
+ managementPrice: "Work management",
18
+ entrepreneurMarkupPercentage: "Markup for subcontractors",
19
+ miscMarkupPercentage: "Markup for material, goods and other",
20
+ travelCosts: "Travel costs for extra work"
21
+ }
22
+ }
23
+ },
24
+ name: "ExtraWorkConstructionPricingListEdit",
25
+ components: {
26
+ InputToggleRow: g,
27
+ CPriceInput: P
28
+ },
29
+ mixins: [
30
+ c(
31
+ [
32
+ "workPrice",
33
+ "managementPrice",
34
+ "entrepreneurMarkupPercentage",
35
+ "miscMarkupPercentage"
36
+ ],
37
+ { type: "number" }
38
+ )
39
+ ]
40
+ }, y = {
41
+ class: "flex w-full justify-end",
42
+ style: { position: "relative" }
43
+ }, M = {
44
+ key: 0,
45
+ class: "ex-vat"
46
+ };
47
+ function b(e, r, V, w, C, I) {
48
+ const s = u("CPriceInput"), i = u("InputToggleRow"), l = u("CInput");
49
+ return p(), d("div", null, [
50
+ k("div", y, [
51
+ e.workPrice || e.managementPrice ? (p(), d("div", M, t(e.$t("_common:vat.exVat", {
52
+ thing: e.$t("_common:vat.sharedTitle")
53
+ }).capitalize()), 1)) : $("", !0)
54
+ ]),
55
+ a(i, {
56
+ "display-value": e.workPrice ? `${e.workPrice / 100} ${e.$t("_common:currency.SEK")}/${e.$t(
57
+ "_common:unitType.hour"
58
+ )}` : e.$t("_common:add"),
59
+ label: e.$t("workPrice")
60
+ }, {
61
+ default: n(() => [
62
+ a(s, {
63
+ modelValue: e.workPrice,
64
+ "onUpdate:modelValue": r[0] || (r[0] = (o) => e.workPrice = o),
65
+ modelModifiers: { number: !0 },
66
+ currency: "SEK",
67
+ min: "0",
68
+ "suffix-class": "text-gray-400"
69
+ }, {
70
+ suffix: n(() => [
71
+ m(t(e.$t("currency.SEK")) + "/" + t(e.$t("_common:unitType.hour")), 1)
72
+ ]),
73
+ _: 1
74
+ }, 8, ["modelValue"])
75
+ ]),
76
+ _: 1
77
+ }, 8, ["display-value", "label"]),
78
+ a(i, {
79
+ "display-value": e.managementPrice ? `${e.managementPrice / 100} kr/h` : e.$t("_common:add"),
80
+ label: e.$t("managementPrice")
81
+ }, {
82
+ default: n(() => [
83
+ a(s, {
84
+ modelValue: e.managementPrice,
85
+ "onUpdate:modelValue": r[1] || (r[1] = (o) => e.managementPrice = o),
86
+ modelModifiers: { number: !0 },
87
+ currency: "SEK",
88
+ min: "0",
89
+ "suffix-class": "text-gray-400"
90
+ }, {
91
+ suffix: n(() => [
92
+ m(t(e.$t("_common:currency.SEK")) + "/" + t(e.$t("unitType.hour")), 1)
93
+ ]),
94
+ _: 1
95
+ }, 8, ["modelValue"])
96
+ ]),
97
+ _: 1
98
+ }, 8, ["display-value", "label"]),
99
+ a(i, {
100
+ "display-value": e.entrepreneurMarkupPercentage ? `${e.entrepreneurMarkupPercentage} %` : e.$t("_common:add"),
101
+ label: e.$t("entrepreneurMarkupPercentage")
102
+ }, {
103
+ default: n(() => [
104
+ a(l, {
105
+ modelValue: e.entrepreneurMarkupPercentage,
106
+ "onUpdate:modelValue": r[2] || (r[2] = (o) => e.entrepreneurMarkupPercentage = o),
107
+ modelModifiers: { number: !0 }
108
+ }, {
109
+ suffix: n(() => r[4] || (r[4] = [
110
+ m("%")
111
+ ])),
112
+ _: 1
113
+ }, 8, ["modelValue"])
114
+ ]),
115
+ _: 1
116
+ }, 8, ["display-value", "label"]),
117
+ a(i, {
118
+ "display-value": e.miscMarkupPercentage ? `${e.miscMarkupPercentage} %` : e.$t("_common:add"),
119
+ label: e.$t("miscMarkupPercentage")
120
+ }, {
121
+ default: n(() => [
122
+ a(l, {
123
+ modelValue: e.miscMarkupPercentage,
124
+ "onUpdate:modelValue": r[3] || (r[3] = (o) => e.miscMarkupPercentage = o),
125
+ modelModifiers: { number: !0 }
126
+ }, {
127
+ suffix: n(() => r[5] || (r[5] = [
128
+ m("%")
129
+ ])),
130
+ _: 1
131
+ }, 8, ["modelValue"])
132
+ ]),
133
+ _: 1
134
+ }, 8, ["display-value", "label"])
135
+ ]);
136
+ }
137
+ const B = /* @__PURE__ */ f(v, [["render", b], ["__scopeId", "data-v-3c3dbd58"]]);
138
+ export {
139
+ B as default
140
+ };
@@ -1,7 +1,7 @@
1
- import { P as m } from "./PlainHtml-B7gUNNZd.js";
2
- import { Z as c, D as u, n as p } from "./main-BL_yzf2r.js";
3
- import { s as g } from "./dom-Ds4ypDrd.js";
4
- const h = {
1
+ import { _ as p } from "./PlainHtml.vue_vue_type_script_setup_true_lang-D6KSjjMA.js";
2
+ import { d as e, aF as c, A as u, B as d, _ as h } from "./main-Bn5XkQPb.js";
3
+ import { s as g } from "./dom-CkTGWrfu.js";
4
+ const f = {
5
5
  name: "ExtraWorkConstructionPricingListRead",
6
6
  props: {
7
7
  _document: {
@@ -60,18 +60,16 @@ const h = {
60
60
  }
61
61
  }
62
62
  },
63
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
64
- render(e) {
65
- if (!this._document.readPrices)
66
- return e("div");
67
- let n = !0, i = null, s = 1, o = null;
63
+ render() {
64
+ if (!this._document.readPrices) return e("div", null, null);
65
+ let a = !0, i = null, n = 1, o = null;
68
66
  const {
69
67
  prices: r = null
70
68
  } = this._document || {};
71
69
  if (r && (r.currency && ({
72
70
  currency: o
73
71
  } = r), r.helpers && ({
74
- isIndivid: n
72
+ isIndivid: a
75
73
  } = r.helpers), r.region)) {
76
74
  ({
77
75
  houseWorkType: i
@@ -83,21 +81,21 @@ const h = {
83
81
  greenRot20: 0.8,
84
82
  greenRot50: 0.5
85
83
  };
86
- n && (s *= 1.25), n && t[i] && (s *= t[i]);
84
+ a && (n *= 1.25), a && t[i] && (n *= t[i]);
87
85
  }
88
- const d = () => i ? this.$t("deduction.afterType", {
86
+ const m = () => i ? this.$t("deduction.afterType", {
89
87
  type: this.$t(`deduction.${i}`)
90
- }) : n ? "" : `${this.$t("vat.exVat", {
88
+ }) : a ? "" : `${this.$t("vat.exVat", {
91
89
  thing: this.$t("_common:vat.sharedTitle")
92
90
  })} `, l = this.$t("subPriceString", {
93
- str: d(),
94
- vat: n ? this.$t("andVat") : ""
95
- }), a = [];
91
+ str: m(),
92
+ vat: a ? this.$t("andVat") : ""
93
+ }), s = [];
96
94
  if (this.workPrice) {
97
95
  const t = c({
98
96
  amount: this.workPrice
99
- }).multiply(s).getAmount();
100
- a.push({
97
+ }).multiply(n).getAmount();
98
+ s.push({
101
99
  title: this.$t("labor"),
102
100
  subTitle: l,
103
101
  amount: `${u(t, {
@@ -109,8 +107,8 @@ const h = {
109
107
  if (this.managementPrice) {
110
108
  const t = c({
111
109
  amount: this.managementPrice
112
- }).multiply(s).getAmount();
113
- a.push({
110
+ }).multiply(n).getAmount();
111
+ s.push({
114
112
  title: this.$t("laborManagement"),
115
113
  subTitle: l,
116
114
  amount: `${u(t, {
@@ -119,53 +117,42 @@ const h = {
119
117
  })}/h`
120
118
  });
121
119
  }
122
- return this.entrepreneurMarkupPercentage && a.push({
120
+ return this.entrepreneurMarkupPercentage && s.push({
123
121
  title: this.$t("subContractors"),
124
122
  subTitle: this.$t("subContractorsSub"),
125
123
  amount: `${this.entrepreneurMarkupPercentage} %`
126
- }), this.miscMarkupPercentage && a.push({
124
+ }), this.miscMarkupPercentage && s.push({
127
125
  title: this.$t("material"),
128
126
  subTitle: this.$t("materialSub"),
129
127
  amount: `${this.miscMarkupPercentage} %`
130
- }), e(m, [e("div", {
131
- class: "m-b-2r"
132
- }, [this.$t("descriptionTop")]), e("div", {
133
- class: "m-b-2r list-box"
134
- }, [a.map((t) => e("div", {
135
- class: "ata-item"
136
- }, [e("div", {
137
- class: "ata-item-text"
138
- }, [e("div", {
139
- class: "ata-item-text-title"
140
- }, [t.title]), e("div", {
141
- class: "ata-item-text-sub"
142
- }, [t.subTitle])]), e("div", {
143
- class: "ata-item-data"
144
- }, [t.amount])]))]), e("div", {
145
- class: "m-b-2r"
146
- }, [this.$t("descriptionBottom")]), i && e("div", {
147
- class: "hint-text"
148
- }, [this.$t("houseWorkDesc1"), " ", document.getElementById("villkor-avdrag") ? e("span", {
149
- on: {
150
- click: () => g(document.getElementById("villkor-avdrag"), {
128
+ }), e(p, null, {
129
+ default: () => [e("div", {
130
+ class: "m-b-2r"
131
+ }, [this.$t("descriptionTop")]), e("div", {
132
+ class: "m-b-2r list-box"
133
+ }, [s.map((t) => e("div", {
134
+ class: "ata-item"
135
+ }, [e("div", {
136
+ class: "ata-item-text"
137
+ }, [e("div", {
138
+ class: "ata-item-text-title"
139
+ }, [t.title]), e("div", {
140
+ class: "ata-item-text-sub"
141
+ }, [t.subTitle])]), e("div", {
142
+ class: "ata-item-data"
143
+ }, [t.amount])]))]), e("div", {
144
+ class: "m-b-2r"
145
+ }, [this.$t("descriptionBottom")]), i && e("div", {
146
+ class: "hint-text"
147
+ }, [this.$t("houseWorkDesc1"), d(" "), document.getElementById("villkor-avdrag") ? e("span", {
148
+ onClick: () => g(document.getElementById("villkor-avdrag"), {
151
149
  offset: 80
152
- })
153
- },
154
- attrs: {
155
- className: "cursor-pointer underline"
156
- }
157
- }, [this.$t("houseWorkReadTerms")]) : this.$t("houseWorkReadTerms"), " ", this.$t("houseWorkDesc2")])]);
150
+ }),
151
+ class: "cursor-pointer underline"
152
+ }, [this.$t("houseWorkReadTerms")]) : this.$t("houseWorkReadTerms"), d(" "), this.$t("houseWorkDesc2")])]
153
+ });
158
154
  }
159
- }, f = null, b = null;
160
- var k = /* @__PURE__ */ p(
161
- h,
162
- f,
163
- b,
164
- !1,
165
- null,
166
- "1142813c"
167
- );
168
- const y = k.exports;
155
+ }, P = /* @__PURE__ */ h(f, [["__scopeId", "data-v-eed65914"]]);
169
156
  export {
170
- y as default
157
+ P as default
171
158
  };