@cling-se/widget 0.15.2 → 0.15.5

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 (137) hide show
  1. package/README.md +43 -43
  2. package/dist/{AddClientCallout-CSxN7XFh.js → AddClientCallout-CrZF5j7A.js} +15 -13
  3. package/dist/{AnswerModal-DEwMlsT8.js → AnswerModal-C3r9vyki.js} +71 -71
  4. package/dist/{AttachmentItem-R7YMKqQ2.js → AttachmentItem-BVXrxCnv.js} +20 -13
  5. package/dist/{BaseDatePicker-Bd1maWgF.js → BaseDatePicker-DxL2l3QC.js} +561 -557
  6. package/dist/{BaseUpload-C9Jd1JBo.js → BaseUpload-B7259IaQ.js} +3 -3
  7. package/dist/{BlockMedia-CUCZYVdZ.js → BlockMedia-BSKtZMwa.js} +2 -2
  8. package/dist/{CCallout-_k7FPbsE.js → CCallout-BNvM6gNJ.js} +4 -5
  9. package/dist/{CCurrencyDropdown-DejfeYVY.js → CCurrencyDropdown-xmqmb8gW.js} +24 -20
  10. package/dist/{CDropdownItem-b6ZzOnv-.js → CDropdownItem-DiLisSei.js} +139 -37
  11. package/dist/{CFormField-BjGICSv5.js → CFormField-DcZVdj3a.js} +3 -4
  12. package/dist/{CPhoneFormat-Bf2fgYtr.js → CPhoneFormat-BeYxRN0i.js} +1 -1
  13. package/dist/CPhoneInput-UzZkxbC6.js +138 -0
  14. package/dist/{CPriceInput-myrETXfz.js → CPriceInput-C2y_3PM7.js} +20 -16
  15. package/dist/CSelect-BmP1UsQA.js +91 -0
  16. package/dist/CSkeleton-BNbft-NE.js +55 -0
  17. package/dist/ClientAutocomplete-BnredOme.js +438 -0
  18. package/dist/{ClientModal-DSmFJ9bu.js → ClientModal-DNcf4APF.js} +92 -51
  19. package/dist/{ColorPicker-B1MJicqo.js → ColorPicker-BupC4jvI.js} +2 -2
  20. package/dist/{CompanyModal-BXs3aAYm.js → CompanyModal-Bh8mEHE1.js} +25 -19
  21. package/dist/{ContentWrapper-BKWZy4Bp.js → ContentWrapper-Bs3nrJda.js} +63 -55
  22. package/dist/CoverBlockSettings-WYZsCdky.js +659 -0
  23. package/dist/{DocAnswer-CaoTYUNh.js → DocAnswer--FfsnnTB.js} +2 -2
  24. package/dist/{DocDetails-C9EEpNg2.js → DocDetails-Ce7bj-qO.js} +43 -39
  25. package/dist/{DocForm-Dww8Ust9.js → DocForm-FR_Vlq_C.js} +801 -755
  26. package/dist/{DocFormSend-DKAqaT50.js → DocFormSend-DcSv3JNg.js} +18 -15
  27. package/dist/{DocLinks-DFUO03dk.js → DocLinks-Bvhc62aJ.js} +2 -2
  28. package/dist/{DocModalBase-QZosNhiK.js → DocModalBase-DkfUBRi3.js} +2 -2
  29. package/dist/{DocPrint--T278pDE.js → DocPrint-BrKY6rOy.js} +3 -3
  30. package/dist/{DocReceipt-CPg45_I7.js → DocReceipt-oGrM6t_k.js} +29 -22
  31. package/dist/{DocSendReminder-DQAaiUrs.js → DocSendReminder-veEC_yHK.js} +19 -16
  32. package/dist/{DocTextEditor-CM1f8eMD.js → DocTextEditor-CNRwxPEx.js} +72 -70
  33. package/dist/{DocTimeline-Ce0OZgGP.js → DocTimeline-e2Xf_QZ7.js} +38 -34
  34. package/dist/{DocumentClient-DHU-Rg3r.js → DocumentClient-Dx4Uyxkh.js} +5 -5
  35. package/dist/{DocumentLayout-GYCBw2F_.js → DocumentLayout-DmjmsTcx.js} +1506 -1538
  36. package/dist/{DocumentLogotype-Cilc0ElE.js → DocumentLogotype-ddYHM9wn.js} +25 -20
  37. package/dist/{DocumentVoided-BH8pkv85.js → DocumentVoided-WCk7XuxH.js} +1 -1
  38. package/dist/{EmbedInput-lMSVQSey.js → EmbedInput-CMueXdFs.js} +25 -21
  39. package/dist/{EmbedSettings-D65Y2AZL.js → EmbedSettings-BRuLCWr0.js} +13 -11
  40. package/dist/{ErrorCallout-BBNHzuhf.js → ErrorCallout-CDtZceLU.js} +6 -6
  41. package/dist/{FilePreviewModal-iPIuaIor.js → FilePreviewModal-BzAUuY58.js} +3 -3
  42. package/dist/Flag-DkJgyDQK.js +46 -0
  43. package/dist/{HeaderSettings-WKUIBCfF.js → HeaderSettings-CoKK5Mbt.js} +159 -110
  44. package/dist/{ImageSelectModal-BTMFM3o9.js → ImageSelectModal-De64vGSr.js} +15 -13
  45. package/dist/{ImageUploadWrapper-BaLjUZF5.js → ImageUploadWrapper-CE6KTze0.js} +3 -3
  46. package/dist/{Index-DS1PwlDq.js → Index-50KxppUS.js} +4 -4
  47. package/dist/{Index-DJeZiYxr.js → Index-B7vVIRFn.js} +7 -7
  48. package/dist/{Index-ivhPuQy5.js → Index-BUQ75xOU.js} +6 -6
  49. package/dist/{Index-BUEXgHEE.js → Index-BVKCCkQY.js} +57 -50
  50. package/dist/{Index-BBTn35Kj.js → Index-BiGT3iEX.js} +21 -17
  51. package/dist/{Index-B-UWz1IM.js → Index-BoDKKVvL.js} +4 -4
  52. package/dist/{Index-DrSgVUyo.js → Index-BotY9nbP.js} +2 -2
  53. package/dist/{Index-B-YqdbQX.js → Index-BwaJW9CY.js} +3 -3
  54. package/dist/{Index-BepvyGqo.js → Index-ByqCyUgx.js} +9 -9
  55. package/dist/{Index-Bsv15ctO.js → Index-C7pge7E9.js} +23 -21
  56. package/dist/{Index-CEaZgZqg.js → Index-CBRJ-AZi.js} +2 -2
  57. package/dist/{Index-GrrsUUz1.js → Index-CFQMtx5w.js} +5 -5
  58. package/dist/{Index-CtQo0b8t.js → Index-CJKyHWiO.js} +15 -15
  59. package/dist/{Index-Dv1fkHWQ.js → Index-CK_5l1kP.js} +2 -2
  60. package/dist/{Index-BVt3pj58.js → Index-CLc_11Bc.js} +276 -232
  61. package/dist/{Index-cPIqnY80.js → Index-CTokKHJA.js} +5 -5
  62. package/dist/Index-Cf45UGbc.js +28 -0
  63. package/dist/{Index-B51tj7qY.js → Index-CfLPq-yA.js} +5 -5
  64. package/dist/{Index-B_ta4yT_.js → Index-Ci7y3O0G.js} +7 -7
  65. package/dist/{Index-ZKkQzVOj.js → Index-CmV8oF4Q.js} +4 -4
  66. package/dist/{Index-C6tGNKAk.js → Index-CoRuYEYW.js} +5 -5
  67. package/dist/Index-CtKNyVUB.js +56 -0
  68. package/dist/{Index-rL3fz1Ew.js → Index-DCf6_Zd2.js} +2 -2
  69. package/dist/{Index-CEHhYmLe.js → Index-DGdlZzVO.js} +7 -7
  70. package/dist/{Index-B5XaBVyJ.js → Index-DbKB8sTh.js} +18 -12
  71. package/dist/{Index-9PMrT3eB.js → Index-DgBOq2MJ.js} +3 -3
  72. package/dist/{Index-BBOJRRgx.js → Index-DvNxOHHu.js} +6 -6
  73. package/dist/{Index-DS7xellB.js → Index-M2Mce2_m.js} +124 -123
  74. package/dist/{Index-2PGn8Pnv.js → Index-QMkjG7hk.js} +4 -4
  75. package/dist/{Index-oKRUWCcJ.js → Index-QmX5pv-V.js} +17 -15
  76. package/dist/{Index-0aZtDWyk.js → Index-h5xDFYM9.js} +4 -4
  77. package/dist/{Index-CtZMlBfK.js → Index-hkGYloih.js} +5 -5
  78. package/dist/{Index-DK3b6Cv-.js → Index-q3gLm4b1.js} +6 -6
  79. package/dist/{Index-BQ3kapHk.js → Index-sqI1TF7Z.js} +2 -2
  80. package/dist/{InputToggleRow-CJF0vwk3.js → InputToggleRow-DLFIMIdx.js} +2 -2
  81. package/dist/{ManualPopover-CEF7LMpn.js → ManualPopover-Cf8DotlW.js} +13 -11
  82. package/dist/{MediaWrapper-CM6vWCoZ.js → MediaWrapper-BgWmA3kS.js} +3 -3
  83. package/dist/{NotBindingText-Cee9yA0M.js → NotBindingText-DhsHxvkX.js} +2 -2
  84. package/dist/{PackageGroup-CFXogKPM.js → PackageGroup-EbOSxv69.js} +26 -20
  85. package/dist/PdfTerms-im6uTd5E.js +31 -0
  86. package/dist/{PdfViewer-Cd0Jm2VB.js → PdfViewer-DY0rcZjo.js} +22 -22
  87. package/dist/{PlainHtml-CucWAcOU.js → PlainHtml-o031pfp-.js} +1 -1
  88. package/dist/{PriceHeader-DdMZUaq5.js → PriceHeader-NdFa0Sqs.js} +15 -15
  89. package/dist/{SearchApi-knNqVduO.js → SearchApi-Bw5E9IPj.js} +2 -2
  90. package/dist/SendForm-BDY5VDkS.js +1023 -0
  91. package/dist/{Setup-7HIAWuiK.js → Setup-BsYqPmOm.js} +1 -1
  92. package/dist/{SmartList-cSmGbybV.js → SmartList-CP2wHig-.js} +1 -1
  93. package/dist/{TermsSettings-CAB-08E3.js → TermsSettings-CUlSayCJ.js} +20 -13
  94. package/dist/{ThemeColorRow-DxcMvBGq.js → ThemeColorRow-D3fav4Sl.js} +14 -12
  95. package/dist/ToggleBinding-B715OVl2.js +42 -0
  96. package/dist/{UploadModal-CvoSMExA.js → UploadModal-THDJ-UNp.js} +6 -6
  97. package/dist/{VideoPlayerInput-X5baUH3q.js → VideoPlayerInput-Cm3KoRnR.js} +15 -11
  98. package/dist/{VideoPlayerSettings-DsIvpufB.js → VideoPlayerSettings-BFAjczuw.js} +3 -3
  99. package/dist/VideoSelectModal-CzO8EMg9.js +104 -0
  100. package/dist/{answerDocumentMixin-B8HB1WAX.js → answerDocumentMixin-D12xJRhx.js} +3 -3
  101. package/dist/{debounce-B2lqFJg2.js → debounce-DLiv1sQX.js} +16 -16
  102. package/dist/{focusDrawerMixin-B2djM7ql.js → focusDrawerMixin-khaScuSu.js} +1 -1
  103. package/dist/{formDrawerState-CchCpZRc.js → formDrawerState-CJ6kjaD_.js} +1 -1
  104. package/dist/{formValidationMixin-Dz9Mabvi.js → formValidationMixin-Bri1WflH.js} +1 -1
  105. package/dist/{index-Dk6sZCYv.js → index-B0Zu30kF.js} +2 -2
  106. package/dist/{index-twnaU4rC.js → index-C1Ngv-v3.js} +1 -1
  107. package/dist/{index-BCrDgR_4.js → index-CMT3coT-.js} +785 -2001
  108. package/dist/{index-H1Kx9sJM.js → index-DJOUQneq.js} +42 -38
  109. package/dist/{index-BaGtbWcA.js → index-DLa3QER7.js} +18 -17
  110. package/dist/{index-kV9OZ5y0.js → index-Dygy9XlG.js} +1 -1
  111. package/dist/index.es.js +10 -10
  112. package/dist/index.umd.js +179 -175
  113. package/dist/{main-CerYX9PA.js → main-U22_wtg0.js} +13008 -11358
  114. package/dist/{mapFormMixin-Hj1Y7rVt.js → mapFormMixin-BZf4RJIE.js} +1 -1
  115. package/dist/omit-RBXmF_Fo.js +31 -0
  116. package/dist/{publicSenderState-t7Gu53cA.js → publicSenderState-DKuvxj4_.js} +1 -1
  117. package/dist/regions-BdZt9Srn.js +1250 -0
  118. package/dist/simplebar.min-Bnrne5ZK.js +71 -0
  119. package/dist/style.css +2 -2
  120. package/dist/{throttle-B8hI9bkk.js → throttle-Fkuqk26x.js} +2 -2
  121. package/dist/{tinycolor-BaK26Ky-.js → tinycolor-BZ8wGctU.js} +1 -1
  122. package/dist/{tippy.esm-BuWRbveV.js → tippy.esm-BJe845c1.js} +246 -240
  123. package/dist/{utils-Pmm0DT8o.js → utils-BOWVR87A.js} +1 -1
  124. package/dist/{vuedraggable.umd-Besz6Tlv.js → vuedraggable.umd-CJL8TWxZ.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-DyXQEfcS.js +0 -78
  129. package/dist/CoverBlockSettings-7Ivt9zN0.js +0 -275
  130. package/dist/Flag-CwnrA4SV.js +0 -114
  131. package/dist/Index-B0pgh8nR.js +0 -21
  132. package/dist/Index-Ccx9wHcb.js +0 -52
  133. package/dist/PdfTerms-ChtDfzne.js +0 -36
  134. package/dist/ToggleBinding-CTTYdrkp.js +0 -38
  135. package/dist/VideoSelectModal-VMcSU3bM.js +0 -100
  136. package/dist/formComponentsInstall-CdjgjI6y.js +0 -2495
  137. package/dist/omit-DGBewD2h.js +0 -31
@@ -0,0 +1,91 @@
1
+ import { n as r, F as c } from "./main-U22_wtg0.js";
2
+ const u = {
3
+ name: "CSelect",
4
+ mixins: [c],
5
+ inheritAttrs: !1,
6
+ props: {
7
+ value: {
8
+ type: [String, Number, Boolean, Object, Array, Function],
9
+ default: null
10
+ },
11
+ placeholder: {
12
+ type: String,
13
+ default: ""
14
+ },
15
+ multiple: Boolean,
16
+ selectClass: {
17
+ type: [String, Object, Array],
18
+ default: ""
19
+ },
20
+ nativeSize: {
21
+ type: [String, Number],
22
+ default: null
23
+ }
24
+ },
25
+ data() {
26
+ return {
27
+ selected: this.value,
28
+ _elementRef: "select"
29
+ };
30
+ },
31
+ computed: {
32
+ computedValue: {
33
+ get() {
34
+ return this.selected;
35
+ },
36
+ set(l) {
37
+ this.selected = l, this.$emit("input", l), !this.isValid && this.checkHtml5Validity();
38
+ }
39
+ },
40
+ spanClasses() {
41
+ return [
42
+ this.size,
43
+ this.statusType,
44
+ {
45
+ "is-fullwidth": this.expanded,
46
+ "is-loading": this.loading,
47
+ "is-multiple": this.multiple,
48
+ "is-rounded": this.rounded,
49
+ "is-empty": this.selected === null
50
+ }
51
+ ];
52
+ }
53
+ },
54
+ watch: {
55
+ /**
56
+ * When v-model is changed:
57
+ * 1. Set the selected option.
58
+ * 2. If it's invalid, validate again.
59
+ */
60
+ value(l) {
61
+ this.selected = l, !this.isValid && this.checkHtml5Validity();
62
+ }
63
+ }
64
+ };
65
+ var d = function() {
66
+ var e = this, i = e._self._c;
67
+ return i("div", { staticClass: "control", class: { "is-expanded": e.expanded, "has-icons-left": e.icon } }, [i("span", { staticClass: "select", class: e.spanClasses }, [i("select", e._b({ directives: [{ name: "model", rawName: "v-model", value: e.computedValue, expression: "computedValue" }], ref: "select", class: e.selectClass, attrs: { multiple: e.multiple, size: e.nativeSize }, on: { blur: function(t) {
68
+ e.$emit("blur", t) && e.checkHtml5Validity();
69
+ }, focus: function(t) {
70
+ return e.$emit("focus", t);
71
+ }, change: function(t) {
72
+ var a = Array.prototype.filter.call(t.target.options, function(s) {
73
+ return s.selected;
74
+ }).map(function(s) {
75
+ var n = "_value" in s ? s._value : s.value;
76
+ return n;
77
+ });
78
+ e.computedValue = t.target.multiple ? a : a[0];
79
+ } } }, "select", e.$attrs, !1), [e.placeholder && e.computedValue == null ? i("option", { attrs: { disabled: "", hidden: "" }, domProps: { value: null } }, [e._v(" " + e._s(e.placeholder) + " ")]) : e._e(), e._t("default")], 2)])]);
80
+ }, o = [], p = /* @__PURE__ */ r(
81
+ u,
82
+ d,
83
+ o,
84
+ !1,
85
+ null,
86
+ "5cf2c0d1"
87
+ );
88
+ const h = p.exports;
89
+ export {
90
+ h as C
91
+ };
@@ -0,0 +1,55 @@
1
+ import { u as m, w as y, x as u, y as h, n as C } from "./main-U22_wtg0.js";
2
+ const k = /* @__PURE__ */ m({
3
+ __name: "CSkeleton",
4
+ props: {
5
+ active: { type: Boolean, default: !0 },
6
+ animated: { type: Boolean, default: !1 },
7
+ width: { default: "" },
8
+ height: { default: "" },
9
+ circle: { type: Boolean, default: !1 },
10
+ rounded: { type: Boolean, default: !0 },
11
+ count: { default: 1 },
12
+ hidden: { type: Boolean, default: !1 },
13
+ color: { default: "" }
14
+ },
15
+ setup(i) {
16
+ const t = i, {
17
+ active: s,
18
+ animated: e,
19
+ width: a,
20
+ height: l,
21
+ circle: c,
22
+ rounded: d,
23
+ count: r,
24
+ hidden: f,
25
+ color: n
26
+ } = y(t), v = u(() => ({
27
+ height: l.value === void 0 ? null : isNaN(Number(l.value)) ? l.value : `${l.value}px`,
28
+ width: a.value === void 0 ? null : isNaN(Number(a.value)) ? a.value : `${a.value}px`,
29
+ borderRadius: c.value ? "50%" : null,
30
+ background: n.value ? n.value : null
31
+ })), o = h(), _ = u(() => o.style), p = u(() => o.class);
32
+ return { __sfc: !0, props: t, active: s, animated: e, width: a, height: l, circle: c, rounded: d, count: r, hidden: f, color: n, itemStyle: v, attrs: o, staticStyle: _, staticClass: p };
33
+ }
34
+ });
35
+ var x = function() {
36
+ var t = this, s = t._self._c, e = t._self._setupProxy;
37
+ return e.active ? s("div", { class: [
38
+ "c-skeleton",
39
+ { "is-animated": e.animated, "is-invisible": e.hidden },
40
+ e.staticClass
41
+ ], style: e.staticStyle }, t._l(e.count, function(a) {
42
+ return s("div", { key: a, staticClass: "c-skeleton-item", class: { "is-rounded": e.rounded }, style: e.itemStyle });
43
+ }), 0) : t._e();
44
+ }, N = [], S = /* @__PURE__ */ C(
45
+ k,
46
+ x,
47
+ N,
48
+ !1,
49
+ null,
50
+ null
51
+ );
52
+ const B = S.exports;
53
+ export {
54
+ B as C
55
+ };
@@ -0,0 +1,438 @@
1
+ import { S as c } from "./SearchApi-Bw5E9IPj.js";
2
+ import { n as l, j as a, F as d, ab as h } from "./main-U22_wtg0.js";
3
+ import { c as u, r as p, g as f } from "./CDropdownItem-DiLisSei.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
+ };