@cling-se/widget 0.14.4 → 0.14.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 (129) hide show
  1. package/dist/AddClientCallout-C7abPZ87.js +46 -0
  2. package/dist/AnswerModal-CsA2pl2P.js +3874 -0
  3. package/dist/AttachmentItem-Da1-7xwf.js +78 -0
  4. package/dist/BaseDatePicker-k9zlSi5J.js +3183 -0
  5. package/dist/BaseUpload-BUrXX3fT.js +1977 -0
  6. package/dist/BlockMedia-CYI07qAn.js +76 -0
  7. package/dist/CCallout-Qwae66vo.js +59 -0
  8. package/dist/CCurrencyDropdown-Y_u0hgBx.js +246 -0
  9. package/dist/CDropdownItem-CXJ4xD8W.js +538 -0
  10. package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +1 -0
  11. package/dist/CFormField--m3PvQuT.js +241 -0
  12. package/dist/CPhoneFormat-Qg6MkDVP.js +62 -0
  13. package/dist/CPriceInput-Dlx44UrR.js +112 -0
  14. package/dist/CTabs.vue_vue_type_style_index_0_scoped_b7262014_lang-l0sNRNKZ.js +1 -0
  15. package/dist/ClientAutocomplete-BKKc_br6.js +78 -0
  16. package/dist/ClientModal-CVZFb1Br.js +625 -0
  17. package/dist/ColorPicker-Bo3s3Esp.js +2879 -0
  18. package/dist/CompanyModal-DadjAioS.js +141 -0
  19. package/dist/ContentWrapper-BC3ZBQW9.js +183 -0
  20. package/dist/CoverBlockSettings-B484eE4g.js +275 -0
  21. package/dist/DocAnswer-CcYryOWI.js +36 -0
  22. package/dist/DocDetails-BigsoEWL.js +246 -0
  23. package/dist/DocForm-DlN0eNWt.js +7273 -0
  24. package/dist/DocFormSend-TqKo210I.js +143 -0
  25. package/dist/DocLinks-DSo54vDn.js +38 -0
  26. package/dist/DocModalBase-XlM1SThW.js +28 -0
  27. package/dist/DocPrint-tD0Vd9Sw.js +240 -0
  28. package/dist/DocReceipt-CDHPrhXM.js +210 -0
  29. package/dist/DocSendReminder-C62RhltH.js +137 -0
  30. package/dist/DocTextEditor-VjhV9IRp.js +17181 -0
  31. package/dist/DocTimeline-LcW4z3nC.js +481 -0
  32. package/dist/DocumentClient-CqbTRdpB.js +136 -0
  33. package/dist/DocumentLayout-Dbf8_01r.js +4909 -0
  34. package/dist/DocumentLogotype-DXYnBedV.js +87 -0
  35. package/dist/DocumentVoided-vH1Ti5lZ.js +25 -0
  36. package/dist/EmbedInput-D9qP8OnY.js +113 -0
  37. package/dist/EmbedSettings-DISuNqJT.js +72 -0
  38. package/dist/ErrorCallout-CCtCVwSh.js +28 -0
  39. package/dist/FilePreviewModal-BjhNyb6L.js +81 -0
  40. package/dist/Flag-Dhukv9_J.js +114 -0
  41. package/dist/HeaderSettings-CK4SkB1x.js +392 -0
  42. package/dist/ImageSelectModal-DnvPZzXx.js +84 -0
  43. package/dist/ImageUploadWrapper-B7cNMu5a.js +1604 -0
  44. package/dist/Index-B3HoK_cZ.js +84 -0
  45. package/dist/Index-B3aucNji.js +25 -0
  46. package/dist/Index-B9H5MMHb.js +62 -0
  47. package/dist/Index-BAYdvT-t.js +754 -0
  48. package/dist/Index-BLeQprjq.js +46 -0
  49. package/dist/Index-BOyvQlng.js +154 -0
  50. package/dist/Index-BVsw2tak.js +70 -0
  51. package/dist/Index-BY1UKGEO.js +98 -0
  52. package/dist/Index-Bh0kMSsA.js +107 -0
  53. package/dist/Index-BlQSM7tC.js +144 -0
  54. package/dist/Index-BpcJBGGd.js +642 -0
  55. package/dist/Index-Bs8wprXw.js +58 -0
  56. package/dist/Index-BvZZAvFd.js +21 -0
  57. package/dist/Index-CFo-3Y5Q.js +26 -0
  58. package/dist/Index-CNvp5K3L.js +559 -0
  59. package/dist/Index-CPJVx14x.js +171 -0
  60. package/dist/Index-CQ325eVT.js +140 -0
  61. package/dist/Index-CWrDtcfT.js +49 -0
  62. package/dist/Index-CyJnSvDR.js +223 -0
  63. package/dist/Index-D6bc7lg4.js +52 -0
  64. package/dist/Index-DCR8ev4U.js +33 -0
  65. package/dist/Index-DGQSB9cH.js +24 -0
  66. package/dist/Index-DXAvlq74.js +292 -0
  67. package/dist/Index-D_rfst8y.js +45 -0
  68. package/dist/Index-Dm8xMFGg.js +61 -0
  69. package/dist/Index-DtSSgtxB.js +55 -0
  70. package/dist/Index-DuTw9vhb.js +77 -0
  71. package/dist/Index-Dw26jtGV.js +31 -0
  72. package/dist/Index-OxN73_fO.js +32 -0
  73. package/dist/Index-S-FHG7_k.js +2402 -0
  74. package/dist/Index-ZFkitzfq.js +69 -0
  75. package/dist/Index-dyWK9jgr.js +25 -0
  76. package/dist/Index-gb11ngPS.js +57 -0
  77. package/dist/Index-lKk_XKJ3.js +150 -0
  78. package/dist/InputToggleRow-DSSvhPKA.js +57 -0
  79. package/dist/ManualPopover-lpJYSkw5.js +58 -0
  80. package/dist/MediaWrapper-BQ22FA2B.js +23 -0
  81. package/dist/NotBindingText-JxwzZLPP.js +32 -0
  82. package/dist/PackageGroup-BLSMSUDz.js +699 -0
  83. package/dist/PdfTerms-DtutjM5Y.js +36 -0
  84. package/dist/PdfViewer-BsxcZI_x.js +374 -0
  85. package/dist/PlainHtml-BMPZs2fT.js +20 -0
  86. package/dist/PriceHeader-BRYY01H2.js +339 -0
  87. package/dist/SearchApi-6001iFxU.js +161 -0
  88. package/dist/Setup-cw6jMI9M.js +50 -0
  89. package/dist/SmartList-q6H-uLbm.js +83 -0
  90. package/dist/TermsSettings-DWvaPneu.js +102 -0
  91. package/dist/ThemeColorRow-BXWnvfz-.js +67 -0
  92. package/dist/ToggleBinding-DydtwpNG.js +38 -0
  93. package/dist/UploadModal-D_EDKHGD.js +95 -0
  94. package/dist/VideoPlayerInput-B9yzUeBW.js +93 -0
  95. package/dist/VideoPlayerSettings-Bvp9l0yj.js +61 -0
  96. package/dist/VideoSelectModal-DY3N4JiS.js +100 -0
  97. package/dist/anime.es-BrPTThYb.js +858 -0
  98. package/dist/answerDocumentMixin-BYZPU_R-.js +51 -0
  99. package/dist/color-TdtKxwVa.js +19 -0
  100. package/dist/debounce-BPnlzNwd.js +84 -0
  101. package/dist/dom-CJxkno7i.js +91 -0
  102. package/dist/favicon.ico +0 -0
  103. package/dist/focusDrawerMixin-DC9Oa1i7.js +22 -0
  104. package/dist/formComponentsInstall-CEW6TK6z.js +2499 -0
  105. package/dist/formDrawerState-CAzvSMiQ.js +20 -0
  106. package/dist/formValidationMixin-D7zXxCpC.js +49 -0
  107. package/dist/i18nMessages-Chz_lxGG.js +17 -0
  108. package/dist/index-B9WDC3Xe.js +166 -0
  109. package/dist/index-BCMaUC5r.js +3916 -0
  110. package/dist/index-BDMI4NVY.js +492 -0
  111. package/dist/index-BbscgdRg.js +81 -0
  112. package/dist/index-CLUljEDI.js +347 -0
  113. package/dist/index-SxyZvewN.js +102 -0
  114. package/dist/index.es.js +35 -0
  115. package/dist/index.umd.js +3148 -0
  116. package/dist/main-CQBEuZk9.js +56739 -0
  117. package/dist/mapFormMixin-DlFcgwhm.js +72 -0
  118. package/dist/omit-BWy0Zhd3.js +31 -0
  119. package/dist/publicSenderState-CvOcFv2U.js +21 -0
  120. package/dist/splitpanes-BHUVsCZF.js +382 -0
  121. package/dist/style.css +4 -0
  122. package/dist/throttle-BrC8eGjQ.js +18 -0
  123. package/dist/tinycolor-PhFP695w.js +633 -0
  124. package/dist/tippy.esm-7dmKOUvu.js +1799 -0
  125. package/dist/utils-NBLgNGHR.js +108 -0
  126. package/dist/vuedraggable.umd-ByfH7ZxC.js +3161 -0
  127. package/dist/vuex.esm-DKGl8mcw.js +467 -0
  128. package/package.json +1 -1
  129. package/vite.config.ts +0 -1
@@ -0,0 +1,241 @@
1
+ import { n as i, Q as l } from "./main-CQBEuZk9.js";
2
+ import "./CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js";
3
+ const n = {
4
+ name: "CFieldBody",
5
+ props: {
6
+ message: {
7
+ type: String,
8
+ default: ""
9
+ },
10
+ type: {
11
+ type: [String, Object],
12
+ default: ""
13
+ }
14
+ },
15
+ render(s) {
16
+ return s(
17
+ "div",
18
+ { attrs: { class: "field-body" } },
19
+ this.$slots.default.map((e) => e.tag ? this.message ? s(
20
+ "c-field",
21
+ { attrs: { message: this.message, type: this.type } },
22
+ [e]
23
+ ) : s("c-field", { attrs: { type: this.type } }, [
24
+ e
25
+ ]) : e)
26
+ );
27
+ }
28
+ }, r = null, o = null;
29
+ var u = /* @__PURE__ */ i(
30
+ n,
31
+ r,
32
+ o,
33
+ !1,
34
+ null,
35
+ null
36
+ );
37
+ const d = u.exports, p = {
38
+ name: "CField",
39
+ components: {
40
+ CFieldBody: d
41
+ },
42
+ props: {
43
+ type: {
44
+ type: [String, Object],
45
+ default: ""
46
+ },
47
+ label: {
48
+ type: String,
49
+ default: ""
50
+ },
51
+ labelFor: {
52
+ type: String,
53
+ default: ""
54
+ },
55
+ message: {
56
+ type: [String, Array, Object],
57
+ default: ""
58
+ },
59
+ grouped: Boolean,
60
+ groupMultiline: Boolean,
61
+ position: {
62
+ type: String,
63
+ default: ""
64
+ },
65
+ expanded: Boolean,
66
+ horizontal: Boolean,
67
+ addons: {
68
+ type: Boolean,
69
+ default: !0
70
+ },
71
+ customClass: {
72
+ type: String,
73
+ default: ""
74
+ },
75
+ labelPosition: {
76
+ type: String,
77
+ default: () => "top"
78
+ // config.defaultFieldLabelPosition,
79
+ }
80
+ },
81
+ data() {
82
+ return {
83
+ newType: this.type,
84
+ newMessage: this.message,
85
+ fieldLabelSize: null,
86
+ _isField: !0
87
+ // Used internally by Input and Select
88
+ };
89
+ },
90
+ computed: {
91
+ rootClasses() {
92
+ return [
93
+ this.newPosition,
94
+ {
95
+ "is-expanded": this.expanded,
96
+ "is-grouped-multiline": this.groupMultiline,
97
+ "is-horizontal": this.horizontal,
98
+ "is-floating-in-label": this.hasLabel && !this.horizontal && this.labelPosition === "inside",
99
+ "is-floating-label": this.hasLabel && !this.horizontal && this.labelPosition === "on-border"
100
+ },
101
+ this.numberInputClasses
102
+ ];
103
+ },
104
+ /**
105
+ * Correct Bulma class for the side of the addon or group.
106
+ *
107
+ * This is not kept like the others (is-small, etc.),
108
+ * because since 'has-addons' is set automatically it
109
+ * doesn't make sense to teach users what addons are exactly.
110
+ */
111
+ // eslint-disable-next-line vue/return-in-computed-property
112
+ newPosition() {
113
+ if (this.position === void 0)
114
+ return;
115
+ const s = this.position.split("-");
116
+ if (s.length < 1)
117
+ return;
118
+ const e = this.grouped ? "is-grouped-" : "has-addons-";
119
+ if (this.position)
120
+ return e + s[1];
121
+ },
122
+ /**
123
+ * Formatted message in case it's an array
124
+ * (each element is separated by <br> tag)
125
+ */
126
+ formattedMessage() {
127
+ if (typeof this.newMessage == "string")
128
+ return this.newMessage;
129
+ const s = [];
130
+ if (Array.isArray(this.newMessage))
131
+ this.newMessage.forEach((e) => {
132
+ if (typeof e == "string")
133
+ s.push(e);
134
+ else
135
+ for (const t in e)
136
+ e[t] && s.push(t);
137
+ });
138
+ else
139
+ for (const e in this.newMessage)
140
+ this.newMessage[e] && s.push(e);
141
+ return s.filter((e) => {
142
+ if (e)
143
+ return e;
144
+ }).join(" <br> ");
145
+ },
146
+ hasLabel() {
147
+ return this.label || this.$slots.label;
148
+ },
149
+ numberInputClasses() {
150
+ if (this.$slots.default) {
151
+ const s = this.$slots.default.filter(
152
+ (e) => e.tag && e.tag.toLowerCase().indexOf("numberinput") >= 0
153
+ )[0];
154
+ if (s) {
155
+ const e = ["has-numberinput"], t = s.componentOptions.propsData.controlsPosition, a = s.componentOptions.propsData.size;
156
+ return t && e.push(`has-numberinput-${t}`), a && e.push(`has-numberinput-${a}`), e;
157
+ }
158
+ }
159
+ return null;
160
+ }
161
+ },
162
+ watch: {
163
+ /**
164
+ * Set internal type when prop change.
165
+ */
166
+ type(s) {
167
+ this.newType = s;
168
+ },
169
+ /**
170
+ * Set internal message when prop change.
171
+ */
172
+ message(s) {
173
+ this.newMessage = s;
174
+ }
175
+ },
176
+ mounted() {
177
+ this.horizontal && this.$el.querySelectorAll(
178
+ ".input, .select, .button, .textarea, .c-slider"
179
+ ).length > 0 && (this.fieldLabelSize = "is-normal");
180
+ },
181
+ methods: {
182
+ /**
183
+ * Field has addons if there are more than one slot
184
+ * (element / component) in the Field.
185
+ * Or is grouped when prop is set.
186
+ * Is a method to be called when component re-render.
187
+ */
188
+ fieldType() {
189
+ if (this.grouped)
190
+ return "is-grouped";
191
+ let s = 0;
192
+ if (this.$slots.default && (s = this.$slots.default.reduce(
193
+ (e, t) => t.tag ? e + 1 : e,
194
+ 0
195
+ )), s > 1 && this.addons && !this.horizontal)
196
+ return "has-addons";
197
+ }
198
+ }
199
+ };
200
+ var f = function() {
201
+ var e = this, t = e._self._c;
202
+ return t("div", { staticClass: "field", class: [e.rootClasses, e.fieldType()] }, [e.horizontal ? t("div", { staticClass: "field-label", class: [e.customClass, e.fieldLabelSize] }, [e.hasLabel ? t("label", { staticClass: "label truncate-text", class: e.customClass, attrs: { for: e.labelFor } }, [e.$slots.label ? e._t("label") : [e._v(e._s(e.label))]], 2) : e._e()]) : [e.hasLabel ? t("label", { staticClass: "label truncate-text", class: e.customClass, attrs: { for: e.labelFor } }, [e.$slots.label ? e._t("label") : [e._v(e._s(e.label))]], 2) : e._e()], e.horizontal ? t("CFieldBody", { attrs: { message: e.newMessage ? e.formattedMessage : "", type: e.newType } }, [e._t("default")], 2) : [e._t("default")], e.newMessage && !e.horizontal ? t("p", { staticClass: "help", class: e.newType, domProps: { innerHTML: e._s(e.formattedMessage) } }) : e._e()], 2);
203
+ }, c = [], h = /* @__PURE__ */ i(
204
+ p,
205
+ f,
206
+ c,
207
+ !1,
208
+ null,
209
+ null
210
+ );
211
+ const _ = h.exports, g = {
212
+ name: "CFormField",
213
+ components: {
214
+ CField: _
215
+ },
216
+ extends: l,
217
+ computed: {
218
+ type() {
219
+ return this.hasErrors ? "is-danger" : this.isValid ? "is-success" : null;
220
+ },
221
+ customClass() {
222
+ return this.hasErrors ? "text-red-500" : this.isValid ? "text-green-500" : null;
223
+ }
224
+ }
225
+ };
226
+ var m = function() {
227
+ var e = this, t = e._self._c;
228
+ return t("CField", e._b({ attrs: { label: e.label, "custom-class": e.customClass, type: e.type, message: e.firstErrorMessage } }, "CField", { ...e.$attrs, ...e.$props }, !1), [e._t("default")], 2);
229
+ }, b = [], y = /* @__PURE__ */ i(
230
+ g,
231
+ m,
232
+ b,
233
+ !1,
234
+ null,
235
+ null
236
+ );
237
+ const w = y.exports;
238
+ export {
239
+ w as C,
240
+ _ as a
241
+ };
@@ -0,0 +1,62 @@
1
+ import { u as e, v as o, n } from "./main-CQBEuZk9.js";
2
+ const r = {
3
+ name: "CPhoneFormat",
4
+ props: {
5
+ phone: {
6
+ type: String,
7
+ required: !1,
8
+ default: ""
9
+ },
10
+ region: {
11
+ type: String,
12
+ required: !1,
13
+ default: null
14
+ }
15
+ },
16
+ data() {
17
+ return {
18
+ formattedPhone: ""
19
+ };
20
+ },
21
+ watch: {
22
+ phone: {
23
+ immediate: !0,
24
+ async handler() {
25
+ this.doFormatPhone();
26
+ }
27
+ }
28
+ },
29
+ methods: {
30
+ async doFormatPhone() {
31
+ if (!this.phone) {
32
+ this.formattedPhone = "";
33
+ return;
34
+ }
35
+ const t = await e(this.phone, {
36
+ defaultRegion: this.region
37
+ });
38
+ if (!t) {
39
+ this.formattedPhone = this.phone;
40
+ return;
41
+ }
42
+ this.formattedPhone = t.national;
43
+ }
44
+ },
45
+ render() {
46
+ return this.$scopedSlots.default ? this.$scopedSlots.default({
47
+ formattedValue: this.formattedPhone
48
+ }) : o("span", [this.formattedPhone]);
49
+ }
50
+ }, a = null, s = null;
51
+ var h = /* @__PURE__ */ n(
52
+ r,
53
+ a,
54
+ s,
55
+ !1,
56
+ null,
57
+ null
58
+ );
59
+ const d = h.exports;
60
+ export {
61
+ d as C
62
+ };
@@ -0,0 +1,112 @@
1
+ import { C as s } from "./CCurrencyDropdown-Y_u0hgBx.js";
2
+ import { n as i, q as u, r as a } from "./main-CQBEuZk9.js";
3
+ const l = {
4
+ name: "CPriceInput",
5
+ components: {
6
+ CInput: u,
7
+ CCurrencyDropdown: s
8
+ },
9
+ props: {
10
+ value: {
11
+ type: Number,
12
+ default: 0
13
+ },
14
+ currency: {
15
+ type: String,
16
+ required: !0
17
+ },
18
+ priceType: {
19
+ type: String,
20
+ default: "fixed",
21
+ validator: (t) => ["fixed", "markup", "openAcc", "approx"].includes(t)
22
+ },
23
+ unitLabel: {
24
+ type: String,
25
+ default: ""
26
+ },
27
+ isIncVat: {
28
+ type: Boolean,
29
+ default: !1
30
+ },
31
+ // Vat in percentage
32
+ vat: {
33
+ type: Number,
34
+ default: null
35
+ }
36
+ },
37
+ data() {
38
+ return {
39
+ isCurrencyDropdownOpen: !1
40
+ };
41
+ },
42
+ computed: {
43
+ internalValue: {
44
+ get() {
45
+ if (!Number.isNaN(parseFloat(this.value)) && Number.isFinite(this.value)) {
46
+ if (!this.value && !this.showZero)
47
+ return "";
48
+ let t = this.value;
49
+ return this.isIncVat && (t *= (100 + this.vat) / 100), Math.round(t) / 100;
50
+ }
51
+ return this.value;
52
+ },
53
+ set(t) {
54
+ let e = t;
55
+ e = t * 100, this.isIncVat && (e /= (100 + this.vat) / 100), e = Math.round(e), this.$emit("input", e);
56
+ }
57
+ },
58
+ internalCurrency: {
59
+ get() {
60
+ return this.currency;
61
+ },
62
+ set(t) {
63
+ this.$emit("update:currency", t);
64
+ }
65
+ },
66
+ suffixValue() {
67
+ const t = a(this.internalCurrency);
68
+ switch (this.priceType) {
69
+ case "openAcc":
70
+ return `${t}/${this.unitLabel || this.$t("_common:unitType.unit")}`;
71
+ case "markup":
72
+ return "%";
73
+ default:
74
+ return t;
75
+ }
76
+ },
77
+ showCurrencyDropdown() {
78
+ return !["markup"].includes(this.priceType);
79
+ },
80
+ eventListeners() {
81
+ return { ...this.$listeners, onInput: () => ({}), input: () => ({}) };
82
+ }
83
+ },
84
+ methods: {
85
+ focus() {
86
+ this.$refs.priceInput && typeof this.$refs.priceInput.focus == "function" && this.$refs.priceInput.focus();
87
+ }
88
+ }
89
+ };
90
+ var o = function() {
91
+ var e = this, r = e._self._c;
92
+ return r("CInput", e._g(e._b({ key: e.internalCurrency + e.priceType, ref: "priceInput", style: e.isCurrencyDropdownOpen && { zIndex: 99 }, attrs: { size: e.$attrs.size, placeholder: e.$attrs.placeholder, type: "number" }, model: { value: e.internalValue, callback: function(n) {
93
+ e.internalValue = n;
94
+ }, expression: "internalValue" } }, "CInput", { ...e.$attrs, ...e.$props }, !1), e.eventListeners), [e.$slots.prefix ? r("div", { attrs: { slot: "prefix" }, slot: "prefix" }, [e._t("prefix")], 2) : e._e(), e.$slots.suffix ? r("div", { attrs: { slot: "suffix" }, slot: "suffix" }, [e._t("suffix")], 2) : r("template", { slot: "suffix" }, [e.showCurrencyDropdown ? r("CCurrencyDropdown", { on: { "active-change": function(n) {
95
+ e.isCurrencyDropdownOpen = n;
96
+ } }, scopedSlots: e._u([{ key: "default", fn: function({ selectedValue: n }) {
97
+ return [r("CButton", { staticClass: "is-thinner", staticStyle: { "padding-left": "0.5em", "padding-right": "0.5em", "border-radius": "0.25em" }, attrs: { size: e.$attrs.size, type: "none", pattern: "tertiary" } }, [e._v(" " + e._s(n) + " ")])];
98
+ } }], null, !1, 1723986040), model: { value: e.internalCurrency, callback: function(n) {
99
+ e.internalCurrency = n;
100
+ }, expression: "internalCurrency" } }) : r("div", [e._v(e._s(e.suffixValue))])], 1)], 2);
101
+ }, p = [], c = /* @__PURE__ */ i(
102
+ l,
103
+ o,
104
+ p,
105
+ !1,
106
+ null,
107
+ null
108
+ );
109
+ const y = c.exports;
110
+ export {
111
+ y as C
112
+ };
@@ -0,0 +1,78 @@
1
+ import { S as o } from "./SearchApi-6001iFxU.js";
2
+ import { n as l, y as c } from "./main-CQBEuZk9.js";
3
+ const i = {
4
+ i18nOptions: {
5
+ namespaces: "components",
6
+ keyPrefix: "account.documentForm.clients"
7
+ },
8
+ name: "ClientAutocomplete",
9
+ components: {
10
+ SearchApi: o
11
+ },
12
+ props: {
13
+ searchEnabled: {
14
+ type: Boolean,
15
+ default: !0
16
+ },
17
+ showLoading: {
18
+ type: Boolean,
19
+ default: !1
20
+ },
21
+ showEmpty: {
22
+ type: Boolean,
23
+ default: !1
24
+ },
25
+ filled: {
26
+ type: Boolean,
27
+ default: !1
28
+ }
29
+ },
30
+ data() {
31
+ return {
32
+ convertToNewClient: c,
33
+ results: [],
34
+ // results when searching for existing endCustomer
35
+ searchQuery: ""
36
+ // query used to search for endCustomers
37
+ };
38
+ },
39
+ methods: {
40
+ search(r, e) {
41
+ this.$emit("input", e), this.searchEnabled && (this.searchQuery = e, r({
42
+ q: e,
43
+ cb: ({ endCustomer: s }) => {
44
+ this.results = s;
45
+ }
46
+ }));
47
+ }
48
+ }
49
+ };
50
+ var u = function() {
51
+ var e = this, s = e._self._c;
52
+ return s("SearchApi", { attrs: { "custom-search": { endCustomer: !0 } }, scopedSlots: e._u([{ key: "default", fn: function({ fetch: a, isLoading: n }) {
53
+ return [s("CAutocomplete", e._b({ attrs: { data: e.results, loading: e.showLoading && n, filled: e.filled, expanded: "", "keep-first": "" }, on: { typing: function(t) {
54
+ return e.search(a, t);
55
+ }, select: function(t) {
56
+ e.$emit("setClient", e.convertToNewClient(t));
57
+ } }, scopedSlots: e._u([{ key: "default", fn: function({ option: t }) {
58
+ return s("div", { staticStyle: { "line-height": "1.5" } }, [s("div", { staticStyle: { "font-weight": "500" } }, [e._v(e._s(t.name || t.email))]), s("div", { staticClass: "text-gray-600", staticStyle: { "font-size": "14px" } }, [e._v(" " + e._s(t.reference ? `${t.reference} · ` : "") + " " + e._s(t.workStreet || t.street || " ") + " ")])]);
59
+ } }], null, !0) }, "CAutocomplete", {
60
+ placeholder: e.$t("search.placeholder"),
61
+ ...e.$attrs,
62
+ ...e.$props
63
+ }, !1), [e.searchEnabled && e.showEmpty ? [s("div", { attrs: { slot: "footer" }, slot: "footer" }, [e.searchQuery && !e.results.length ? s("CButton", { staticStyle: { "font-weight": "600" }, attrs: { type: "secondary", pattern: "tertiary", size: "small" }, on: { click: function(t) {
64
+ return e.$emit("add");
65
+ } } }, [e._v(" " + e._s(e.$t("_common:add")) + " ")]) : e._e()], 1), s("template", { slot: "empty" }, [e._v(" " + e._s(e.$t("search.empty")) + " " + e._s(e.searchQuery) + " ")])] : e._e()], 2)];
66
+ } }]) });
67
+ }, d = [], f = /* @__PURE__ */ l(
68
+ i,
69
+ u,
70
+ d,
71
+ !1,
72
+ null,
73
+ "dd1b240c"
74
+ );
75
+ const h = f.exports;
76
+ export {
77
+ h as C
78
+ };