@cling-se/widget 0.17.0 → 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 (232) hide show
  1. package/dist/AddClientCallout-e8d19R3f.js +101 -0
  2. package/dist/AnswerModal-BGvB8IVV.js +3291 -0
  3. package/dist/AttachmentItem-CkHbAm4l.js +171 -0
  4. package/dist/BaseUpload-BiJBcWRu.js +2472 -0
  5. package/dist/BlockMedia-CW5wgipC.js +103 -0
  6. package/dist/CCallout-Cy2eeIYd.js +104 -0
  7. package/dist/{CCurrencyDropdown-C2rXt2cJ.js → CCurrencyDropdown-DE_3CTjm.js} +91 -53
  8. package/dist/CDropdownItem-Dmq5gYzA.js +751 -0
  9. package/dist/CFormField.vue_vue_type_script_setup_true_lang-D_U9coAY.js +292 -0
  10. package/dist/{CPhoneFormat-C8VPsiK6.js → CPhoneFormat-BS2nP9kc.js} +13 -21
  11. package/dist/CPhoneInput-Bf6329PO.js +207 -0
  12. package/dist/CPriceInput-d1yjuMQr.js +140 -0
  13. package/dist/CSelect-DgnT07Hk.js +98 -0
  14. package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-Ckl--dyv.js +51 -0
  15. package/dist/ClientAutocomplete-9JzGcO9O.js +532 -0
  16. package/dist/ClientModal-BzWQtWSZ.js +1181 -0
  17. package/dist/ColorPicker-BvoFN8nu.js +1408 -0
  18. package/dist/CompanyModal-Bp4V_az9.js +250 -0
  19. package/dist/ContentWrapper-CuH6xKmo.js +265 -0
  20. package/dist/CoverBlockSettings-BA5L0Zee.js +861 -0
  21. package/dist/DocAnswer-BcNA_KEg.js +33 -0
  22. package/dist/DocDetails-CStEwWnU.js +448 -0
  23. package/dist/DocForm-BOoILf5E.js +6748 -0
  24. package/dist/DocFormSend-CQIf-HJY.js +171 -0
  25. package/dist/DocLinks-BRX5QzNe.js +36 -0
  26. package/dist/DocModalBase-D72yWj-x.js +29 -0
  27. package/dist/DocPrint-BI1LXUPE.js +399 -0
  28. package/dist/DocReceipt-DaZ4V76p.js +341 -0
  29. package/dist/DocSendReminder-DKGZlo7s.js +181 -0
  30. package/dist/DocTextEditor-Dm-cTZpA.js +19413 -0
  31. package/dist/DocTimeline-DCwofzuk.js +537 -0
  32. package/dist/DocumentClient-vJdxCB53.js +90 -0
  33. package/dist/DocumentLayout-CKSi42ev.js +1368 -0
  34. package/dist/DocumentLogotype-DbQlvQ-y.js +162 -0
  35. package/dist/DocumentVoided-CRX2WxWO.js +33 -0
  36. package/dist/EmbedInput-B-oeC4Wy.js +157 -0
  37. package/dist/EmbedSettings-B9Yka2yB.js +103 -0
  38. package/dist/ErrorCallout-B_ygH33E.js +34 -0
  39. package/dist/FilePreviewModal-Bf3ELTow.js +202 -0
  40. package/dist/Flag-BwTgCNHO.js +41 -0
  41. package/dist/HeaderSettings-DvC7nlyY.js +720 -0
  42. package/dist/ImageSelectModal-D3sP3lhR.js +119 -0
  43. package/dist/ImageUploadWrapper-RWNa-yIq.js +1585 -0
  44. package/dist/Index-0_3ULrWX.js +126 -0
  45. package/dist/Index-4NPe0sfX.js +629 -0
  46. package/dist/Index-B1uA0FF6.js +4 -0
  47. package/dist/Index-BBkCYm2q.js +201 -0
  48. package/dist/{Index-LzN6dktq.js → Index-BBwvo7S9.js} +10 -18
  49. package/dist/Index-BEMlsYwJ.js +68 -0
  50. package/dist/Index-BRBhJ6kz.js +21 -0
  51. package/dist/{Index-BPUYpfLJ.js → Index-BTFmHjUt.js} +47 -60
  52. package/dist/Index-BcUNnxLC.js +1098 -0
  53. package/dist/Index-Bo6ExBUL.js +93 -0
  54. package/dist/Index-BvMPCgdH.js +102 -0
  55. package/dist/Index-Bx5TOI9k.js +74 -0
  56. package/dist/Index-C7GZS8EI.js +16 -0
  57. package/dist/Index-CNWhm07R.js +25 -0
  58. package/dist/{Index-BUK-1yVR.js → Index-CQpznMKV.js} +9 -17
  59. package/dist/Index-CRzsnIij.js +159 -0
  60. package/dist/Index-CeSG1C41.js +140 -0
  61. package/dist/Index-CjfjdZj5.js +52 -0
  62. package/dist/Index-CskKmZpd.js +363 -0
  63. package/dist/Index-D5qwbCo1.js +28 -0
  64. package/dist/Index-D8Ae1Txt.js +228 -0
  65. package/dist/Index-DE8aenDB.js +3452 -0
  66. package/dist/Index-DI5EB5Rt.js +39 -0
  67. package/dist/Index-DaV57YPP.js +163 -0
  68. package/dist/Index-DbwkmoyM.js +38 -0
  69. package/dist/Index-Df9skok6.js +70 -0
  70. package/dist/{Index-BHJGfHm9.js → Index-DfLLA0ij.js} +313 -206
  71. package/dist/Index-Dw1CO5F9.js +76 -0
  72. package/dist/Index-PZXyOoVb.js +87 -0
  73. package/dist/{Index-BioOegOO.js → Index-ZUnH-BHj.js} +10 -18
  74. package/dist/Index-cjKGSiDi.js +136 -0
  75. package/dist/Index-m-goRuKD.js +49 -0
  76. package/dist/Index-rGeWbLcB.js +47 -0
  77. package/dist/Index-vrljNp6G.js +28 -0
  78. package/dist/Index.vue_vue_type_script_lang-aeVuChGF.js +671 -0
  79. package/dist/InputToggleRow-v6qAWPg6.js +99 -0
  80. package/dist/ManualPopover-BONBJIUA.js +57 -0
  81. package/dist/MediaWrapper-CXb2UGd9.js +18 -0
  82. package/dist/{NotBindingText-CM3FN0A6.js → NotBindingText-BqESO13N.js} +13 -17
  83. package/dist/PackageGroup-AIysVmyh.js +1058 -0
  84. package/dist/PdfTerms-BlhHdTu3.js +34 -0
  85. package/dist/PdfViewer-DwZ1rwlN.js +392 -0
  86. package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6NNUTz0.js +17 -0
  87. package/dist/PriceHeader-C4XhnoA3.js +488 -0
  88. package/dist/SearchApi-B7lXgUY6.js +137 -0
  89. package/dist/SendForm-BcD0xSvB.js +7031 -0
  90. package/dist/Setup-C2qaYDei.js +47 -0
  91. package/dist/{SmartList-DhhjSWLO.js → SmartList-DqG7Q5t7.js} +16 -24
  92. package/dist/Sortable.vue_vue_type_script_setup_true_lang-CzMbr8AX.js +1303 -0
  93. package/dist/{TermsSettings-BEQwmkFH.js → TermsSettings-BOCONyM4.js} +169 -56
  94. package/dist/ThemeColorRow-sjGdMzGN.js +108 -0
  95. package/dist/ToggleBinding-7oq_oXPt.js +44 -0
  96. package/dist/UploadModal-C_X2NjVY.js +134 -0
  97. package/dist/VideoPlayerInput-BsUcmpl4.js +135 -0
  98. package/dist/VideoPlayerSettings-BXMmxaZQ.js +78 -0
  99. package/dist/VideoSelectModal-CW0OweCw.js +217 -0
  100. package/dist/{anime.es-BrPTThYb.js → anime.es-gdcpA-eY.js} +1 -2
  101. package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
  102. package/dist/{debounce-D0hKNU85.js → debounce-DNl99Gyo.js} +10 -10
  103. package/dist/dom-CkTGWrfu.js +69 -0
  104. package/dist/{focusDrawerMixin-C_aTLmK0.js → focusDrawerMixin-BwcErMDY.js} +1 -1
  105. package/dist/{formDrawerState-Da4mcbab.js → formDrawerState-DaurePnd.js} +2 -2
  106. package/dist/helpers-CPW--XIz.js +44 -0
  107. package/dist/index-BjiGCJPI.js +149 -0
  108. package/dist/index-CFNv6OvX.js +188 -0
  109. package/dist/index-Cx71On5Z.js +508 -0
  110. package/dist/index-DKMxIBz_.js +270 -0
  111. package/dist/index-DKf5SGLD.js +125 -0
  112. package/dist/index-E32WgUp9.js +3525 -0
  113. package/dist/index-kp-GC5I0.js +513 -0
  114. package/dist/index.es.js +2 -5
  115. package/dist/index.umd.js +285 -1485
  116. package/dist/{main-BgzLHIoo.js → main-Cb-nyil1.js} +41414 -42507
  117. package/dist/mapFormMixin-D3BihYWW.js +1544 -0
  118. package/dist/omit--YYr41Xp.js +31 -0
  119. package/dist/{publicSenderState-DB4BHByV.js → publicSenderState-CdRW_Wwp.js} +4 -4
  120. package/dist/splitpanes-D-ThFkeR.js +342 -0
  121. package/dist/style.css +1 -4
  122. package/dist/template-BvaNnq-g.js +1493 -0
  123. package/dist/{throttle-DT2UVOqm.js → throttle-D-bUGaVh.js} +2 -2
  124. package/dist/tippy.esm-BmKNqohP.js +1994 -0
  125. package/dist/useTermsModal-Dhf6_eYb.js +87 -0
  126. package/dist/{utils-nos8CB1L.js → utils-CBPcYdLv.js} +8 -11
  127. package/dist/validation-DOcUOoMe.js +40 -0
  128. package/package.json +18 -21
  129. package/dist/AddClientCallout-BJzBdba1.js +0 -48
  130. package/dist/AnswerModal-frHq1g4s.js +0 -3874
  131. package/dist/AttachmentItem-BaN0OrEV.js +0 -85
  132. package/dist/BaseDatePicker-B-AfdrSb.js +0 -3187
  133. package/dist/BaseUpload-CY3lTcte.js +0 -1977
  134. package/dist/BlockMedia-Bb5wQIDg.js +0 -76
  135. package/dist/CCallout-5quI6yyk.js +0 -58
  136. package/dist/CDropdownItem-CaoSQX6X.js +0 -640
  137. package/dist/CFormField-Dd2Y71JG.js +0 -240
  138. package/dist/CPhoneInput-BU1t6eo_.js +0 -138
  139. package/dist/CPriceInput-pv2aIVkH.js +0 -116
  140. package/dist/CSelect-CrM45B7V.js +0 -91
  141. package/dist/CSkeleton-BkvONMqL.js +0 -55
  142. package/dist/ClientAutocomplete-BRXIKQSk.js +0 -438
  143. package/dist/ClientModal-CvHAptV2.js +0 -666
  144. package/dist/ColorPicker-RgoXRrud.js +0 -2879
  145. package/dist/CompanyModal-OL4bD9Gk.js +0 -147
  146. package/dist/ContentWrapper-8HduCnR4.js +0 -190
  147. package/dist/CoverBlockSettings-DUv8AcdX.js +0 -659
  148. package/dist/DocAnswer-DiyFfpT2.js +0 -36
  149. package/dist/DocDetails-BxNRfBnK.js +0 -263
  150. package/dist/DocForm-MGp-o0pu.js +0 -5017
  151. package/dist/DocFormSend-q_QuVCqh.js +0 -146
  152. package/dist/DocLinks-DGDdp30U.js +0 -38
  153. package/dist/DocModalBase-qG4RqwBn.js +0 -28
  154. package/dist/DocPrint-Cln3kt0g.js +0 -240
  155. package/dist/DocReceipt-nbsJ-ukZ.js +0 -217
  156. package/dist/DocSendReminder-B3qdqduf.js +0 -140
  157. package/dist/DocTextEditor-CQDnjnRY.js +0 -17193
  158. package/dist/DocTimeline-CgKHoDcG.js +0 -485
  159. package/dist/DocumentClient-UZlnIlz5.js +0 -136
  160. package/dist/DocumentLayout-Dvr4zgyF.js +0 -4880
  161. package/dist/DocumentLogotype-mAVgMRHr.js +0 -92
  162. package/dist/DocumentVoided-BXYNrf_6.js +0 -25
  163. package/dist/EmbedInput-YRUrw3c6.js +0 -117
  164. package/dist/EmbedSettings-DvRreF7H.js +0 -74
  165. package/dist/ErrorCallout-DVknpLVY.js +0 -27
  166. package/dist/FilePreviewModal-DC56FaGy.js +0 -81
  167. package/dist/Flag-D5iZLESg.js +0 -46
  168. package/dist/HeaderSettings-DXZnZL7A.js +0 -440
  169. package/dist/ImageSelectModal-Bu4_xZga.js +0 -86
  170. package/dist/ImageUploadWrapper-CtZhkAm1.js +0 -1604
  171. package/dist/Index-B1dJO6Bk.js +0 -54
  172. package/dist/Index-B3pz1coY.js +0 -150
  173. package/dist/Index-BHgW8EHW.js +0 -2446
  174. package/dist/Index-BNucs2O-.js +0 -154
  175. package/dist/Index-BW-EtZ1z.js +0 -55
  176. package/dist/Index-BjKACpun.js +0 -66
  177. package/dist/Index-C94BL4uU.js +0 -294
  178. package/dist/Index-CB57haU8.js +0 -58
  179. package/dist/Index-CP17iXT6.js +0 -25
  180. package/dist/Index-CUSbvjoD.js +0 -62
  181. package/dist/Index-CVnD6jo5.js +0 -25
  182. package/dist/Index-Ci5zdPeT.js +0 -28
  183. package/dist/Index-CikqSMjb.js +0 -41
  184. package/dist/Index-CxO4tJ3U.js +0 -26
  185. package/dist/Index-D4J4BpHd.js +0 -230
  186. package/dist/Index-DAQQQlut.js +0 -754
  187. package/dist/Index-DNxSR72J.js +0 -73
  188. package/dist/Index-DPuKRwmu.js +0 -41
  189. package/dist/Index-DSy8QG8T.js +0 -32
  190. package/dist/Index-DX6_D-J-.js +0 -77
  191. package/dist/Index-Dk0KaIKg.js +0 -643
  192. package/dist/Index-Hkzoh9QR.js +0 -24
  193. package/dist/Index-KsHJxWAa.js +0 -94
  194. package/dist/Index-TtItTuv6.js +0 -33
  195. package/dist/Index-YAD39Qvg.js +0 -146
  196. package/dist/Index-eh909lAz.js +0 -107
  197. package/dist/Index-otowKI_C.js +0 -56
  198. package/dist/Index-t_oVV8Rc.js +0 -84
  199. package/dist/Index-vG96oEXZ.js +0 -144
  200. package/dist/InputToggleRow-CcqJDguN.js +0 -57
  201. package/dist/ManualPopover-BE2IN-XU.js +0 -60
  202. package/dist/MediaWrapper-lnGUFiyc.js +0 -23
  203. package/dist/PackageGroup-BsmxOMLW.js +0 -704
  204. package/dist/PdfTerms-BgYwZoAZ.js +0 -31
  205. package/dist/PdfViewer-C0lDpjte.js +0 -383
  206. package/dist/PlainHtml-5YwYVj1v.js +0 -27
  207. package/dist/PriceHeader-CxqhpGS-.js +0 -338
  208. package/dist/SearchApi-BndaIbri.js +0 -161
  209. package/dist/SendForm-D7U9fG-5.js +0 -1023
  210. package/dist/Setup-CmAK2_ZT.js +0 -50
  211. package/dist/ThemeColorRow-BlnhzebY.js +0 -69
  212. package/dist/ToggleBinding-t_58JFya.js +0 -42
  213. package/dist/UploadModal-T-WpYNsN.js +0 -95
  214. package/dist/VideoPlayerInput-DKHKjMgX.js +0 -97
  215. package/dist/VideoPlayerSettings-DDMlUvSt.js +0 -61
  216. package/dist/VideoSelectModal-B9bbP0dd.js +0 -104
  217. package/dist/answerDocumentMixin-DXI_E5Kx.js +0 -51
  218. package/dist/dom-CWsqMElk.js +0 -71
  219. package/dist/formValidationMixin-WZ2lGndu.js +0 -49
  220. package/dist/index-B2l57ilt.js +0 -102
  221. package/dist/index-COKDjmM2.js +0 -167
  222. package/dist/index-HtKGcIng.js +0 -2700
  223. package/dist/index-LQ7NztTt.js +0 -81
  224. package/dist/index-fx5gR8fM.js +0 -351
  225. package/dist/index-zXXJrTvv.js +0 -492
  226. package/dist/mapFormMixin-CQgSN7dv.js +0 -3028
  227. package/dist/omit-ScS7B6c5.js +0 -31
  228. package/dist/simplebar.min-B0cB_p8g.js +0 -71
  229. package/dist/splitpanes-BHUVsCZF.js +0 -382
  230. package/dist/tippy.esm-CR89mtdY.js +0 -1805
  231. package/dist/vuedraggable.umd-CkXXkt1b.js +0 -3161
  232. package/dist/vuex.esm-DKGl8mcw.js +0 -467
@@ -1,438 +0,0 @@
1
- import { S as c } from "./SearchApi-BndaIbri.js";
2
- import { n as l, j as a, F as d, ab as h } from "./main-BgzLHIoo.js";
3
- import { c as u, r as p, g as f } from "./CDropdownItem-CaoSQX6X.js";
4
- const m = {
5
- name: "CAutocomplete",
6
- components: {
7
- CInput: a
8
- },
9
- mixins: [d],
10
- inheritAttrs: !1,
11
- props: {
12
- value: {
13
- type: [Number, String],
14
- default: null
15
- },
16
- data: {
17
- type: Array,
18
- default: () => []
19
- },
20
- field: {
21
- type: String,
22
- default: "value"
23
- },
24
- keepFirst: Boolean,
25
- clearOnSelect: Boolean,
26
- openOnFocus: Boolean,
27
- customFormatter: {
28
- type: Function,
29
- default: () => {
30
- }
31
- },
32
- checkInfiniteScroll: Boolean,
33
- keepOpen: Boolean,
34
- clearable: Boolean,
35
- maxHeight: {
36
- type: [String, Number],
37
- default: null
38
- },
39
- dropdownPosition: {
40
- type: String,
41
- default: "auto"
42
- },
43
- iconRight: {
44
- type: String,
45
- default: null
46
- },
47
- iconRightClickable: Boolean,
48
- appendToBody: Boolean
49
- },
50
- data() {
51
- return {
52
- selected: null,
53
- hovered: null,
54
- isActive: !1,
55
- newValue: this.value,
56
- newAutocomplete: this.autocomplete || "off",
57
- isListInViewportVertically: !0,
58
- hasFocus: !1,
59
- style: {},
60
- _isAutocomplete: !0,
61
- _elementRef: "input",
62
- _bodyEl: void 0
63
- // Used to append to body
64
- };
65
- },
66
- computed: {
67
- /**
68
- * White-listed items to not close when clicked.
69
- * Add input, dropdown and all children.
70
- */
71
- whiteList() {
72
- const t = [];
73
- if (t.push(this.$refs.input.$el.querySelector("input")), t.push(this.$refs.dropdown), this.$refs.dropdown !== void 0) {
74
- const e = this.$refs.dropdown.querySelectorAll("*");
75
- for (const s of e)
76
- t.push(s);
77
- }
78
- if (this.$parent.$data._isTaginput) {
79
- t.push(this.$parent.$el);
80
- const e = this.$parent.$el.querySelectorAll("*");
81
- for (const s of e)
82
- t.push(s);
83
- }
84
- return t;
85
- },
86
- /**
87
- * Check if exists default slot
88
- */
89
- hasDefaultSlot() {
90
- return !!this.$scopedSlots.default;
91
- },
92
- /**
93
- * Check if exists "empty" slot
94
- */
95
- hasEmptySlot() {
96
- return !!this.$slots.empty;
97
- },
98
- /**
99
- * Check if exists "header" slot
100
- */
101
- hasHeaderSlot() {
102
- return !!this.$slots.header;
103
- },
104
- /**
105
- * Check if exists "footer" slot
106
- */
107
- hasFooterSlot() {
108
- return !!this.$slots.footer;
109
- },
110
- /**
111
- * Apply dropdownPosition property
112
- */
113
- isOpenedTop() {
114
- return this.dropdownPosition === "top" || this.dropdownPosition === "auto" && !this.isListInViewportVertically;
115
- },
116
- newIconRight() {
117
- return this.clearable && this.newValue ? "close-circle" : this.iconRight;
118
- },
119
- newIconRightClickable() {
120
- return this.clearable ? !0 : this.iconRightClickable;
121
- },
122
- contentStyle() {
123
- return {
124
- maxHeight: this.maxHeight === void 0 ? null : isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`
125
- };
126
- },
127
- isDropdownOpen() {
128
- return this.isActive && (this.data.length > 0 || this.hasEmptySlot || this.hasHeaderSlot);
129
- }
130
- },
131
- watch: {
132
- /**
133
- * When dropdown is toggled, check the visibility to know when
134
- * to open upwards.
135
- */
136
- isActive(t) {
137
- this.dropdownPosition === "auto" && (t ? this.calcDropdownInViewportVertical() : setTimeout(() => {
138
- this.calcDropdownInViewportVertical();
139
- }, 100)), t && this.$nextTick(() => this.setHovered(null));
140
- },
141
- /**
142
- * When updating input's value
143
- * 1. Emit changes
144
- * 2. If value isn't the same as selected, set null
145
- * 3. Close dropdown if value is clear or else open it
146
- */
147
- newValue(t) {
148
- this.$emit("input", t);
149
- const e = this.getValue(this.selected);
150
- e && e !== t && this.setSelected(null, !1), this.hasFocus && (!this.openOnFocus || t) && (this.isActive = !!t);
151
- },
152
- /**
153
- * When v-model is changed:
154
- * 1. Update internal value.
155
- * 2. If it's invalid, validate again.
156
- */
157
- value(t) {
158
- this.newValue = t;
159
- },
160
- /**
161
- * Select first option if "keep-first
162
- */
163
- data(t) {
164
- this.keepFirst && this.selectFirstOption(t);
165
- }
166
- },
167
- created() {
168
- typeof window < "u" && (document.addEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.addEventListener("resize", this.calcDropdownInViewportVertical));
169
- },
170
- mounted() {
171
- if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content")) {
172
- const t = this.$refs.dropdown.querySelector(".dropdown-content");
173
- t.addEventListener(
174
- "scroll",
175
- () => this.checkIfReachedTheEndOfScroll(t)
176
- );
177
- }
178
- this.appendToBody && (this.$data._bodyEl = u(this.$refs.dropdown), this.updateAppendToBody());
179
- },
180
- beforeDestroy() {
181
- typeof window < "u" && (document.removeEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.removeEventListener(
182
- "resize",
183
- this.calcDropdownInViewportVertical
184
- )), this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content") && this.$refs.dropdown.querySelector(".dropdown-content").removeEventListener("scroll", this.checkIfReachedTheEndOfScroll), this.appendToBody && p(this.$data._bodyEl);
185
- },
186
- methods: {
187
- /**
188
- * Set which option is currently hovered.
189
- */
190
- setHovered(t) {
191
- t !== void 0 && (this.hovered = t);
192
- },
193
- /**
194
- * Set which option is currently selected, update v-model,
195
- * update input value and close dropdown.
196
- */
197
- setSelected(t, e = !0) {
198
- 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(() => {
199
- this.isActive = !1;
200
- }), this.checkValidity());
201
- },
202
- /**
203
- * Select first option
204
- */
205
- selectFirstOption(t) {
206
- this.$nextTick(() => {
207
- t.length ? (this.openOnFocus || this.newValue !== "" && this.hovered !== t[0]) && this.setHovered(t[0]) : this.setHovered(null);
208
- });
209
- },
210
- /**
211
- * Enter key listener.
212
- * Select the hovered option.
213
- */
214
- enterPressed(t) {
215
- this.isDropdownOpen && (t.preventDefault(), this.hovered !== null && this.setSelected(this.hovered, !this.keepOpen));
216
- },
217
- /**
218
- * Tab key listener.
219
- * Select hovered option if it exists, close dropdown, then allow
220
- * native handling to move to next tabbable element.
221
- */
222
- tabPressed() {
223
- if (this.hovered === null) {
224
- this.isActive = !1;
225
- return;
226
- }
227
- this.setSelected(this.hovered, !this.keepOpen);
228
- },
229
- /**
230
- * Close dropdown if clicked outside.
231
- */
232
- clickedOutside(t) {
233
- var s;
234
- const e = ((s = t.path) == null ? void 0 : s[0]) || t.target;
235
- this.whiteList.indexOf(e) < 0 && (this.isActive = !1);
236
- },
237
- /**
238
- * Return display text for the input.
239
- * If object, get value from path, or else just the value.
240
- */
241
- getValue(t) {
242
- if (t !== null)
243
- return typeof this.customFormatter < "u" ? this.customFormatter(t) : typeof t == "object" ? f(t, this.field) : t;
244
- },
245
- /**
246
- * Check if the scroll list inside the dropdown
247
- * reached it's end.
248
- */
249
- checkIfReachedTheEndOfScroll(t) {
250
- t.clientHeight !== t.scrollHeight && t.scrollTop + t.clientHeight >= t.scrollHeight && this.$emit("infinite-scroll");
251
- },
252
- /**
253
- * Calculate if the dropdown is vertically visible when activated,
254
- * otherwise it is openened upwards.
255
- */
256
- calcDropdownInViewportVertical() {
257
- this.$nextTick(() => {
258
- if (this.$refs.dropdown === void 0)
259
- return;
260
- const t = this.$refs.dropdown.getBoundingClientRect();
261
- this.isListInViewportVertically = t.top >= 0 && t.bottom <= (window.innerHeight || document.documentElement.clientHeight), this.appendToBody && this.updateAppendToBody();
262
- });
263
- },
264
- /**
265
- * Arrows keys listener.
266
- * If dropdown is active, set hovered option, or else just open.
267
- */
268
- keyArrows(t) {
269
- const e = t === "down" ? 1 : -1;
270
- if (this.isActive) {
271
- let s = this.data.indexOf(this.hovered) + e;
272
- s = s > this.data.length - 1 ? this.data.length : s, s = s < 0 ? 0 : s, this.setHovered(this.data[s]);
273
- const i = this.$refs.dropdown.querySelector(".dropdown-content"), o = i.querySelectorAll(
274
- "a.dropdown-item:not(.is-disabled)"
275
- )[s];
276
- if (!o)
277
- return;
278
- const n = i.scrollTop, r = i.scrollTop + i.clientHeight - o.clientHeight;
279
- o.offsetTop < n ? i.scrollTop = o.offsetTop : o.offsetTop >= r && (i.scrollTop = o.offsetTop - i.clientHeight + o.clientHeight);
280
- } else
281
- this.isActive = !0;
282
- },
283
- /**
284
- * Focus listener.
285
- * If value is the same as selected, select all text.
286
- */
287
- focused(t) {
288
- 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);
289
- },
290
- /**
291
- * Blur listener.
292
- */
293
- onBlur(t) {
294
- this.hasFocus = !1, this.$emit("blur", t);
295
- },
296
- onInput() {
297
- const t = this.getValue(this.selected);
298
- t && t === this.newValue || (this.$emit("typing", this.newValue), this.checkValidity());
299
- },
300
- rightIconClick(t) {
301
- this.clearable ? this.newValue = "" : this.$emit("icon-right-click", t);
302
- },
303
- checkValidity() {
304
- this.useHtml5Validation && this.$nextTick(() => {
305
- this.checkHtml5Validity();
306
- });
307
- },
308
- updateAppendToBody() {
309
- const t = this.$refs.dropdown, e = this.$refs.input.$el;
310
- if (t && e) {
311
- const s = this.$data._bodyEl;
312
- s.classList.forEach((r) => s.classList.remove(r)), s.classList.add("autocomplete"), s.classList.add("control"), this.expandend && s.classList.add("is-expandend");
313
- const i = e.getBoundingClientRect();
314
- let o = i.top + window.scrollY;
315
- const n = i.left + window.scrollX;
316
- this.isOpenedTop ? o -= t.clientHeight : o += e.clientHeight, this.style = {
317
- position: "absolute",
318
- top: `${o}px`,
319
- left: `${n}px`,
320
- width: `${e.clientWidth}px`,
321
- maxWidth: `${e.clientWidth}px`,
322
- zIndex: "99"
323
- };
324
- }
325
- }
326
- }
327
- };
328
- var w = function() {
329
- var e = this, s = e._self._c;
330
- return s("div", { staticClass: "autocomplete control", class: { "is-expanded": e.expanded } }, [s("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": (i) => e.$emit("icon-click", i) }, nativeOn: { keyup: function(i) {
331
- if (!i.type.indexOf("key") && e._k(i.keyCode, "esc", 27, i.key, ["Esc", "Escape"]))
332
- return null;
333
- i.preventDefault(), e.isActive = !1;
334
- }, keydown: [function(i) {
335
- return !i.type.indexOf("key") && e._k(i.keyCode, "tab", 9, i.key, "Tab") ? null : e.tabPressed.apply(null, arguments);
336
- }, function(i) {
337
- return !i.type.indexOf("key") && e._k(i.keyCode, "enter", 13, i.key, "Enter") ? null : e.enterPressed.apply(null, arguments);
338
- }, function(i) {
339
- return !i.type.indexOf("key") && e._k(i.keyCode, "up", 38, i.key, ["Up", "ArrowUp"]) ? null : (i.preventDefault(), e.keyArrows("up"));
340
- }, function(i) {
341
- return !i.type.indexOf("key") && e._k(i.keyCode, "down", 40, i.key, ["Down", "ArrowDown"]) ? null : (i.preventDefault(), e.keyArrows("down"));
342
- }] }, model: { value: e.newValue, callback: function(i) {
343
- e.newValue = i;
344
- }, expression: "newValue" } }, "CInput", e.$attrs, !1)), s("transition", { attrs: { name: "fade" } }, [s("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 }, [s("div", { directives: [{ name: "show", rawName: "v-show", value: e.isActive, expression: "isActive" }], staticClass: "dropdown-content", style: e.contentStyle }, [e.hasHeaderSlot ? s("div", { staticClass: "dropdown-item" }, [e._t("header")], 2) : e._e(), e._l(e.data, function(i, o) {
345
- return s("a", { key: o, staticClass: "dropdown-item", class: { "is-hovered": i === e.hovered }, on: { click: function(n) {
346
- return e.setSelected(i, void 0, n);
347
- } } }, [e.hasDefaultSlot ? e._t("default", null, { option: i, index: o }) : s("span", [e._v(" " + e._s(e.getValue(i, !0)) + " ")])], 2);
348
- }), e.data.length === 0 && e.hasEmptySlot ? s("div", { staticClass: "dropdown-item is-disabled" }, [e._t("empty")], 2) : e._e(), e.hasFooterSlot ? s("div", { staticClass: "dropdown-item" }, [e._t("footer")], 2) : e._e()], 2)])])], 1);
349
- }, y = [], g = /* @__PURE__ */ l(
350
- m,
351
- w,
352
- y,
353
- !1,
354
- null,
355
- null
356
- );
357
- const k = g.exports, v = {
358
- i18nOptions: {
359
- namespaces: "components",
360
- keyPrefix: "account.documentForm.clients"
361
- },
362
- name: "ClientAutocomplete",
363
- components: {
364
- SearchApi: c,
365
- CAutocomplete: k
366
- },
367
- props: {
368
- searchEnabled: {
369
- type: Boolean,
370
- default: !0
371
- },
372
- showLoading: {
373
- type: Boolean,
374
- default: !1
375
- },
376
- showEmpty: {
377
- type: Boolean,
378
- default: !1
379
- },
380
- filled: {
381
- type: Boolean,
382
- default: !1
383
- }
384
- },
385
- data() {
386
- return {
387
- convertToNewClient: h,
388
- results: [],
389
- // results when searching for existing endCustomer
390
- searchQuery: ""
391
- // query used to search for endCustomers
392
- };
393
- },
394
- methods: {
395
- search(t, e) {
396
- this.$emit("input", e), this.searchEnabled && (this.searchQuery = e, t({
397
- q: e,
398
- cb: ({ endCustomer: s }) => {
399
- this.results = s;
400
- }
401
- }));
402
- }
403
- }
404
- };
405
- var _ = function() {
406
- var e = this, s = e._self._c;
407
- return s("SearchApi", { attrs: { "custom-search": { endCustomer: !0 } }, scopedSlots: e._u([{ key: "default", fn: function({ fetch: i, isLoading: o }) {
408
- return [s("CAutocomplete", e._b({ attrs: { data: e.results, loading: e.showLoading && o, filled: e.filled, expanded: "", "keep-first": "" }, on: { typing: function(n) {
409
- return e.search(i, n);
410
- }, select: function(n) {
411
- e.$emit("setClient", e.convertToNewClient(n));
412
- } }, scopedSlots: e._u([{ key: "default", fn: function({ option: n }) {
413
- return [s("div", { staticStyle: { "line-height": "1.5" } }, [s("div", { staticStyle: { "font-weight": "500" } }, [e._v(e._s(n.name || n.email))]), s("div", { staticClass: "text-gray-600", staticStyle: { "font-size": "14px" } }, [e._v(" " + e._s(n.reference ? `${n.reference} · ` : "") + " " + e._s(n.workStreet || n.street || " ") + " ")])])];
414
- } }, { key: "footer", fn: function() {
415
- return [e.searchEnabled && e.showEmpty ? s("div", [e.searchQuery && !e.results.length ? s("CButton", { staticStyle: { "font-weight": "600" }, attrs: { type: "secondary", pattern: "tertiary", size: "small" }, on: { click: function(n) {
416
- return e.$emit("add");
417
- } } }, [e._v(" " + e._s(e.$t("_common:add")) + " ")]) : e._e()], 1) : e._e()];
418
- }, proxy: !0 }, { key: "empty", fn: function() {
419
- return [e.searchEnabled && e.showEmpty ? s("div", [e._v(" " + e._s(e.$t("search.empty")) + " " + e._s(e.searchQuery) + " ")]) : e._e()];
420
- }, proxy: !0 }], null, !0) }, "CAutocomplete", {
421
- placeholder: e.$t("search.placeholder"),
422
- ...e.$attrs,
423
- ...e.$props
424
- }, !1))];
425
- } }]) });
426
- }, S = [], $ = /* @__PURE__ */ l(
427
- v,
428
- _,
429
- S,
430
- !1,
431
- null,
432
- "b24e2ce6"
433
- );
434
- const b = $.exports;
435
- export {
436
- b as C,
437
- k as a
438
- };