@cling-se/widget 0.15.3 → 0.15.6

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 (134) hide show
  1. package/README.md +43 -43
  2. package/dist/{AddClientCallout-8s5a1_CZ.js → AddClientCallout-BpWCvb7A.js} +15 -13
  3. package/dist/{AnswerModal-Cnp43tGo.js → AnswerModal-0JXov7oA.js} +71 -71
  4. package/dist/{AttachmentItem-BP85gcjP.js → AttachmentItem-C93ndWhI.js} +17 -12
  5. package/dist/{BaseDatePicker-C27CsTzy.js → BaseDatePicker-BaUxrKlN.js} +2 -2
  6. package/dist/{BaseUpload-DnhS3hGx.js → BaseUpload-CACi6tYY.js} +3 -3
  7. package/dist/{BlockMedia-D4nhek2s.js → BlockMedia-Dlv23tgo.js} +2 -2
  8. package/dist/{CCallout-CQjRcxpC.js → CCallout-jnIpJu5U.js} +4 -5
  9. package/dist/{CCurrencyDropdown-BT01qBGg.js → CCurrencyDropdown-BQLDbp9J.js} +4 -4
  10. package/dist/{CDropdownItem-BSPNul90.js → CDropdownItem-CNUf29O4.js} +139 -37
  11. package/dist/{CFormField-Cz_jNazS.js → CFormField-qy_STCgm.js} +3 -4
  12. package/dist/{CPhoneFormat-C017AoM0.js → CPhoneFormat-BZd_xftN.js} +1 -1
  13. package/dist/CPhoneInput-j4Zuah8p.js +138 -0
  14. package/dist/{CPriceInput-jktMjvwx.js → CPriceInput-CXGw4w0R.js} +2 -2
  15. package/dist/CSelect-CSwTYXae.js +91 -0
  16. package/dist/CSkeleton-B5J9cKAm.js +55 -0
  17. package/dist/ClientAutocomplete-CjaUEuHJ.js +438 -0
  18. package/dist/{ClientModal-DLtFhJya.js → ClientModal-Cn40dzh3.js} +77 -42
  19. package/dist/{ColorPicker-MQmVGbvm.js → ColorPicker-wUW8hJ8i.js} +2 -2
  20. package/dist/{CompanyModal-Qx5xMku0.js → CompanyModal-CbcusrDu.js} +25 -19
  21. package/dist/{ContentWrapper-B9NQqp2q.js → ContentWrapper-Bad8dXOX.js} +11 -11
  22. package/dist/CoverBlockSettings-DX390gBU.js +659 -0
  23. package/dist/{DocAnswer-BlxFv_Gc.js → DocAnswer-BESzyKCO.js} +2 -2
  24. package/dist/{DocDetails-dGcYGJpp.js → DocDetails-1rMbwwY3.js} +10 -10
  25. package/dist/{DocForm-C6o_XBcW.js → DocForm-B3IxEK4j.js} +512 -498
  26. package/dist/{DocFormSend-_prtxNIf.js → DocFormSend-sm8Hu8Be.js} +14 -15
  27. package/dist/{DocLinks-Dp495SCS.js → DocLinks-CyXFaNcq.js} +2 -2
  28. package/dist/{DocModalBase-B0wYq3ft.js → DocModalBase-CSh4Lkzq.js} +2 -2
  29. package/dist/{DocPrint-CURxofeU.js → DocPrint-BQ-M-3OC.js} +3 -3
  30. package/dist/{DocReceipt-DgGcBRVH.js → DocReceipt-OoEOv4bh.js} +25 -20
  31. package/dist/{DocSendReminder-CPty4svi.js → DocSendReminder-dQcAFIdw.js} +19 -16
  32. package/dist/{DocTextEditor-BYsXFRLg.js → DocTextEditor-Ckfx6Hj5.js} +13 -15
  33. package/dist/{DocTimeline-CHg1QykR.js → DocTimeline-DDaN8k9R.js} +36 -34
  34. package/dist/{DocumentClient-CZ6N73pQ.js → DocumentClient-DBA3AQQG.js} +5 -5
  35. package/dist/{DocumentLayout-CiszuoQc.js → DocumentLayout-D42e3G51.js} +1503 -1539
  36. package/dist/{DocumentLogotype-BgFCWcwC.js → DocumentLogotype-ngySb8g4.js} +18 -15
  37. package/dist/{DocumentVoided-DT2hhHk2.js → DocumentVoided-Dtj2XpOI.js} +1 -1
  38. package/dist/{EmbedInput-aLmvzK1I.js → EmbedInput-CxqpXi4D.js} +25 -21
  39. package/dist/{EmbedSettings-BZipciy9.js → EmbedSettings-B4ejIQIJ.js} +13 -11
  40. package/dist/{ErrorCallout-CNxSDsr_.js → ErrorCallout-BiCmogrM.js} +6 -6
  41. package/dist/{FilePreviewModal-DxdksQiy.js → FilePreviewModal-CpSfuR9V.js} +3 -3
  42. package/dist/Flag-B9CEVlmX.js +46 -0
  43. package/dist/{HeaderSettings-DeoSRi6O.js → HeaderSettings-CowCzINW.js} +155 -110
  44. package/dist/{ImageSelectModal-DvQz2VPi.js → ImageSelectModal-DdzcxIMp.js} +6 -6
  45. package/dist/{ImageUploadWrapper-CNQRdHF9.js → ImageUploadWrapper-CWCF8Dlc.js} +3 -3
  46. package/dist/{Index-CPjAXBMU.js → Index-07hqDjA-.js} +5 -5
  47. package/dist/{Index-CDKq7Fx6.js → Index-4_K-mW5b.js} +4 -4
  48. package/dist/Index-B4PLiPUX.js +28 -0
  49. package/dist/{Index-CjfCyQlB.js → Index-B4imH9tr.js} +5 -5
  50. package/dist/{Index-CJeSVpRh.js → Index-BGXkhXYw.js} +2 -2
  51. package/dist/{Index-BjdxeF4C.js → Index-BLK2yfMF.js} +2 -2
  52. package/dist/{Index-w5DWfGOc.js → Index-BS2bqI3s.js} +4 -4
  53. package/dist/{Index-CWj2vDHc.js → Index-BXm5pjk3.js} +49 -44
  54. package/dist/{Index-B3Q09phm.js → Index-BY9jJJk1.js} +4 -4
  55. package/dist/{Index-BEpKb8IR.js → Index-BeAySORd.js} +4 -4
  56. package/dist/{Index-BIv8flFB.js → Index-BguXp1xd.js} +9 -9
  57. package/dist/{Index-CTqdaykO.js → Index-CEQgPBnH.js} +18 -12
  58. package/dist/{Index-q04Dwxrr.js → Index-CWRkkwfa.js} +7 -7
  59. package/dist/{Index-3bD76d9q.js → Index-CaRFixxe.js} +7 -7
  60. package/dist/{Index-D-l3i9vY.js → Index-ClP8s9kZ.js} +3 -3
  61. package/dist/{Index-BDCgilFk.js → Index-Cmu_M3TM.js} +2 -2
  62. package/dist/{Index-BglKAnNq.js → Index-Cnyk_-IC.js} +7 -7
  63. package/dist/{Index-CvRNeJ4U.js → Index-CpLsMmCx.js} +124 -123
  64. package/dist/{Index-CXibuEkU.js → Index-D7WQe9WH.js} +15 -15
  65. package/dist/{Index-CTk6Nh-I.js → Index-DAsAy5JF.js} +7 -7
  66. package/dist/{Index-BiVwDgqW.js → Index-DEcCSixa.js} +2 -2
  67. package/dist/{Index-PUFeH_1z.js → Index-DMy3kJ7T.js} +4 -4
  68. package/dist/{Index-Cfc0Q0AG.js → Index-DWC0ggkj.js} +6 -6
  69. package/dist/{Index-B0n1UOOA.js → Index-DZ59IAyR.js} +6 -6
  70. package/dist/{Index-S3LqU0A0.js → Index-DdJbi1AO.js} +12 -10
  71. package/dist/{Index-B9_POjpY.js → Index-Df9ct4wb.js} +23 -21
  72. package/dist/{Index-D1NwTUs-.js → Index-DhrjL3IY.js} +5 -5
  73. package/dist/{Index-FC1UsElU.js → Index-Dm0Fzc6C.js} +7 -7
  74. package/dist/{Index-Ch5j2tqD.js → Index-DqSikIZB.js} +2 -2
  75. package/dist/{Index-BeMeWDIf.js → Index-DtSf7JJt.js} +6 -6
  76. package/dist/{Index-BNJ2KHKc.js → Index-FfBNBm3w.js} +3 -3
  77. package/dist/{Index-jIIHHGh3.js → Index-SN7H4PM1.js} +489 -471
  78. package/dist/{Index-CePHdKi2.js → Index-U_PvsI4Y.js} +5 -5
  79. package/dist/{Index-C-CE21WK.js → Index-sFiPn5zO.js} +5 -5
  80. package/dist/{InputToggleRow-CvHvRdsn.js → InputToggleRow-CRC8ievQ.js} +2 -2
  81. package/dist/{ManualPopover-DxE-6-Sp.js → ManualPopover-15SKAS2F.js} +1 -1
  82. package/dist/{MediaWrapper-DNi80fbw.js → MediaWrapper-CihDdp6P.js} +3 -3
  83. package/dist/{NotBindingText-D2rYFVxr.js → NotBindingText-nUBihSic.js} +2 -2
  84. package/dist/{PackageGroup-6ar8HjPo.js → PackageGroup-Bk0UeRqr.js} +26 -20
  85. package/dist/PdfTerms-Cy2kB_Zo.js +31 -0
  86. package/dist/{PdfViewer-B5qbLLtd.js → PdfViewer-BMcMfsRH.js} +5 -5
  87. package/dist/{PlainHtml-CIMtcn2F.js → PlainHtml-BDvPNe17.js} +1 -1
  88. package/dist/{PriceHeader-BSpj_-5M.js → PriceHeader-DzvUaY9O.js} +15 -15
  89. package/dist/{SearchApi-Cwgf52EV.js → SearchApi-BPJpYWWz.js} +2 -2
  90. package/dist/SendForm-DWVu8jq8.js +1023 -0
  91. package/dist/{Setup-CRmiH9lD.js → Setup-DjxGq4d9.js} +1 -1
  92. package/dist/{SmartList-D6AvxfSL.js → SmartList-Bh10ojB0.js} +1 -1
  93. package/dist/{TermsSettings-DEO1O460.js → TermsSettings-Cg8TYiLL.js} +17 -12
  94. package/dist/{ThemeColorRow-Cy1NKEIG.js → ThemeColorRow-BeNhoFSI.js} +4 -4
  95. package/dist/{ToggleBinding-BvIUt1Jx.js → ToggleBinding-KmMUK5gz.js} +12 -10
  96. package/dist/{UploadModal-C1j-GeMD.js → UploadModal-DTmPPCz3.js} +6 -6
  97. package/dist/{VideoPlayerInput-BmbrquN6.js → VideoPlayerInput-Z5j6JzLW.js} +15 -11
  98. package/dist/{VideoPlayerSettings-B7HpBoWX.js → VideoPlayerSettings-C7GjuMAw.js} +3 -3
  99. package/dist/{VideoSelectModal-CeaG2tME.js → VideoSelectModal-DMIdcoOE.js} +4 -4
  100. package/dist/{answerDocumentMixin-AcDG8Byi.js → answerDocumentMixin-DulmofDA.js} +3 -3
  101. package/dist/{debounce-HJoaSvIY.js → debounce-nohaKn7u.js} +16 -16
  102. package/dist/{focusDrawerMixin-CBYjpEGL.js → focusDrawerMixin-BsYcC4qG.js} +1 -1
  103. package/dist/{formDrawerState-DYSBcjo4.js → formDrawerState-Bpcaq429.js} +1 -1
  104. package/dist/{formValidationMixin-Dqlhg0R2.js → formValidationMixin-DYGNCEbq.js} +1 -1
  105. package/dist/{index-CLOsPxCh.js → index-BUGMJTF2.js} +35 -33
  106. package/dist/{index-CKZmpLr6.js → index-BVOHCIHl.js} +781 -2021
  107. package/dist/{index-CFe1BJZJ.js → index-CtA6LmXt.js} +1 -1
  108. package/dist/{index-zzCfHTf8.js → index-CxitjuY3.js} +2 -2
  109. package/dist/{index-CFx0cpeM.js → index-CySeSzas.js} +1 -1
  110. package/dist/{index-CFwLDxbi.js → index-zBWldKKX.js} +18 -17
  111. package/dist/index.es.js +10 -10
  112. package/dist/index.umd.js +177 -173
  113. package/dist/{main-BIwKzAN8.js → main-CfSVOXu-.js} +12995 -11349
  114. package/dist/{mapFormMixin-e2PJ431T.js → mapFormMixin-BTZaIaQ8.js} +1 -1
  115. package/dist/omit-DIEW6Th9.js +31 -0
  116. package/dist/{publicSenderState-D-_7UwjT.js → publicSenderState-B4TdI-yD.js} +1 -1
  117. package/dist/regions-BdZt9Srn.js +1250 -0
  118. package/dist/simplebar.min-BZ0EEeAp.js +71 -0
  119. package/dist/style.css +2 -2
  120. package/dist/{throttle-B2yMLA5N.js → throttle-JENEyCY1.js} +2 -2
  121. package/dist/{tinycolor-vIxz4Xgi.js → tinycolor-79beE8BV.js} +1 -1
  122. package/dist/{tippy.esm-DiOYviyf.js → tippy.esm-CR28gOMM.js} +208 -206
  123. package/dist/{utils-CFXqaEy7.js → utils-CD2k1yv3.js} +1 -1
  124. package/dist/{vuedraggable.umd-DDT8qZBI.js → vuedraggable.umd-IXGjMCUG.js} +1 -1
  125. package/package.json +2 -11
  126. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
  127. package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
  128. package/dist/ClientAutocomplete-B3z6RPXr.js +0 -82
  129. package/dist/CoverBlockSettings-Bcz_W5I3.js +0 -275
  130. package/dist/Flag-3OyFDPsP.js +0 -114
  131. package/dist/Index-Cr6DlYGN.js +0 -21
  132. package/dist/PdfTerms-B-lbU_6H.js +0 -36
  133. package/dist/formComponentsInstall-DMoWrprH.js +0 -2505
  134. package/dist/omit-CpamclWf.js +0 -31
@@ -0,0 +1,438 @@
1
+ import { S as c } from "./SearchApi-BPJpYWWz.js";
2
+ import { n as l, j as a, F as d, ab as h } from "./main-CfSVOXu-.js";
3
+ import { c as u, r as p, g as f } from "./CDropdownItem-CNUf29O4.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
+ "94f7a2c5"
433
+ );
434
+ const A = $.exports;
435
+ export {
436
+ A as C,
437
+ k as a
438
+ };
@@ -1,9 +1,33 @@
1
- import { C as v } from "./ClientAutocomplete-B3z6RPXr.js";
2
- import { E as u, ad as y, I as C, n as p, b as l, d as b, c as _, g as c, ae as $, y as x } from "./main-BIwKzAN8.js";
3
- import { w as f } from "./CDropdownItem-BSPNul90.js";
4
- import { v as r } from "./index-CFx0cpeM.js";
5
- import { m as g, b as w, a as k } from "./vuex.esm-DKGl8mcw.js";
6
- import { o as N } from "./omit-CpamclWf.js";
1
+ import { C as v } from "./ClientAutocomplete-CjaUEuHJ.js";
2
+ import { n as d, ai as y, M as p, al as C, t as b, I as _, b as l, d as $, c as x, g as m, am as w, ab as k } from "./main-CfSVOXu-.js";
3
+ import { C as S, a as N, w as f } from "./CDropdownItem-CNUf29O4.js";
4
+ import { C as I } from "./CFormField-qy_STCgm.js";
5
+ import { C as F } from "./CPhoneInput-j4Zuah8p.js";
6
+ import { v as r } from "./index-CySeSzas.js";
7
+ import { m as g, b as M, a as R } from "./vuex.esm-DKGl8mcw.js";
8
+ import { o as z } from "./omit-DIEW6Th9.js";
9
+ const O = {
10
+ name: "CRadio",
11
+ mixins: [y]
12
+ };
13
+ var q = function() {
14
+ var e = this, t = e._self._c;
15
+ return t("label", { ref: "label", staticClass: "b-radio radio", class: [`is-${e.size}`, { "is-disabled": e.disabled }], attrs: { disabled: e.disabled }, on: { click: e.focus, keydown: function(i) {
16
+ return !i.type.indexOf("key") && e._k(i.keyCode, "enter", 13, i.key, "Enter") ? null : (i.preventDefault(), e.$refs.label.click());
17
+ } } }, [t("input", { directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "input", attrs: { disabled: e.disabled, required: e.required, name: e.name, type: "radio" }, domProps: { value: e.nativeValue, checked: e._q(e.computedValue, e.nativeValue) }, on: { click: function(i) {
18
+ i.stopPropagation();
19
+ }, change: function(i) {
20
+ e.computedValue = e.nativeValue;
21
+ } } }), t("span", { staticClass: "check", class: `is-${e.type}` }), t("span", { staticClass: "control-label" }, [e._t("default")], 2)]);
22
+ }, A = [], D = /* @__PURE__ */ d(
23
+ O,
24
+ q,
25
+ A,
26
+ !1,
27
+ null,
28
+ null
29
+ );
30
+ const V = D.exports;
7
31
  function h(a) {
8
32
  if (typeof a > "u")
9
33
  throw Error("Missing param inputParam");
@@ -16,11 +40,11 @@ function h(a) {
16
40
  o = parseInt(e.charAt(s), 10), s % 2 === n && (o *= 2), o > 9 && (o -= 9), t += o;
17
41
  return t % 10 === 0;
18
42
  }
19
- function m(a) {
43
+ function u(a) {
20
44
  let e = a.replace(/ /g, "");
21
45
  return e = e.replace(/-/g, ""), !h(e) || (e = [e.slice(0, 6), "-", e.slice(6)].join(""), !e.match(/^(\d{6})-(\d{4})$/)) ? !1 : e;
22
46
  }
23
- function d(a) {
47
+ function c(a) {
24
48
  if (typeof a > "u" || a === null || a === "")
25
49
  return !1;
26
50
  let e = a.trim().replace(/[^0-9]+/g, "");
@@ -35,7 +59,7 @@ function d(a) {
35
59
  }
36
60
  return (/* @__PURE__ */ new Date()).getFullYear() - parseInt(e.substring(0, 4), 10) < 16 ? !1 : h(e.substring(2)) ? e : !1;
37
61
  }
38
- const S = {
62
+ const B = {
39
63
  sv: {
40
64
  title: "Mottagare",
41
65
  updateButton: "Spara mottagare",
@@ -150,18 +174,24 @@ const S = {
150
174
  }
151
175
  }
152
176
  }
153
- }, { mapFields: I } = u({
177
+ }, { mapFields: P } = p({
154
178
  getterType: "forms/getField",
155
179
  mutationType: "forms/updateField"
156
- }), F = {
180
+ }), E = {
157
181
  name: "FormClient",
158
182
  i18nOptions: {
159
183
  namespaces: "formClient",
160
- messages: S
184
+ messages: B
161
185
  },
162
186
  components: {
163
187
  ClientAutocomplete: v,
164
- Animation: y
188
+ Animation: C,
189
+ CCheckbox: b,
190
+ CDropdown: S,
191
+ CDropdownItem: N,
192
+ CField: I,
193
+ CPhoneInput: F,
194
+ CRadio: V
165
195
  },
166
196
  mixins: [f],
167
197
  props: {
@@ -214,7 +244,7 @@ const S = {
214
244
  ].some((e) => !!e) ? {
215
245
  orgNo: {
216
246
  personalNumber(e) {
217
- return !this.validateOrgNo || !e ? !0 : this.isIndivid ? d(e) : m(e) || d(e);
247
+ return !this.validateOrgNo || !e ? !0 : this.isIndivid ? c(e) : u(e) || c(e);
218
248
  }
219
249
  },
220
250
  reference: {
@@ -242,7 +272,7 @@ const S = {
242
272
  };
243
273
  },
244
274
  computed: {
245
- ...I({
275
+ ...P({
246
276
  id: "endCustomer.id",
247
277
  type: "endCustomer.customerType",
248
278
  name: "endCustomer.name",
@@ -291,7 +321,7 @@ const S = {
291
321
  return this.realOrgNo;
292
322
  },
293
323
  set(a) {
294
- const e = this.isIndivid ? d(a) : m(a) || d(a);
324
+ const e = this.isIndivid ? c(a) : u(a) || c(a);
295
325
  return this.validateOrgNo && e ? (this.realOrgNo = e, !0) : (this.realOrgNo = a, !0);
296
326
  }
297
327
  },
@@ -301,7 +331,7 @@ const S = {
301
331
  },
302
332
  watch: {
303
333
  type(a) {
304
- C.setItem("defaultClientType", a);
334
+ _.setItem("defaultClientType", a);
305
335
  }
306
336
  },
307
337
  mounted() {
@@ -313,7 +343,7 @@ const S = {
313
343
  }
314
344
  }
315
345
  };
316
- var M = function() {
346
+ var W = function() {
317
347
  var e = this, t = e._self._c;
318
348
  return t("div", { staticClass: "form-client" }, [e.simpleForm ? t("form", { on: { submit: function(i) {
319
349
  return i.preventDefault(), e.validateForm.apply(null, arguments);
@@ -401,18 +431,18 @@ var M = function() {
401
431
  });
402
432
  } } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`signMethod.${i}.title`)))]), t("div", { staticClass: "max-w-[calc(12_*_var(--rem))] truncate", staticStyle: { "font-size": "12px", opacity: "0.7", "text-wrap": "wrap" } }, [e._v(" " + e._s(e.$t(`signMethod.${i}.content`)) + " ")])])]);
403
433
  }), 1)], 1) : e._e()]) : e._e(), t("div", { staticStyle: { "margin-top": "calc(3 * var(--rem))" } }, [t("CButton", { staticStyle: { padding: "16px", "border-radius": "8px", height: "100%", "font-size": "14px", "font-weight": "600", "box-shadow": "0 2px 4px -1px rgba(0, 0, 0, 0.1)" }, attrs: { loading: e.isPosting, type: "secondary", wide: "" }, on: { click: e.validateForm } }, [e._v(e._s(e.$t("updateButton")))])], 1)], 1)]);
404
- }, z = [], O = /* @__PURE__ */ p(
405
- F,
406
- M,
407
- z,
434
+ }, T = [], L = /* @__PURE__ */ d(
435
+ E,
436
+ W,
437
+ T,
408
438
  !1,
409
439
  null,
410
- "12f94211"
440
+ "048c074e"
411
441
  );
412
- const R = O.exports, { mapFields: q } = u({
442
+ const j = L.exports, { mapFields: Z } = p({
413
443
  getterType: "forms/getField",
414
444
  mutationType: "forms/updateField"
415
- }), A = {
445
+ }), U = {
416
446
  name: "ClientModal",
417
447
  i18nOptions: {
418
448
  namespaces: "clientModal",
@@ -444,7 +474,7 @@ const R = O.exports, { mapFields: q } = u({
444
474
  }
445
475
  },
446
476
  components: {
447
- FormClient: R
477
+ FormClient: j
448
478
  },
449
479
  mixins: [f],
450
480
  props: {
@@ -499,10 +529,10 @@ const R = O.exports, { mapFields: q } = u({
499
529
  };
500
530
  },
501
531
  computed: {
502
- ...q({
532
+ ...Z({
503
533
  endCustomer: "endCustomer"
504
534
  }),
505
- ...w("forms", {
535
+ ...M("forms", {
506
536
  formData: (a) => a.document2
507
537
  }),
508
538
  ...g({
@@ -511,7 +541,7 @@ const R = O.exports, { mapFields: q } = u({
511
541
  defaultClientType: "endCustomers/defaultClientType"
512
542
  }),
513
543
  validateOrgNo() {
514
- return !!(this.feature("bankId") || this.isPublicForm && b[_.brand].defaultRegion === "SE");
544
+ return !!(this.feature("bankId") || this.isPublicForm && $[x.brand].defaultRegion === "SE");
515
545
  },
516
546
  existsOnDocument() {
517
547
  return !!l(this.formData, `clients[${this.documentClientIndex}]`);
@@ -534,13 +564,13 @@ const R = O.exports, { mapFields: q } = u({
534
564
  );
535
565
  },
536
566
  methods: {
537
- ...k({
538
- saveClient: c.FORM_SUBMIT_ENDCUSTOMER,
539
- showMessage: c.SHOW_MESSAGE
567
+ ...R({
568
+ saveClient: m.FORM_SUBMIT_ENDCUSTOMER,
569
+ showMessage: m.SHOW_MESSAGE
540
570
  }),
541
- omit: N,
571
+ omit: z,
542
572
  loadForm(a = {}) {
543
- this.storedNewClient = Object.assign(this.storedNewClient, a), this.endCustomer = $({
573
+ this.storedNewClient = Object.assign(this.storedNewClient, a), this.endCustomer = w({
544
574
  type: this.defaultClientType(),
545
575
  ...a
546
576
  });
@@ -554,7 +584,7 @@ const R = O.exports, { mapFields: q } = u({
554
584
  }
555
585
  this.setFormValue({
556
586
  key: `clients[${this.documentClientIndex}]`,
557
- value: x(
587
+ value: k(
558
588
  { ...this.endCustomer, ...a && { id: a } },
559
589
  { ...this.storedNewClient, signOrder: this.signOrder }
560
590
  )
@@ -600,7 +630,7 @@ const R = O.exports, { mapFields: q } = u({
600
630
  }
601
631
  }
602
632
  };
603
- var D = function() {
633
+ var Y = function() {
604
634
  var e = this, t = e._self._c;
605
635
  return t("div", { staticClass: "font-primary fixed inset-0 z-[1000] grid place-items-center overflow-auto bg-black bg-opacity-10 max-sm:block max-sm:min-h-full max-sm:w-full max-sm:overflow-auto sm:py-4", on: { "&click": function(i) {
606
636
  return i.target !== i.currentTarget ? null : e.close.apply(null, arguments);
@@ -617,15 +647,20 @@ var D = function() {
617
647
  }, submit: e.onSave, "show-more": function(i) {
618
648
  e.showMore = !0;
619
649
  } } }), e.existsOnDocument && e.mq === "sm" ? t("CButton", { staticClass: "mt-4 text-sm", attrs: { type: "danger", pattern: "secondary", wide: "" }, on: { click: e.removeClient } }, [e._v(" " + e._s(e.$t("_common:remove")) + " ")]) : e._e()], 1)]);
620
- }, B = [], E = /* @__PURE__ */ p(
621
- A,
622
- D,
623
- B,
650
+ }, G = [], H = /* @__PURE__ */ d(
651
+ U,
652
+ Y,
653
+ G,
624
654
  !1,
625
655
  null,
626
656
  null
627
657
  );
628
- const U = E.exports;
658
+ const J = H.exports, se = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
659
+ __proto__: null,
660
+ default: J
661
+ }, Symbol.toStringTag, { value: "Module" }));
629
662
  export {
630
- U as default
663
+ J as C,
664
+ V as a,
665
+ se as b
631
666
  };