@cling-se/widget 1.0.0-beta.1 → 1.0.0-beta.2

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 (241) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.internal.md +82 -0
  3. package/README.md +14 -40
  4. package/README.public.md +14 -0
  5. package/dist/AddClientCallout-e8d19R3f.js +101 -0
  6. package/dist/AnswerModal-BGvB8IVV.js +3291 -0
  7. package/dist/AttachmentItem-CkHbAm4l.js +171 -0
  8. package/dist/BaseUpload-BiJBcWRu.js +2472 -0
  9. package/dist/BlockMedia-CW5wgipC.js +103 -0
  10. package/dist/CCallout-Cy2eeIYd.js +104 -0
  11. package/dist/{CCurrencyDropdown-qH-3m2eP.js → CCurrencyDropdown-DE_3CTjm.js} +91 -49
  12. package/dist/CDropdownItem-Dmq5gYzA.js +751 -0
  13. package/dist/CFormField.vue_vue_type_script_setup_true_lang-D_U9coAY.js +292 -0
  14. package/dist/{CPhoneFormat-CfQayFxw.js → CPhoneFormat-BS2nP9kc.js} +13 -21
  15. package/dist/CPhoneInput-Bf6329PO.js +207 -0
  16. package/dist/CPriceInput-d1yjuMQr.js +140 -0
  17. package/dist/CSelect-DgnT07Hk.js +98 -0
  18. package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-Ckl--dyv.js +51 -0
  19. package/dist/ClientAutocomplete-9JzGcO9O.js +532 -0
  20. package/dist/ClientModal-BzWQtWSZ.js +1181 -0
  21. package/dist/ColorPicker-BvoFN8nu.js +1408 -0
  22. package/dist/CompanyModal-Bp4V_az9.js +250 -0
  23. package/dist/ContentWrapper-CuH6xKmo.js +265 -0
  24. package/dist/CoverBlockSettings-BA5L0Zee.js +861 -0
  25. package/dist/DocAnswer-BcNA_KEg.js +33 -0
  26. package/dist/DocDetails-CStEwWnU.js +448 -0
  27. package/dist/DocForm-BOoILf5E.js +6748 -0
  28. package/dist/DocFormSend-CQIf-HJY.js +171 -0
  29. package/dist/DocLinks-BRX5QzNe.js +36 -0
  30. package/dist/DocModalBase-D72yWj-x.js +29 -0
  31. package/dist/DocPrint-BI1LXUPE.js +399 -0
  32. package/dist/DocReceipt-DaZ4V76p.js +341 -0
  33. package/dist/DocSendReminder-DKGZlo7s.js +181 -0
  34. package/dist/DocTextEditor-Dm-cTZpA.js +19413 -0
  35. package/dist/DocTimeline-DCwofzuk.js +537 -0
  36. package/dist/DocumentClient-vJdxCB53.js +90 -0
  37. package/dist/DocumentLayout-CKSi42ev.js +1368 -0
  38. package/dist/DocumentLogotype-DbQlvQ-y.js +162 -0
  39. package/dist/DocumentVoided-CRX2WxWO.js +33 -0
  40. package/dist/EmbedInput-B-oeC4Wy.js +157 -0
  41. package/dist/EmbedSettings-B9Yka2yB.js +103 -0
  42. package/dist/ErrorCallout-B_ygH33E.js +34 -0
  43. package/dist/FilePreviewModal-Bf3ELTow.js +202 -0
  44. package/dist/Flag-BwTgCNHO.js +41 -0
  45. package/dist/HeaderSettings-DvC7nlyY.js +720 -0
  46. package/dist/ImageSelectModal-D3sP3lhR.js +119 -0
  47. package/dist/ImageUploadWrapper-RWNa-yIq.js +1585 -0
  48. package/dist/Index-0_3ULrWX.js +126 -0
  49. package/dist/Index-4NPe0sfX.js +629 -0
  50. package/dist/Index-B1uA0FF6.js +4 -0
  51. package/dist/Index-BBkCYm2q.js +201 -0
  52. package/dist/{Index-DIOiMm9f.js → Index-BBwvo7S9.js} +10 -18
  53. package/dist/Index-BEMlsYwJ.js +68 -0
  54. package/dist/Index-BRBhJ6kz.js +21 -0
  55. package/dist/{Index--qPMWUMT.js → Index-BTFmHjUt.js} +48 -61
  56. package/dist/Index-BcUNnxLC.js +1098 -0
  57. package/dist/Index-Bo6ExBUL.js +93 -0
  58. package/dist/Index-BvMPCgdH.js +102 -0
  59. package/dist/Index-Bx5TOI9k.js +74 -0
  60. package/dist/Index-C7GZS8EI.js +16 -0
  61. package/dist/Index-CNWhm07R.js +25 -0
  62. package/dist/{Index-DcQbh-z2.js → Index-CQpznMKV.js} +9 -17
  63. package/dist/Index-CRzsnIij.js +159 -0
  64. package/dist/Index-CeSG1C41.js +140 -0
  65. package/dist/Index-CjfjdZj5.js +52 -0
  66. package/dist/Index-CskKmZpd.js +363 -0
  67. package/dist/Index-D5qwbCo1.js +28 -0
  68. package/dist/Index-D8Ae1Txt.js +228 -0
  69. package/dist/Index-DE8aenDB.js +3452 -0
  70. package/dist/Index-DI5EB5Rt.js +39 -0
  71. package/dist/Index-DaV57YPP.js +163 -0
  72. package/dist/Index-DbwkmoyM.js +38 -0
  73. package/dist/Index-Df9skok6.js +70 -0
  74. package/dist/{Index-Bu0MGrj6.js → Index-DfLLA0ij.js} +313 -206
  75. package/dist/Index-Dw1CO5F9.js +76 -0
  76. package/dist/Index-PZXyOoVb.js +87 -0
  77. package/dist/{Index-D4XgxmbD.js → Index-ZUnH-BHj.js} +10 -18
  78. package/dist/Index-cjKGSiDi.js +136 -0
  79. package/dist/Index-m-goRuKD.js +49 -0
  80. package/dist/Index-rGeWbLcB.js +47 -0
  81. package/dist/Index-vrljNp6G.js +28 -0
  82. package/dist/Index.vue_vue_type_script_lang-aeVuChGF.js +671 -0
  83. package/dist/InputToggleRow-v6qAWPg6.js +99 -0
  84. package/dist/ManualPopover-BONBJIUA.js +57 -0
  85. package/dist/MediaWrapper-CXb2UGd9.js +18 -0
  86. package/dist/{NotBindingText-CNV2Wmdx.js → NotBindingText-BqESO13N.js} +13 -17
  87. package/dist/PackageGroup-AIysVmyh.js +1058 -0
  88. package/dist/PdfTerms-BlhHdTu3.js +34 -0
  89. package/dist/PdfViewer-DwZ1rwlN.js +392 -0
  90. package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6NNUTz0.js +17 -0
  91. package/dist/PriceHeader-C4XhnoA3.js +488 -0
  92. package/dist/SearchApi-B7lXgUY6.js +137 -0
  93. package/dist/SendForm-BcD0xSvB.js +7031 -0
  94. package/dist/Setup-C2qaYDei.js +47 -0
  95. package/dist/{SmartList-Qgu0rMrI.js → SmartList-DqG7Q5t7.js} +16 -24
  96. package/dist/Sortable.vue_vue_type_script_setup_true_lang-CzMbr8AX.js +1303 -0
  97. package/dist/{TermsSettings-CE3h_xkm.js → TermsSettings-BOCONyM4.js} +169 -49
  98. package/dist/ThemeColorRow-sjGdMzGN.js +108 -0
  99. package/dist/ToggleBinding-7oq_oXPt.js +44 -0
  100. package/dist/UploadModal-C_X2NjVY.js +134 -0
  101. package/dist/VideoPlayerInput-BsUcmpl4.js +135 -0
  102. package/dist/VideoPlayerSettings-BXMmxaZQ.js +78 -0
  103. package/dist/VideoSelectModal-CW0OweCw.js +217 -0
  104. package/dist/{anime.es-BrPTThYb.js → anime.es-gdcpA-eY.js} +1 -2
  105. package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
  106. package/dist/{debounce-C1AuSpOZ.js → debounce-DNl99Gyo.js} +7 -7
  107. package/dist/dom-CkTGWrfu.js +69 -0
  108. package/dist/{focusDrawerMixin-Be6BAK8-.js → focusDrawerMixin-BwcErMDY.js} +1 -1
  109. package/dist/{formDrawerState-DRbg5rVI.js → formDrawerState-DaurePnd.js} +2 -2
  110. package/dist/helpers-CPW--XIz.js +44 -0
  111. package/dist/index-BjiGCJPI.js +149 -0
  112. package/dist/index-CFNv6OvX.js +188 -0
  113. package/dist/index-Cx71On5Z.js +508 -0
  114. package/dist/index-DKMxIBz_.js +270 -0
  115. package/dist/index-DKf5SGLD.js +125 -0
  116. package/dist/index-E32WgUp9.js +3525 -0
  117. package/dist/index-kp-GC5I0.js +513 -0
  118. package/dist/index.es.js +2 -5
  119. package/dist/index.umd.js +306 -1505
  120. package/dist/{main-WKzC-Dnu.js → main-Cb-nyil1.js} +33252 -33755
  121. package/dist/mapFormMixin-D3BihYWW.js +1544 -0
  122. package/dist/omit--YYr41Xp.js +31 -0
  123. package/dist/{publicSenderState-BujjYsZZ.js → publicSenderState-CdRW_Wwp.js} +4 -4
  124. package/dist/regions-BdZt9Srn.js +1250 -0
  125. package/dist/splitpanes-D-ThFkeR.js +342 -0
  126. package/dist/style.css +1 -4
  127. package/dist/template-BvaNnq-g.js +1493 -0
  128. package/dist/{throttle-CWPJmFid.js → throttle-D-bUGaVh.js} +2 -2
  129. package/dist/tippy.esm-BmKNqohP.js +1994 -0
  130. package/dist/useTermsModal-Dhf6_eYb.js +87 -0
  131. package/dist/{utils-CA_Zy6u1.js → utils-CBPcYdLv.js} +8 -11
  132. package/dist/validation-DOcUOoMe.js +40 -0
  133. package/package.json +25 -31
  134. package/.eslintrc.cjs +0 -4
  135. package/dist/AddClientCallout-BWnvyBcK.js +0 -46
  136. package/dist/AnswerModal-CLGRdSnK.js +0 -3874
  137. package/dist/AttachmentItem-BPS0-wyc.js +0 -78
  138. package/dist/BaseDatePicker-BbmV_GdD.js +0 -3183
  139. package/dist/BaseUpload-9gPgI7r6.js +0 -1977
  140. package/dist/BlockMedia-DkPFWiYL.js +0 -76
  141. package/dist/CCallout-T26jwUby.js +0 -59
  142. package/dist/CDropdownItem-BE8BAMD1.js +0 -636
  143. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
  144. package/dist/CFormField-DECEfoVq.js +0 -241
  145. package/dist/CPriceInput-C4SOB-P5.js +0 -112
  146. package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
  147. package/dist/ClientAutocomplete-DSebA1Mx.js +0 -78
  148. package/dist/ClientModal-BXFYvYCF.js +0 -625
  149. package/dist/ColorPicker-CZ_bJabP.js +0 -2879
  150. package/dist/CompanyModal-CDr3t28n.js +0 -141
  151. package/dist/ContentWrapper-BwmMoe4W.js +0 -183
  152. package/dist/CoverBlockSettings-_F11-DGc.js +0 -275
  153. package/dist/DocAnswer-BR59xzkT.js +0 -36
  154. package/dist/DocDetails-D1qbCbps.js +0 -259
  155. package/dist/DocForm-DBc2a7z5.js +0 -7272
  156. package/dist/DocFormSend-Casix-yG.js +0 -144
  157. package/dist/DocLinks-DGTaewyX.js +0 -38
  158. package/dist/DocModalBase-BbS_qvSv.js +0 -28
  159. package/dist/DocPrint-0PqX3mbJ.js +0 -240
  160. package/dist/DocReceipt-CU3VD5pt.js +0 -210
  161. package/dist/DocSendReminder-CuycBspr.js +0 -137
  162. package/dist/DocTextEditor-CntS2Bd-.js +0 -17180
  163. package/dist/DocTimeline-DJuv3yBe.js +0 -481
  164. package/dist/DocumentClient-C25XXzz6.js +0 -136
  165. package/dist/DocumentLayout-B7afHRMr.js +0 -4909
  166. package/dist/DocumentLogotype-sqI51wvM.js +0 -87
  167. package/dist/DocumentVoided-TahdTSMn.js +0 -25
  168. package/dist/EmbedInput-BY-wHSfc.js +0 -113
  169. package/dist/EmbedSettings-8pfjk4NP.js +0 -72
  170. package/dist/ErrorCallout-Dsr8PNsU.js +0 -28
  171. package/dist/FilePreviewModal-CcEinEFg.js +0 -81
  172. package/dist/Flag-PJKrghi9.js +0 -114
  173. package/dist/HeaderSettings-BqczIOsG.js +0 -392
  174. package/dist/ImageSelectModal-Cd-HhKnH.js +0 -84
  175. package/dist/ImageUploadWrapper-Dv43rGdb.js +0 -1604
  176. package/dist/Index-6b5VBKE-.js +0 -107
  177. package/dist/Index-B4pRJnbw.js +0 -84
  178. package/dist/Index-B69f8qgZ.js +0 -62
  179. package/dist/Index-B79YN9RO.js +0 -25
  180. package/dist/Index-BBrlPoe8.js +0 -58
  181. package/dist/Index-BXfWJCuq.js +0 -52
  182. package/dist/Index-Bd76vb37.js +0 -55
  183. package/dist/Index-BmbtQO5F.js +0 -150
  184. package/dist/Index-ByV_kJaH.js +0 -77
  185. package/dist/Index-CDV5rhWS.js +0 -49
  186. package/dist/Index-CIx4OOK-.js +0 -144
  187. package/dist/Index-CL1OWLt6.js +0 -223
  188. package/dist/Index-Caow0eZu.js +0 -31
  189. package/dist/Index-Cd3-3PEK.js +0 -2402
  190. package/dist/Index-CdpZBEKU.js +0 -98
  191. package/dist/Index-CmU3Sys-.js +0 -754
  192. package/dist/Index-CtRtgnpm.js +0 -32
  193. package/dist/Index-Cukkr33D.js +0 -140
  194. package/dist/Index-Cuqw0ios.js +0 -57
  195. package/dist/Index-Czm_WdqC.js +0 -25
  196. package/dist/Index-DNdYXHgr.js +0 -33
  197. package/dist/Index-DcuBxutp.js +0 -642
  198. package/dist/Index-DpWNWiyY.js +0 -291
  199. package/dist/Index-DzS1rZdF.js +0 -24
  200. package/dist/Index-N6s5pZxv.js +0 -26
  201. package/dist/Index-g_DNu4mt.js +0 -69
  202. package/dist/Index-mJ8F41GY.js +0 -154
  203. package/dist/Index-q7W9KA8m.js +0 -21
  204. package/dist/Index-rtzblZp4.js +0 -70
  205. package/dist/InputToggleRow-CZjxsDOQ.js +0 -57
  206. package/dist/ManualPopover-CZrWiT-P.js +0 -58
  207. package/dist/MediaWrapper-D37qK4KR.js +0 -23
  208. package/dist/PackageGroup-Heo_s8ct.js +0 -699
  209. package/dist/PdfTerms-AB9tXAtU.js +0 -36
  210. package/dist/PdfViewer-CIVkvOBr.js +0 -373
  211. package/dist/PlainHtml-CPmIebjY.js +0 -20
  212. package/dist/PriceHeader-DhDAruwX.js +0 -339
  213. package/dist/SearchApi-BMgdaI4s.js +0 -161
  214. package/dist/Setup-VIaIV9uT.js +0 -50
  215. package/dist/ThemeColorRow-DYJNgk6S.js +0 -67
  216. package/dist/ToggleBinding-CuwCeYpO.js +0 -38
  217. package/dist/UploadModal-BITcxG-J.js +0 -95
  218. package/dist/VideoPlayerInput-8szEX_8L.js +0 -93
  219. package/dist/VideoPlayerSettings-BIPytm6w.js +0 -61
  220. package/dist/VideoSelectModal-B-Pe34nb.js +0 -100
  221. package/dist/answerDocumentMixin-W7vE1Gp4.js +0 -51
  222. package/dist/formComponentsInstall-Bm3VMOh6.js +0 -2507
  223. package/dist/formValidationMixin-COkY8COk.js +0 -49
  224. package/dist/index-BFvjENMH.js +0 -81
  225. package/dist/index-BV2nGWay.js +0 -492
  226. package/dist/index-BgJ05dYc.js +0 -165
  227. package/dist/index-CMPAXxzs.js +0 -347
  228. package/dist/index-DNDjI5uI.js +0 -3916
  229. package/dist/index-aoff9oUi.js +0 -102
  230. package/dist/mapFormMixin-QbevCwJK.js +0 -72
  231. package/dist/omit-CTp9CXoU.js +0 -31
  232. package/dist/splitpanes-BHUVsCZF.js +0 -382
  233. package/dist/tinycolor-kTl0yxzz.js +0 -633
  234. package/dist/tippy.esm-sS5koDSU.js +0 -1799
  235. package/dist/vuedraggable.umd-BA3ZDRAp.js +0 -3161
  236. package/dist/vuex.esm-DKGl8mcw.js +0 -467
  237. package/public/favicon.ico +0 -0
  238. package/tsconfig.json +0 -26
  239. package/tsconfig.node.json +0 -10
  240. package/tsconfig.paths.json +0 -17
  241. package/vite.config.ts +0 -60
@@ -1,2507 +0,0 @@
1
- import { m as p } from "./mapFormMixin-QbevCwJK.js";
2
- import { I as L, a as H, r as l } from "./index-DNDjI5uI.js";
3
- import { az as v, h as q, n as o, b as c, aA as j, t as K, aB as B, aC as W, q as I, aD as T, f as P, aE as R, J as y } from "./main-WKzC-Dnu.js";
4
- import { B as M } from "./BaseDatePicker-BbmV_GdD.js";
5
- import { E as X } from "./ErrorCallout-Dsr8PNsU.js";
6
- import { s as U, F as Q } from "./Flag-PJKrghi9.js";
7
- import { b as Y, m as g } from "./vuex.esm-DKGl8mcw.js";
8
- import G from "./AddClientCallout-BWnvyBcK.js";
9
- import J from "./ClientModal-BXFYvYCF.js";
10
- import { c as Z, r as ee, g as te, C as h, a as f, b as m } from "./CDropdownItem-BE8BAMD1.js";
11
- import "./CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js";
12
- import { C as _ } from "./CCallout-T26jwUby.js";
13
- import { a as ie, C as se } from "./CFormField-DECEfoVq.js";
14
- import { S as ne } from "./SmartList-Qgu0rMrI.js";
15
- function z(t, e) {
16
- const i = new Date(t.getTime());
17
- return i.setDate(
18
- t.getDate() + (7 + e - t.getDay() - 1) % 7 + 1
19
- ), i.setHours(8, 0, 0, 0), i;
20
- }
21
- function E(t) {
22
- const e = new Date(t.getTime());
23
- return e.setDate(e.getDate() + 1), e.setHours(10, 0, 0, 0), e;
24
- }
25
- let b = E(/* @__PURE__ */ new Date()), C = z(/* @__PURE__ */ new Date(), 1);
26
- const ae = {
27
- name: "DocumentSendLater",
28
- i18nOptions: {
29
- namespaces: "documentSendLater",
30
- messages: {
31
- en: {
32
- title: "Schedule Delivery",
33
- tomorrowMorning: "Tomorrow morning",
34
- mondayMorning: "Monday morning",
35
- custom: {
36
- title: "Set time & date",
37
- invalid: "Time & date can't be in the past"
38
- }
39
- },
40
- sv: {
41
- title: "Skicka med schemaläggning",
42
- tomorrowMorning: "Imorgon förmiddag",
43
- mondayMorning: "Måndag morgon",
44
- custom: {
45
- title: "Välj datum & tid",
46
- invalid: "Välj en tid & datum längre fram i tiden."
47
- }
48
- }
49
- }
50
- },
51
- components: {
52
- BaseDatePicker: M
53
- },
54
- props: {
55
- _document: {
56
- type: Object,
57
- default: () => ({})
58
- },
59
- setFormValue: {
60
- type: Function,
61
- required: !0
62
- },
63
- removeFormValue: {
64
- type: Function,
65
- required: !0
66
- },
67
- onSaveDocument: {
68
- type: Function,
69
- required: !0
70
- }
71
- },
72
- data() {
73
- return {
74
- sendAt: v(/* @__PURE__ */ new Date(), 5).toISOString(),
75
- showCustom: !1,
76
- backupSentFlag: !1
77
- // needed since doc/project flags not instant on double clicks
78
- };
79
- },
80
- validations: {
81
- sendAt: {
82
- minValue: (t) => t > v(/* @__PURE__ */ new Date(), 2).toISOString()
83
- // two minutes as safety
84
- }
85
- },
86
- computed: {
87
- ...Y("forms", {
88
- formData: (t) => t.document2.data
89
- }),
90
- ...g({
91
- deliveryTypes: "forms/deliveryTypes",
92
- isPostingDocument: "documents2/isPosting",
93
- feature: "application/feature"
94
- }),
95
- tomorrowMorning() {
96
- return b.toISOString();
97
- },
98
- mondayMorning() {
99
- return C.toISOString();
100
- },
101
- reminderDeliveryTypes() {
102
- const t = ["email"];
103
- return this.feature("sms") && t.push("sms"), this.deliveryTypes ? [
104
- ...this.deliveryTypes.sms && this.feature("sms") ? ["sms"] : [],
105
- ...this.deliveryTypes.email ? ["email"] : []
106
- ] : t;
107
- }
108
- },
109
- created() {
110
- b = E(/* @__PURE__ */ new Date()), C = z(/* @__PURE__ */ new Date(), 1);
111
- },
112
- methods: {
113
- setTime(t) {
114
- const e = t.split(":"), i = new Date(this.sendAt).setHours(e[0], e[1]);
115
- i && (this.sendAt = new Date(i).toISOString());
116
- },
117
- setDate(t) {
118
- const e = new Date(this.sendAt), i = new Date(t).setHours(e.getHours(), e.getMinutes());
119
- this.sendAt = new Date(i).toISOString();
120
- },
121
- async onSendAt(t) {
122
- try {
123
- if (this.$v.$invalid || this.isPostingDocument || this.backupSentFlag)
124
- return;
125
- this.backupSentFlag = !0;
126
- const e = {
127
- type: "first",
128
- status: "new",
129
- sendDays: 0,
130
- sendAt: t,
131
- deliveryTypes: this.reminderDeliveryTypes,
132
- tries: 0
133
- }, i = this.formData.reminders.findIndex(
134
- (n) => n.type === "first"
135
- ), s = i >= 0 ? `data.reminders[${i}]` : "data.reminders";
136
- this.setFormValue({ key: s, value: e }), await this.onSaveDocument({ doSend: !0 }), this.backupSentFlag = !1;
137
- } catch (e) {
138
- q(e);
139
- } finally {
140
- this.backupSentFlag = !1;
141
- }
142
- }
143
- }
144
- };
145
- var re = function() {
146
- var e = this, i = e._self._c;
147
- return i("div", { staticClass: "overflow-hidden rounded-xl bg-white" }, [i("div", { staticClass: "px-6 pb-3 pt-8" }, [i("div", { staticClass: "text-md text-center font-semibold" }, [e._v(" " + e._s(e.$t("title")) + " ")]), i("div", { staticClass: "pt-8" }, e._l([
148
- [e.tomorrowMorning, "tomorrowMorning"],
149
- [e.mondayMorning, "mondayMorning"]
150
- ], function(s, n) {
151
- return i("div", { key: n, 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]) } }, [i("div", { staticClass: "font-medium" }, [e._v(e._s(e.$t(s[1])))]), i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$formatDate(s[0], "p, d MMM")) + " ")])]);
152
- }), 0)]), i("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) {
153
- e.showCustom = !0;
154
- } } }, [i("div", { staticClass: "flex items-center text-sm" }, [i("CIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar", size: "18" } }), i("div", { staticClass: "font-medium", domProps: { textContent: e._s(e.$t("custom.title")) } })], 1), i("Animation", [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.showCustom, expression: "showCustom" }], staticClass: "mt-4" }, [i("div", { staticClass: "grid grid-cols-2 gap-4" }, [i("BaseDatePicker", { attrs: { value: e.sendAt }, on: { input: e.setDate } }), i("CInput", { attrs: { value: e.$formatDate(e.sendAt, "HH:mm"), type: "time" }, on: { input: e.setTime } })], 1), e.$v.$invalid ? i("div", { staticClass: "error-wrapper" }, [i("CIcon", { staticClass: "text-primary-500 mr-2", attrs: { type: "calendar" } }), e._v(" " + e._s(e.$t("custom.invalid")) + " ")], 1) : e._e(), i("CButton", { staticStyle: { "margin-top": "calc(1.5 * var(--rem))" }, attrs: { loading: e.isPostingDocument, type: "secondary", wide: "" }, on: { click: function(s) {
155
- return e.onSendAt(e.sendAt);
156
- } } }, [e._v(" " + e._s(e.$t("_common:send")) + " " + e._s(e.$formatDate(e.sendAt, "d MMM - p")) + " ")])], 1)])], 1)]);
157
- }, oe = [], le = /* @__PURE__ */ o(
158
- ae,
159
- re,
160
- oe,
161
- !1,
162
- null,
163
- "dcfae061"
164
- );
165
- const de = le.exports, ce = {
166
- sv: {
167
- title: "Skicka dokument",
168
- nameLabel: "Dokumentnamn",
169
- namePlaceholder: "Namn",
170
- sendAs: "Skicka som",
171
- validityPeriod: "Giltighetstid",
172
- manualDelivery: "Manuell leverans",
173
- manualDeliveryTooltip: "Skicka ut dokument till din mottagare själv. Du kan dela en länk eller en PDF.",
174
- scheduledTooltip: "Schemalägg utskick",
175
- clientsAreMissingContactInfo: "En eller flera mottagare saknar e-post eller mobiltelefon-nr. Dokumentet kommer inte att kunna skickas till dem.",
176
- missingDeliveryMethod: "Välj en eller fler leveransmetoder",
177
- sendButton: "Skicka dokument",
178
- signMethod: {
179
- title: "Signeringsmetod",
180
- tooltip: "Hur ska din mottagare signera?",
181
- button: {
182
- title: "Standard - knapptryck",
183
- content: "Bevisnivå: IP-adress, tidpunkt och enhet."
184
- },
185
- bankId: {
186
- title: "BankId",
187
- content: "Samma säkerhetsgrad som bankerna har."
188
- },
189
- signature: {
190
- title: "Standard",
191
- content: "Bevisnivå: IP-adress, tidpunkt och enhet."
192
- },
193
- inPerson: {
194
- title: "Fysisk underskrift",
195
- content: "Signatur på utskrivet dokument"
196
- }
197
- }
198
- },
199
- en: {
200
- title: "Send document",
201
- nameLabel: "Document name",
202
- namePlaceholder: "Name",
203
- sendAs: "Send as",
204
- validityPeriod: "Expiration",
205
- manualDelivery: "Manual delivery",
206
- manualDeliveryTooltip: "Share the document with your recipient yourself. You can share a link or a PDF.",
207
- scheduledTooltip: "Schedule delivery",
208
- clientsAreMissingContactInfo: "Note that one or more recipients are missing an email or cellphone number. The document will not be sent to them.",
209
- missingDeliveryMethod: "Please select one or more delivery methods",
210
- sendButton: "Send document",
211
- signMethod: {
212
- title: "Signing method",
213
- tooltip: "How do you want your client to sign?",
214
- button: {
215
- title: "Standard - button",
216
- content: "Level of proof: IP address, timestamp and device."
217
- },
218
- bankId: {
219
- title: "BankID",
220
- content: "Same level of proof as the banks use."
221
- },
222
- signature: {
223
- title: "Signature",
224
- content: "Level of proof: IP address, timestamp and device."
225
- },
226
- inPerson: {
227
- title: "In person",
228
- content: "Signature on print document"
229
- }
230
- }
231
- }
232
- }, ue = {
233
- sv: {
234
- addFirstButton: "Lägg till mottagare",
235
- addButton: "Lägg till mottagare",
236
- signOrder: {
237
- label: "Signeringsordning",
238
- tooltip: "Signeringsordning låter dig bestämma i vilken ordning dina mottagare tar emot och signerar dokumentet."
239
- }
240
- },
241
- en: {
242
- addFirstButton: "Add recipient",
243
- addButton: "Add recipient",
244
- signOrder: {
245
- label: "Signing order",
246
- tooltip: "Signing order lets you decide the order in which your recipients receive and sign your documents."
247
- }
248
- }
249
- }, pe = {
250
- name: "ClientSendListItem",
251
- props: {
252
- client: {
253
- type: Object,
254
- default: () => ({})
255
- },
256
- isOrder: {
257
- type: Boolean,
258
- default: !1
259
- },
260
- isSender: {
261
- type: Boolean,
262
- default: !1
263
- },
264
- compact: {
265
- type: Boolean,
266
- default: !1
267
- },
268
- allowEditClients: {
269
- type: Boolean,
270
- default: !0
271
- },
272
- rightButton: {
273
- // TODO temporary in order to disable sender sign for widget context
274
- type: Boolean,
275
- default: !0
276
- }
277
- },
278
- data() {
279
- return {
280
- isHover: !1,
281
- isDropdownOpen: !1
282
- };
283
- },
284
- methods: {
285
- onClick() {
286
- var t;
287
- if (this.rightButton && this.isSender)
288
- return (t = this.$refs.dropdown) == null ? void 0 : t.toggle();
289
- this.allowEditClients && this.$emit("open");
290
- }
291
- }
292
- };
293
- var me = function() {
294
- var s;
295
- var e = this, i = e._self._c;
296
- return i("div", { staticClass: "rc-card flex items-center", class: {
297
- "is-hover": e.isHover,
298
- "has-controls": e.isOrder
299
- }, staticStyle: { "padding-left": "8px" }, on: { click: e.onClick, "&mouseover": function(n) {
300
- e.isHover = !0;
301
- }, "&mouseleave": function(n) {
302
- e.isHover = !1;
303
- } } }, [e.compact ? i("div", { staticStyle: { "font-size": "14px" } }, [i("div", [e._v(e._s(e.client.name || e.client.companyName))]), e.client.name && e.client.companyName ? i("div", { staticStyle: { "font-size": "12px", "font-weight": "500" } }, [e._v(" " + e._s(e.client.companyName) + " ")]) : e._e(), e.client.documentRole ? i("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 ? i("div", { staticClass: "compact-order" }, [i("CIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-up" }, on: { click: function(n) {
304
- return n.preventDefault(), n.stopPropagation(), e.$emit("move", -1);
305
- } } }), i("div", { staticClass: "rc-order", staticStyle: { width: "20px", height: "20px" } }, [e._v(" " + e._s(e.client.signOrder) + " ")]), i("CIcon", { staticClass: "compact-order-button", attrs: { size: "16", type: "chevron-down" }, on: { click: function(n) {
306
- return n.preventDefault(), n.stopPropagation(), e.$emit("move", 1);
307
- } } })], 1) : e._e()]) : [i("div", { staticStyle: { width: "34px", flex: "0 0 34px", display: "inline-flex", "justify-content": "center" } }, [e.isOrder ? i("div", { staticStyle: { position: "relative", display: "inline-block" } }, [i("CButton", { staticClass: "rc-order__button up", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "minus" }, on: { click: function(n) {
308
- return n.preventDefault(), n.stopPropagation(), e.$emit("move", -1);
309
- } } }), i("CButton", { staticClass: "rc-order__button down", attrs: { type: "none", pattern: "primary", circle: "", raised: "", size: "small", icon: "plus" }, on: { click: function(n) {
310
- return n.preventDefault(), n.stopPropagation(), e.$emit("move", 1);
311
- } } }), i("div", { staticClass: "rc-order" }, [e._v(" " + e._s(e.client.signOrder) + " ")])], 1) : i("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), i("div", { staticClass: "rc-data truncate-text" }, [e.client.name || e.client.companyName ? i("div", { staticStyle: { "font-weight": "500" } }, [e._v(" " + e._s(e.client.name || e.client.companyName) + " ")]) : e.isSender ? i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:empty", { thing: e.$t("_common:reference") })) + " ")]) : i("div", { staticClass: "text-gray-500" }, [e._v(" " + e._s(e.$t("_common:missing", { thing: e.$t("_common:name") })) + " ")]), i("div", { staticClass: "text-gray-700", staticStyle: { "font-size": "12px" } }, [e.isSender ? [e.isSender ? i("span", [e._v(" " + e._s(e.$t("_common:documentRole.sender.description")) + " ")]) : e._e(), e.client.documentRole === "signee" ? i("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" ? i("span", { staticClass: "text-red-500" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + ": "), i("span", [e._v(" " + e._s(e.$t("_common:signMethod.inPerson")) + " ")])]) : e._e(), e.client.documentRole ? i("span", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.client.documentRole}.description`)) + " ")]) : e._e(), e.client.email ? i("span", [e._v(e._s(e.client.email))]) : e._e(), e.client.cellphone ? i("span", [e._v(e._s(e.client.cellphone))]) : e._e()]], 2)])], e.rightButton ? i("transition", { attrs: { name: "fade-100" } }, [e.isHover || e.isDropdownOpen ? [e.isSender ? i("CDropdown", { ref: "dropdown", staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { position: "is-bottom-left", "menu-styling": {
312
- minWidth: "220px"
313
- }, "append-to-body": "" }, on: { "active-change": function(n) {
314
- e.isDropdownOpen = n;
315
- } }, nativeOn: { click: function(n) {
316
- n.stopPropagation();
317
- } } }, [i("CButton", { attrs: { slot: "trigger", circle: "", size: "small", type: "none", pattern: "secondary", raised: "", icon: "more-horizontal" }, slot: "trigger" }), e._t("dropdownOptions")], 2) : e.allowEditClients ? i("CButton", { staticStyle: { position: "absolute", right: "calc(0.5 * var(--rem))" }, attrs: { circle: "", size: "small", icon: "x", type: "none", pattern: "secondary", raised: "" }, on: { click: function(n) {
318
- return n.stopPropagation(), e.$emit("remove");
319
- } } }) : e._e()] : e._e()], 2) : e._e()], 2);
320
- }, he = [], fe = /* @__PURE__ */ o(
321
- pe,
322
- me,
323
- he,
324
- !1,
325
- null,
326
- "47fa5bc0"
327
- );
328
- const N = fe.exports, ge = {
329
- name: "SenderBlockItem",
330
- i18nOptions: {
331
- namespaces: "senderBlockItem",
332
- messages: {
333
- en: {
334
- toggle: {
335
- label: "Sign the document",
336
- description: "Toggle to add your own signature to the document."
337
- }
338
- },
339
- sv: {
340
- toggle: {
341
- label: "Signera dokumentet",
342
- description: "Aktivera för att lägga till din signatur på dokumentet."
343
- }
344
- }
345
- }
346
- },
347
- components: {
348
- RecipientBlockItem: N
349
- },
350
- mixins: [
351
- p(["senderClient"], {
352
- useEmit: !1,
353
- setFnName: "setFormValue"
354
- })
355
- ],
356
- inject: {
357
- allowSenderSign: {
358
- default: !0
359
- }
360
- },
361
- props: {
362
- setFormValue: {
363
- type: Function,
364
- required: !0
365
- },
366
- defaultAddSenderClient: {
367
- type: Boolean,
368
- default: !1
369
- }
370
- },
371
- data() {
372
- return {
373
- senderClientData: null
374
- };
375
- },
376
- computed: {
377
- ...g({
378
- feature: "application/feature"
379
- })
380
- },
381
- created() {
382
- this.generateSenderClient(), this._document.id || this._document.isDirty("senderClient") ? this.toggleSenderSign(!!this.senderClient) : this.defaultAddSenderClient && this.toggleSenderSign(!0);
383
- },
384
- methods: {
385
- get: c,
386
- generateSenderClient() {
387
- const { company: t, user: e } = this._document.sender || {}, i = c(
388
- this._document,
389
- "data.defaultAnswerMethod"
390
- );
391
- this.senderClientData = {
392
- ...j(),
393
- documentRole: "recipient",
394
- ...i && { answerMethod: i },
395
- ...this.senderClient,
396
- // latest sender values in the document
397
- type: "company",
398
- companyName: t.name,
399
- name: e.name,
400
- email: e.email,
401
- cellphone: e.cellphone
402
- };
403
- },
404
- toggleSenderSign(t) {
405
- this.senderClientData.documentRole = t ? "signee" : "recipient", this.senderClient = t ? this.senderClientData : null, this._document.setDirty("senderClient");
406
- },
407
- setSenderMethod(t) {
408
- const e = {
409
- ...this.senderClient,
410
- answerMethod: {
411
- accept: t,
412
- deny: "button"
413
- }
414
- };
415
- this.senderClient = e, this.senderClientData = { ...e };
416
- }
417
- }
418
- };
419
- var ve = function() {
420
- var e = this, i = e._self._c;
421
- return e.senderClientData ? i("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 } }, [i("template", { slot: "dropdownOptions" }, [i("CDropdownItem", { attrs: { value: !!e.senderClient, "close-on-click": !1, toggle: "" }, on: { input: e.toggleSenderSign } }, [e._v(" " + e._s(e.$t("toggle.label")) + " ")]), e.senderClient ? [i("CDropdownItem", { attrs: { separator: "" } }), i("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([
422
- "login",
423
- "signature",
424
- ...e.feature("bankId") ? ["bankId"] : []
425
- ], function(s) {
426
- return i("CDropdownItem", { key: s, attrs: { "icon-right": e.get(e.senderClient, "answerMethod.accept") === s ? "check" : "" }, on: { click: function(n) {
427
- return e.setSenderMethod(s);
428
- } } }, [e._v(" " + e._s(e.$t(`_common:signMethod.${s}`)) + " ")]);
429
- })] : i("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")) + " ")])], 2)], 2) : e._e();
430
- }, ye = [], _e = /* @__PURE__ */ o(
431
- ge,
432
- ve,
433
- ye,
434
- !1,
435
- null,
436
- "dad49914"
437
- );
438
- const be = _e.exports, Ce = {
439
- name: "RecipientBlock",
440
- i18nOptions: {
441
- namespaces: "recipientBlock",
442
- messages: ue
443
- },
444
- components: {
445
- AddClientCallout: G,
446
- RecipientBlockItem: N,
447
- SenderBlockItem: be
448
- },
449
- mixins: [
450
- p(["clients"], {
451
- useEmit: !1,
452
- setFnName: "setFormValue"
453
- })
454
- ],
455
- props: {
456
- compact: {
457
- type: Boolean,
458
- default: !1
459
- },
460
- setFormValue: {
461
- type: Function,
462
- required: !0
463
- },
464
- removeFormValue: {
465
- type: Function,
466
- required: !0
467
- },
468
- defaultAddSenderClient: {
469
- type: Boolean,
470
- default: !1
471
- },
472
- allowEditClients: {
473
- type: Boolean,
474
- default: !0
475
- },
476
- isPublicForm: {
477
- type: Boolean,
478
- default: !1
479
- }
480
- },
481
- computed: {
482
- sortedClients() {
483
- return [...this.clients].map((t, e) => ({ ...t, index: e })).sort((t, e) => t.signOrder - e.signOrder);
484
- },
485
- maxSignOrder() {
486
- if (!this.useSignOrder || this.sortedClients.length === 0)
487
- return 0;
488
- const { signOrder: t } = this.sortedClients[this.sortedClients.length - 1];
489
- return t;
490
- },
491
- useSignOrder() {
492
- return c(this._document, "useSignOrder", !1);
493
- }
494
- },
495
- methods: {
496
- onMoveRecipient({ index: t, direction: e }) {
497
- this.clients = K(this.clients).set(
498
- {
499
- ...this.clients[t],
500
- signOrder: Math.max(this.clients[t].signOrder + e, 0)
501
- },
502
- t
503
- );
504
- },
505
- toggleSignOrder(t) {
506
- let e = [];
507
- if (t) {
508
- const i = !this.clients.every(
509
- ({ signOrder: s }) => !s
510
- );
511
- this.clients = this.clients.map((s, n) => ({
512
- ...s,
513
- signOrder: i ? s.signOrder : n + 1
514
- }));
515
- } else
516
- e = c(this._document, "template.reminders", []), e.length || (e = B.default);
517
- this.setFormValue({ key: "data.reminders", value: e }), this.setFormValue({ key: "useSignOrder", value: t });
518
- },
519
- removeClient(t) {
520
- this.removeFormValue(`clients[${t}]`);
521
- },
522
- openClientModal(t = 0) {
523
- var i;
524
- const e = c(this, `clients[${t}].signOrder`);
525
- this.$modal.show(J, {
526
- documentClientIndex: t,
527
- ...this.useSignOrder && {
528
- signOrder: W(e) === "number" ? e : this.maxSignOrder + 1
529
- },
530
- signOptions: (i = this._document) == null ? void 0 : i.signOptions,
531
- setFormValue: this.setFormValue,
532
- removeFormValue: this.removeFormValue,
533
- isPublicForm: this.isPublicForm
534
- });
535
- },
536
- setClient(t) {
537
- this.setFormValue({ key: `clients[${this.clients.length}]`, value: t });
538
- }
539
- }
540
- };
541
- var we = function() {
542
- var e = this, i = e._self._c;
543
- return i("div", [e.compact ? e._e() : [i("div", { staticClass: "pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:from").capitalize()) + ": ")]), i("SenderBlockItem", { attrs: { _document: e._document, _value: { senderClient: "senderClient" }, "set-form-value": e.setFormValue, "default-add-sender-client": e.defaultAddSenderClient } })], i("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() : i("div", { staticClass: "font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("_common:to").capitalize()) + ": ")]), e.clients && e.clients.length ? i("div", { staticClass: "ml-auto inline-flex items-center justify-end" }, [i("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("signOrder.tooltip"), expression: "$t('signOrder.tooltip')" }], staticClass: "mr-1", attrs: { type: "info", size: "14" } }), i("div", { staticClass: "mr-2 font-medium" }, [e._v(" " + e._s(e.$t("signOrder.label")) + " ")]), i("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 ? i("transition-group", { staticClass: "list-move", attrs: { name: "list-move" } }, [e._l(e.sortedClients, function(s, n) {
544
- return [n > 0 && s.signOrder !== e.sortedClients[n - 1].signOrder ? i("div", { key: n, staticClass: "h-2 pl-6" }, [i("div", { staticClass: "bg-primary-500 h-full w-0.5 rounded-sm" })]) : e._e(), i("div", { key: s._uniqueId, staticClass: "mb-0.5 mt-px" }, [i("RecipientBlockItem", { class: {
545
- "first-of-group": n === 0 || n > 0 && s.signOrder !== e.sortedClients[n - 1].signOrder,
546
- "last-of-group": n === e.sortedClients.length - 1 || e.sortedClients[n + 1] && s.signOrder !== e.sortedClients[n + 1].signOrder
547
- }, attrs: { client: s, "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients }, on: { move: function(a) {
548
- return e.onMoveRecipient({ index: s.index, direction: a });
549
- }, open: function(a) {
550
- return e.openClientModal(s.index);
551
- }, remove: function(a) {
552
- return e.removeClient(s.index);
553
- } } })], 1)];
554
- })], 2) : e._l(e.clients, function(s, n) {
555
- return i("RecipientBlockItem", { key: s._uniqueId, staticClass: "mb-0.5 mt-px", class: {
556
- "first-of-group": n === 0,
557
- "last-of-group": n === e.clients.length - 1
558
- }, attrs: { "is-order": e.useSignOrder, compact: e.compact, "allow-edit-clients": e.allowEditClients, client: s }, on: { open: function(a) {
559
- return e.openClientModal(n);
560
- }, remove: function(a) {
561
- return e.removeClient(n);
562
- } } });
563
- }), !e.compact && e.allowEditClients ? i("CButton", { staticClass: "is-thinner !text-sm", attrs: { type: "secondary", pattern: "tertiary", "icon-left": "plus", size: "normal" }, on: { click: function(s) {
564
- return e.openClientModal(e.clients.length);
565
- } } }, [e._v(" " + e._s(e.$t("addButton")) + " ")]) : e._e()] : (e.$view === "widget" || e.viewSettings.isPublicForm) && e.allowEditClients ? i("CButton", { staticClass: "!px-4 font-medium", attrs: { type: "secondary", raised: "", size: "small", taller: "", "icon-left": "person" }, on: { click: function(s) {
566
- return e.openClientModal(e.clients.length);
567
- } } }, [e._v(" " + e._s(e.$t("addFirstButton")) + " ")]) : !e.compact && e.allowEditClients ? i("AddClientCallout", { attrs: { compact: !0 }, on: { add: function(s) {
568
- return e.openClientModal(e.clients.length);
569
- }, setClient: e.setClient } }) : e._e()], 2);
570
- }, xe = [], Se = /* @__PURE__ */ o(
571
- Ce,
572
- we,
573
- xe,
574
- !1,
575
- null,
576
- "51e072f2"
577
- );
578
- const $e = Se.exports, ke = {
579
- name: "DocumentSendReminderItem",
580
- props: {
581
- label: {
582
- type: String,
583
- required: !0
584
- },
585
- value: {
586
- type: [Number, String],
587
- default: 0
588
- },
589
- done: {
590
- type: Boolean,
591
- default: !1
592
- }
593
- }
594
- };
595
- var De = function() {
596
- var e = this, i = e._self._c;
597
- return i("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" }, [i("div", { staticClass: "mr-6 flex-auto select-none text-gray-700" }, [e._v(" " + e._s(e.label) + " ")]), i("div", { staticClass: "flex flex-nowrap items-center justify-center text-sm" }, [e.done ? i("span", { staticClass: "text-green-500" }, [i("CIcon", { attrs: { type: "check", size: "18" } }), e._v(" " + e._s(e.$t("sent")) + " ")], 1) : [i("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "minus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
598
- e.$emit("input", Math.max(e.value - 1, 0));
599
- } } }), i("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) })) + " ")] : i("span", { staticClass: "text-xs text-gray-500" }, [e._v(" " + e._s(e.$t("disabled").capitalize()) + " ")])], 2), i("CButton", { staticClass: "!h-6 !w-6 bg-white", attrs: { icon: "plus", size: "small", circle: "", raised: "" }, on: { click: function(s) {
600
- return e.$emit("input", e.value + 1);
601
- } } })]], 2)]);
602
- }, Ve = [], Fe = /* @__PURE__ */ o(
603
- ke,
604
- De,
605
- Ve,
606
- !1,
607
- null,
608
- null
609
- );
610
- const Ae = Fe.exports, Oe = {
611
- name: "DocumentSendReminders",
612
- i18nOptions: {
613
- namespaces: "documentSendReminders",
614
- messages: {
615
- en: {
616
- description: "Edit when smart reminders should be sent to client",
617
- notViewed: "Not viewed after",
618
- notAnswered: "No reply after",
619
- expires: "When expiration date is within"
620
- },
621
- sv: {
622
- description: "Ställ in när smarta påminnelser ska skickas ut till mottagaren",
623
- notViewed: "Inte öppnat efter",
624
- notAnswered: "Inte svarat efter",
625
- expires: "När giltighetstiden är inom"
626
- }
627
- }
628
- },
629
- components: {
630
- DocumentSendReminderItem: Ae
631
- },
632
- mixins: [p()],
633
- props: {
634
- setFormValue: {
635
- type: Function,
636
- required: !0
637
- },
638
- removeFormValue: {
639
- type: Function,
640
- required: !0
641
- }
642
- },
643
- computed: {
644
- reminders() {
645
- const t = {
646
- first: null,
647
- notViewed: null,
648
- notAnswered: null,
649
- expires: null
650
- };
651
- return this._document.reminders.forEach((e, i) => {
652
- e.type === "first" ? t.first = { ...e, index: i } : e.type === "viewed" ? t.notViewed = { ...e, index: i } : e.type === "expires" ? t.expires = { ...e, index: i } : t.notAnswered = { ...e, index: i };
653
- }), t;
654
- }
655
- },
656
- methods: {
657
- getDefaultReminders() {
658
- if (!this._document.template)
659
- return [];
660
- const t = this._document.template.getDefaultData({
661
- path: "properties.data.properties.reminders"
662
- });
663
- return t && Array.isArray(t) ? t : [];
664
- },
665
- setReminder(t, e) {
666
- let i = "sendDays";
667
- if (typeof e == "string" && (i = "sendAt"), !e) {
668
- this.removeFormValue(`data.reminders[${t.index}]`);
669
- return;
670
- }
671
- if (typeof t == "string") {
672
- let s = this.getDefaultReminders().find(
673
- (n) => n.type === t
674
- );
675
- if (s || (s = B.default.find((n) => n.type === t)), !s)
676
- throw new Error("Could not find default reminder");
677
- s[i] = e, this.setFormValue({ key: "data.reminders", value: s });
678
- return;
679
- }
680
- this.setFormValue({
681
- key: `data.reminders[${t.index}].${i}`,
682
- value: e
683
- });
684
- }
685
- }
686
- };
687
- var Be = function() {
688
- var e = this, i = e._self._c;
689
- return i("div", { staticStyle: { "background-color": "white", "border-radius": "calc(0.5 * var(--rem))", padding: "calc(2 * var(--rem))", "font-size": "16px" } }, [i("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()) + " ")]), i("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([
690
- { type: "notViewed", fallbackKey: "viewed" },
691
- { type: "notAnswered", fallbackKey: "reminder" },
692
- { type: "expires", fallbackKey: "expires" }
693
- ], function(s, n) {
694
- return i("DocumentSendReminderItem", { key: n, 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) {
695
- return e.setReminder(e.reminders[s.type] || s.fallbackKey, a);
696
- } } });
697
- }), i("div", { staticClass: "flex w-full items-center justify-center", staticStyle: { "margin-top": "calc(2.5 * var(--rem))" } }, [i("CButton", { attrs: { type: "secondary", expanded: "" }, on: { click: function(s) {
698
- return e.$emit("close");
699
- } } }, [e._v(" " + e._s(e.$t("_common:save")) + " ")])], 1)], 2);
700
- }, Ie = [], Te = /* @__PURE__ */ o(
701
- Oe,
702
- Be,
703
- Ie,
704
- !1,
705
- null,
706
- null
707
- );
708
- const Pe = Te.exports, Re = {
709
- name: "SendForm",
710
- i18nOptions: {
711
- namespaces: "sendForm",
712
- messages: ce
713
- },
714
- components: {
715
- Simplebar: U,
716
- BaseDatePicker: M,
717
- RecipientBlock: $e,
718
- ErrorCallout: X,
719
- IsPremiumPreStep: L,
720
- IsPremium: H
721
- },
722
- mixins: [
723
- p(
724
- ["expiresAt", "clients", "defaultAnswerMethod", "reminders", "name"],
725
- {
726
- useEmit: !1,
727
- setFnName: "setFormValue"
728
- }
729
- )
730
- ],
731
- props: {
732
- showName: {
733
- type: Boolean,
734
- default: !0
735
- },
736
- showSave: {
737
- type: Boolean,
738
- default: !0
739
- },
740
- showSchedule: {
741
- type: Boolean,
742
- default: !0
743
- },
744
- allowManualDelivery: {
745
- type: Boolean,
746
- default: !0
747
- },
748
- allowEditClients: {
749
- type: Boolean,
750
- default: !0
751
- },
752
- setFormValue: {
753
- type: Function,
754
- required: !0
755
- },
756
- removeFormValue: {
757
- type: Function,
758
- required: !0
759
- },
760
- useScroll: {
761
- type: Boolean,
762
- default: !1
763
- },
764
- onSaveDocument: {
765
- type: Function,
766
- required: !0
767
- }
768
- },
769
- data() {
770
- return {
771
- localIsPosting: !1,
772
- clientHoverIndex: null
773
- };
774
- },
775
- computed: {
776
- ...g({
777
- deliveryTypes: "forms/deliveryTypes",
778
- isPostingDocument: "documents2/isPosting",
779
- documentSenderSign: "settings/documentSenderSign",
780
- // todo: could be moved to load form action
781
- getCompanySetting: "settings/getCompanySetting",
782
- feature: "application/feature"
783
- }),
784
- isPosting() {
785
- return this.isPostingDocument || this.localIsPosting;
786
- },
787
- isPublicForm() {
788
- return !!(this.viewSettings && this.viewSettings.isPublicForm);
789
- },
790
- useSignOrder() {
791
- var t;
792
- return ((t = this._document) == null ? void 0 : t.useSignOrder) || !1;
793
- },
794
- noOfReminders() {
795
- return Object.values(this.reminders || []).reduce(
796
- (t, e) => e && (e.sendDays || e.sendAt) && e.type !== "first" ? t + 1 : t,
797
- 0
798
- );
799
- },
800
- smsActivated() {
801
- return this.deliveryTypes.sms;
802
- },
803
- emailActivated() {
804
- return this.deliveryTypes.email;
805
- },
806
- isManualDelivery() {
807
- return !this.smsActivated && !this.emailActivated;
808
- },
809
- sendTypesText() {
810
- return this.emailActivated || this.smsActivated ? [
811
- ...this.emailActivated ? [this.$t("_common:email").capitalize()] : [],
812
- ...this.smsActivated ? [this.$t("_common:sms")] : []
813
- ].join(" & ") : this._document.isDirty("isManualDelivery") && this.clients.length ? this.$t("manualDelivery") : " ";
814
- },
815
- clientsAreMissingContactInfo() {
816
- return this.isManualDelivery ? !1 : this.clients.some((t) => !(t.email || t.cellphone));
817
- },
818
- signMethods() {
819
- var t, e;
820
- return ((e = (t = this._document.signOptions) == null ? void 0 : t.filter((i) => i !== "inPerson")) == null ? void 0 : e.map((i) => ({
821
- value: i,
822
- title: this.$t(`signMethod.${i}.title`),
823
- content: this.$t(`signMethod.${i}.content`)
824
- }))) || [];
825
- }
826
- },
827
- created() {
828
- var t;
829
- if (!this.expiresAt && !this._document.isDirty("expiresAt")) {
830
- const e = this.getCompanySetting("defaultExpireDays");
831
- if (e && Number.isInteger(e) && e > 0) {
832
- const i = /* @__PURE__ */ new Date();
833
- i.setDate(i.getDate() + e), this.setField({
834
- field: "expiresAt",
835
- value: i.toISOString(),
836
- options: { ignoreChanges: !0 }
837
- });
838
- }
839
- }
840
- if (((t = this.defaultAnswerMethod) == null ? void 0 : t.accept) === "button") {
841
- const [e] = this._document.signOptions || ["signature"];
842
- this.setAnswerMethod(e, { ignoreChanges: !0 });
843
- }
844
- },
845
- validations() {
846
- const t = {
847
- clients: {
848
- required: (e) => e && e.length
849
- }
850
- };
851
- return !this.allowManualDelivery && this.clients.length && (t.isManualDelivery = {
852
- checked: (e) => !e
853
- }), t;
854
- },
855
- methods: {
856
- async doSaveDocument({ doSend: t }) {
857
- try {
858
- this.localIsPosting = !0, await this.onSaveDocument({ doSend: t });
859
- } finally {
860
- this.localIsPosting = !1;
861
- }
862
- },
863
- async doSendDocument() {
864
- var t;
865
- this.$v.$touch(), !this.$v.$invalid && (["denied", "expired", "voided"].includes((t = this._document) == null ? void 0 : t.status) && this.resetDeniedDocument(), await this.doSaveDocument({ doSend: !0 }));
866
- },
867
- setDeliveryMethod(t, e) {
868
- const i = this.deliveryTypes;
869
- i[t] = e;
870
- const s = Object.keys(i).filter((n) => i[n]);
871
- (this.clients || []).forEach((n, a) => {
872
- this.setFormValue({
873
- key: `clients[${a}].deliveryTypes`,
874
- value: s
875
- });
876
- });
877
- },
878
- setAnswerMethod(t, e = {}) {
879
- this.setField({
880
- field: "defaultAnswerMethod",
881
- value: { ...this.defaultAnswerMethod, accept: t },
882
- options: e
883
- }), (this.clients || []).forEach((i, s) => {
884
- var n;
885
- ((n = i.answerMethod) == null ? void 0 : n.accept) !== "inPerson" && this.setField({
886
- key: `clients[${s}].answerMethod.accept`,
887
- value: t,
888
- options: e
889
- });
890
- });
891
- },
892
- openReminders() {
893
- this.useSignOrder || this.$modal.show(
894
- Pe,
895
- {
896
- _document: this._document,
897
- setFormValue: this.setFormValue,
898
- removeFormValue: this.removeFormValue
899
- },
900
- {
901
- adaptive: !0,
902
- height: "auto",
903
- width: "90%",
904
- maxWidth: 360
905
- }
906
- );
907
- },
908
- openSendLater() {
909
- this.$v.$touch(), !this.$v.$invalid && this.$modal.show(
910
- de,
911
- {
912
- _document: this._document,
913
- setFormValue: this.setFormValue,
914
- removeFormValue: this.removeFormValue,
915
- onSaveDocument: this.doSaveDocument
916
- },
917
- {
918
- adaptive: !0,
919
- height: "auto",
920
- width: "90%",
921
- maxWidth: 360
922
- }
923
- );
924
- },
925
- resetDeniedDocument() {
926
- (this.clients || []).forEach((t, e) => {
927
- this.setFormValue({ key: `clients[${e}].answer`, value: null });
928
- }), this.setFormValue({ key: "data.rejectReasons", value: [] }), this.setFormValue({ key: "status", value: "sent" });
929
- },
930
- shouldShowUpgradeModal({ canUseBankId: t, canUseSms: e }) {
931
- var i;
932
- return !!(this.smsActivated && !e || ((i = this.defaultAnswerMethod) == null ? void 0 : i.accept) === "bankId" && !t);
933
- }
934
- }
935
- };
936
- var Me = function() {
937
- var e = this, i = e._self._c;
938
- return i("IsPremium", { scopedSlots: e._u([{ key: "default", fn: function({ canUseBankId: s, canUseSms: n }) {
939
- var a;
940
- return [i("div", { staticClass: "@container flex h-full flex-col" }, [i(e.useScroll ? "Simplebar" : "div", { tag: "component", staticClass: "main-container" }, [i("div", { staticClass: "@md:px-8 @md:pb-8 @xl:px-16 @xl:pb-16 relative px-4 pb-4 pt-6" }, [i("div", { staticClass: "pb-4 text-lg font-bold" }, [e._v(" " + e._s(e.$t("title")) + " ")]), e.showName ? i("div", { staticClass: "mb-6" }, [i("div", { staticClass: "pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("nameLabel")) + " ")]), i("CInput", { attrs: { placeholder: e.$t("namePlaceholder"), filled: "" }, model: { value: e.name, callback: function(r) {
941
- e.name = r;
942
- }, expression: "name" } })], 1) : e._e(), i("div", { staticClass: "mb-6" }, [i("RecipientBlock", { attrs: { _value: {
943
- clients: "clients"
944
- }, _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 ? i("div", { staticClass: "mb-8" }, [i("div", { staticClass: "block-title pb-0.5 text-xs font-medium text-gray-900" }, [e._v(" " + e._s(e.$t("signMethod.title")) + " "), i("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), i("div", { staticClass: "cb-card-group" }, e._l(e.signMethods, function(r) {
945
- return i("div", { key: r.value, staticClass: "cb-card flex border-2 border-transparent hover:border-gray-300/30 hover:bg-gray-200", class: {
946
- checked: e.defaultAnswerMethod.accept === r.value
947
- }, on: { click: function(d) {
948
- e.defaultAnswerMethod.accept !== r.value && e.setAnswerMethod(r.value);
949
- } } }, [i("CRadio", { staticClass: "sign-radio pointer-events-none mr-3", attrs: { value: e.defaultAnswerMethod.accept, "native-value": r.value, type: "secondary", size: "small" } }), i("div", { staticClass: "flex-grow" }, [i("div", { staticClass: "cb-card-title flex items-center justify-between" }, [e._v(" " + e._s(r.title) + " "), r.value === "bankId" && !s ? i("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()]), i("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);
950
- }), 0)]) : e._e(), i("div", { staticClass: "grid items-center gap-2", staticStyle: { "grid-template-columns": "repeat(auto-fit, minmax(200px, 1fr))" } }, [i("div", [i("BaseDatePicker", { staticClass: "psuedo-input relative", attrs: { "custom-el": !0, direction: "end", tabindex: "0" }, model: { value: e.expiresAt, callback: function(r) {
951
- e.expiresAt = r;
952
- }, expression: "expiresAt" } }, [i("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("validityPeriod")))]), i("div", [e._v(" " + e._s(e.expiresAt ? e.$formatDate(e.expiresAt) : e.$t("_common:disabled").capitalize()) + " ")]), e.expiresAt ? i("CButton", { staticClass: "absolute right-3 top-3 z-10", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(r) {
953
- r.preventDefault(), r.stopPropagation(), e.expiresAt = void 0, e._document.setDirty("expiresAt");
954
- } } }) : e._e()], 1)], 1), i("CDropdown", e._b(
955
- { staticStyle: { flex: "1 0 200px" }, attrs: { disabled: !e.clients.length, "mobile-label": e.$t("sendAs"), expanded: "" } },
956
- "CDropdown",
957
- e.$view === "widget" && {
958
- appendToBody: !0,
959
- menuStyling: { minWidth: "200px" }
960
- },
961
- !1
962
- ), [i("div", { staticClass: "psuedo-input", attrs: { slot: "trigger", tabindex: "0" }, slot: "trigger" }, [i("div", { staticClass: "psuedo-input-label" }, [e._v(e._s(e.$t("sendAs")))]), i("div", { domProps: { innerHTML: e._s(e.sendTypesText) } })]), i("CDropdownItem", { attrs: { value: e.emailActivated, "close-on-click": !1, toggle: "" }, on: { click: function(r) {
963
- return e.setDeliveryMethod("email", !e.emailActivated);
964
- } } }, [e._v(" " + e._s(e.$t("_common:email").capitalize()) + " ")]), e.feature("sms") ? i("CDropdownItem", { attrs: { value: e.smsActivated, "close-on-click": !1, toggle: "" }, on: { click: function(r) {
965
- return e.setDeliveryMethod("sms", !e.smsActivated);
966
- } } }, [e._v(" " + e._s(e.$t("_common:sms")) + " "), n ? e._e() : i("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 ? i("CDropdownItem", { attrs: { value: "", tooltip: {
967
- content: e.$t("manualDeliveryTooltip")
968
- } }, domProps: { textContent: e._s(e.$t("manualDelivery")) }, on: { click: () => {
969
- e.setDeliveryMethod("sms", !1), e.setDeliveryMethod("email", !1), e._document.setDirty("isManualDelivery");
970
- } } }) : e._e()], 1), !e.useSignOrder && !e.isManualDelivery ? i("div", { staticClass: "psuedo-input relative", attrs: { tabindex: "0" }, on: { click: e.openReminders } }, [i("div", { staticClass: "psuedo-input-label" }, [e._v(" " + e._s(e.$t("_common:reminder_plural").capitalize()) + " ")]), i("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 ? i("CButton", { staticClass: "absolute right-3 top-3", attrs: { icon: "x", size: "small", type: "none", pattern: "secondary" }, on: { click: function(r) {
971
- r.preventDefault(), r.stopPropagation(), e.reminders = [];
972
- } } }) : e._e()], 1) : e._e()], 1), e.clientsAreMissingContactInfo || (a = e.$v.isManualDelivery) != null && a.$invalid ? i("ErrorCallout", { attrs: { message: e.clientsAreMissingContactInfo ? e.$t("clientsAreMissingContactInfo") : e.$t("missingDeliveryMethod"), size: "small" } }) : e._e(), e._t("content")], 2)]), i("div", { staticClass: "@md:px-8 @xl:px-16 px-4 pb-4" }, [e._t("send", function() {
973
- return [i("IsPremiumPreStep", { attrs: { feature: "bankIdAndSms" }, scopedSlots: e._u([{ key: "default", fn: function({ onClick: r }) {
974
- return [i("div", { staticClass: "flex" }, [e.showSave ? i("CButton", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("_common:save", {
975
- thing: e.$t("_common:document").toLowerCase()
976
- }), expression: `
977
- $t('_common:save', {
978
- thing: $t('_common:document').toLowerCase()
979
- })
980
- ` }], staticClass: "mr-2 w-12", attrs: { loading: e.isPosting, type: "none", icon: "save", pattern: "secondary" }, on: { click: function(d) {
981
- return e.doSaveDocument({ doSend: !1 });
982
- } } }) : e._e(), e.showSchedule && !e.useSignOrder && !e.isManualDelivery ? i("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 } }, [i("span", { staticClass: "@md:!block !hidden", domProps: { textContent: e._s(e.$t("scheduledTooltip")) } }), i("CIcon", { staticClass: "@md:!hidden", attrs: { type: "calendar", size: "16" } })], 1) : e._e(), i("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$v.$invalid ? {
983
- content: e.clients.length ? e.$t("missingDeliveryMethod") : e.$t(
984
- "components:account.documentForm.clients.errorMessage"
985
- )
986
- } : {}, expression: `
987
- $v.$invalid
988
- ? {
989
- content: !clients.length
990
- ? $t(
991
- 'components:account.documentForm.clients.errorMessage'
992
- )
993
- : $t('missingDeliveryMethod')
994
- }
995
- : {}
996
- ` }], staticClass: "flex-auto" }, [i("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(d) {
997
- e.shouldShowUpgradeModal({ canUseBankId: s, canUseSms: n }) ? r({
998
- data: {
999
- bankIdBlocked: !s,
1000
- smsBlocked: !n
1001
- }
1002
- }) : e.doSendDocument();
1003
- } } }, [e._v(" " + e._s(e.$t("sendButton")) + " ")])], 1)], 1)];
1004
- } }], null, !0) })];
1005
- }), e._t("footer")], 2)], 1)];
1006
- } }], null, !0) });
1007
- }, ze = [], Ee = /* @__PURE__ */ o(
1008
- Re,
1009
- Me,
1010
- ze,
1011
- !1,
1012
- null,
1013
- "f67a7651"
1014
- );
1015
- const ii = Ee.exports, Ne = {
1016
- name: "CAutocomplete",
1017
- components: {
1018
- CInput: I
1019
- },
1020
- mixins: [T],
1021
- inheritAttrs: !1,
1022
- props: {
1023
- value: {
1024
- type: [Number, String],
1025
- default: null
1026
- },
1027
- data: {
1028
- type: Array,
1029
- default: () => []
1030
- },
1031
- field: {
1032
- type: String,
1033
- default: "value"
1034
- },
1035
- keepFirst: Boolean,
1036
- clearOnSelect: Boolean,
1037
- openOnFocus: Boolean,
1038
- customFormatter: {
1039
- type: Function,
1040
- default: () => {
1041
- }
1042
- },
1043
- checkInfiniteScroll: Boolean,
1044
- keepOpen: Boolean,
1045
- clearable: Boolean,
1046
- maxHeight: {
1047
- type: [String, Number],
1048
- default: null
1049
- },
1050
- dropdownPosition: {
1051
- type: String,
1052
- default: "auto"
1053
- },
1054
- iconRight: {
1055
- type: String,
1056
- default: null
1057
- },
1058
- iconRightClickable: Boolean,
1059
- appendToBody: Boolean
1060
- },
1061
- data() {
1062
- return {
1063
- selected: null,
1064
- hovered: null,
1065
- isActive: !1,
1066
- newValue: this.value,
1067
- newAutocomplete: this.autocomplete || "off",
1068
- isListInViewportVertically: !0,
1069
- hasFocus: !1,
1070
- style: {},
1071
- _isAutocomplete: !0,
1072
- _elementRef: "input",
1073
- _bodyEl: void 0
1074
- // Used to append to body
1075
- };
1076
- },
1077
- computed: {
1078
- /**
1079
- * White-listed items to not close when clicked.
1080
- * Add input, dropdown and all children.
1081
- */
1082
- whiteList() {
1083
- const t = [];
1084
- if (t.push(this.$refs.input.$el.querySelector("input")), t.push(this.$refs.dropdown), this.$refs.dropdown !== void 0) {
1085
- const e = this.$refs.dropdown.querySelectorAll("*");
1086
- for (const i of e)
1087
- t.push(i);
1088
- }
1089
- if (this.$parent.$data._isTaginput) {
1090
- t.push(this.$parent.$el);
1091
- const e = this.$parent.$el.querySelectorAll("*");
1092
- for (const i of e)
1093
- t.push(i);
1094
- }
1095
- return t;
1096
- },
1097
- /**
1098
- * Check if exists default slot
1099
- */
1100
- hasDefaultSlot() {
1101
- return !!this.$scopedSlots.default;
1102
- },
1103
- /**
1104
- * Check if exists "empty" slot
1105
- */
1106
- hasEmptySlot() {
1107
- return !!this.$slots.empty;
1108
- },
1109
- /**
1110
- * Check if exists "header" slot
1111
- */
1112
- hasHeaderSlot() {
1113
- return !!this.$slots.header;
1114
- },
1115
- /**
1116
- * Check if exists "footer" slot
1117
- */
1118
- hasFooterSlot() {
1119
- return !!this.$slots.footer;
1120
- },
1121
- /**
1122
- * Apply dropdownPosition property
1123
- */
1124
- isOpenedTop() {
1125
- return this.dropdownPosition === "top" || this.dropdownPosition === "auto" && !this.isListInViewportVertically;
1126
- },
1127
- newIconRight() {
1128
- return this.clearable && this.newValue ? "close-circle" : this.iconRight;
1129
- },
1130
- newIconRightClickable() {
1131
- return this.clearable ? !0 : this.iconRightClickable;
1132
- },
1133
- contentStyle() {
1134
- return {
1135
- maxHeight: this.maxHeight === void 0 ? null : isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`
1136
- };
1137
- },
1138
- isDropdownOpen() {
1139
- return this.isActive && (this.data.length > 0 || this.hasEmptySlot || this.hasHeaderSlot);
1140
- }
1141
- },
1142
- watch: {
1143
- /**
1144
- * When dropdown is toggled, check the visibility to know when
1145
- * to open upwards.
1146
- */
1147
- isActive(t) {
1148
- this.dropdownPosition === "auto" && (t ? this.calcDropdownInViewportVertical() : setTimeout(() => {
1149
- this.calcDropdownInViewportVertical();
1150
- }, 100)), t && this.$nextTick(() => this.setHovered(null));
1151
- },
1152
- /**
1153
- * When updating input's value
1154
- * 1. Emit changes
1155
- * 2. If value isn't the same as selected, set null
1156
- * 3. Close dropdown if value is clear or else open it
1157
- */
1158
- newValue(t) {
1159
- this.$emit("input", t);
1160
- const e = this.getValue(this.selected);
1161
- e && e !== t && this.setSelected(null, !1), this.hasFocus && (!this.openOnFocus || t) && (this.isActive = !!t);
1162
- },
1163
- /**
1164
- * When v-model is changed:
1165
- * 1. Update internal value.
1166
- * 2. If it's invalid, validate again.
1167
- */
1168
- value(t) {
1169
- this.newValue = t;
1170
- },
1171
- /**
1172
- * Select first option if "keep-first
1173
- */
1174
- data(t) {
1175
- this.keepFirst && this.selectFirstOption(t);
1176
- }
1177
- },
1178
- created() {
1179
- typeof window < "u" && (document.addEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.addEventListener("resize", this.calcDropdownInViewportVertical));
1180
- },
1181
- mounted() {
1182
- if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content")) {
1183
- const t = this.$refs.dropdown.querySelector(".dropdown-content");
1184
- t.addEventListener(
1185
- "scroll",
1186
- () => this.checkIfReachedTheEndOfScroll(t)
1187
- );
1188
- }
1189
- this.appendToBody && (this.$data._bodyEl = Z(this.$refs.dropdown), this.updateAppendToBody());
1190
- },
1191
- beforeDestroy() {
1192
- typeof window < "u" && (document.removeEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.removeEventListener(
1193
- "resize",
1194
- this.calcDropdownInViewportVertical
1195
- )), this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content") && this.$refs.dropdown.querySelector(".dropdown-content").removeEventListener("scroll", this.checkIfReachedTheEndOfScroll), this.appendToBody && ee(this.$data._bodyEl);
1196
- },
1197
- methods: {
1198
- /**
1199
- * Set which option is currently hovered.
1200
- */
1201
- setHovered(t) {
1202
- t !== void 0 && (this.hovered = t);
1203
- },
1204
- /**
1205
- * Set which option is currently selected, update v-model,
1206
- * update input value and close dropdown.
1207
- */
1208
- setSelected(t, e = !0) {
1209
- t !== void 0 && (this.selected = t, this.$emit("select", this.selected), this.selected !== null && (this.newValue = this.clearOnSelect ? "" : this.getValue(this.selected), this.setHovered(this.clearOnSelect ? null : this.hovered)), e && this.$nextTick(() => {
1210
- this.isActive = !1;
1211
- }), this.checkValidity());
1212
- },
1213
- /**
1214
- * Select first option
1215
- */
1216
- selectFirstOption(t) {
1217
- this.$nextTick(() => {
1218
- t.length ? (this.openOnFocus || this.newValue !== "" && this.hovered !== t[0]) && this.setHovered(t[0]) : this.setHovered(null);
1219
- });
1220
- },
1221
- /**
1222
- * Enter key listener.
1223
- * Select the hovered option.
1224
- */
1225
- enterPressed(t) {
1226
- this.isDropdownOpen && (t.preventDefault(), this.hovered !== null && this.setSelected(this.hovered, !this.keepOpen));
1227
- },
1228
- /**
1229
- * Tab key listener.
1230
- * Select hovered option if it exists, close dropdown, then allow
1231
- * native handling to move to next tabbable element.
1232
- */
1233
- tabPressed() {
1234
- if (this.hovered === null) {
1235
- this.isActive = !1;
1236
- return;
1237
- }
1238
- this.setSelected(this.hovered, !this.keepOpen);
1239
- },
1240
- /**
1241
- * Close dropdown if clicked outside.
1242
- */
1243
- clickedOutside(t) {
1244
- var i;
1245
- const e = ((i = t.path) == null ? void 0 : i[0]) || t.target;
1246
- this.whiteList.indexOf(e) < 0 && (this.isActive = !1);
1247
- },
1248
- /**
1249
- * Return display text for the input.
1250
- * If object, get value from path, or else just the value.
1251
- */
1252
- getValue(t) {
1253
- if (t !== null)
1254
- return typeof this.customFormatter < "u" ? this.customFormatter(t) : typeof t == "object" ? te(t, this.field) : t;
1255
- },
1256
- /**
1257
- * Check if the scroll list inside the dropdown
1258
- * reached it's end.
1259
- */
1260
- checkIfReachedTheEndOfScroll(t) {
1261
- t.clientHeight !== t.scrollHeight && t.scrollTop + t.clientHeight >= t.scrollHeight && this.$emit("infinite-scroll");
1262
- },
1263
- /**
1264
- * Calculate if the dropdown is vertically visible when activated,
1265
- * otherwise it is openened upwards.
1266
- */
1267
- calcDropdownInViewportVertical() {
1268
- this.$nextTick(() => {
1269
- if (this.$refs.dropdown === void 0)
1270
- return;
1271
- const t = this.$refs.dropdown.getBoundingClientRect();
1272
- this.isListInViewportVertically = t.top >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight), this.appendToBody && this.updateAppendToBody();
1273
- });
1274
- },
1275
- /**
1276
- * Arrows keys listener.
1277
- * If dropdown is active, set hovered option, or else just open.
1278
- */
1279
- keyArrows(t) {
1280
- const e = t === "down" ? 1 : -1;
1281
- if (this.isActive) {
1282
- let i = this.data.indexOf(this.hovered) + e;
1283
- i = i > this.data.length - 1 ? this.data.length : i, i = i < 0 ? 0 : i, this.setHovered(this.data[i]);
1284
- const s = this.$refs.dropdown.querySelector(".dropdown-content"), n = s.querySelectorAll(
1285
- "a.dropdown-item:not(.is-disabled)"
1286
- )[i];
1287
- if (!n)
1288
- return;
1289
- const a = s.scrollTop, r = s.scrollTop + s.clientHeight - n.clientHeight;
1290
- n.offsetTop < a ? s.scrollTop = n.offsetTop : n.offsetTop >= r && (s.scrollTop = n.offsetTop - s.clientHeight + n.clientHeight);
1291
- } else
1292
- this.isActive = !0;
1293
- },
1294
- /**
1295
- * Focus listener.
1296
- * If value is the same as selected, select all text.
1297
- */
1298
- focused(t) {
1299
- this.getValue(this.selected) === this.newValue && this.$el.querySelector("input").select(), this.openOnFocus && (this.isActive = !0, this.keepFirst && this.selectFirstOption(this.data)), this.hasFocus = !0, this.$emit("focus", t);
1300
- },
1301
- /**
1302
- * Blur listener.
1303
- */
1304
- onBlur(t) {
1305
- this.hasFocus = !1, this.$emit("blur", t);
1306
- },
1307
- onInput() {
1308
- const t = this.getValue(this.selected);
1309
- t && t === this.newValue || (this.$emit("typing", this.newValue), this.checkValidity());
1310
- },
1311
- rightIconClick(t) {
1312
- this.clearable ? this.newValue = "" : this.$emit("icon-right-click", t);
1313
- },
1314
- checkValidity() {
1315
- this.useHtml5Validation && this.$nextTick(() => {
1316
- this.checkHtml5Validity();
1317
- });
1318
- },
1319
- updateAppendToBody() {
1320
- const t = this.$refs.dropdown, e = this.$refs.input.$el;
1321
- if (t && e) {
1322
- const i = this.$data._bodyEl;
1323
- i.classList.forEach((r) => i.classList.remove(r)), i.classList.add("autocomplete"), i.classList.add("control"), this.expandend && i.classList.add("is-expandend");
1324
- const s = e.getBoundingClientRect();
1325
- let n = s.top + window.scrollY;
1326
- const a = s.left + window.scrollX;
1327
- this.isOpenedTop ? n -= t.clientHeight : n += e.clientHeight, this.style = {
1328
- position: "absolute",
1329
- top: `${n}px`,
1330
- left: `${a}px`,
1331
- width: `${e.clientWidth}px`,
1332
- maxWidth: `${e.clientWidth}px`,
1333
- zIndex: "99"
1334
- };
1335
- }
1336
- }
1337
- }
1338
- };
1339
- var Le = function() {
1340
- var e = this, i = e._self._c;
1341
- return i("div", { staticClass: "autocomplete control", class: { "is-expanded": e.expanded } }, [i("CInput", e._b({ ref: "input", attrs: { size: e.size, loading: e.loading, rounded: e.rounded, icon: e.icon, "icon-right": e.newIconRight, "icon-right-clickable": e.newIconRightClickable, "icon-pack": e.iconPack, maxlength: e.maxlength, autocomplete: e.newAutocomplete, "use-html5-validation": !1, type: "text" }, on: { input: e.onInput, focus: e.focused, blur: e.onBlur, "icon-right-click": e.rightIconClick, "icon-click": (s) => e.$emit("icon-click", s) }, nativeOn: { keyup: function(s) {
1342
- if (!s.type.indexOf("key") && e._k(s.keyCode, "esc", 27, s.key, ["Esc", "Escape"]))
1343
- return null;
1344
- s.preventDefault(), e.isActive = !1;
1345
- }, keydown: [function(s) {
1346
- return !s.type.indexOf("key") && e._k(s.keyCode, "tab", 9, s.key, "Tab") ? null : e.tabPressed.apply(null, arguments);
1347
- }, function(s) {
1348
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : e.enterPressed.apply(null, arguments);
1349
- }, function(s) {
1350
- return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.keyArrows("up"));
1351
- }, function(s) {
1352
- return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.keyArrows("down"));
1353
- }] }, model: { value: e.newValue, callback: function(s) {
1354
- e.newValue = s;
1355
- }, expression: "newValue" } }, "CInput", e.$attrs, !1)), i("transition", { attrs: { name: "fade" } }, [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.isDropdownOpen, expression: "isDropdownOpen" }], ref: "dropdown", staticClass: "dropdown-menu", class: { "is-opened-top": e.isOpenedTop && !e.appendToBody }, style: e.style }, [i("div", { directives: [{ name: "show", rawName: "v-show", value: e.isActive, expression: "isActive" }], staticClass: "dropdown-content", style: e.contentStyle }, [e.hasHeaderSlot ? i("div", { staticClass: "dropdown-item" }, [e._t("header")], 2) : e._e(), e._l(e.data, function(s, n) {
1356
- return i("a", { key: n, staticClass: "dropdown-item", class: { "is-hovered": s === e.hovered }, on: { click: function(a) {
1357
- return e.setSelected(s, void 0, a);
1358
- } } }, [e.hasDefaultSlot ? e._t("default", null, { option: s, index: n }) : i("span", [e._v(" " + e._s(e.getValue(s, !0)) + " ")])], 2);
1359
- }), e.data.length === 0 && e.hasEmptySlot ? i("div", { staticClass: "dropdown-item is-disabled" }, [e._t("empty")], 2) : e._e(), e.hasFooterSlot ? i("div", { staticClass: "dropdown-item" }, [e._t("footer")], 2) : e._e()], 2)])])], 1);
1360
- }, He = [], qe = /* @__PURE__ */ o(
1361
- Ne,
1362
- Le,
1363
- He,
1364
- !1,
1365
- null,
1366
- null
1367
- );
1368
- const je = qe.exports, Ke = {
1369
- name: "CMessage",
1370
- props: {
1371
- type: {
1372
- type: String,
1373
- default: "secondary"
1374
- },
1375
- badge: {
1376
- type: String,
1377
- default: ""
1378
- },
1379
- text: {
1380
- type: String,
1381
- default: ""
1382
- }
1383
- }
1384
- };
1385
- var We = function(e, i) {
1386
- return e("div", { class: [i.data.class, i.data.staticClass], staticStyle: { padding: "0.75em 1em", display: "flex", "align-items": "flex-start", "border-radius": "0.6em", "background-color": "hsl(var(--gray-color-100) / 1)" }, style: { ...i.data.staticStyle } }, [e("div", { class: [`has-background-${i.props.type}`], staticStyle: { display: "inline-block", padding: "0.5em", "border-radius": "0.45em", "font-weight": "700", color: "white", "line-height": "1", "font-size": "12px", "margin-right": "1.25em" } }, [i._v(" " + i._s(i.props.badge || i.parent.$t("components:cling.message.tip")) + " ")]), e("div", { staticStyle: { color: "hsl(0, 0%, 25%)" } }, [i.props.text ? [i._v(" " + i._s(i.props.text) + " ")] : i._e(), i._t("default")], 2)]);
1387
- }, Xe = [], Ue = /* @__PURE__ */ o(
1388
- Ke,
1389
- We,
1390
- Xe,
1391
- !0,
1392
- null,
1393
- "9be3b227"
1394
- );
1395
- const w = Ue.exports, Qe = {
1396
- name: "CPhoneInput",
1397
- components: {
1398
- Flag: Q,
1399
- CInput: I,
1400
- CDropdown: h,
1401
- CDropdownItem: f,
1402
- CButton: P,
1403
- CField: ie,
1404
- SmartList: ne
1405
- },
1406
- props: {
1407
- value: {
1408
- type: [String, Number],
1409
- default: ""
1410
- },
1411
- region: {
1412
- type: String,
1413
- default: ""
1414
- },
1415
- // Region to fallback to if prefix is not found in value
1416
- defaultRegion: {
1417
- type: String,
1418
- required: !0
1419
- },
1420
- label: {
1421
- type: String,
1422
- default: ""
1423
- },
1424
- labelPosition: {
1425
- type: String,
1426
- default: ""
1427
- }
1428
- },
1429
- data() {
1430
- return {
1431
- internalPrefix: null,
1432
- // Used to remember prefix when value is changed to empty
1433
- searchQuery: ""
1434
- };
1435
- },
1436
- computed: {
1437
- defaultPrefix() {
1438
- return l[this.internalRegion].callingCode;
1439
- },
1440
- currentRegion() {
1441
- return this.getRegionByCallingCode(this.prefix);
1442
- },
1443
- internalRegion: {
1444
- get() {
1445
- if (this.region)
1446
- return this.region;
1447
- if (this.value) {
1448
- const t = (Object.keys(l) || []).find(
1449
- (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
1450
- );
1451
- if (t)
1452
- return t;
1453
- }
1454
- return this.internalPrefix ? this.getRegionByCallingCode(this.internalPrefix) : this.defaultRegion;
1455
- },
1456
- set(t) {
1457
- this.$emit("update:region", t), this.updateValue({ prefix: l[t].callingCode });
1458
- }
1459
- },
1460
- prefix() {
1461
- if (!this.value)
1462
- return this.internalPrefix || this.defaultPrefix;
1463
- const t = (Object.keys(l) || []).find(
1464
- (e) => l[e].callingCode && this.value && this.value.startsWith(l[e].callingCode)
1465
- );
1466
- return t ? l[t].callingCode : this.defaultPrefix;
1467
- },
1468
- phone: {
1469
- get() {
1470
- return this.prefix && this.value && this.value.startsWith(this.prefix) ? this.value.substring(this.prefix.length) : this.value;
1471
- },
1472
- set(t) {
1473
- this.updateValue({ phone: t });
1474
- }
1475
- },
1476
- sortedRegions() {
1477
- return (Object.keys(l) || []).map((t) => ({
1478
- key: t,
1479
- title: `${l[t].name} (${t})`,
1480
- callingCode: l[t].callingCode
1481
- })).sort((t, e) => t.title.localeCompare(e.title));
1482
- }
1483
- },
1484
- methods: {
1485
- getRegionByCallingCode(t) {
1486
- return t ? (Object.keys(l) || []).find(
1487
- (i) => t === l[i].callingCode
1488
- ) : null;
1489
- },
1490
- updateValue({ prefix: t, phone: e }) {
1491
- const i = t !== void 0 ? t : this.prefix || "", s = e !== void 0 ? e : this.phone || "", n = `${i}${s}`;
1492
- n !== i ? (this.$emit("input", n), this.region || this.$emit("update:region", this.internalRegion), this.internalPrefix = null) : (this.internalPrefix = i, this.$emit("input", ""));
1493
- }
1494
- }
1495
- };
1496
- var Ye = function() {
1497
- var e = this, i = e._self._c;
1498
- return i("CField", { staticClass: "has-addons", attrs: { expanded: "" } }, [i("div", { staticClass: "control" }, [i("SmartList", { attrs: { query: e.searchQuery, items: e.sortedRegions }, scopedSlots: e._u([{ key: "default", fn: function({ items: s }) {
1499
- return [i("CDropdown", { staticClass: "control", staticStyle: { height: "100%" }, attrs: { size: e.$attrs.size, disabled: e.$attrs.disabled, "menu-styling": {
1500
- maxWidth: "300px"
1501
- }, scrollable: !0, position: "is-bottom-right", "max-height": "240px" }, model: { value: e.internalRegion, callback: function(n) {
1502
- e.internalRegion = n;
1503
- }, expression: "internalRegion" } }, [i("CButton", { staticStyle: { height: "100%" }, attrs: { slot: "trigger", size: e.$attrs.size, type: "none", pattern: "secondary" }, slot: "trigger" }, [i("Flag", { staticStyle: { "margin-right": "0.35em" }, attrs: { region: e.internalRegion } }), e._v(" " + e._s(e.prefix) + " ")], 1), i("CInput", { staticStyle: { "margin-bottom": "0.25em" }, attrs: { slot: "header", placeholder: e.$t("_common:search"), filled: "" }, slot: "header", model: { value: e.searchQuery, callback: function(n) {
1504
- e.searchQuery = n;
1505
- }, expression: "searchQuery" } }), e._l(s, function({ key: n, title: a, callingCode: r }) {
1506
- return i("CDropdownItem", { key: n, staticClass: "truncate-text", attrs: { value: n } }, [i("Flag", { staticStyle: { "margin-right": "0.75em", flex: "0 0 auto" }, attrs: { region: n, title: a } }), i("span", { staticClass: "truncate-text" }, [e._v(" " + e._s(a) + " (" + e._s(r) + ") ")])], 1);
1507
- })], 2)];
1508
- } }]) })], 1), i("CField", { staticClass: "control", attrs: { label: e.label, "label-position": e.labelPosition, expanded: "" } }, [i("CInput", e._b({ attrs: { size: e.$attrs.size, placeholder: e.$attrs.placeholder, type: "tel" }, model: { value: e.phone, callback: function(s) {
1509
- e.phone = s;
1510
- }, expression: "phone" } }, "CInput", { ...e.$attrs, ...e.$props }, !1))], 1)], 1);
1511
- }, Ge = [], Je = /* @__PURE__ */ o(
1512
- Qe,
1513
- Ye,
1514
- Ge,
1515
- !1,
1516
- null,
1517
- null
1518
- );
1519
- const x = Je.exports, Ze = {
1520
- name: "CRadio",
1521
- mixins: [R]
1522
- };
1523
- var et = function() {
1524
- var e = this, i = e._self._c;
1525
- return i("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(s) {
1526
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
1527
- } } }, [i("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(s) {
1528
- s.stopPropagation();
1529
- }, change: function(s) {
1530
- e.computedValue = e.nativeValue;
1531
- } } }), i("span", { staticClass: "check", class: `is-${e.type}` }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
1532
- }, tt = [], it = /* @__PURE__ */ o(
1533
- Ze,
1534
- et,
1535
- tt,
1536
- !1,
1537
- null,
1538
- null
1539
- );
1540
- const S = it.exports, st = {
1541
- name: "CRadioButton",
1542
- components: {
1543
- CButton: P
1544
- },
1545
- mixins: [R],
1546
- props: {
1547
- type: {
1548
- type: String,
1549
- default: "primary"
1550
- },
1551
- expanded: Boolean
1552
- },
1553
- data() {
1554
- return {
1555
- isFocused: !1
1556
- };
1557
- }
1558
- };
1559
- var nt = function() {
1560
- var e = this, i = e._self._c;
1561
- return i("div", { staticClass: "control", class: { "is-expanded": e.expanded } }, [i("CButton", { ref: "label", staticClass: "c-radio radio button", class: [{ "is-disabled": e.disabled, "is-focused": e.isFocused }], attrs: { tag: "label", type: e.newValue === e.nativeValue ? e.type : null, size: e.size, disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
1562
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.$el.label.click());
1563
- } } }, [e._t("default"), i("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(s) {
1564
- s.stopPropagation();
1565
- }, focus: function(s) {
1566
- e.isFocused = !0;
1567
- }, blur: function(s) {
1568
- e.isFocused = !1;
1569
- }, change: function(s) {
1570
- e.computedValue = e.nativeValue;
1571
- } } })], 2)], 1);
1572
- }, at = [], rt = /* @__PURE__ */ o(
1573
- st,
1574
- nt,
1575
- at,
1576
- !1,
1577
- null,
1578
- null
1579
- );
1580
- const $ = rt.exports, ot = {
1581
- name: "CSelect",
1582
- mixins: [T],
1583
- inheritAttrs: !1,
1584
- props: {
1585
- value: {
1586
- type: [String, Number, Boolean, Object, Array, Function],
1587
- default: null
1588
- },
1589
- placeholder: {
1590
- type: String,
1591
- default: ""
1592
- },
1593
- multiple: Boolean,
1594
- selectClass: {
1595
- type: [String, Object, Array],
1596
- default: ""
1597
- },
1598
- nativeSize: {
1599
- type: [String, Number],
1600
- default: null
1601
- }
1602
- },
1603
- data() {
1604
- return {
1605
- selected: this.value,
1606
- _elementRef: "select"
1607
- };
1608
- },
1609
- computed: {
1610
- computedValue: {
1611
- get() {
1612
- return this.selected;
1613
- },
1614
- set(t) {
1615
- this.selected = t, this.$emit("input", t), !this.isValid && this.checkHtml5Validity();
1616
- }
1617
- },
1618
- spanClasses() {
1619
- return [
1620
- this.size,
1621
- this.statusType,
1622
- {
1623
- "is-fullwidth": this.expanded,
1624
- "is-loading": this.loading,
1625
- "is-multiple": this.multiple,
1626
- "is-rounded": this.rounded,
1627
- "is-empty": this.selected === null
1628
- }
1629
- ];
1630
- }
1631
- },
1632
- watch: {
1633
- /**
1634
- * When v-model is changed:
1635
- * 1. Set the selected option.
1636
- * 2. If it's invalid, validate again.
1637
- */
1638
- value(t) {
1639
- this.selected = t, !this.isValid && this.checkHtml5Validity();
1640
- }
1641
- }
1642
- };
1643
- var lt = function() {
1644
- var e = this, i = e._self._c;
1645
- return i("div", { staticClass: "control", class: { "is-expanded": e.expanded, "has-icons-left": e.icon } }, [i("span", { staticClass: "select", class: e.spanClasses }, [i("select", e._b({ directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "select", class: e.selectClass, attrs: { multiple: e.multiple, size: e.nativeSize }, on: { blur: function(s) {
1646
- e.$emit("blur", s) && e.checkHtml5Validity();
1647
- }, focus: function(s) {
1648
- return e.$emit("focus", s);
1649
- }, change: function(s) {
1650
- var n = Array.prototype.filter.call(s.target.options, function(a) {
1651
- return a.selected;
1652
- }).map(function(a) {
1653
- var r = "_value" in a ? a._value : a.value;
1654
- return r;
1655
- });
1656
- e.computedValue = s.target.multiple ? n : n[0];
1657
- } } }, "select", e.$attrs, !1), [e.placeholder && e.computedValue == null ? i("option", { attrs: { disabled: "", hidden: "" }, domProps: { value: null } }, [e._v(" " + e._s(e.placeholder) + " ")]) : e._e(), e._t("default")], 2)])]);
1658
- }, dt = [], ct = /* @__PURE__ */ o(
1659
- ot,
1660
- lt,
1661
- dt,
1662
- !1,
1663
- null,
1664
- "23e48013"
1665
- );
1666
- const k = ct.exports, ut = {
1667
- name: "CSkeleton",
1668
- functional: !0,
1669
- props: {
1670
- active: {
1671
- type: Boolean,
1672
- default: !0
1673
- },
1674
- animated: {
1675
- type: Boolean,
1676
- default: !1
1677
- },
1678
- width: [Number, String],
1679
- height: [Number, String],
1680
- circle: Boolean,
1681
- rounded: {
1682
- type: Boolean,
1683
- default: !0
1684
- },
1685
- count: {
1686
- type: Number,
1687
- default: 1
1688
- },
1689
- hidden: {
1690
- type: [Boolean, String],
1691
- default: !1
1692
- },
1693
- color: {
1694
- type: String,
1695
- default: null
1696
- }
1697
- },
1698
- render(t, e) {
1699
- if (!e.props.active)
1700
- return;
1701
- const i = [], s = e.props.width, n = e.props.height;
1702
- for (let a = 0; a < e.props.count; a++)
1703
- i.push(
1704
- t("div", {
1705
- staticClass: "c-skeleton-item",
1706
- class: { "is-rounded": e.props.rounded },
1707
- key: a,
1708
- style: {
1709
- height: n === void 0 ? null : isNaN(n) ? n : n + "px",
1710
- width: s === void 0 ? null : isNaN(s) ? s : s + "px",
1711
- borderRadius: e.props.circle ? "50%" : null,
1712
- background: e.props.color ? e.props.color : null
1713
- }
1714
- })
1715
- );
1716
- return t(
1717
- "div",
1718
- {
1719
- staticStyle: e.data.staticStyle,
1720
- staticClass: "c-skeleton",
1721
- class: [
1722
- e.data.staticClass,
1723
- {
1724
- "is-animated": e.props.animated,
1725
- "is-invisible": e.props.hidden
1726
- }
1727
- ]
1728
- },
1729
- i
1730
- );
1731
- }
1732
- }, pt = null, mt = null;
1733
- var ht = /* @__PURE__ */ o(
1734
- ut,
1735
- pt,
1736
- mt,
1737
- !1,
1738
- null,
1739
- null
1740
- );
1741
- const D = ht.exports, ft = {
1742
- name: "CSliderThumb",
1743
- inheritAttrs: !1,
1744
- props: {
1745
- value: {
1746
- type: Number,
1747
- default: 0
1748
- },
1749
- type: {
1750
- type: String,
1751
- default: ""
1752
- },
1753
- tooltip: {
1754
- type: Boolean,
1755
- default: !0
1756
- },
1757
- customFormatter: {
1758
- type: Function,
1759
- default: null
1760
- }
1761
- },
1762
- data() {
1763
- return {
1764
- isFocused: !1,
1765
- dragging: !1,
1766
- startX: 0,
1767
- startPosition: 0,
1768
- newPosition: null,
1769
- oldValue: this.value
1770
- };
1771
- },
1772
- computed: {
1773
- disabled() {
1774
- return this.$parent.disabled;
1775
- },
1776
- max() {
1777
- return this.$parent.max;
1778
- },
1779
- min() {
1780
- return this.$parent.min;
1781
- },
1782
- step() {
1783
- return this.$parent.step;
1784
- },
1785
- precision() {
1786
- return this.$parent.precision;
1787
- },
1788
- currentPosition() {
1789
- return `${(this.value - this.min) / (this.max - this.min) * 100}%`;
1790
- },
1791
- wrapperStyle() {
1792
- return { left: this.currentPosition };
1793
- },
1794
- tooltipLabel() {
1795
- return typeof this.customFormatter == "function" ? this.customFormatter(this.value) : this.value.toString();
1796
- }
1797
- },
1798
- methods: {
1799
- onFocus() {
1800
- this.isFocused = !0;
1801
- },
1802
- onBlur() {
1803
- this.isFocused = !1;
1804
- },
1805
- onButtonDown(t) {
1806
- this.disabled || (t.preventDefault(), this.onDragStart(t), typeof window < "u" && (document.addEventListener("mousemove", this.onDragging), document.addEventListener("touchmove", this.onDragging), document.addEventListener("mouseup", this.onDragEnd), document.addEventListener("touchend", this.onDragEnd), document.addEventListener("contextmenu", this.onDragEnd)));
1807
- },
1808
- onLeftKeyDown() {
1809
- this.disabled || this.value === this.min || (this.newPosition = parseFloat(this.currentPosition) - this.step / (this.max - this.min) * 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1810
- },
1811
- onRightKeyDown() {
1812
- this.disabled || this.value === this.max || (this.newPosition = parseFloat(this.currentPosition) + this.step / (this.max - this.min) * 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1813
- },
1814
- onHomeKeyDown() {
1815
- this.disabled || this.value === this.min || (this.newPosition = 0, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1816
- },
1817
- onEndKeyDown() {
1818
- this.disabled || this.value === this.max || (this.newPosition = 100, this.setPosition(this.newPosition), this.$parent.emitValue("change"));
1819
- },
1820
- onDragStart(t) {
1821
- this.dragging = !0, this.$emit("dragstart"), t.type === "touchstart" && (t.clientX = t.touches[0].clientX), this.startX = t.clientX, this.startPosition = parseFloat(this.currentPosition), this.newPosition = this.startPosition;
1822
- },
1823
- onDragging(t) {
1824
- if (this.dragging) {
1825
- t.type === "touchmove" && (t.clientX = t.touches[0].clientX);
1826
- const e = (t.clientX - this.startX) / this.$parent.sliderSize() * 100;
1827
- this.newPosition = this.startPosition + e, this.setPosition(this.newPosition);
1828
- }
1829
- },
1830
- onDragEnd() {
1831
- this.dragging = !1, this.$emit("dragend"), this.value !== this.oldValue && this.$parent.emitValue("change"), this.setPosition(this.newPosition), typeof window < "u" && (document.removeEventListener("mousemove", this.onDragging), document.removeEventListener("touchmove", this.onDragging), document.removeEventListener("mouseup", this.onDragEnd), document.removeEventListener("touchend", this.onDragEnd), document.removeEventListener("contextmenu", this.onDragEnd));
1832
- },
1833
- setPosition(t) {
1834
- if (t === null || isNaN(t))
1835
- return;
1836
- t < 0 ? t = 0 : t > 100 && (t = 100);
1837
- const e = 100 / ((this.max - this.min) / this.step);
1838
- let s = Math.round(t / e) * e / 100 * (this.max - this.min) + this.min;
1839
- s = parseFloat(s.toFixed(this.precision)), this.$emit("input", s), !this.dragging && s !== this.oldValue && (this.oldValue = s);
1840
- }
1841
- }
1842
- };
1843
- var gt = function() {
1844
- var e = this, i = e._self._c;
1845
- return i("div", { staticClass: "c-slider-thumb-wrapper", class: { "is-dragging": e.dragging }, style: e.wrapperStyle }, [i("div", e._b({ staticClass: "c-slider-thumb", attrs: { tabindex: e.disabled ? !1 : 0 }, on: { mousedown: e.onButtonDown, touchstart: e.onButtonDown, focus: e.onFocus, blur: e.onBlur, keydown: [function(s) {
1846
- return !s.type.indexOf("key") && e._k(s.keyCode, "left", 37, s.key, ["Left", "ArrowLeft"]) || "button" in s && s.button !== 0 ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
1847
- }, function(s) {
1848
- return !s.type.indexOf("key") && e._k(s.keyCode, "right", 39, s.key, ["Right", "ArrowRight"]) || "button" in s && s.button !== 2 ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
1849
- }, function(s) {
1850
- return !s.type.indexOf("key") && e._k(s.keyCode, "down", 40, s.key, ["Down", "ArrowDown"]) ? null : (s.preventDefault(), e.onLeftKeyDown.apply(null, arguments));
1851
- }, function(s) {
1852
- return !s.type.indexOf("key") && e._k(s.keyCode, "up", 38, s.key, ["Up", "ArrowUp"]) ? null : (s.preventDefault(), e.onRightKeyDown.apply(null, arguments));
1853
- }, function(s) {
1854
- return !s.type.indexOf("key") && e._k(s.keyCode, "home", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onHomeKeyDown.apply(null, arguments));
1855
- }, function(s) {
1856
- return !s.type.indexOf("key") && e._k(s.keyCode, "end", void 0, s.key, void 0) ? null : (s.preventDefault(), e.onEndKeyDown.apply(null, arguments));
1857
- }] } }, "div", e.$attrs, !1))]);
1858
- }, vt = [], yt = /* @__PURE__ */ o(
1859
- ft,
1860
- gt,
1861
- vt,
1862
- !1,
1863
- null,
1864
- null
1865
- );
1866
- const _t = yt.exports, bt = {
1867
- name: "CSliderTick",
1868
- props: {
1869
- value: {
1870
- type: Number,
1871
- default: 0
1872
- }
1873
- },
1874
- computed: {
1875
- position() {
1876
- const t = (this.value - this.$parent.min) / (this.$parent.max - this.$parent.min) * 100;
1877
- return t >= 0 && t <= 100 ? t : 0;
1878
- },
1879
- hidden() {
1880
- return this.value === this.$parent.min || this.value === this.$parent.max;
1881
- }
1882
- },
1883
- created() {
1884
- if (!this.$parent.$data._isSlider)
1885
- throw this.$destroy(), new Error("You should wrap bSliderTick on a bSlider");
1886
- },
1887
- methods: {
1888
- getTickStyle(t) {
1889
- return { left: `${t}%` };
1890
- }
1891
- }
1892
- };
1893
- var Ct = function() {
1894
- var e = this, i = e._self._c;
1895
- return i("div", { staticClass: "c-slider-tick", class: { "is-tick-hidden": e.hidden }, style: e.getTickStyle(e.position) }, [e.$slots.default ? i("span", { staticClass: "c-slider-tick-label" }, [e._t("default")], 2) : e._e()]);
1896
- }, wt = [], xt = /* @__PURE__ */ o(
1897
- bt,
1898
- Ct,
1899
- wt,
1900
- !1,
1901
- null,
1902
- null
1903
- );
1904
- const St = xt.exports, $t = {
1905
- name: "CSlider",
1906
- components: {
1907
- CSliderThumb: _t,
1908
- CSliderTick: St
1909
- },
1910
- props: {
1911
- value: {
1912
- type: [Number, Array],
1913
- default: 0
1914
- },
1915
- min: {
1916
- type: Number,
1917
- default: 0
1918
- },
1919
- max: {
1920
- type: Number,
1921
- default: 100
1922
- },
1923
- step: {
1924
- type: Number,
1925
- default: 1
1926
- },
1927
- type: {
1928
- type: String,
1929
- default: "primary"
1930
- },
1931
- size: {
1932
- type: String,
1933
- default: ""
1934
- },
1935
- ticks: {
1936
- type: Boolean,
1937
- default: !1
1938
- },
1939
- tooltip: {
1940
- type: Boolean,
1941
- default: !0
1942
- },
1943
- tooltipType: {
1944
- type: String,
1945
- default: ""
1946
- },
1947
- rounded: {
1948
- type: Boolean,
1949
- default: !1
1950
- },
1951
- disabled: {
1952
- type: Boolean,
1953
- default: !1
1954
- },
1955
- lazy: {
1956
- type: Boolean,
1957
- default: !1
1958
- },
1959
- customFormatter: {
1960
- type: Function,
1961
- default: null
1962
- },
1963
- ariaLabel: {
1964
- type: [String, Array],
1965
- default: ""
1966
- },
1967
- biggerSliderFocus: {
1968
- type: Boolean,
1969
- default: !1
1970
- }
1971
- },
1972
- data() {
1973
- return {
1974
- value1: null,
1975
- value2: null,
1976
- dragging: !1,
1977
- isRange: !1,
1978
- _isSlider: !0
1979
- // Used by Thumb and Tick
1980
- };
1981
- },
1982
- computed: {
1983
- newTooltipType() {
1984
- return this.tooltipType ? this.tooltipType : this.type;
1985
- },
1986
- tickValues() {
1987
- if (!this.ticks || this.min > this.max || this.step === 0)
1988
- return [];
1989
- const t = [];
1990
- for (let e = this.min + this.step; e < this.max; e += this.step)
1991
- t.push(e);
1992
- return t;
1993
- },
1994
- minValue() {
1995
- return Math.min(this.value1, this.value2);
1996
- },
1997
- maxValue() {
1998
- return Math.max(this.value1, this.value2);
1999
- },
2000
- barSize() {
2001
- return this.isRange ? `${100 * (this.maxValue - this.minValue) / (this.max - this.min)}%` : `${100 * (this.value1 - this.min) / (this.max - this.min)}%`;
2002
- },
2003
- barStart() {
2004
- return this.isRange ? `${100 * (this.minValue - this.min) / (this.max - this.min)}%` : "0%";
2005
- },
2006
- precision() {
2007
- const t = [this.min, this.max, this.step].map((e) => {
2008
- const i = `${e}`.split(".")[1];
2009
- return i ? i.length : 0;
2010
- });
2011
- return Math.max(...t);
2012
- },
2013
- barStyle() {
2014
- return {
2015
- width: this.barSize,
2016
- left: this.barStart
2017
- };
2018
- },
2019
- rootClasses() {
2020
- return {
2021
- "is-rounded": this.rounded,
2022
- "is-dragging": this.dragging,
2023
- "is-disabled": this.disabled,
2024
- "slider-focus": this.biggerSliderFocus
2025
- };
2026
- }
2027
- },
2028
- watch: {
2029
- /**
2030
- * When v-model is changed set the new active step.
2031
- */
2032
- value(t) {
2033
- this.setValues(t);
2034
- },
2035
- value1() {
2036
- this.onInternalValueUpdate();
2037
- },
2038
- value2() {
2039
- this.onInternalValueUpdate();
2040
- },
2041
- min() {
2042
- this.setValues(this.value);
2043
- },
2044
- max() {
2045
- this.setValues(this.value);
2046
- }
2047
- },
2048
- created() {
2049
- this.isThumbReversed = !1, this.isTrackClickDisabled = !1, this.setValues(this.value);
2050
- },
2051
- methods: {
2052
- setValues(t) {
2053
- if (!(this.min > this.max))
2054
- if (Array.isArray(t)) {
2055
- this.isRange = !0;
2056
- const e = typeof t[0] != "number" || isNaN(t[0]) ? this.min : m(t[0], this.min, this.max), i = typeof t[1] != "number" || isNaN(t[1]) ? this.max : m(t[1], this.min, this.max);
2057
- this.value1 = this.isThumbReversed ? i : e, this.value2 = this.isThumbReversed ? e : i;
2058
- } else
2059
- this.isRange = !1, this.value1 = isNaN(t) ? this.min : m(t, this.min, this.max), this.value2 = null;
2060
- },
2061
- onInternalValueUpdate() {
2062
- this.isRange && (this.isThumbReversed = this.value1 > this.value2), (!this.lazy || !this.dragging) && this.emitValue("input"), this.dragging && this.emitValue("dragging");
2063
- },
2064
- sliderSize() {
2065
- return this.$refs.slider.getBoundingClientRect().width;
2066
- },
2067
- onSliderClick(t) {
2068
- if (this.disabled || this.isTrackClickDisabled)
2069
- return;
2070
- const e = this.$refs.slider.getBoundingClientRect().left, i = (t.clientX - e) / this.sliderSize() * 100, s = this.min + i * (this.max - this.min) / 100, n = Math.abs(s - this.value1);
2071
- if (this.isRange) {
2072
- const a = Math.abs(s - this.value2);
2073
- if (n <= a) {
2074
- if (n < this.step / 2)
2075
- return;
2076
- this.$refs.button1.setPosition(i);
2077
- } else {
2078
- if (a < this.step / 2)
2079
- return;
2080
- this.$refs.button2.setPosition(i);
2081
- }
2082
- } else {
2083
- if (n < this.step / 2)
2084
- return;
2085
- this.$refs.button1.setPosition(i);
2086
- }
2087
- this.emitValue("change");
2088
- },
2089
- onDragStart() {
2090
- this.dragging = !0, this.$emit("dragstart");
2091
- },
2092
- onDragEnd() {
2093
- this.isTrackClickDisabled = !0, setTimeout(() => {
2094
- this.isTrackClickDisabled = !1;
2095
- }, 0), this.dragging = !1, this.$emit("dragend"), this.lazy && this.emitValue("input");
2096
- },
2097
- emitValue(t) {
2098
- this.$emit(
2099
- t,
2100
- this.isRange ? [this.minValue, this.maxValue] : this.value1
2101
- );
2102
- }
2103
- }
2104
- };
2105
- var kt = function() {
2106
- var e = this, i = e._self._c;
2107
- return i("div", { staticClass: "c-slider", class: [`is-${e.size}`, `is-${e.type}`, e.rootClasses], on: { click: e.onSliderClick } }, [i("div", { ref: "slider", staticClass: "c-slider-track" }, [i("div", { staticClass: "c-slider-fill", style: e.barStyle }), e.ticks ? e._l(e.tickValues, function(s, n) {
2108
- return i("CSliderTick", { key: n, attrs: { value: s } });
2109
- }) : e._e(), e._t("default"), i("CSliderThumb", { ref: "button1", attrs: { type: `is-${e.newTooltipType}`, tooltip: e.tooltip, "custom-formatter": e.customFormatter, "aria-valuenow": e.value1, "aria-valuemin": e.min, "aria-valuemax": e.max, "aria-label": Array.isArray(e.ariaLabel) ? e.ariaLabel[0] : e.ariaLabel, "aria-disabled": e.disabled, role: "slider", "aria-orientation": "horizontal" }, on: { dragstart: e.onDragStart, dragend: e.onDragEnd }, model: { value: e.value1, callback: function(s) {
2110
- e.value1 = s;
2111
- }, expression: "value1" } }), e.isRange ? i("CSliderThumb", { ref: "button2", attrs: { type: e.newTooltipType, tooltip: e.tooltip, "custom-formatter": e.customFormatter, "aria-valuenow": e.value2, "aria-valuemin": e.min, "aria-valuemax": e.max, "aria-label": Array.isArray(e.ariaLabel) ? e.ariaLabel[1] : "", "aria-disabled": e.disabled, role: "slider", "aria-orientation": "horizontal" }, on: { dragstart: e.onDragStart, dragend: e.onDragEnd }, model: { value: e.value2, callback: function(s) {
2112
- e.value2 = s;
2113
- }, expression: "value2" } }) : e._e()], 2)]);
2114
- }, Dt = [], Vt = /* @__PURE__ */ o(
2115
- $t,
2116
- kt,
2117
- Dt,
2118
- !1,
2119
- null,
2120
- null
2121
- );
2122
- const V = Vt.exports, Ft = {
2123
- name: "CSwitch",
2124
- props: {
2125
- value: {
2126
- type: [String, Number, Boolean, Function, Object, Array, Date],
2127
- default: null
2128
- },
2129
- nativeValue: {
2130
- type: [String, Number, Boolean, Function, Object, Array, Date],
2131
- default: null
2132
- },
2133
- disabled: Boolean,
2134
- type: {
2135
- type: String,
2136
- default: ""
2137
- },
2138
- name: {
2139
- type: String,
2140
- default: ""
2141
- },
2142
- required: Boolean,
2143
- size: {
2144
- type: String,
2145
- default: ""
2146
- },
2147
- trueValue: {
2148
- type: [String, Number, Boolean, Function, Object, Array, Date],
2149
- default: !0
2150
- },
2151
- falseValue: {
2152
- type: [String, Number, Boolean, Function, Object, Array, Date],
2153
- default: !1
2154
- },
2155
- rounded: {
2156
- type: Boolean,
2157
- default: !0
2158
- }
2159
- },
2160
- data() {
2161
- return {
2162
- newValue: this.value
2163
- };
2164
- },
2165
- computed: {
2166
- computedValue: {
2167
- get() {
2168
- return this.newValue;
2169
- },
2170
- set(t) {
2171
- this.newValue = t, this.$emit("input", t);
2172
- }
2173
- },
2174
- newClass() {
2175
- return [
2176
- `is-${this.size}`,
2177
- {
2178
- "is-disabled": this.disabled,
2179
- "is-rounded": this.rounded
2180
- }
2181
- ];
2182
- }
2183
- },
2184
- watch: {
2185
- /**
2186
- * When v-model change, set internal value.
2187
- */
2188
- value(t) {
2189
- this.newValue = t;
2190
- }
2191
- },
2192
- methods: {
2193
- focus() {
2194
- this.$refs.input.focus();
2195
- }
2196
- }
2197
- };
2198
- var At = function() {
2199
- var e = this, i = e._self._c;
2200
- return i("label", { ref: "label", staticClass: "switch", class: e.newClass, attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(s) {
2201
- return !s.type.indexOf("key") && e._k(s.keyCode, "enter", 13, s.key, "Enter") ? null : (s.preventDefault(), e.$refs.label.click());
2202
- } } }, [i("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, name: e.name, required: e.required, "true-value": e.trueValue, "false-value": e.falseValue, type: "checkbox" }, domProps: { value: e.nativeValue, checked: Array.isArray(e.computedValue) ? e._i(e.computedValue, e.nativeValue) > -1 : e._q(e.computedValue, e.trueValue) }, on: { click: function(s) {
2203
- s.stopPropagation();
2204
- }, change: function(s) {
2205
- var n = e.computedValue, a = s.target, r = a.checked ? e.trueValue : e.falseValue;
2206
- if (Array.isArray(n)) {
2207
- var d = e.nativeValue, u = e._i(n, d);
2208
- a.checked ? u < 0 && (e.computedValue = n.concat([d])) : u > -1 && (e.computedValue = n.slice(0, u).concat(n.slice(u + 1)));
2209
- } else
2210
- e.computedValue = r;
2211
- } } }), i("span", { staticClass: "check", class: [`is-${e.type}`] }), i("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
2212
- }, Ot = [], Bt = /* @__PURE__ */ o(
2213
- Ft,
2214
- At,
2215
- Ot,
2216
- !1,
2217
- null,
2218
- "4cdd239d"
2219
- );
2220
- const F = Bt.exports, It = {
2221
- name: "CTabItem",
2222
- props: {
2223
- label: String,
2224
- icon: String,
2225
- iconPack: String,
2226
- disabled: Boolean,
2227
- visible: {
2228
- type: Boolean,
2229
- default: !0
2230
- },
2231
- value: [String, Number]
2232
- },
2233
- data() {
2234
- return {
2235
- isActive: !1,
2236
- transitionName: null,
2237
- _isTabItem: !0
2238
- // Used internally by Tab
2239
- };
2240
- },
2241
- created() {
2242
- if (!this.$parent.$data._isTabs)
2243
- throw this.$destroy(), new Error("You should wrap bTabItem on a bTabs");
2244
- this.$parent.refreshSlots();
2245
- },
2246
- beforeDestroy() {
2247
- this.$parent.refreshSlots();
2248
- },
2249
- methods: {
2250
- /**
2251
- * Activate tab, alter animation name based on the index.
2252
- */
2253
- activate(t, e) {
2254
- this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !0;
2255
- },
2256
- /**
2257
- * Deactivate tab, alter animation name based on the index.
2258
- */
2259
- deactivate(t, e) {
2260
- this.transitionName = e < t ? this.$parent.vertical ? "slide-down" : "slide-next" : this.$parent.vertical ? "slide-up" : "slide-prev", this.isActive = !1;
2261
- }
2262
- },
2263
- render(t) {
2264
- if (this.$parent.destroyOnHide && (!this.isActive || !this.visible))
2265
- return;
2266
- const e = t(
2267
- "div",
2268
- {
2269
- directives: [
2270
- {
2271
- name: "show",
2272
- value: this.isActive && this.visible
2273
- }
2274
- ],
2275
- class: "tab-item"
2276
- },
2277
- this.$slots.default
2278
- );
2279
- return this.$parent.animated ? t(
2280
- "transition",
2281
- {
2282
- props: {
2283
- name: this.transitionName,
2284
- mode: "out-in"
2285
- },
2286
- on: {
2287
- "before-enter": () => {
2288
- this.$parent.isTransitioning = !0;
2289
- },
2290
- "after-enter": () => {
2291
- this.$parent.isTransitioning = !1;
2292
- }
2293
- }
2294
- },
2295
- [e]
2296
- ) : e;
2297
- }
2298
- }, Tt = null, Pt = null;
2299
- var Rt = /* @__PURE__ */ o(
2300
- It,
2301
- Tt,
2302
- Pt,
2303
- !1,
2304
- null,
2305
- null
2306
- );
2307
- const A = Rt.exports, Mt = {
2308
- name: "CSlotComponent",
2309
- props: {
2310
- component: {
2311
- type: Object,
2312
- required: !0
2313
- },
2314
- name: {
2315
- type: String,
2316
- default: "default"
2317
- },
2318
- scoped: {
2319
- type: Boolean
2320
- },
2321
- props: {
2322
- type: Object
2323
- },
2324
- tag: {
2325
- type: String,
2326
- default: "div"
2327
- },
2328
- event: {
2329
- type: String,
2330
- default: "hook:updated"
2331
- }
2332
- },
2333
- methods: {
2334
- refresh() {
2335
- this.$forceUpdate();
2336
- },
2337
- isVueComponent() {
2338
- return this.component && this.component._isVue;
2339
- }
2340
- },
2341
- created() {
2342
- this.isVueComponent() && this.component.$on(this.event, this.refresh);
2343
- },
2344
- beforeDestroy() {
2345
- this.isVueComponent() && this.component.$off(this.event, this.refresh);
2346
- },
2347
- render(t) {
2348
- if (this.isVueComponent())
2349
- return t(
2350
- this.tag,
2351
- {},
2352
- this.scoped ? this.component.$scopedSlots[this.name](this.props) : this.component.$slots[this.name]
2353
- );
2354
- }
2355
- }, zt = {
2356
- name: "CTabs",
2357
- components: {
2358
- CSlotComponent: Mt
2359
- },
2360
- props: {
2361
- value: {
2362
- type: [Number, String],
2363
- default: null
2364
- },
2365
- expanded: Boolean,
2366
- type: {
2367
- type: String,
2368
- default: null
2369
- },
2370
- size: {
2371
- type: String,
2372
- default: null
2373
- },
2374
- position: {
2375
- type: String,
2376
- validator(t) {
2377
- return ["left", "right", "center"].indexOf(t) > -1;
2378
- },
2379
- default: null
2380
- },
2381
- animated: {
2382
- type: Boolean,
2383
- default: !0
2384
- },
2385
- destroyOnHide: {
2386
- type: Boolean,
2387
- default: !1
2388
- },
2389
- vertical: Boolean,
2390
- multiline: Boolean
2391
- },
2392
- data() {
2393
- return {
2394
- activeTab: 0,
2395
- defaultSlots: [],
2396
- contentHeight: 0,
2397
- isTransitioning: !1,
2398
- _isTabs: !0
2399
- // Used internally by TabItem
2400
- };
2401
- },
2402
- computed: {
2403
- mainClasses() {
2404
- return {
2405
- "is-fullwidth": this.expanded,
2406
- "is-vertical": this.vertical,
2407
- "is-multiline": this.multiline,
2408
- [`is-${this.position}`]: this.position && this.vertical
2409
- };
2410
- },
2411
- navClasses() {
2412
- return [
2413
- this.type,
2414
- {
2415
- [`is-${this.size}`]: !!this.size,
2416
- [`is-${this.position}`]: this.position && !this.vertical,
2417
- "is-fullwidth": this.expanded,
2418
- "is-toggle-rounded is-toggle": this.type === "is-toggle-rounded"
2419
- }
2420
- ];
2421
- },
2422
- tabItems() {
2423
- return this.defaultSlots.filter(
2424
- (t) => t.componentInstance && t.componentInstance.$data && t.componentInstance.$data._isTabItem
2425
- ).map((t) => t.componentInstance);
2426
- }
2427
- },
2428
- watch: {
2429
- /**
2430
- * When v-model is changed set the new active tab.
2431
- */
2432
- value(t) {
2433
- const e = this.getIndexByValue(t, t);
2434
- this.changeTab(e);
2435
- },
2436
- /**
2437
- * When tab-items are updated, set active one.
2438
- */
2439
- tabItems() {
2440
- if (this.activeTab < this.tabItems.length) {
2441
- let t = this.activeTab;
2442
- this.tabItems.map((e, i) => {
2443
- e.isActive && (t = i, t < this.tabItems.length && (this.tabItems[t].isActive = !1));
2444
- }), this.tabItems[this.activeTab].isActive = !0;
2445
- } else
2446
- this.activeTab > 0 && this.changeTab(this.activeTab - 1);
2447
- }
2448
- },
2449
- mounted() {
2450
- this.activeTab = this.getIndexByValue(this.value || 0), this.activeTab < this.tabItems.length && (this.tabItems[this.activeTab].isActive = !0), this.refreshSlots();
2451
- },
2452
- methods: {
2453
- /**
2454
- * Change the active tab and emit change event.
2455
- */
2456
- changeTab(t) {
2457
- this.activeTab === t || this.tabItems[t] === void 0 || (this.activeTab < this.tabItems.length && this.tabItems[this.activeTab].deactivate(this.activeTab, t), this.tabItems[t].activate(this.activeTab, t), this.activeTab = t, this.$emit("change", this.getValueByIndex(t)));
2458
- },
2459
- /**
2460
- * Tab click listener, emit input event and change active tab.
2461
- */
2462
- tabClick(t) {
2463
- this.activeTab !== t && (this.$emit("input", this.getValueByIndex(t)), this.changeTab(t));
2464
- },
2465
- refreshSlots() {
2466
- this.defaultSlots = this.$slots.default || [];
2467
- },
2468
- getIndexByValue(t) {
2469
- const e = this.tabItems.map(
2470
- (i) => i.$options.propsData ? i.$options.propsData.value : void 0
2471
- ).indexOf(t);
2472
- return e >= 0 ? e : t;
2473
- },
2474
- getValueByIndex(t) {
2475
- const { propsData: e } = this.tabItems[t].$options;
2476
- return e && e.value ? e.value : t;
2477
- }
2478
- }
2479
- };
2480
- var Et = function() {
2481
- var e = this, i = e._self._c;
2482
- return i("div", { staticClass: "c-tabs", class: e.mainClasses }, [i("nav", { staticClass: "tabs", class: e.navClasses }, [i("ul", e._l(e.tabItems, function(s, n) {
2483
- return i("li", { directives: [{ name: "show", rawName: "v-show", value: s.visible, expression: "tabItem.visible" }], key: n, class: {
2484
- "is-active": e.activeTab === n,
2485
- "is-disabled": s.disabled
2486
- } }, [s.$slots.header ? i("CSlotComponent", { attrs: { component: s, name: "header", tag: "a" }, nativeOn: { click: function(a) {
2487
- return e.tabClick(n);
2488
- } } }) : i("a", { on: { click: function(a) {
2489
- return e.tabClick(n);
2490
- } } }, [s.icon ? i("CIcon", { attrs: { size: e.size, type: s.icon } }) : e._e(), i("span", [e._v(e._s(s.label))])], 1)], 1);
2491
- }), 0)]), i("section", { staticClass: "tab-content", class: { "is-transitioning": e.isTransitioning } }, [e._t("default")], 2)]);
2492
- }, Nt = [], Lt = /* @__PURE__ */ o(
2493
- zt,
2494
- Et,
2495
- Nt,
2496
- !1,
2497
- null,
2498
- "e02a6440"
2499
- );
2500
- const O = Lt.exports;
2501
- function si(t) {
2502
- t.component(D.name, D), t.component("CAutocomplete", je), t.component(y.name, y), t.component(S.name, S), t.component($.name, $), t.component(h.name, h), t.component(f.name, f), t.component(k.name, k), t.component(_.name, _), t.component(F.name, F), t.component(O.name, O), t.component(A.name, A), t.component("CField", se), t.component(w.name, w), t.component(x.name, x), t.component(V.name, V);
2503
- }
2504
- export {
2505
- ii as S,
2506
- si as i
2507
- };