@cling-se/widget 0.17.3 → 0.18.0
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.
- package/CHANGELOG.md +7 -0
- package/dist/AddClientCallout-Bod9Eqx4.js +101 -0
- package/dist/AnswerModal-a2cyKFbt.js +3371 -0
- package/dist/AttachmentItem-DBUqckCS.js +171 -0
- package/dist/BaseUpload-DrWzuvbS.js +6503 -0
- package/dist/BlockMedia-DuE_K9hR.js +103 -0
- package/dist/CCallout-CM1VsH30.js +104 -0
- package/dist/{CCurrencyDropdown-CXXQu8th.js → CCurrencyDropdown-C_lAaq4P.js} +91 -53
- package/dist/CDropdownItem-DMUAJ90n.js +749 -0
- package/dist/CFormField.vue_vue_type_script_setup_true_lang-BqAyWe3T.js +292 -0
- package/dist/{CPhoneFormat-BtBGl8b4.js → CPhoneFormat-Dnn_cKk7.js} +13 -21
- package/dist/CPhoneInput-DuGkDiv-.js +207 -0
- package/dist/CPriceInput-B7DYzKcF.js +142 -0
- package/dist/CSelect-BZZDr27O.js +98 -0
- package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-D2jDhnYI.js +51 -0
- package/dist/ClientAutocomplete-DuaJ5zDf.js +532 -0
- package/dist/ClientModal-CaMSjLkD.js +1188 -0
- package/dist/ColorPicker-BISZPQ6j.js +1408 -0
- package/dist/CompanyModal-ClTcmU4Y.js +250 -0
- package/dist/ContentWrapper-Bj7jbWU0.js +265 -0
- package/dist/CoverBlockSettings-AXyiLxrF.js +861 -0
- package/dist/DocAnswer-Bu09V33D.js +33 -0
- package/dist/DocDetails-B6-2LKsO.js +452 -0
- package/dist/DocForm-CFN8LWSd.js +6772 -0
- package/dist/DocFormSend-D1CUhy4n.js +171 -0
- package/dist/DocLinks-CuliFqtN.js +36 -0
- package/dist/DocModalBase-BxKsnwN-.js +29 -0
- package/dist/DocPrint-B_HJ_RET.js +399 -0
- package/dist/DocReceipt-D-A1TaTI.js +341 -0
- package/dist/DocSendReminder-BKTJonzh.js +181 -0
- package/dist/{DocTextEditor-yD9Dt_um.js → DocTextEditor-CEPcJT2o.js} +7907 -5579
- package/dist/DocTimeline-CF9S4YDZ.js +537 -0
- package/dist/DocumentClient-7mbq2QA4.js +90 -0
- package/dist/DocumentLayout-DkFlHgW6.js +1434 -0
- package/dist/DocumentLogotype-BTYMdpNi.js +162 -0
- package/dist/DocumentVoided-CWr5WMUv.js +33 -0
- package/dist/EmbedInput-SevVEpwc.js +156 -0
- package/dist/EmbedSettings-YMbUmp1O.js +103 -0
- package/dist/ErrorCallout-CQo2iF9c.js +34 -0
- package/dist/FilePreviewModal-C0xBeoAz.js +202 -0
- package/dist/Flag-BObij6SN.js +41 -0
- package/dist/HeaderSettings-C77pR78n.js +720 -0
- package/dist/ImageSelectModal-DKdU-0uq.js +119 -0
- package/dist/ImageUploadWrapper-BGkS5Cll.js +1585 -0
- package/dist/Index-B3y-jq9s.js +1098 -0
- package/dist/Index-B41pUREi.js +47 -0
- package/dist/Index-BEyeS1OG.js +52 -0
- package/dist/Index-BG5j8ZFP.js +93 -0
- package/dist/Index-BOT65yQR.js +68 -0
- package/dist/Index-BQNl-cXP.js +28 -0
- package/dist/Index-BY6xsS7C.js +38 -0
- package/dist/Index-Bh0Xv5ry.js +163 -0
- package/dist/Index-Bn4FSQcx.js +228 -0
- package/dist/Index-BrRIAede.js +87 -0
- package/dist/Index-C-6um0kX.js +76 -0
- package/dist/{Index-C_aIQ908.js → Index-C-gHa5xk.js} +319 -214
- package/dist/Index-C0wcjKCH.js +629 -0
- package/dist/Index-C6BbUFYw.js +160 -0
- package/dist/Index-C8xwJ0m1.js +200 -0
- package/dist/Index-CKgFEJF4.js +140 -0
- package/dist/{Index-Dfq7egc1.js → Index-CQwmu4f1.js} +47 -60
- package/dist/Index-CXchTpBa.js +74 -0
- package/dist/{Index-Ch9r5yhG.js → Index-CYoRt8PA.js} +9 -17
- package/dist/Index-CZZNQ4q5.js +39 -0
- package/dist/Index-CkaAs5ms.js +136 -0
- package/dist/Index-CtpXaBz8.js +363 -0
- package/dist/Index-CxDsSGtZ.js +126 -0
- package/dist/Index-DFkTBm02.js +102 -0
- package/dist/Index-DP3ll8F-.js +70 -0
- package/dist/{Index-RWMPRDAE.js → Index-DPDzMKQa.js} +10 -18
- package/dist/Index-DvxSig3z.js +25 -0
- package/dist/Index-Dzrn3Y6p.js +16 -0
- package/dist/{Index-CRiATiQn.js → Index-LQb0omFE.js} +10 -18
- package/dist/Index-Mt4mSaNT.js +4 -0
- package/dist/Index-_xN_cczo.js +3477 -0
- package/dist/Index-gAz45qgR.js +21 -0
- package/dist/Index-xXLFalgR.js +49 -0
- package/dist/Index-zyZRPz3H.js +28 -0
- package/dist/Index.vue_vue_type_script_lang-Ddo1wo-D.js +671 -0
- package/dist/InputToggleRow-CokEYwm2.js +99 -0
- package/dist/ManualPopover-Dukly7GP.js +65 -0
- package/dist/MediaWrapper-B8msCrQm.js +18 -0
- package/dist/{NotBindingText-CC7TxUqg.js → NotBindingText-DcQd8Eej.js} +13 -17
- package/dist/PackageGroup-clUIUoik.js +1060 -0
- package/dist/PdfTerms-DpzMVRfN.js +34 -0
- package/dist/PdfViewer-CSf4Rtbj.js +392 -0
- package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6KSjjMA.js +17 -0
- package/dist/PriceHeader-Dyweu8aH.js +488 -0
- package/dist/{SearchApi-G2Hvp0Dd.js → SearchApi-Y1fDQn0u.js} +37 -49
- package/dist/SendForm-B9l24WwR.js +6689 -0
- package/dist/Setup-DyzbPFM4.js +47 -0
- package/dist/{SmartList-BynTuXtB.js → SmartList-CWGKoAJh.js} +16 -24
- package/dist/Sortable.vue_vue_type_script_setup_true_lang-C2Gwp6Q-.js +1349 -0
- package/dist/{TermsSettings-cA5YAO77.js → TermsSettings-BeQH307A.js} +169 -56
- package/dist/ThemeColorRow-DFIsPy55.js +105 -0
- package/dist/ToggleBinding-DlH4y1IM.js +44 -0
- package/dist/UploadModal-BZ0mPBBB.js +134 -0
- package/dist/VideoPlayerInput-DBxcTUb7.js +134 -0
- package/dist/VideoPlayerSettings-Dg1OxjOa.js +78 -0
- package/dist/VideoSelectModal-BhbanMix.js +217 -0
- package/dist/{anime.es-BrPTThYb.js → anime.es-4wvNItHq.js} +205 -201
- package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
- package/dist/{dom-Ds4ypDrd.js → dom-CkTGWrfu.js} +3 -6
- package/dist/{focusDrawerMixin-CximZA1J.js → focusDrawerMixin-BVbTYOGr.js} +1 -1
- package/dist/{formDrawerState-CkNGdxn5.js → formDrawerState-CogZ-GVm.js} +2 -2
- package/dist/helpers-B4GUxtdD.js +46 -0
- package/dist/index-BZDey7B-.js +268 -0
- package/dist/index-Bd8_ZHHq.js +188 -0
- package/dist/index-BvyoYp1e.js +508 -0
- package/dist/index-CJZoubA3.js +3525 -0
- package/dist/index-D7yQWP4d.js +125 -0
- package/dist/index-D8hGHka6.js +513 -0
- package/dist/index-Dxy4tf7x.js +149 -0
- package/dist/index.es.js +2 -5
- package/dist/index.umd.js +303 -1486
- package/dist/main-Bn5XkQPb.js +57570 -0
- package/dist/mapFormMixin-C7FJLnbO.js +1528 -0
- package/dist/omit-DrWpFvRJ.js +56 -0
- package/dist/{publicSenderState-CGEm9EYe.js → publicSenderState-tdtCFPMx.js} +4 -4
- package/dist/splitpanes-BApidgjj.js +342 -0
- package/dist/template-CHdf2K2I.js +1572 -0
- package/dist/tippy.esm-Co6FYzEM.js +1994 -0
- package/dist/useTermsModal-VDnO1Lro.js +87 -0
- package/dist/{utils-Dr4AcaE9.js → utils-DZkn0Q9c.js} +8 -11
- package/dist/validation-CqBkar3f.js +40 -0
- package/dist/widget.css +1 -0
- package/package.json +20 -25
- package/dist/AddClientCallout-Br6IhwGH.js +0 -48
- package/dist/AnswerModal-CsWltR6j.js +0 -3879
- package/dist/AttachmentItem-BG7FuSCD.js +0 -85
- package/dist/BaseDatePicker-PSNBtUIh.js +0 -3187
- package/dist/BaseUpload-BfEurAAV.js +0 -1977
- package/dist/BlockMedia-Bo3OfNSU.js +0 -76
- package/dist/CCallout-CAjM8-1X.js +0 -58
- package/dist/CDropdownItem-CN7gSfgY.js +0 -640
- package/dist/CFormField-Clvcf2Jh.js +0 -240
- package/dist/CPhoneInput-CEHXh5jM.js +0 -138
- package/dist/CPriceInput-D2c07SXp.js +0 -116
- package/dist/CSelect-Cz2IPzxS.js +0 -91
- package/dist/CSkeleton-AsnvnD-m.js +0 -55
- package/dist/ClientAutocomplete-CZ55-DKe.js +0 -438
- package/dist/ClientModal-CgUhWZ5L.js +0 -666
- package/dist/ColorPicker-IFGHqH-u.js +0 -2879
- package/dist/CompanyModal-TLSBFo3U.js +0 -147
- package/dist/ContentWrapper-HClxKPuT.js +0 -190
- package/dist/CoverBlockSettings-D99hAa6e.js +0 -659
- package/dist/DocAnswer-CTV_Bpt7.js +0 -36
- package/dist/DocDetails-CQe5htXj.js +0 -263
- package/dist/DocForm-6Efv5_oz.js +0 -5017
- package/dist/DocFormSend-DbXcklxU.js +0 -146
- package/dist/DocLinks-BO545zbL.js +0 -38
- package/dist/DocModalBase-DXHNJ-6i.js +0 -28
- package/dist/DocPrint-Bf2U4FQN.js +0 -240
- package/dist/DocReceipt-CWXvC7bY.js +0 -217
- package/dist/DocSendReminder-CRzBM2NJ.js +0 -140
- package/dist/DocTimeline-DGVOk8-2.js +0 -485
- package/dist/DocumentClient-Das9BaJ7.js +0 -136
- package/dist/DocumentLayout-4q8rmTVT.js +0 -4880
- package/dist/DocumentLogotype-DLncJJAB.js +0 -92
- package/dist/DocumentVoided-CcI9lX27.js +0 -25
- package/dist/EmbedInput-BPdy0lGS.js +0 -117
- package/dist/EmbedSettings-L2iwYLQK.js +0 -74
- package/dist/ErrorCallout-Ds_tBT02.js +0 -27
- package/dist/FilePreviewModal-hxUu330p.js +0 -81
- package/dist/Flag-1-HcT5Dz.js +0 -46
- package/dist/HeaderSettings-C27fMugK.js +0 -440
- package/dist/ImageSelectModal-BKDIyxF4.js +0 -86
- package/dist/ImageUploadWrapper-BiYzUQur.js +0 -1604
- package/dist/Index-5BOWxcPG.js +0 -26
- package/dist/Index-B1Odktov.js +0 -754
- package/dist/Index-B3d5BjEn.js +0 -25
- package/dist/Index-B3sSU_4X.js +0 -54
- package/dist/Index-B5Dqsh3K.js +0 -150
- package/dist/Index-B6aO1c_w.js +0 -62
- package/dist/Index-BGfICxJQ.js +0 -643
- package/dist/Index-BHopC0hv.js +0 -24
- package/dist/Index-BJXcSmp_.js +0 -55
- package/dist/Index-BQe6QjQZ.js +0 -25
- package/dist/Index-BmXx_x6t.js +0 -77
- package/dist/Index-C692qMTG.js +0 -294
- package/dist/Index-CEvbw-3i.js +0 -41
- package/dist/Index-CYSULnpn.js +0 -32
- package/dist/Index-CdtYzwAM.js +0 -107
- package/dist/Index-CetF2FW0.js +0 -230
- package/dist/Index-Cv6XLM20.js +0 -73
- package/dist/Index-Cwy8ff76.js +0 -154
- package/dist/Index-D34z4UEY.js +0 -84
- package/dist/Index-DNCei-lp.js +0 -56
- package/dist/Index-DUbxgIYB.js +0 -2445
- package/dist/Index-DVwn_LLf.js +0 -28
- package/dist/Index-Dla-mesV.js +0 -146
- package/dist/Index-KtUkOPI2.js +0 -58
- package/dist/Index-LjnOTVJk.js +0 -66
- package/dist/Index-ky1SRtfY.js +0 -94
- package/dist/Index-mceZW2NX.js +0 -41
- package/dist/Index-tD3hZjh8.js +0 -144
- package/dist/Index-vM5kDtC2.js +0 -33
- package/dist/InputToggleRow-BmDuSbE2.js +0 -57
- package/dist/ManualPopover-CQfjPvFe.js +0 -60
- package/dist/MediaWrapper-DDzcjR6V.js +0 -23
- package/dist/PackageGroup-mAGXfZDv.js +0 -704
- package/dist/PdfTerms-BH_Nwf2h.js +0 -31
- package/dist/PdfViewer-mBLxI8bA.js +0 -383
- package/dist/PlainHtml-B7gUNNZd.js +0 -27
- package/dist/PriceHeader-DClYMPcq.js +0 -338
- package/dist/SendForm-Cxv_m8Rq.js +0 -1023
- package/dist/Setup-B90VDZTG.js +0 -50
- package/dist/ThemeColorRow-D-Z7w4Wk.js +0 -69
- package/dist/ToggleBinding-DOeTcWzi.js +0 -42
- package/dist/UploadModal-DOPLVEpV.js +0 -95
- package/dist/VideoPlayerInput-1zG06elO.js +0 -97
- package/dist/VideoPlayerSettings-O-4rAYYh.js +0 -61
- package/dist/VideoSelectModal-DzqFrqCg.js +0 -104
- package/dist/answerDocumentMixin-HBiNWYCH.js +0 -51
- package/dist/debounce-Ch1d3526.js +0 -84
- package/dist/formValidationMixin-D_MzsHsR.js +0 -49
- package/dist/index-BNdbPq4J.js +0 -492
- package/dist/index-BXzugeJ6.js +0 -81
- package/dist/index-C5wcxrC6.js +0 -167
- package/dist/index-CgDOs7t4.js +0 -2700
- package/dist/index-Cj-_2coz.js +0 -351
- package/dist/index-DpqV5y0K.js +0 -102
- package/dist/main-BL_yzf2r.js +0 -57357
- package/dist/mapFormMixin-Cu_vkTP-.js +0 -3028
- package/dist/omit-Dfe_H1Ft.js +0 -31
- package/dist/simplebar.min-CRlLD1Oz.js +0 -71
- package/dist/splitpanes-BHUVsCZF.js +0 -382
- package/dist/style.css +0 -4
- package/dist/throttle-BX_w77tW.js +0 -18
- package/dist/tippy.esm-n4arfVzA.js +0 -1805
- package/dist/vuedraggable.umd-DW4PJoZ3.js +0 -3161
- package/dist/vuex.esm-DKGl8mcw.js +0 -467
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { _ as u, aj as r, ak as m, o as i, b as d, s as n, E as c, al as p, $ as o, v as h, f, S as V, n as y } from "./main-Bn5XkQPb.js";
|
|
2
|
+
const S = {
|
|
3
|
+
name: "CSelect",
|
|
4
|
+
mixins: [r, m],
|
|
5
|
+
inheritAttrs: !1,
|
|
6
|
+
props: {
|
|
7
|
+
modelValue: {
|
|
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
|
+
emits: ["blur", "focus", "update:modelValue"],
|
|
26
|
+
data() {
|
|
27
|
+
return {
|
|
28
|
+
selected: this.modelValue,
|
|
29
|
+
_elementRef: "select"
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
computed: {
|
|
33
|
+
computedValue: {
|
|
34
|
+
get() {
|
|
35
|
+
return this.selected;
|
|
36
|
+
},
|
|
37
|
+
set(e) {
|
|
38
|
+
this.selected = e, this.$emit("update:modelValue", e), !this.isValid && this.checkHtml5Validity();
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
spanClasses() {
|
|
42
|
+
return [
|
|
43
|
+
this.size,
|
|
44
|
+
this.statusType,
|
|
45
|
+
{
|
|
46
|
+
"is-fullwidth": this.expanded,
|
|
47
|
+
"is-loading": this.loading,
|
|
48
|
+
"is-multiple": this.multiple,
|
|
49
|
+
"is-rounded": this.rounded,
|
|
50
|
+
"is-empty": this.selected === null
|
|
51
|
+
}
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
watch: {
|
|
56
|
+
/**
|
|
57
|
+
* When v-model is changed:
|
|
58
|
+
* 1. Set the selected option.
|
|
59
|
+
* 2. If it's invalid, validate again.
|
|
60
|
+
*/
|
|
61
|
+
modelValue(e) {
|
|
62
|
+
this.selected = e, !this.isValid && this.checkHtml5Validity();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}, g = ["multiple", "size"], C = {
|
|
66
|
+
key: 0,
|
|
67
|
+
value: null,
|
|
68
|
+
disabled: "",
|
|
69
|
+
hidden: ""
|
|
70
|
+
};
|
|
71
|
+
function b(e, t, l, k, v, a) {
|
|
72
|
+
return i(), d("div", o({
|
|
73
|
+
class: [{ "is-expanded": e.expanded, "has-icons-left": e.icon }, "control"]
|
|
74
|
+
}, e.rootAttrs), [
|
|
75
|
+
n("span", {
|
|
76
|
+
class: y([a.spanClasses, "select"])
|
|
77
|
+
}, [
|
|
78
|
+
c(n("select", o(e.fallthroughAttrs, {
|
|
79
|
+
ref: "select",
|
|
80
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => a.computedValue = s),
|
|
81
|
+
multiple: l.multiple,
|
|
82
|
+
size: l.nativeSize,
|
|
83
|
+
class: l.selectClass,
|
|
84
|
+
onBlur: t[1] || (t[1] = (s) => e.$emit("blur", s) && e.checkHtml5Validity()),
|
|
85
|
+
onFocus: t[2] || (t[2] = (s) => e.$emit("focus", s))
|
|
86
|
+
}), [
|
|
87
|
+
l.placeholder && a.computedValue == null ? (i(), d("option", C, h(l.placeholder), 1)) : f("", !0),
|
|
88
|
+
V(e.$slots, "default", {}, void 0, !0)
|
|
89
|
+
], 16, g), [
|
|
90
|
+
[p, a.computedValue]
|
|
91
|
+
])
|
|
92
|
+
], 2)
|
|
93
|
+
], 16);
|
|
94
|
+
}
|
|
95
|
+
const B = /* @__PURE__ */ u(S, [["render", b], ["__scopeId", "data-v-097f661c"]]);
|
|
96
|
+
export {
|
|
97
|
+
B as C
|
|
98
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { h as b, t as g, i as l, u as C, j as e, o as s, b as n, F as x, k as S, n as i, l as d, f as w } from "./main-Bn5XkQPb.js";
|
|
2
|
+
const $ = /* @__PURE__ */ b({
|
|
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(r) {
|
|
16
|
+
const c = r, {
|
|
17
|
+
active: f,
|
|
18
|
+
animated: m,
|
|
19
|
+
width: t,
|
|
20
|
+
height: a,
|
|
21
|
+
circle: v,
|
|
22
|
+
rounded: p,
|
|
23
|
+
count: h,
|
|
24
|
+
hidden: y,
|
|
25
|
+
color: u
|
|
26
|
+
} = g(c), k = l(() => ({
|
|
27
|
+
height: a.value === void 0 ? null : isNaN(Number(a.value)) ? a.value : `${a.value}px`,
|
|
28
|
+
width: t.value === void 0 ? null : isNaN(Number(t.value)) ? t.value : `${t.value}px`,
|
|
29
|
+
borderRadius: v.value ? "50%" : null,
|
|
30
|
+
background: u.value ? u.value : null
|
|
31
|
+
})), o = C(), B = l(() => o.style), N = l(() => o.class);
|
|
32
|
+
return (z, F) => e(f) ? (s(), n("div", {
|
|
33
|
+
key: 0,
|
|
34
|
+
class: i([
|
|
35
|
+
"c-skeleton",
|
|
36
|
+
{ "is-animated": e(m), "is-invisible": e(y) },
|
|
37
|
+
N.value
|
|
38
|
+
]),
|
|
39
|
+
style: d(B.value)
|
|
40
|
+
}, [
|
|
41
|
+
(s(!0), n(x, null, S(e(h), (_) => (s(), n("div", {
|
|
42
|
+
key: _,
|
|
43
|
+
class: i(["c-skeleton-item", { "is-rounded": e(p) }]),
|
|
44
|
+
style: d(k.value)
|
|
45
|
+
}, null, 6))), 128))
|
|
46
|
+
], 6)) : w("", !0);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
$ as _
|
|
51
|
+
};
|
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
import { S as E } from "./SearchApi-Y1fDQn0u.js";
|
|
2
|
+
import { _ as B, Y as O, aj as H, ak as F, o as d, b as c, d as V, $ as S, ae as m, an as v, w as p, E as $, G as T, s as w, l as C, S as y, f, F as x, k as _, n as A, ai as L, e as g, v as h, aE as D, c as b, B as R } from "./main-Bn5XkQPb.js";
|
|
3
|
+
import { c as P, r as z, g as N } from "./helpers-B4GUxtdD.js";
|
|
4
|
+
const q = {
|
|
5
|
+
name: "CAutocomplete",
|
|
6
|
+
components: {
|
|
7
|
+
CInput: O
|
|
8
|
+
},
|
|
9
|
+
mixins: [H, F],
|
|
10
|
+
props: {
|
|
11
|
+
modelValue: {
|
|
12
|
+
type: [Number, String],
|
|
13
|
+
default: null
|
|
14
|
+
},
|
|
15
|
+
data: {
|
|
16
|
+
type: Array,
|
|
17
|
+
default: () => []
|
|
18
|
+
},
|
|
19
|
+
field: {
|
|
20
|
+
type: String,
|
|
21
|
+
default: "value"
|
|
22
|
+
},
|
|
23
|
+
keepFirst: Boolean,
|
|
24
|
+
clearOnSelect: Boolean,
|
|
25
|
+
openOnFocus: Boolean,
|
|
26
|
+
customFormatter: {
|
|
27
|
+
type: Function,
|
|
28
|
+
default: () => {
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
checkInfiniteScroll: Boolean,
|
|
32
|
+
keepOpen: Boolean,
|
|
33
|
+
clearable: Boolean,
|
|
34
|
+
maxHeight: {
|
|
35
|
+
type: [String, Number],
|
|
36
|
+
default: null
|
|
37
|
+
},
|
|
38
|
+
dropdownPosition: {
|
|
39
|
+
type: String,
|
|
40
|
+
default: "auto"
|
|
41
|
+
},
|
|
42
|
+
iconRight: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: null
|
|
45
|
+
},
|
|
46
|
+
iconRightClickable: Boolean,
|
|
47
|
+
appendToBody: Boolean
|
|
48
|
+
},
|
|
49
|
+
emits: [
|
|
50
|
+
"active",
|
|
51
|
+
"blur",
|
|
52
|
+
"focus",
|
|
53
|
+
"icon-click",
|
|
54
|
+
"icon-right-click",
|
|
55
|
+
"infinite-scroll",
|
|
56
|
+
"select",
|
|
57
|
+
"select-footer",
|
|
58
|
+
"select-header",
|
|
59
|
+
"typing",
|
|
60
|
+
"update:modelValue"
|
|
61
|
+
],
|
|
62
|
+
data() {
|
|
63
|
+
return {
|
|
64
|
+
selected: null,
|
|
65
|
+
hovered: null,
|
|
66
|
+
isActive: !1,
|
|
67
|
+
newValue: this.modelValue,
|
|
68
|
+
newAutocomplete: this.autocomplete || "off",
|
|
69
|
+
isListInViewportVertically: !0,
|
|
70
|
+
hasFocus: !1,
|
|
71
|
+
style: {},
|
|
72
|
+
_isAutocomplete: !0,
|
|
73
|
+
_elementRef: "input",
|
|
74
|
+
_bodyEl: void 0,
|
|
75
|
+
// Used to append to body
|
|
76
|
+
timeOutID: null
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
computed: {
|
|
80
|
+
/**
|
|
81
|
+
* White-listed items to not close when clicked.
|
|
82
|
+
* Add input, dropdown and all children.
|
|
83
|
+
*/
|
|
84
|
+
whiteList() {
|
|
85
|
+
const e = [];
|
|
86
|
+
if (e.push(this.$refs.input.$el.querySelector("input")), e.push(this.$refs.dropdown), this.$refs.dropdown != null) {
|
|
87
|
+
const t = this.$refs.dropdown.querySelectorAll("*");
|
|
88
|
+
for (const i of t)
|
|
89
|
+
e.push(i);
|
|
90
|
+
}
|
|
91
|
+
if (this.$parent.$data._isTaginput) {
|
|
92
|
+
e.push(this.$parent.$el);
|
|
93
|
+
const t = this.$parent.$el.querySelectorAll("*");
|
|
94
|
+
for (const i of t)
|
|
95
|
+
e.push(i);
|
|
96
|
+
}
|
|
97
|
+
return e;
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* Check if exists default slot
|
|
101
|
+
*/
|
|
102
|
+
hasDefaultSlot() {
|
|
103
|
+
return !!this.$slots.default;
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* Check if exists "empty" slot
|
|
107
|
+
*/
|
|
108
|
+
hasEmptySlot() {
|
|
109
|
+
return !!this.$slots.empty;
|
|
110
|
+
},
|
|
111
|
+
/**
|
|
112
|
+
* Check if exists "header" slot
|
|
113
|
+
*/
|
|
114
|
+
hasHeaderSlot() {
|
|
115
|
+
return !!this.$slots.header;
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* Check if exists "footer" slot
|
|
119
|
+
*/
|
|
120
|
+
hasFooterSlot() {
|
|
121
|
+
return !!this.$slots.footer;
|
|
122
|
+
},
|
|
123
|
+
/**
|
|
124
|
+
* Apply dropdownPosition property
|
|
125
|
+
*/
|
|
126
|
+
isOpenedTop() {
|
|
127
|
+
return this.dropdownPosition === "top" || this.dropdownPosition === "auto" && !this.isListInViewportVertically;
|
|
128
|
+
},
|
|
129
|
+
newIconRight() {
|
|
130
|
+
return this.clearable && this.newValue ? "close-circle" : this.iconRight;
|
|
131
|
+
},
|
|
132
|
+
newIconRightClickable() {
|
|
133
|
+
return this.clearable ? !0 : this.iconRightClickable;
|
|
134
|
+
},
|
|
135
|
+
contentStyle() {
|
|
136
|
+
return {
|
|
137
|
+
maxHeight: this.maxHeight === void 0 ? null : isNaN(this.maxHeight) ? this.maxHeight : `${this.maxHeight}px`
|
|
138
|
+
};
|
|
139
|
+
},
|
|
140
|
+
isDropdownOpen() {
|
|
141
|
+
return this.isActive && (this.data.length > 0 || this.hasEmptySlot || this.hasHeaderSlot || this.hasFooterSlot);
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
watch: {
|
|
145
|
+
/**
|
|
146
|
+
* When dropdown is toggled, check the visibility to know when
|
|
147
|
+
* to open upwards.
|
|
148
|
+
*/
|
|
149
|
+
isActive(e) {
|
|
150
|
+
this.dropdownPosition === "auto" && (e ? this.calcDropdownInViewportVertical() : this.timeOutID = setTimeout(() => {
|
|
151
|
+
this.calcDropdownInViewportVertical();
|
|
152
|
+
}, 100)), this.$nextTick(() => {
|
|
153
|
+
this.$emit("active", e);
|
|
154
|
+
}), e && this.$nextTick(() => this.setHovered(null));
|
|
155
|
+
},
|
|
156
|
+
/**
|
|
157
|
+
* When updating input's value
|
|
158
|
+
* 1. Emit changes
|
|
159
|
+
* 2. If value isn't the same as selected, set null
|
|
160
|
+
* 3. Close dropdown if value is clear or else open it
|
|
161
|
+
*/
|
|
162
|
+
newValue(e) {
|
|
163
|
+
this.$emit("update:modelValue", e);
|
|
164
|
+
const t = this.getValue(this.selected);
|
|
165
|
+
t && t !== e && this.setSelected(null, !1), this.hasFocus && (!this.openOnFocus || e) && (this.isActive = !!e);
|
|
166
|
+
},
|
|
167
|
+
/**
|
|
168
|
+
* When v-model is changed:
|
|
169
|
+
* 1. Update internal value.
|
|
170
|
+
* 2. If it's invalid, validate again.
|
|
171
|
+
*/
|
|
172
|
+
modelValue(e) {
|
|
173
|
+
this.newValue = e;
|
|
174
|
+
},
|
|
175
|
+
/**
|
|
176
|
+
* Select first option if "keep-first
|
|
177
|
+
*/
|
|
178
|
+
data(e) {
|
|
179
|
+
this.keepFirst && this.selectFirstOption(e);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
created() {
|
|
183
|
+
typeof window < "u" && (document.addEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.addEventListener("resize", this.calcDropdownInViewportVertical));
|
|
184
|
+
},
|
|
185
|
+
mounted() {
|
|
186
|
+
if (this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content")) {
|
|
187
|
+
const e = this.$refs.dropdown.querySelector(".dropdown-content");
|
|
188
|
+
e.addEventListener(
|
|
189
|
+
"scroll",
|
|
190
|
+
() => this.checkIfReachedTheEndOfScroll(e)
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
this.appendToBody && (this.$data._bodyEl = P(this.$refs.dropdown), this.updateAppendToBody());
|
|
194
|
+
},
|
|
195
|
+
beforeUnmount() {
|
|
196
|
+
typeof window < "u" && (document.removeEventListener("click", this.clickedOutside), this.dropdownPosition === "auto" && window.removeEventListener(
|
|
197
|
+
"resize",
|
|
198
|
+
this.calcDropdownInViewportVertical
|
|
199
|
+
)), this.checkInfiniteScroll && this.$refs.dropdown && this.$refs.dropdown.querySelector(".dropdown-content") && this.$refs.dropdown.querySelector(".dropdown-content").removeEventListener("scroll", this.checkIfReachedTheEndOfScroll), this.appendToBody && z(this.$data._bodyEl), clearTimeout(this.timeOutID);
|
|
200
|
+
},
|
|
201
|
+
methods: {
|
|
202
|
+
/**
|
|
203
|
+
* Set which option is currently hovered.
|
|
204
|
+
*/
|
|
205
|
+
setHovered(e) {
|
|
206
|
+
e !== void 0 && (this.hovered = e);
|
|
207
|
+
},
|
|
208
|
+
/**
|
|
209
|
+
* Set which option is currently selected, update v-model,
|
|
210
|
+
* update input value and close dropdown.
|
|
211
|
+
*/
|
|
212
|
+
setSelected(e, t = !0) {
|
|
213
|
+
e !== void 0 && (this.selected = e, this.$emit("select", this.selected), this.selected !== null && (this.newValue = this.clearOnSelect ? "" : this.getValue(this.selected), this.setHovered(this.clearOnSelect ? null : this.hovered)), t && this.$nextTick(() => {
|
|
214
|
+
this.isActive = !1;
|
|
215
|
+
}), this.checkValidity());
|
|
216
|
+
},
|
|
217
|
+
/**
|
|
218
|
+
* Select first option
|
|
219
|
+
*/
|
|
220
|
+
selectFirstOption(e) {
|
|
221
|
+
this.$nextTick(() => {
|
|
222
|
+
e.length ? (this.openOnFocus || this.newValue !== "" && this.hovered !== e[0]) && this.setHovered(e[0]) : this.setHovered(null);
|
|
223
|
+
});
|
|
224
|
+
},
|
|
225
|
+
/**
|
|
226
|
+
* Enter key listener.
|
|
227
|
+
* Select the hovered option.
|
|
228
|
+
*/
|
|
229
|
+
enterPressed(e) {
|
|
230
|
+
this.isDropdownOpen && (e.preventDefault(), this.hovered !== null && this.setSelected(this.hovered, !this.keepOpen));
|
|
231
|
+
},
|
|
232
|
+
/**
|
|
233
|
+
* Tab key listener.
|
|
234
|
+
* Select hovered option if it exists, close dropdown, then allow
|
|
235
|
+
* native handling to move to next tabbable element.
|
|
236
|
+
*/
|
|
237
|
+
tabPressed() {
|
|
238
|
+
if (this.hovered === null) {
|
|
239
|
+
this.isActive = !1;
|
|
240
|
+
return;
|
|
241
|
+
}
|
|
242
|
+
this.setSelected(this.hovered, !this.keepOpen);
|
|
243
|
+
},
|
|
244
|
+
/**
|
|
245
|
+
* Close dropdown if clicked outside.
|
|
246
|
+
*/
|
|
247
|
+
clickedOutside(e) {
|
|
248
|
+
var i;
|
|
249
|
+
const t = ((i = e.path) == null ? void 0 : i[0]) || e.target;
|
|
250
|
+
this.whiteList.indexOf(t) < 0 && (this.isActive = !1);
|
|
251
|
+
},
|
|
252
|
+
/**
|
|
253
|
+
* Return display text for the input.
|
|
254
|
+
* If object, get value from path, or else just the value.
|
|
255
|
+
*/
|
|
256
|
+
getValue(e) {
|
|
257
|
+
if (e !== null)
|
|
258
|
+
return typeof this.customFormatter < "u" ? this.customFormatter(e) : typeof e == "object" ? N(e, this.field) : e;
|
|
259
|
+
},
|
|
260
|
+
/**
|
|
261
|
+
* Check if the scroll list inside the dropdown
|
|
262
|
+
* reached it's end.
|
|
263
|
+
*/
|
|
264
|
+
checkIfReachedTheEndOfScroll(e) {
|
|
265
|
+
e.clientHeight !== e.scrollHeight && e.scrollTop + e.clientHeight >= e.scrollHeight && this.$emit("infinite-scroll");
|
|
266
|
+
},
|
|
267
|
+
/**
|
|
268
|
+
* Calculate if the dropdown is vertically visible when activated,
|
|
269
|
+
* otherwise it is openened upwards.
|
|
270
|
+
*/
|
|
271
|
+
calcDropdownInViewportVertical() {
|
|
272
|
+
this.$nextTick(() => {
|
|
273
|
+
if (this.$refs.dropdown == null) return;
|
|
274
|
+
const e = this.$refs.dropdown.getBoundingClientRect();
|
|
275
|
+
this.isListInViewportVertically = e.top >= 0 && e.bottom <= (window.innerHeight || document.documentElement.clientHeight), this.appendToBody && this.updateAppendToBody();
|
|
276
|
+
});
|
|
277
|
+
},
|
|
278
|
+
/**
|
|
279
|
+
* Arrows keys listener.
|
|
280
|
+
* If dropdown is active, set hovered option, or else just open.
|
|
281
|
+
*/
|
|
282
|
+
keyArrows(e) {
|
|
283
|
+
const t = e === "down" ? 1 : -1;
|
|
284
|
+
if (this.isActive) {
|
|
285
|
+
let i = this.data.indexOf(this.hovered) + t;
|
|
286
|
+
i = i > this.data.length - 1 ? this.data.length : i, i = i < 0 ? 0 : i, this.setHovered(this.data[i]);
|
|
287
|
+
const l = this.$refs.dropdown.querySelector(".dropdown-content"), s = l.querySelectorAll(
|
|
288
|
+
"a.dropdown-item:not(.is-disabled)"
|
|
289
|
+
)[i];
|
|
290
|
+
if (!s) return;
|
|
291
|
+
const o = l.scrollTop, a = l.scrollTop + l.clientHeight - s.clientHeight;
|
|
292
|
+
s.offsetTop < o ? l.scrollTop = s.offsetTop : s.offsetTop >= a && (l.scrollTop = s.offsetTop - l.clientHeight + s.clientHeight);
|
|
293
|
+
} else
|
|
294
|
+
this.isActive = !0;
|
|
295
|
+
},
|
|
296
|
+
/**
|
|
297
|
+
* Focus listener.
|
|
298
|
+
* If value is the same as selected, select all text.
|
|
299
|
+
*/
|
|
300
|
+
focused(e) {
|
|
301
|
+
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", e);
|
|
302
|
+
},
|
|
303
|
+
/**
|
|
304
|
+
* Blur listener.
|
|
305
|
+
*/
|
|
306
|
+
onBlur(e) {
|
|
307
|
+
this.hasFocus = !1, this.$emit("blur", e);
|
|
308
|
+
},
|
|
309
|
+
onInput() {
|
|
310
|
+
const e = this.getValue(this.selected);
|
|
311
|
+
e && e === this.newValue || (this.$emit("typing", this.newValue), this.checkValidity());
|
|
312
|
+
},
|
|
313
|
+
rightIconClick(e) {
|
|
314
|
+
this.clearable ? this.newValue = "" : this.$emit("icon-right-click", e);
|
|
315
|
+
},
|
|
316
|
+
checkValidity() {
|
|
317
|
+
this.useHtml5Validation && this.$nextTick(() => {
|
|
318
|
+
this.checkHtml5Validity();
|
|
319
|
+
});
|
|
320
|
+
},
|
|
321
|
+
updateAppendToBody() {
|
|
322
|
+
var i, l;
|
|
323
|
+
const e = this.$refs.dropdown, t = (l = (i = this.$parent) == null ? void 0 : i.$data) != null && l._isTaginput ? this.$parent.$el : this.$refs.input.$el;
|
|
324
|
+
if (e && t) {
|
|
325
|
+
const s = this.$data._bodyEl;
|
|
326
|
+
s.classList.forEach((u) => s.classList.remove(u)), s.classList.add("autocomplete"), s.classList.add("control"), this.expandend && s.classList.add("is-expandend");
|
|
327
|
+
const o = t.getBoundingClientRect();
|
|
328
|
+
let a = o.top + window.scrollY;
|
|
329
|
+
const n = o.left + window.scrollX;
|
|
330
|
+
this.isOpenedTop ? a -= e.clientHeight : a += t.clientHeight, this.style = {
|
|
331
|
+
position: "absolute",
|
|
332
|
+
top: `${a}px`,
|
|
333
|
+
left: `${n}px`,
|
|
334
|
+
width: `${t.clientWidth}px`,
|
|
335
|
+
maxWidth: `${t.clientWidth}px`,
|
|
336
|
+
zIndex: "99"
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}, M = {
|
|
342
|
+
key: 0,
|
|
343
|
+
class: "dropdown-item"
|
|
344
|
+
}, K = ["onClick"], Q = { key: 1 }, U = {
|
|
345
|
+
key: 1,
|
|
346
|
+
class: "dropdown-item is-disabled"
|
|
347
|
+
}, W = {
|
|
348
|
+
key: 2,
|
|
349
|
+
class: "dropdown-item"
|
|
350
|
+
};
|
|
351
|
+
function j(e, t, i, l, s, o) {
|
|
352
|
+
const a = g("CInput");
|
|
353
|
+
return d(), c("div", S({
|
|
354
|
+
class: ["autocomplete control", { "is-expanded": e.expanded }]
|
|
355
|
+
}, e.rootAttrs), [
|
|
356
|
+
V(a, S({
|
|
357
|
+
modelValue: s.newValue,
|
|
358
|
+
"onUpdate:modelValue": t[0] || (t[0] = (n) => s.newValue = n),
|
|
359
|
+
ref: "input",
|
|
360
|
+
size: e.size,
|
|
361
|
+
loading: e.loading,
|
|
362
|
+
rounded: e.rounded,
|
|
363
|
+
icon: e.icon,
|
|
364
|
+
"icon-right": o.newIconRight,
|
|
365
|
+
"icon-right-clickable": o.newIconRightClickable,
|
|
366
|
+
"icon-pack": e.iconPack,
|
|
367
|
+
maxlength: e.maxlength,
|
|
368
|
+
autocomplete: s.newAutocomplete,
|
|
369
|
+
"use-html5-validation": !1,
|
|
370
|
+
type: "text"
|
|
371
|
+
}, e.fallthroughAttrs, {
|
|
372
|
+
"onUpdate:modelValue": o.onInput,
|
|
373
|
+
onFocus: o.focused,
|
|
374
|
+
onBlur: o.onBlur,
|
|
375
|
+
onKeyup: t[1] || (t[1] = m(v((n) => s.isActive = !1, ["prevent"]), ["esc"])),
|
|
376
|
+
onKeydown: [
|
|
377
|
+
m(o.tabPressed, ["tab"]),
|
|
378
|
+
m(o.enterPressed, ["enter"]),
|
|
379
|
+
t[2] || (t[2] = m(v((n) => o.keyArrows("up"), ["prevent"]), ["up"])),
|
|
380
|
+
t[3] || (t[3] = m(v((n) => o.keyArrows("down"), ["prevent"]), ["down"]))
|
|
381
|
+
],
|
|
382
|
+
onIconRightClick: o.rightIconClick,
|
|
383
|
+
onIconClick: t[4] || (t[4] = (n) => e.$emit("icon-click", n))
|
|
384
|
+
}), null, 16, ["modelValue", "size", "loading", "rounded", "icon", "icon-right", "icon-right-clickable", "icon-pack", "maxlength", "autocomplete", "onUpdate:modelValue", "onFocus", "onBlur", "onKeydown", "onIconRightClick"]),
|
|
385
|
+
V(L, { name: "fade" }, {
|
|
386
|
+
default: p(() => [
|
|
387
|
+
$(w("div", {
|
|
388
|
+
ref: "dropdown",
|
|
389
|
+
class: A([{ "is-opened-top": o.isOpenedTop && !i.appendToBody }, "dropdown-menu"]),
|
|
390
|
+
style: C(s.style)
|
|
391
|
+
}, [
|
|
392
|
+
$(w("div", {
|
|
393
|
+
style: C(o.contentStyle),
|
|
394
|
+
class: "dropdown-content"
|
|
395
|
+
}, [
|
|
396
|
+
o.hasHeaderSlot ? (d(), c("div", M, [
|
|
397
|
+
y(e.$slots, "header")
|
|
398
|
+
])) : f("", !0),
|
|
399
|
+
(d(!0), c(x, null, _(i.data, (n, u) => (d(), c("a", {
|
|
400
|
+
key: u,
|
|
401
|
+
class: A([{ "is-hovered": n === s.hovered }, "dropdown-item"]),
|
|
402
|
+
onClick: (k) => o.setSelected(n, void 0, k)
|
|
403
|
+
}, [
|
|
404
|
+
o.hasDefaultSlot ? y(e.$slots, "default", {
|
|
405
|
+
key: 0,
|
|
406
|
+
option: n,
|
|
407
|
+
index: u
|
|
408
|
+
}) : (d(), c("span", Q, h(o.getValue(n, !0)), 1))
|
|
409
|
+
], 10, K))), 128)),
|
|
410
|
+
i.data.length === 0 && o.hasEmptySlot ? (d(), c("div", U, [
|
|
411
|
+
y(e.$slots, "empty")
|
|
412
|
+
])) : f("", !0),
|
|
413
|
+
o.hasFooterSlot ? (d(), c("div", W, [
|
|
414
|
+
y(e.$slots, "footer")
|
|
415
|
+
])) : f("", !0)
|
|
416
|
+
], 4), [
|
|
417
|
+
[T, s.isActive]
|
|
418
|
+
])
|
|
419
|
+
], 6), [
|
|
420
|
+
[T, o.isDropdownOpen]
|
|
421
|
+
])
|
|
422
|
+
]),
|
|
423
|
+
_: 3
|
|
424
|
+
})
|
|
425
|
+
], 16);
|
|
426
|
+
}
|
|
427
|
+
const Y = /* @__PURE__ */ B(q, [["render", j]]), G = {
|
|
428
|
+
i18nOptions: {
|
|
429
|
+
namespaces: "components",
|
|
430
|
+
keyPrefix: "account.documentForm.clients"
|
|
431
|
+
},
|
|
432
|
+
name: "ClientAutocomplete",
|
|
433
|
+
components: {
|
|
434
|
+
SearchApi: E,
|
|
435
|
+
CAutocomplete: Y
|
|
436
|
+
},
|
|
437
|
+
props: {
|
|
438
|
+
searchEnabled: {
|
|
439
|
+
type: Boolean,
|
|
440
|
+
default: !0
|
|
441
|
+
},
|
|
442
|
+
showLoading: {
|
|
443
|
+
type: Boolean,
|
|
444
|
+
default: !1
|
|
445
|
+
},
|
|
446
|
+
showEmpty: {
|
|
447
|
+
type: Boolean,
|
|
448
|
+
default: !1
|
|
449
|
+
},
|
|
450
|
+
filled: {
|
|
451
|
+
type: Boolean,
|
|
452
|
+
default: !1
|
|
453
|
+
}
|
|
454
|
+
},
|
|
455
|
+
emits: ["input", "setClient", "add"],
|
|
456
|
+
data() {
|
|
457
|
+
return {
|
|
458
|
+
convertToNewClient: D,
|
|
459
|
+
results: [],
|
|
460
|
+
// results when searching for existing endCustomer
|
|
461
|
+
searchQuery: ""
|
|
462
|
+
// query used to search for endCustomers
|
|
463
|
+
};
|
|
464
|
+
},
|
|
465
|
+
methods: {
|
|
466
|
+
search(e, t) {
|
|
467
|
+
this.$emit("input", t), this.searchEnabled && (this.searchQuery = t, e({
|
|
468
|
+
q: t,
|
|
469
|
+
cb: ({ endCustomer: i }) => {
|
|
470
|
+
this.results = i;
|
|
471
|
+
}
|
|
472
|
+
}));
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
}, X = { style: { "line-height": "1.5" } }, J = { style: { "font-weight": "500" } }, Z = {
|
|
476
|
+
class: "text-gray-600",
|
|
477
|
+
style: { "font-size": "14px" }
|
|
478
|
+
}, ee = { key: 0 }, te = { key: 0 };
|
|
479
|
+
function ie(e, t, i, l, s, o) {
|
|
480
|
+
const a = g("CButton"), n = g("CAutocomplete"), u = g("SearchApi");
|
|
481
|
+
return d(), b(u, { "custom-search": { endCustomer: !0 } }, {
|
|
482
|
+
default: p(({ fetch: k, isLoading: I }) => [
|
|
483
|
+
V(n, S({
|
|
484
|
+
placeholder: e.$t("search.placeholder"),
|
|
485
|
+
...e.$attrs,
|
|
486
|
+
...e.$props
|
|
487
|
+
}, {
|
|
488
|
+
data: s.results,
|
|
489
|
+
loading: i.showLoading && I,
|
|
490
|
+
filled: i.filled,
|
|
491
|
+
expanded: "",
|
|
492
|
+
"keep-first": "",
|
|
493
|
+
onTyping: (r) => o.search(k, r),
|
|
494
|
+
onSelect: t[1] || (t[1] = (r) => e.$emit("setClient", s.convertToNewClient(r)))
|
|
495
|
+
}), {
|
|
496
|
+
default: p(({ option: r }) => [
|
|
497
|
+
w("div", X, [
|
|
498
|
+
w("div", J, h(r.name || r.email), 1),
|
|
499
|
+
w("div", Z, h(r.reference ? `${r.reference} · ` : "") + " " + h(r.workStreet || r.street || " "), 1)
|
|
500
|
+
])
|
|
501
|
+
]),
|
|
502
|
+
footer: p(() => [
|
|
503
|
+
i.searchEnabled && i.showEmpty ? (d(), c("div", ee, [
|
|
504
|
+
s.searchQuery && !s.results.length ? (d(), b(a, {
|
|
505
|
+
key: 0,
|
|
506
|
+
type: "secondary",
|
|
507
|
+
pattern: "tertiary",
|
|
508
|
+
size: "small",
|
|
509
|
+
style: { "font-weight": "600" },
|
|
510
|
+
onClick: t[0] || (t[0] = (r) => e.$emit("add"))
|
|
511
|
+
}, {
|
|
512
|
+
default: p(() => [
|
|
513
|
+
R(h(e.$t("_common:add")), 1)
|
|
514
|
+
]),
|
|
515
|
+
_: 1
|
|
516
|
+
})) : f("", !0)
|
|
517
|
+
])) : f("", !0)
|
|
518
|
+
]),
|
|
519
|
+
empty: p(() => [
|
|
520
|
+
i.searchEnabled && i.showEmpty ? (d(), c("div", te, h(e.$t("search.empty")) + " " + h(s.searchQuery), 1)) : f("", !0)
|
|
521
|
+
]),
|
|
522
|
+
_: 2
|
|
523
|
+
}, 1040, ["data", "loading", "filled", "onTyping"])
|
|
524
|
+
]),
|
|
525
|
+
_: 1
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
const le = /* @__PURE__ */ B(G, [["render", ie]]);
|
|
529
|
+
export {
|
|
530
|
+
le as C,
|
|
531
|
+
Y as a
|
|
532
|
+
};
|