@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
@@ -0,0 +1,292 @@
1
+ import { i as M, a as _ } from "./helpers-CPW--XIz.js";
2
+ import { F as h, ai as y, aC as v, aD as F, b as C, _ as k, o as l, d as r, n as d, S as u, B as m, v as b, f, c as w, w as S, h as z, i as p, Z as B, j as T } from "./main-Cb-nyil1.js";
3
+ const $ = {
4
+ name: "CFieldBody",
5
+ inject: {
6
+ parent: {
7
+ from: "CField",
8
+ default: null
9
+ }
10
+ },
11
+ props: {
12
+ message: {
13
+ type: [String, Array],
14
+ default: ""
15
+ },
16
+ type: {
17
+ type: [String, Object],
18
+ default: ""
19
+ }
20
+ },
21
+ render() {
22
+ let t = !0, e = typeof this.$slots.default == "function" ? this.$slots.default() : this.$slots.default;
23
+ return e != null && e.length === 1 && e[0].type === h && (e = e[0].children), y(
24
+ "div",
25
+ { class: "field-body" },
26
+ {
27
+ default: () => e != null && e.map((s) => {
28
+ if (s.type === v || s.type === F)
29
+ return s;
30
+ let o;
31
+ return t && (o = this.message, t = !1), y(
32
+ this.parent ? this.parent.$.type : C("c-field"),
33
+ {
34
+ type: this.type,
35
+ message: o
36
+ },
37
+ () => s
38
+ );
39
+ })
40
+ }
41
+ );
42
+ }
43
+ }, L = {
44
+ name: "CField",
45
+ components: {
46
+ CFieldBody: $
47
+ },
48
+ provide() {
49
+ return {
50
+ CField: this
51
+ };
52
+ },
53
+ props: {
54
+ type: {
55
+ type: [String, Object],
56
+ default: ""
57
+ },
58
+ label: {
59
+ type: String,
60
+ default: ""
61
+ },
62
+ labelFor: {
63
+ type: String,
64
+ default: ""
65
+ },
66
+ message: {
67
+ type: [String, Array, Object],
68
+ default: ""
69
+ },
70
+ grouped: Boolean,
71
+ groupMultiline: Boolean,
72
+ position: {
73
+ type: String,
74
+ default: ""
75
+ },
76
+ expanded: Boolean,
77
+ horizontal: Boolean,
78
+ addons: {
79
+ type: Boolean,
80
+ default: !0
81
+ },
82
+ customClass: {
83
+ type: String,
84
+ default: ""
85
+ },
86
+ labelPosition: {
87
+ type: String,
88
+ default: () => "top"
89
+ // config.defaultFieldLabelPosition,
90
+ }
91
+ },
92
+ data() {
93
+ return {
94
+ newType: this.type,
95
+ newMessage: this.message,
96
+ fieldLabelSize: null,
97
+ numberInputClasses: [],
98
+ _isField: !0
99
+ // Used internally by Input and Select
100
+ };
101
+ },
102
+ computed: {
103
+ rootClasses() {
104
+ return [
105
+ this.newPosition,
106
+ {
107
+ "is-expanded": this.expanded,
108
+ "is-grouped-multiline": this.groupMultiline,
109
+ "is-horizontal": this.horizontal,
110
+ "is-floating-in-label": this.hasLabel && !this.horizontal && this.labelPosition === "inside",
111
+ "is-floating-label": this.hasLabel && !this.horizontal && this.labelPosition === "on-border"
112
+ },
113
+ this.numberInputClasses
114
+ ];
115
+ },
116
+ /**
117
+ * Correct Bulma class for the side of the addon or group.
118
+ *
119
+ * This is not kept like the others (is-small, etc.),
120
+ * because since 'has-addons' is set automatically it
121
+ * doesn't make sense to teach users what addons are exactly.
122
+ */
123
+ newPosition() {
124
+ if (this.position === void 0) return;
125
+ const t = this.position.split("-");
126
+ if (t.length < 1) return;
127
+ const e = this.grouped ? "is-grouped-" : "has-addons-";
128
+ if (this.position) return e + t[1];
129
+ },
130
+ /**
131
+ * Formatted message in case it's an array
132
+ * (each element is separated by <br> tag)
133
+ */
134
+ formattedMessage() {
135
+ if (typeof this.newMessage == "string")
136
+ return this.newMessage;
137
+ const t = [];
138
+ if (Array.isArray(this.newMessage))
139
+ this.newMessage.forEach((e) => {
140
+ if (typeof e == "string")
141
+ t.push(e);
142
+ else
143
+ for (const s in e)
144
+ e[s] && t.push(s);
145
+ });
146
+ else
147
+ for (const e in this.newMessage)
148
+ this.newMessage[e] && t.push(e);
149
+ return t.filter((e) => !!e).join(" <br> ");
150
+ },
151
+ hasLabel() {
152
+ return this.label || this.$slots.label;
153
+ }
154
+ },
155
+ watch: {
156
+ /**
157
+ * Set internal type when prop change.
158
+ */
159
+ type(t) {
160
+ this.newType = t;
161
+ },
162
+ /**
163
+ * Set internal message when prop change.
164
+ */
165
+ message(t) {
166
+ JSON.stringify(t) !== JSON.stringify(this.newMessage) && (this.newMessage = t);
167
+ }
168
+ },
169
+ mounted() {
170
+ this.horizontal && this.$el.querySelectorAll(
171
+ ".input, .select, .button, .textarea, .c-slider"
172
+ ).length > 0 && (this.fieldLabelSize = "is-normal");
173
+ },
174
+ methods: {
175
+ /**
176
+ * Field has addons if there are more than one slot
177
+ * (element / component) in the Field.
178
+ * Or is grouped when prop is set.
179
+ * Is a method to be called when component re-render.
180
+ */
181
+ fieldType() {
182
+ if (this.grouped) return "is-grouped";
183
+ if (this.hasAddons()) return "has-addons";
184
+ },
185
+ getSlotNodes(t) {
186
+ return t.flatMap(
187
+ (e) => M(e) ? this.getSlotNodes(e.children) : [e]
188
+ );
189
+ },
190
+ hasAddons() {
191
+ let t = 0;
192
+ return this.$slots.default && (t = this.getSlotNodes(this.$slots.default()).reduce(
193
+ (e, s) => _(s) ? e + 1 : e,
194
+ 0
195
+ )), t > 1 && this.addons && !this.horizontal;
196
+ },
197
+ // called by a number input if it is a direct child.
198
+ wrapNumberinput({ controlsPosition: t, size: e }) {
199
+ const s = ["has-numberinput"];
200
+ t && s.push(`has-numberinput-${t}`), e && s.push(`has-numberinput-${e}`), this.numberInputClasses = s;
201
+ }
202
+ }
203
+ }, N = ["for"], A = ["for"], j = ["innerHTML"];
204
+ function x(t, e, s, o, n, a) {
205
+ const i = C("CFieldBody");
206
+ return l(), r("div", {
207
+ class: d([[a.rootClasses, a.fieldType()], "field"])
208
+ }, [
209
+ s.horizontal ? (l(), r("div", {
210
+ key: 0,
211
+ class: d([[s.customClass, n.fieldLabelSize], "field-label"])
212
+ }, [
213
+ a.hasLabel ? (l(), r("label", {
214
+ key: 0,
215
+ for: s.labelFor,
216
+ class: d([s.customClass, "label truncate-text"])
217
+ }, [
218
+ t.$slots.label ? u(t.$slots, "label", { key: 0 }) : (l(), r(h, { key: 1 }, [
219
+ m(b(s.label), 1)
220
+ ], 64))
221
+ ], 10, N)) : f("", !0)
222
+ ], 2)) : (l(), r(h, { key: 1 }, [
223
+ a.hasLabel ? (l(), r("label", {
224
+ key: 0,
225
+ for: s.labelFor,
226
+ class: d([s.customClass, "label truncate-text"])
227
+ }, [
228
+ t.$slots.label ? u(t.$slots, "label", { key: 0 }) : (l(), r(h, { key: 1 }, [
229
+ m(b(s.label), 1)
230
+ ], 64))
231
+ ], 10, A)) : f("", !0)
232
+ ], 64)),
233
+ s.horizontal ? (l(), w(i, {
234
+ key: 2,
235
+ message: n.newMessage ? a.formattedMessage : "",
236
+ type: n.newType
237
+ }, {
238
+ default: S(() => [
239
+ u(t.$slots, "default")
240
+ ]),
241
+ _: 3
242
+ }, 8, ["message", "type"])) : u(t.$slots, "default", { key: 3 }),
243
+ n.newMessage && !s.horizontal ? (l(), r("p", {
244
+ key: 4,
245
+ class: d([n.newType, "help"]),
246
+ innerHTML: a.formattedMessage
247
+ }, null, 10, j)) : f("", !0)
248
+ ], 2);
249
+ }
250
+ const O = /* @__PURE__ */ k(L, [["render", x]]), I = /* @__PURE__ */ z({
251
+ __name: "CFormField",
252
+ props: {
253
+ label: {},
254
+ validator: {},
255
+ messages: {}
256
+ },
257
+ setup(t) {
258
+ const e = t, s = p(() => {
259
+ var a, i;
260
+ if ((a = e.validator) != null && a.$error)
261
+ return "is-danger";
262
+ if ((i = e.validator) != null && i.$dirty)
263
+ return "is-success";
264
+ }), o = p(() => {
265
+ var a, i;
266
+ if ((a = e.validator) != null && a.$error)
267
+ return "text-red-500";
268
+ if ((i = e.validator) != null && i.$dirty)
269
+ return "text-green-500";
270
+ }), n = p(() => {
271
+ var c, g;
272
+ if (!((c = e.validator) != null && c.$errors.length)) return "";
273
+ const i = e.validator.$errors[0].$validator;
274
+ return ((g = e.messages) == null ? void 0 : g[i]) ?? "";
275
+ });
276
+ return (a, i) => (l(), w(T(O), B({ ...a.$attrs, ...a.$props }, {
277
+ label: a.label,
278
+ "custom-class": o.value,
279
+ type: s.value,
280
+ message: n.value
281
+ }), {
282
+ default: S(() => [
283
+ u(a.$slots, "default")
284
+ ]),
285
+ _: 3
286
+ }, 16, ["label", "custom-class", "type", "message"]));
287
+ }
288
+ });
289
+ export {
290
+ O as C,
291
+ I as _
292
+ };
@@ -1,5 +1,5 @@
1
- import { u as e, v as o, n } from "./main-WKzC-Dnu.js";
2
- const r = {
1
+ import { ag as o, _ as n, S as r, s as a, v as s } from "./main-Cb-nyil1.js";
2
+ const h = {
3
3
  name: "CPhoneFormat",
4
4
  props: {
5
5
  phone: {
@@ -32,31 +32,23 @@ const r = {
32
32
  this.formattedPhone = "";
33
33
  return;
34
34
  }
35
- const t = await e(this.phone, {
35
+ const e = await o(this.phone, {
36
36
  defaultRegion: this.region
37
37
  });
38
- if (!t) {
38
+ if (!e) {
39
39
  this.formattedPhone = this.phone;
40
40
  return;
41
41
  }
42
- this.formattedPhone = t.national;
42
+ this.formattedPhone = e.national;
43
43
  }
44
- },
45
- render() {
46
- return this.$scopedSlots.default ? this.$scopedSlots.default({
47
- formattedValue: this.formattedPhone
48
- }) : o("span", [this.formattedPhone]);
49
44
  }
50
- }, a = null, s = null;
51
- var h = /* @__PURE__ */ n(
52
- r,
53
- a,
54
- s,
55
- !1,
56
- null,
57
- null
58
- );
59
- const d = h.exports;
45
+ };
46
+ function i(e, d, f, m, t, p) {
47
+ return r(e.$slots, "default", { formattedValue: t.formattedPhone }, () => [
48
+ a("span", null, s(t.formattedPhone), 1)
49
+ ]);
50
+ }
51
+ const u = /* @__PURE__ */ n(h, [["render", i]]);
60
52
  export {
61
- d as C
53
+ u as C
62
54
  };
@@ -0,0 +1,207 @@
1
+ import { _ as w, X as B, Y as S, b as s, o as m, c as y, w as i, s as V, e as o, B as z, v as p, d as F, k, F as I, Z as $ } from "./main-Cb-nyil1.js";
2
+ import { C as D, a as v } from "./CDropdownItem-Dmq5gYzA.js";
3
+ import { C as j } from "./CFormField.vue_vue_type_script_setup_true_lang-D_U9coAY.js";
4
+ import { F as K } from "./Flag-BwTgCNHO.js";
5
+ import { S as L } from "./SmartList-DqG7Q5t7.js";
6
+ import { r as n } from "./regions-BdZt9Srn.js";
7
+ const N = {
8
+ name: "CPhoneInput",
9
+ components: {
10
+ Flag: K,
11
+ CInput: B,
12
+ CDropdown: D,
13
+ CDropdownItem: v,
14
+ CButton: S,
15
+ CField: j,
16
+ SmartList: L
17
+ },
18
+ props: {
19
+ modelValue: {
20
+ type: [String, Number],
21
+ default: ""
22
+ },
23
+ region: {
24
+ type: String,
25
+ default: ""
26
+ },
27
+ // Region to fallback to if prefix is not found in modelValue
28
+ defaultRegion: {
29
+ type: String,
30
+ required: !0
31
+ },
32
+ label: {
33
+ type: String,
34
+ default: ""
35
+ },
36
+ labelPosition: {
37
+ type: String,
38
+ default: ""
39
+ }
40
+ },
41
+ emits: ["update:modelValue", "update:region"],
42
+ data() {
43
+ return {
44
+ internalPrefix: null,
45
+ // Used to remember prefix when value is changed to empty
46
+ searchQuery: ""
47
+ };
48
+ },
49
+ computed: {
50
+ defaultPrefix() {
51
+ return n[this.internalRegion].callingCode;
52
+ },
53
+ currentRegion() {
54
+ return this.getRegionByCallingCode(this.prefix);
55
+ },
56
+ internalRegion: {
57
+ get() {
58
+ if (this.region) return this.region;
59
+ if (this.modelValue) {
60
+ const e = (Object.keys(n) || []).find(
61
+ (t) => n[t].callingCode && this.modelValue && this.modelValue.startsWith(n[t].callingCode)
62
+ );
63
+ if (e) return e;
64
+ }
65
+ return this.internalPrefix ? this.getRegionByCallingCode(this.internalPrefix) : this.defaultRegion;
66
+ },
67
+ set(e) {
68
+ this.$emit("update:region", e), this.updateValue({ prefix: n[e].callingCode });
69
+ }
70
+ },
71
+ prefix() {
72
+ if (!this.modelValue) return this.internalPrefix || this.defaultPrefix;
73
+ const e = (Object.keys(n) || []).find(
74
+ (t) => n[t].callingCode && this.modelValue && this.modelValue.startsWith(n[t].callingCode)
75
+ );
76
+ return e ? n[e].callingCode : this.defaultPrefix;
77
+ },
78
+ phone: {
79
+ get() {
80
+ return this.prefix && this.modelValue && this.modelValue.startsWith(this.prefix) ? this.modelValue.substring(this.prefix.length) : this.modelValue;
81
+ },
82
+ set(e) {
83
+ this.updateValue({ phone: e });
84
+ }
85
+ },
86
+ sortedRegions() {
87
+ return (Object.keys(n) || []).map((e) => ({
88
+ key: e,
89
+ title: `${n[e].name} (${e})`,
90
+ callingCode: n[e].callingCode
91
+ })).sort((e, t) => e.title.localeCompare(t.title));
92
+ }
93
+ },
94
+ methods: {
95
+ getRegionByCallingCode(e) {
96
+ return e ? (Object.keys(n) || []).find(
97
+ (l) => e === n[l].callingCode
98
+ ) : null;
99
+ },
100
+ updateValue({ prefix: e, phone: t }) {
101
+ const l = e !== void 0 ? e : this.prefix || "", h = t !== void 0 ? t : this.phone || "", d = `${l}${h}`;
102
+ d !== l ? (this.$emit("update:modelValue", d), this.region || this.$emit("update:region", this.internalRegion), this.internalPrefix = null) : (this.internalPrefix = l, this.$emit("update:modelValue", ""));
103
+ }
104
+ }
105
+ }, O = { class: "control" }, Q = { class: "truncate-text" };
106
+ function W(e, t, l, h, d, r) {
107
+ const g = s("Flag"), x = s("CButton"), c = s("CInput"), b = s("CDropdownItem"), _ = s("CDropdown"), P = s("SmartList"), f = s("CField");
108
+ return m(), y(f, {
109
+ class: "has-addons",
110
+ expanded: ""
111
+ }, {
112
+ default: i(() => [
113
+ V("div", O, [
114
+ o(P, {
115
+ query: d.searchQuery,
116
+ items: r.sortedRegions
117
+ }, {
118
+ default: i(({ items: u }) => [
119
+ o(_, {
120
+ modelValue: r.internalRegion,
121
+ "onUpdate:modelValue": t[1] || (t[1] = (a) => r.internalRegion = a),
122
+ size: e.$attrs.size,
123
+ disabled: e.$attrs.disabled,
124
+ "menu-styling": {
125
+ maxWidth: "300px"
126
+ },
127
+ scrollable: !0,
128
+ position: "is-bottom-right",
129
+ "max-height": "240px",
130
+ class: "control",
131
+ style: { height: "100%" }
132
+ }, {
133
+ trigger: i(() => [
134
+ o(x, {
135
+ size: e.$attrs.size,
136
+ type: "none",
137
+ pattern: "secondary",
138
+ style: { height: "100%" }
139
+ }, {
140
+ default: i(() => [
141
+ o(g, {
142
+ region: r.internalRegion,
143
+ style: { "margin-right": "0.35em" }
144
+ }, null, 8, ["region"]),
145
+ z(" " + p(r.prefix), 1)
146
+ ]),
147
+ _: 1
148
+ }, 8, ["size"])
149
+ ]),
150
+ header: i(() => [
151
+ o(c, {
152
+ modelValue: d.searchQuery,
153
+ "onUpdate:modelValue": t[0] || (t[0] = (a) => d.searchQuery = a),
154
+ placeholder: e.$t("_common:search"),
155
+ filled: "",
156
+ style: { "margin-bottom": "0.25em" },
157
+ "custom-class": "!rounded-[7px]"
158
+ }, null, 8, ["modelValue", "placeholder"])
159
+ ]),
160
+ default: i(() => [
161
+ (m(!0), F(I, null, k(u, ({ key: a, title: C, callingCode: R }) => (m(), y(b, {
162
+ key: a,
163
+ value: a,
164
+ class: "truncate-text"
165
+ }, {
166
+ default: i(() => [
167
+ o(g, {
168
+ region: a,
169
+ title: C,
170
+ style: { "margin-right": "0.75em", flex: "0 0 auto" }
171
+ }, null, 8, ["region", "title"]),
172
+ V("span", Q, p(C) + " (" + p(R) + ") ", 1)
173
+ ]),
174
+ _: 2
175
+ }, 1032, ["value"]))), 128))
176
+ ]),
177
+ _: 2
178
+ }, 1032, ["modelValue", "size", "disabled"])
179
+ ]),
180
+ _: 1
181
+ }, 8, ["query", "items"])
182
+ ]),
183
+ o(f, {
184
+ label: l.label,
185
+ "label-position": l.labelPosition,
186
+ class: "control",
187
+ expanded: ""
188
+ }, {
189
+ default: i(() => [
190
+ o(c, $({ ...e.$attrs, ...e.$props }, {
191
+ modelValue: r.phone,
192
+ "onUpdate:modelValue": t[2] || (t[2] = (u) => r.phone = u),
193
+ size: e.$attrs.size,
194
+ placeholder: e.$attrs.placeholder,
195
+ type: "tel"
196
+ }), null, 16, ["modelValue", "size", "placeholder"])
197
+ ]),
198
+ _: 1
199
+ }, 8, ["label", "label-position"])
200
+ ]),
201
+ _: 1
202
+ });
203
+ }
204
+ const Z = /* @__PURE__ */ w(N, [["render", W]]);
205
+ export {
206
+ Z as C
207
+ };
@@ -0,0 +1,140 @@
1
+ import { C as h } from "./CCurrencyDropdown-DE_3CTjm.js";
2
+ import { _ as C, X as V, a6 as g, b as o, o as s, c as l, w as i, d as u, S as p, f as w, e as I, B as k, v as d, Z as _ } from "./main-Cb-nyil1.js";
3
+ const $ = {
4
+ name: "CPriceInput",
5
+ inheritAttrs: !1,
6
+ components: {
7
+ CInput: V,
8
+ CCurrencyDropdown: h
9
+ },
10
+ props: {
11
+ modelValue: {
12
+ type: Number,
13
+ default: 0
14
+ },
15
+ currency: {
16
+ type: String,
17
+ required: !0
18
+ },
19
+ priceType: {
20
+ type: String,
21
+ default: "fixed",
22
+ validator: (e) => ["fixed", "markup", "openAcc", "approx"].includes(e)
23
+ },
24
+ unitLabel: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ isIncVat: {
29
+ type: Boolean,
30
+ default: !1
31
+ },
32
+ // Vat in percentage
33
+ vat: {
34
+ type: Number,
35
+ default: null
36
+ }
37
+ },
38
+ emits: ["update:modelValue", "update:currency"],
39
+ data() {
40
+ return {
41
+ isCurrencyDropdownOpen: !1
42
+ };
43
+ },
44
+ computed: {
45
+ internalValue: {
46
+ get() {
47
+ if (!Number.isNaN(parseFloat(this.modelValue)) && Number.isFinite(this.modelValue)) {
48
+ if (!this.modelValue) return "";
49
+ let e = this.modelValue;
50
+ return this.isIncVat && (e *= (100 + this.vat) / 100), Math.round(e) / 100;
51
+ }
52
+ return this.modelValue;
53
+ },
54
+ set(e) {
55
+ let t = e;
56
+ t = e * 100, this.isIncVat && (t /= (100 + this.vat) / 100), t = Math.round(t), this.$emit("update:modelValue", t);
57
+ }
58
+ },
59
+ internalCurrency: {
60
+ get() {
61
+ return this.currency;
62
+ },
63
+ set(e) {
64
+ this.$emit("update:currency", e);
65
+ }
66
+ },
67
+ suffixValue() {
68
+ const e = g(this.internalCurrency);
69
+ switch (this.priceType) {
70
+ case "openAcc":
71
+ return `${e}/${this.unitLabel || this.$t("_common:unitType.unit")}`;
72
+ case "markup":
73
+ return "%";
74
+ default:
75
+ return e;
76
+ }
77
+ },
78
+ showCurrencyDropdown() {
79
+ return !["markup"].includes(this.priceType);
80
+ }
81
+ },
82
+ methods: {
83
+ focus() {
84
+ this.$refs.priceInput && typeof this.$refs.priceInput.focus == "function" && this.$refs.priceInput.focus();
85
+ }
86
+ }
87
+ }, b = { key: 0 }, v = { key: 0 }, D = { key: 1 }, N = { key: 1 };
88
+ function x(e, t, c, z, a, r) {
89
+ const f = o("CButton"), m = o("CCurrencyDropdown"), y = o("CInput");
90
+ return s(), l(y, _({ ...e.$attrs, ...e.$props }, {
91
+ ref: "priceInput",
92
+ key: r.internalCurrency + c.priceType,
93
+ modelValue: r.internalValue,
94
+ "onUpdate:modelValue": t[2] || (t[2] = (n) => r.internalValue = n),
95
+ modelModifiers: { lazy: !0 },
96
+ size: e.$attrs.size,
97
+ placeholder: e.$attrs.placeholder,
98
+ style: a.isCurrencyDropdownOpen && { zIndex: 99 },
99
+ type: "number"
100
+ }), {
101
+ prefix: i(() => [
102
+ e.$slots.prefix ? (s(), u("div", b, [
103
+ p(e.$slots, "prefix")
104
+ ])) : w("", !0)
105
+ ]),
106
+ suffix: i(() => [
107
+ e.$slots.suffix ? (s(), u("div", v, [
108
+ p(e.$slots, "suffix")
109
+ ])) : (s(), u("div", D, [
110
+ r.showCurrencyDropdown ? (s(), l(m, {
111
+ key: 0,
112
+ modelValue: r.internalCurrency,
113
+ "onUpdate:modelValue": t[0] || (t[0] = (n) => r.internalCurrency = n),
114
+ onActiveChange: t[1] || (t[1] = (n) => a.isCurrencyDropdownOpen = n)
115
+ }, {
116
+ default: i(({ selectedValue: n }) => [
117
+ I(f, {
118
+ size: e.$attrs.size,
119
+ type: "none",
120
+ pattern: "tertiary",
121
+ class: "is-thinner",
122
+ style: { "padding-left": "0.5em", "padding-right": "0.5em", "border-radius": "0.25em" }
123
+ }, {
124
+ default: i(() => [
125
+ k(d(n), 1)
126
+ ]),
127
+ _: 2
128
+ }, 1032, ["size"])
129
+ ]),
130
+ _: 1
131
+ }, 8, ["modelValue"])) : (s(), u("div", N, d(r.suffixValue), 1))
132
+ ]))
133
+ ]),
134
+ _: 3
135
+ }, 16, ["modelValue", "size", "placeholder", "style"]);
136
+ }
137
+ const T = /* @__PURE__ */ C($, [["render", x]]);
138
+ export {
139
+ T as C
140
+ };