@cling-se/widget 1.0.0-beta.1 → 1.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/README.internal.md +82 -0
- package/README.md +14 -40
- package/README.public.md +14 -0
- package/dist/AddClientCallout-e8d19R3f.js +101 -0
- package/dist/AnswerModal-BGvB8IVV.js +3291 -0
- package/dist/AttachmentItem-CkHbAm4l.js +171 -0
- package/dist/BaseUpload-BiJBcWRu.js +2472 -0
- package/dist/BlockMedia-CW5wgipC.js +103 -0
- package/dist/CCallout-Cy2eeIYd.js +104 -0
- package/dist/{CCurrencyDropdown-qH-3m2eP.js → CCurrencyDropdown-DE_3CTjm.js} +91 -49
- package/dist/CDropdownItem-Dmq5gYzA.js +751 -0
- package/dist/CFormField.vue_vue_type_script_setup_true_lang-D_U9coAY.js +292 -0
- package/dist/{CPhoneFormat-CfQayFxw.js → CPhoneFormat-BS2nP9kc.js} +13 -21
- package/dist/CPhoneInput-Bf6329PO.js +207 -0
- package/dist/CPriceInput-d1yjuMQr.js +140 -0
- package/dist/CSelect-DgnT07Hk.js +98 -0
- package/dist/CSkeleton.vue_vue_type_script_setup_true_lang-Ckl--dyv.js +51 -0
- package/dist/ClientAutocomplete-9JzGcO9O.js +532 -0
- package/dist/ClientModal-BzWQtWSZ.js +1181 -0
- package/dist/ColorPicker-BvoFN8nu.js +1408 -0
- package/dist/CompanyModal-Bp4V_az9.js +250 -0
- package/dist/ContentWrapper-CuH6xKmo.js +265 -0
- package/dist/CoverBlockSettings-BA5L0Zee.js +861 -0
- package/dist/DocAnswer-BcNA_KEg.js +33 -0
- package/dist/DocDetails-CStEwWnU.js +448 -0
- package/dist/DocForm-BOoILf5E.js +6748 -0
- package/dist/DocFormSend-CQIf-HJY.js +171 -0
- package/dist/DocLinks-BRX5QzNe.js +36 -0
- package/dist/DocModalBase-D72yWj-x.js +29 -0
- package/dist/DocPrint-BI1LXUPE.js +399 -0
- package/dist/DocReceipt-DaZ4V76p.js +341 -0
- package/dist/DocSendReminder-DKGZlo7s.js +181 -0
- package/dist/DocTextEditor-Dm-cTZpA.js +19413 -0
- package/dist/DocTimeline-DCwofzuk.js +537 -0
- package/dist/DocumentClient-vJdxCB53.js +90 -0
- package/dist/DocumentLayout-CKSi42ev.js +1368 -0
- package/dist/DocumentLogotype-DbQlvQ-y.js +162 -0
- package/dist/DocumentVoided-CRX2WxWO.js +33 -0
- package/dist/EmbedInput-B-oeC4Wy.js +157 -0
- package/dist/EmbedSettings-B9Yka2yB.js +103 -0
- package/dist/ErrorCallout-B_ygH33E.js +34 -0
- package/dist/FilePreviewModal-Bf3ELTow.js +202 -0
- package/dist/Flag-BwTgCNHO.js +41 -0
- package/dist/HeaderSettings-DvC7nlyY.js +720 -0
- package/dist/ImageSelectModal-D3sP3lhR.js +119 -0
- package/dist/ImageUploadWrapper-RWNa-yIq.js +1585 -0
- package/dist/Index-0_3ULrWX.js +126 -0
- package/dist/Index-4NPe0sfX.js +629 -0
- package/dist/Index-B1uA0FF6.js +4 -0
- package/dist/Index-BBkCYm2q.js +201 -0
- package/dist/{Index-DIOiMm9f.js → Index-BBwvo7S9.js} +10 -18
- package/dist/Index-BEMlsYwJ.js +68 -0
- package/dist/Index-BRBhJ6kz.js +21 -0
- package/dist/{Index--qPMWUMT.js → Index-BTFmHjUt.js} +48 -61
- package/dist/Index-BcUNnxLC.js +1098 -0
- package/dist/Index-Bo6ExBUL.js +93 -0
- package/dist/Index-BvMPCgdH.js +102 -0
- package/dist/Index-Bx5TOI9k.js +74 -0
- package/dist/Index-C7GZS8EI.js +16 -0
- package/dist/Index-CNWhm07R.js +25 -0
- package/dist/{Index-DcQbh-z2.js → Index-CQpznMKV.js} +9 -17
- package/dist/Index-CRzsnIij.js +159 -0
- package/dist/Index-CeSG1C41.js +140 -0
- package/dist/Index-CjfjdZj5.js +52 -0
- package/dist/Index-CskKmZpd.js +363 -0
- package/dist/Index-D5qwbCo1.js +28 -0
- package/dist/Index-D8Ae1Txt.js +228 -0
- package/dist/Index-DE8aenDB.js +3452 -0
- package/dist/Index-DI5EB5Rt.js +39 -0
- package/dist/Index-DaV57YPP.js +163 -0
- package/dist/Index-DbwkmoyM.js +38 -0
- package/dist/Index-Df9skok6.js +70 -0
- package/dist/{Index-Bu0MGrj6.js → Index-DfLLA0ij.js} +313 -206
- package/dist/Index-Dw1CO5F9.js +76 -0
- package/dist/Index-PZXyOoVb.js +87 -0
- package/dist/{Index-D4XgxmbD.js → Index-ZUnH-BHj.js} +10 -18
- package/dist/Index-cjKGSiDi.js +136 -0
- package/dist/Index-m-goRuKD.js +49 -0
- package/dist/Index-rGeWbLcB.js +47 -0
- package/dist/Index-vrljNp6G.js +28 -0
- package/dist/Index.vue_vue_type_script_lang-aeVuChGF.js +671 -0
- package/dist/InputToggleRow-v6qAWPg6.js +99 -0
- package/dist/ManualPopover-BONBJIUA.js +57 -0
- package/dist/MediaWrapper-CXb2UGd9.js +18 -0
- package/dist/{NotBindingText-CNV2Wmdx.js → NotBindingText-BqESO13N.js} +13 -17
- package/dist/PackageGroup-AIysVmyh.js +1058 -0
- package/dist/PdfTerms-BlhHdTu3.js +34 -0
- package/dist/PdfViewer-DwZ1rwlN.js +392 -0
- package/dist/PlainHtml.vue_vue_type_script_setup_true_lang-D6NNUTz0.js +17 -0
- package/dist/PriceHeader-C4XhnoA3.js +488 -0
- package/dist/SearchApi-B7lXgUY6.js +137 -0
- package/dist/SendForm-BcD0xSvB.js +7031 -0
- package/dist/Setup-C2qaYDei.js +47 -0
- package/dist/{SmartList-Qgu0rMrI.js → SmartList-DqG7Q5t7.js} +16 -24
- package/dist/Sortable.vue_vue_type_script_setup_true_lang-CzMbr8AX.js +1303 -0
- package/dist/{TermsSettings-CE3h_xkm.js → TermsSettings-BOCONyM4.js} +169 -49
- package/dist/ThemeColorRow-sjGdMzGN.js +108 -0
- package/dist/ToggleBinding-7oq_oXPt.js +44 -0
- package/dist/UploadModal-C_X2NjVY.js +134 -0
- package/dist/VideoPlayerInput-BsUcmpl4.js +135 -0
- package/dist/VideoPlayerSettings-BXMmxaZQ.js +78 -0
- package/dist/VideoSelectModal-CW0OweCw.js +217 -0
- package/dist/{anime.es-BrPTThYb.js → anime.es-gdcpA-eY.js} +1 -2
- package/dist/{color-TdtKxwVa.js → color-HetJPhlA.js} +1 -2
- package/dist/{debounce-C1AuSpOZ.js → debounce-DNl99Gyo.js} +7 -7
- package/dist/dom-CkTGWrfu.js +69 -0
- package/dist/{focusDrawerMixin-Be6BAK8-.js → focusDrawerMixin-BwcErMDY.js} +1 -1
- package/dist/{formDrawerState-DRbg5rVI.js → formDrawerState-DaurePnd.js} +2 -2
- package/dist/helpers-CPW--XIz.js +44 -0
- package/dist/index-BjiGCJPI.js +149 -0
- package/dist/index-CFNv6OvX.js +188 -0
- package/dist/index-Cx71On5Z.js +508 -0
- package/dist/index-DKMxIBz_.js +270 -0
- package/dist/index-DKf5SGLD.js +125 -0
- package/dist/index-E32WgUp9.js +3525 -0
- package/dist/index-kp-GC5I0.js +513 -0
- package/dist/index.es.js +2 -5
- package/dist/index.umd.js +306 -1505
- package/dist/{main-WKzC-Dnu.js → main-Cb-nyil1.js} +33252 -33755
- package/dist/mapFormMixin-D3BihYWW.js +1544 -0
- package/dist/omit--YYr41Xp.js +31 -0
- package/dist/{publicSenderState-BujjYsZZ.js → publicSenderState-CdRW_Wwp.js} +4 -4
- package/dist/regions-BdZt9Srn.js +1250 -0
- package/dist/splitpanes-D-ThFkeR.js +342 -0
- package/dist/style.css +1 -4
- package/dist/template-BvaNnq-g.js +1493 -0
- package/dist/{throttle-CWPJmFid.js → throttle-D-bUGaVh.js} +2 -2
- package/dist/tippy.esm-BmKNqohP.js +1994 -0
- package/dist/useTermsModal-Dhf6_eYb.js +87 -0
- package/dist/{utils-CA_Zy6u1.js → utils-CBPcYdLv.js} +8 -11
- package/dist/validation-DOcUOoMe.js +40 -0
- package/package.json +25 -31
- package/.eslintrc.cjs +0 -4
- package/dist/AddClientCallout-BWnvyBcK.js +0 -46
- package/dist/AnswerModal-CLGRdSnK.js +0 -3874
- package/dist/AttachmentItem-BPS0-wyc.js +0 -78
- package/dist/BaseDatePicker-BbmV_GdD.js +0 -3183
- package/dist/BaseUpload-9gPgI7r6.js +0 -1977
- package/dist/BlockMedia-DkPFWiYL.js +0 -76
- package/dist/CCallout-T26jwUby.js +0 -59
- package/dist/CDropdownItem-BE8BAMD1.js +0 -636
- package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +0 -1
- package/dist/CFormField-DECEfoVq.js +0 -241
- package/dist/CPriceInput-C4SOB-P5.js +0 -112
- package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +0 -1
- package/dist/ClientAutocomplete-DSebA1Mx.js +0 -78
- package/dist/ClientModal-BXFYvYCF.js +0 -625
- package/dist/ColorPicker-CZ_bJabP.js +0 -2879
- package/dist/CompanyModal-CDr3t28n.js +0 -141
- package/dist/ContentWrapper-BwmMoe4W.js +0 -183
- package/dist/CoverBlockSettings-_F11-DGc.js +0 -275
- package/dist/DocAnswer-BR59xzkT.js +0 -36
- package/dist/DocDetails-D1qbCbps.js +0 -259
- package/dist/DocForm-DBc2a7z5.js +0 -7272
- package/dist/DocFormSend-Casix-yG.js +0 -144
- package/dist/DocLinks-DGTaewyX.js +0 -38
- package/dist/DocModalBase-BbS_qvSv.js +0 -28
- package/dist/DocPrint-0PqX3mbJ.js +0 -240
- package/dist/DocReceipt-CU3VD5pt.js +0 -210
- package/dist/DocSendReminder-CuycBspr.js +0 -137
- package/dist/DocTextEditor-CntS2Bd-.js +0 -17180
- package/dist/DocTimeline-DJuv3yBe.js +0 -481
- package/dist/DocumentClient-C25XXzz6.js +0 -136
- package/dist/DocumentLayout-B7afHRMr.js +0 -4909
- package/dist/DocumentLogotype-sqI51wvM.js +0 -87
- package/dist/DocumentVoided-TahdTSMn.js +0 -25
- package/dist/EmbedInput-BY-wHSfc.js +0 -113
- package/dist/EmbedSettings-8pfjk4NP.js +0 -72
- package/dist/ErrorCallout-Dsr8PNsU.js +0 -28
- package/dist/FilePreviewModal-CcEinEFg.js +0 -81
- package/dist/Flag-PJKrghi9.js +0 -114
- package/dist/HeaderSettings-BqczIOsG.js +0 -392
- package/dist/ImageSelectModal-Cd-HhKnH.js +0 -84
- package/dist/ImageUploadWrapper-Dv43rGdb.js +0 -1604
- package/dist/Index-6b5VBKE-.js +0 -107
- package/dist/Index-B4pRJnbw.js +0 -84
- package/dist/Index-B69f8qgZ.js +0 -62
- package/dist/Index-B79YN9RO.js +0 -25
- package/dist/Index-BBrlPoe8.js +0 -58
- package/dist/Index-BXfWJCuq.js +0 -52
- package/dist/Index-Bd76vb37.js +0 -55
- package/dist/Index-BmbtQO5F.js +0 -150
- package/dist/Index-ByV_kJaH.js +0 -77
- package/dist/Index-CDV5rhWS.js +0 -49
- package/dist/Index-CIx4OOK-.js +0 -144
- package/dist/Index-CL1OWLt6.js +0 -223
- package/dist/Index-Caow0eZu.js +0 -31
- package/dist/Index-Cd3-3PEK.js +0 -2402
- package/dist/Index-CdpZBEKU.js +0 -98
- package/dist/Index-CmU3Sys-.js +0 -754
- package/dist/Index-CtRtgnpm.js +0 -32
- package/dist/Index-Cukkr33D.js +0 -140
- package/dist/Index-Cuqw0ios.js +0 -57
- package/dist/Index-Czm_WdqC.js +0 -25
- package/dist/Index-DNdYXHgr.js +0 -33
- package/dist/Index-DcuBxutp.js +0 -642
- package/dist/Index-DpWNWiyY.js +0 -291
- package/dist/Index-DzS1rZdF.js +0 -24
- package/dist/Index-N6s5pZxv.js +0 -26
- package/dist/Index-g_DNu4mt.js +0 -69
- package/dist/Index-mJ8F41GY.js +0 -154
- package/dist/Index-q7W9KA8m.js +0 -21
- package/dist/Index-rtzblZp4.js +0 -70
- package/dist/InputToggleRow-CZjxsDOQ.js +0 -57
- package/dist/ManualPopover-CZrWiT-P.js +0 -58
- package/dist/MediaWrapper-D37qK4KR.js +0 -23
- package/dist/PackageGroup-Heo_s8ct.js +0 -699
- package/dist/PdfTerms-AB9tXAtU.js +0 -36
- package/dist/PdfViewer-CIVkvOBr.js +0 -373
- package/dist/PlainHtml-CPmIebjY.js +0 -20
- package/dist/PriceHeader-DhDAruwX.js +0 -339
- package/dist/SearchApi-BMgdaI4s.js +0 -161
- package/dist/Setup-VIaIV9uT.js +0 -50
- package/dist/ThemeColorRow-DYJNgk6S.js +0 -67
- package/dist/ToggleBinding-CuwCeYpO.js +0 -38
- package/dist/UploadModal-BITcxG-J.js +0 -95
- package/dist/VideoPlayerInput-8szEX_8L.js +0 -93
- package/dist/VideoPlayerSettings-BIPytm6w.js +0 -61
- package/dist/VideoSelectModal-B-Pe34nb.js +0 -100
- package/dist/answerDocumentMixin-W7vE1Gp4.js +0 -51
- package/dist/formComponentsInstall-Bm3VMOh6.js +0 -2507
- package/dist/formValidationMixin-COkY8COk.js +0 -49
- package/dist/index-BFvjENMH.js +0 -81
- package/dist/index-BV2nGWay.js +0 -492
- package/dist/index-BgJ05dYc.js +0 -165
- package/dist/index-CMPAXxzs.js +0 -347
- package/dist/index-DNDjI5uI.js +0 -3916
- package/dist/index-aoff9oUi.js +0 -102
- package/dist/mapFormMixin-QbevCwJK.js +0 -72
- package/dist/omit-CTp9CXoU.js +0 -31
- package/dist/splitpanes-BHUVsCZF.js +0 -382
- package/dist/tinycolor-kTl0yxzz.js +0 -633
- package/dist/tippy.esm-sS5koDSU.js +0 -1799
- package/dist/vuedraggable.umd-BA3ZDRAp.js +0 -3161
- package/dist/vuex.esm-DKGl8mcw.js +0 -467
- package/public/favicon.ico +0 -0
- package/tsconfig.json +0 -26
- package/tsconfig.node.json +0 -10
- package/tsconfig.paths.json +0 -17
- package/vite.config.ts +0 -60
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
import { m as v } from "./mapFormMixin-D3BihYWW.js";
|
|
2
|
+
import { B as A } from "./BlockMedia-CW5wgipC.js";
|
|
3
|
+
import { aa as u, A as C, _ as b, o as n, d as s, s as i, n as f, l as w, v as r, f as l, B as T, z as N, b as h, c as _, F as V, b2 as F, e as x, Z as P } from "./main-Cb-nyil1.js";
|
|
4
|
+
import { u as B } from "./DocumentLayout-CKSi42ev.js";
|
|
5
|
+
import { t as D } from "./template-BvaNnq-g.js";
|
|
6
|
+
import { s as L } from "./dom-CkTGWrfu.js";
|
|
7
|
+
import { T as j } from "./DocTextEditor-Dm-cTZpA.js";
|
|
8
|
+
import { i as z } from "./i18nMessages-Chz_lxGG.js";
|
|
9
|
+
const M = {
|
|
10
|
+
name: "SummaryBottom",
|
|
11
|
+
mixins: [v([])],
|
|
12
|
+
props: {
|
|
13
|
+
base: {
|
|
14
|
+
type: Object,
|
|
15
|
+
default: null
|
|
16
|
+
},
|
|
17
|
+
options: {
|
|
18
|
+
type: Array,
|
|
19
|
+
default: () => []
|
|
20
|
+
},
|
|
21
|
+
backgroundColor: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: "#4c576d"
|
|
24
|
+
},
|
|
25
|
+
documentCurrency: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: !0
|
|
28
|
+
},
|
|
29
|
+
vatType: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: !0
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
setup() {
|
|
35
|
+
return { docWidth: B() };
|
|
36
|
+
},
|
|
37
|
+
data() {
|
|
38
|
+
return {
|
|
39
|
+
get: u,
|
|
40
|
+
tinycolor: D
|
|
41
|
+
};
|
|
42
|
+
},
|
|
43
|
+
computed: {
|
|
44
|
+
prices() {
|
|
45
|
+
return u(this, "base.prices") || {};
|
|
46
|
+
},
|
|
47
|
+
isIndivid() {
|
|
48
|
+
return u(this.prices, "helpers.isIndivid", !0);
|
|
49
|
+
},
|
|
50
|
+
showIncVat() {
|
|
51
|
+
return this.isIndivid;
|
|
52
|
+
},
|
|
53
|
+
priceTotal() {
|
|
54
|
+
return this.isIndivid ? u(this.prices, "total", null) : u(this.prices, "subTotal", null);
|
|
55
|
+
},
|
|
56
|
+
priceType() {
|
|
57
|
+
return this.prices.type || ["fixed"];
|
|
58
|
+
},
|
|
59
|
+
currency() {
|
|
60
|
+
return this.prices.currency || this.documentCurrency;
|
|
61
|
+
},
|
|
62
|
+
openAccMaxPrice() {
|
|
63
|
+
return this.prices.maxTotal || null;
|
|
64
|
+
},
|
|
65
|
+
houseWorkType() {
|
|
66
|
+
return u(this.prices, "region.houseWorkType", null);
|
|
67
|
+
},
|
|
68
|
+
isReverseVat() {
|
|
69
|
+
return u(this.prices, "region.reverseVat", !1);
|
|
70
|
+
},
|
|
71
|
+
priceTypeString() {
|
|
72
|
+
return this.priceType.includes("openAccMaxPrice") ? this._document.$t("price.openAccMaxPrice") : this.priceType.includes("openAcc") ? this._document.$t("price.openAcc") : this._document.$t("price.price").capitalize();
|
|
73
|
+
},
|
|
74
|
+
priceDeductionVatString() {
|
|
75
|
+
let e = "";
|
|
76
|
+
if (this.isReverseVat && !this.showIncVat) {
|
|
77
|
+
const o = this.priceFormat(0, {
|
|
78
|
+
currency: this.currency,
|
|
79
|
+
showZero: !0
|
|
80
|
+
});
|
|
81
|
+
return e = this._document.$t("summaryBottom.reverseVat", { amount: o }), e;
|
|
82
|
+
}
|
|
83
|
+
return this.houseWorkType && (e = this._document.$t("deduction.afterType", {
|
|
84
|
+
type: this.$t(`deduction.${this.houseWorkType}_percentage`)
|
|
85
|
+
})), this.showIncVat && (e += ` ${this._document.$t("vat.incVat", {
|
|
86
|
+
thing: this._document.$t(`vat.${this.vatType}`)
|
|
87
|
+
})}`), this.showIncVat || (e += ` ${this._document.$t("vat.exVat", {
|
|
88
|
+
thing: this._document.$t(`vat.${this.vatType}`)
|
|
89
|
+
})}`), e.capitalize();
|
|
90
|
+
},
|
|
91
|
+
backgroundSecondary() {
|
|
92
|
+
if (!this.isSmallScreen) return { backgroundColor: "transparent" };
|
|
93
|
+
const e = this.backgroundColor.match(/(\d*\.)?\d+/g)[0], o = this.backgroundColor.match(/(\d*\.)?\d+/g)[1], t = this.backgroundColor.match(/(\d*\.)?\d+/g)[2], c = this.backgroundColor.match(/(\d*\.)?\d+/g)[3];
|
|
94
|
+
return {
|
|
95
|
+
backgroundColor: `hsla(${e}, ${o ** 0.9}%, ${t ** 0.9}%, ${c})`
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
isSmallScreen() {
|
|
99
|
+
return this.docWidth <= 576;
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
methods: {
|
|
103
|
+
priceFormat: C,
|
|
104
|
+
scrollToPricing() {
|
|
105
|
+
const e = document.querySelector("#price");
|
|
106
|
+
e && L(e);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}, I = { class: "summary-bottom-root" }, W = { class: "price-type-string data-text" }, H = {
|
|
110
|
+
key: 0,
|
|
111
|
+
class: "price-deduction-text"
|
|
112
|
+
}, E = {
|
|
113
|
+
key: 0,
|
|
114
|
+
class: "open-acc-wrapper"
|
|
115
|
+
}, $ = {
|
|
116
|
+
key: 0,
|
|
117
|
+
class: "open-acc-item"
|
|
118
|
+
}, O = { class: "open-acc-link" }, U = {
|
|
119
|
+
class: "data-text",
|
|
120
|
+
style: { "font-size": "calc(2 * var(--rem))", "font-weight": "900", "letter-spacing": "1px", "line-height": "1", "padding-bottom": "calc(0.3 * var(--rem))" }
|
|
121
|
+
}, q = {
|
|
122
|
+
key: 2,
|
|
123
|
+
class: "label-text caps price-deduction-text",
|
|
124
|
+
style: { "margin-top": "4px" }
|
|
125
|
+
}, Z = {
|
|
126
|
+
key: 1,
|
|
127
|
+
class: "flex w-full items-center justify-end",
|
|
128
|
+
style: { height: "108px" }
|
|
129
|
+
}, R = { style: { "text-align": "right", padding: "calc(2 * var(--rem))" } }, G = { style: { "font-size": "calc(1.5 * var(--rem))", "font-weight": "900" } }, J = { style: { "background-color": "hsla(0, 0%, 0%, 0.15)", paadding: "calc(1 * var(--rem)) calc(2 * var(--rem))", height: "100%", display: "inline-flex" } }, K = {
|
|
130
|
+
key: 0,
|
|
131
|
+
style: { padding: "calc(2 * var(--rem))", display: "inline-flex", "align-items": "center", "justify-content": "center", "font-weight": "900", "font-size": "calc(2.5 * var(--rem))" }
|
|
132
|
+
}, Q = {
|
|
133
|
+
key: 1,
|
|
134
|
+
style: { display: "flex", "flex-direction": "column", "align-items": "flex-start", "justify-content": "center", padding: "calc(1 * var(--rem)) calc(1 * var(--rem))", "text-align": "left" }
|
|
135
|
+
}, X = { style: { "font-weight": "900", "font-size": "calc(1.5 * var(--rem))" } };
|
|
136
|
+
function Y(e, o, t, c, d, a) {
|
|
137
|
+
return n(), s("section", I, [
|
|
138
|
+
i("div", {
|
|
139
|
+
style: w([
|
|
140
|
+
{
|
|
141
|
+
backgroundColor: t.backgroundColor,
|
|
142
|
+
color: d.tinycolor.readability(t.backgroundColor, "#FFF") > 2.2 ? "#FFF" : "#000"
|
|
143
|
+
},
|
|
144
|
+
t.options.length && {
|
|
145
|
+
overflow: "hidden",
|
|
146
|
+
padding: 0
|
|
147
|
+
}
|
|
148
|
+
]),
|
|
149
|
+
class: "summary-bottom"
|
|
150
|
+
}, [
|
|
151
|
+
t.options.length ? (n(), s("div", Z, [
|
|
152
|
+
i("div", R, [
|
|
153
|
+
i("div", G, r(e._document.$t("price.proposal")), 1),
|
|
154
|
+
i("div", null, r(e._document.$t("summaryBottom.chooseFrom")), 1)
|
|
155
|
+
]),
|
|
156
|
+
i("div", J, [
|
|
157
|
+
t.base ? (n(), s("div", Q, [
|
|
158
|
+
i("div", X, r(a.priceFormat(t.base.prices.total, {
|
|
159
|
+
currency: a.currency,
|
|
160
|
+
decimals: 2,
|
|
161
|
+
hideZeroDecimals: !0
|
|
162
|
+
})), 1),
|
|
163
|
+
i("div", null, " + " + r(e._document.$tc("summaryBottom.option", { count: t.options.length })), 1)
|
|
164
|
+
])) : (n(), s("div", K, r(e._document.$t("summaryBottom.noOfOptions", {
|
|
165
|
+
count: t.options.length
|
|
166
|
+
})), 1))
|
|
167
|
+
]),
|
|
168
|
+
o[1] || (o[1] = i("div", { style: { "background-color": "hsla(0, 0%, 0%, 0.4)", overflow: "hidden", width: "calc(1.5 * var(--rem))", display: "flex", "flex-direction": "column", "justify-content": "center", "align-items": "center", height: "100%", color: "hsla(0, 0%, 100%, 0.2)" } }, null, -1))
|
|
169
|
+
])) : (n(), s("div", {
|
|
170
|
+
key: 0,
|
|
171
|
+
class: f([[
|
|
172
|
+
{
|
|
173
|
+
column: a.isSmallScreen,
|
|
174
|
+
sm: a.isSmallScreen
|
|
175
|
+
}
|
|
176
|
+
], "flex w-full justify-between"]),
|
|
177
|
+
style: { position: "relative" }
|
|
178
|
+
}, [
|
|
179
|
+
i("div", {
|
|
180
|
+
class: f(["flex w-full flex-col", [{ "fixed-price-type-string": a.isSmallScreen }]]),
|
|
181
|
+
style: w([{ "background-color": "hsl(224, 57%, 39%)" }, [a.backgroundSecondary]])
|
|
182
|
+
}, [
|
|
183
|
+
i("div", W, r(a.priceTypeString), 1),
|
|
184
|
+
a.isSmallScreen ? l("", !0) : (n(), s("div", H, r(a.priceDeductionVatString), 1))
|
|
185
|
+
], 6),
|
|
186
|
+
a.priceType.some((m) => ["openAcc", "openAccMaxPrice"].includes(m)) ? (n(), s("div", E, [
|
|
187
|
+
a.openAccMaxPrice ? (n(), s("div", $, [
|
|
188
|
+
i("div", null, r(e._document.$t("price.maxPrice").capitalize()) + " " + r(e._document.$t("vat.exVat", {
|
|
189
|
+
thing: e._document.$t(`vat.${t.vatType}`)
|
|
190
|
+
})) + ": ", 1),
|
|
191
|
+
i("div", null, r(a.priceFormat(a.openAccMaxPrice, { currency: a.currency })), 1)
|
|
192
|
+
])) : l("", !0),
|
|
193
|
+
i("div", O, [
|
|
194
|
+
T(r(e._document.$t("see").capitalize()) + " ", 1),
|
|
195
|
+
i("span", {
|
|
196
|
+
style: { color: "inherit", cursor: "pointer" },
|
|
197
|
+
onClick: o[0] || (o[0] = (...m) => a.scrollToPricing && a.scrollToPricing(...m))
|
|
198
|
+
}, [
|
|
199
|
+
i("u", null, r(e._document.$t("price.price_plural")), 1)
|
|
200
|
+
]),
|
|
201
|
+
T(" " + r(e._document.$t("summaryBottom.forDetails")), 1)
|
|
202
|
+
])
|
|
203
|
+
])) : (n(), s("div", {
|
|
204
|
+
key: 1,
|
|
205
|
+
class: f([[{ "justify-end": !a.isSmallScreen }], "flex w-full items-center"])
|
|
206
|
+
}, [
|
|
207
|
+
i("div", U, r(a.priceType.includes("approx") ? e._document.$t("approx").capitalize() : "") + " " + r(a.priceFormat(a.priceTotal, {
|
|
208
|
+
currency: a.currency,
|
|
209
|
+
decimals: 2,
|
|
210
|
+
hideZeroDecimals: !0
|
|
211
|
+
})), 1)
|
|
212
|
+
], 2)),
|
|
213
|
+
a.isSmallScreen ? (n(), s("div", q, r(a.priceDeductionVatString), 1)) : l("", !0)
|
|
214
|
+
], 2))
|
|
215
|
+
], 4)
|
|
216
|
+
]);
|
|
217
|
+
}
|
|
218
|
+
const ee = /* @__PURE__ */ b(M, [["render", Y], ["__scopeId", "data-v-7ac386a1"]]), te = {
|
|
219
|
+
name: "SummaryTop",
|
|
220
|
+
i18nOptions: {
|
|
221
|
+
namespaces: "summaryTop",
|
|
222
|
+
messages: z
|
|
223
|
+
},
|
|
224
|
+
components: {
|
|
225
|
+
TextEditor: j,
|
|
226
|
+
DocumentLogotype: N(
|
|
227
|
+
() => import("./DocumentLogotype-DbQlvQ-y.js")
|
|
228
|
+
)
|
|
229
|
+
},
|
|
230
|
+
emits: ["update:logotype", "update:doc-name"],
|
|
231
|
+
mixins: [v([])],
|
|
232
|
+
props: {
|
|
233
|
+
showLogo: {
|
|
234
|
+
type: Boolean,
|
|
235
|
+
default: !0
|
|
236
|
+
},
|
|
237
|
+
logotype: {
|
|
238
|
+
type: String,
|
|
239
|
+
default: null
|
|
240
|
+
},
|
|
241
|
+
companyLogotype: {
|
|
242
|
+
type: String,
|
|
243
|
+
default: null
|
|
244
|
+
},
|
|
245
|
+
senderName: {
|
|
246
|
+
type: String,
|
|
247
|
+
default: null
|
|
248
|
+
},
|
|
249
|
+
docName: {
|
|
250
|
+
type: String,
|
|
251
|
+
default: null
|
|
252
|
+
},
|
|
253
|
+
docType: {
|
|
254
|
+
type: String,
|
|
255
|
+
required: !0
|
|
256
|
+
},
|
|
257
|
+
docNumber: {
|
|
258
|
+
type: [Number, String],
|
|
259
|
+
default: null
|
|
260
|
+
},
|
|
261
|
+
sentAt: {
|
|
262
|
+
type: [String, Number],
|
|
263
|
+
default: null
|
|
264
|
+
// required: true,
|
|
265
|
+
},
|
|
266
|
+
expiresAt: {
|
|
267
|
+
type: String,
|
|
268
|
+
default: null
|
|
269
|
+
},
|
|
270
|
+
estimatedTime: {
|
|
271
|
+
type: String,
|
|
272
|
+
default: null
|
|
273
|
+
},
|
|
274
|
+
validator: {
|
|
275
|
+
type: Object,
|
|
276
|
+
default: () => ({})
|
|
277
|
+
},
|
|
278
|
+
hasHover: {
|
|
279
|
+
type: Boolean,
|
|
280
|
+
default: !1
|
|
281
|
+
}
|
|
282
|
+
},
|
|
283
|
+
setup() {
|
|
284
|
+
return { docWidth: B() };
|
|
285
|
+
}
|
|
286
|
+
}, oe = { class: "summary-top flex w-full justify-center" }, ae = { class: "doc-summary-top-wrapper" }, ie = {
|
|
287
|
+
class: "flex w-full justify-between",
|
|
288
|
+
style: { "margin-bottom": "calc(2.5 * var(--rem))" }
|
|
289
|
+
}, re = {
|
|
290
|
+
key: 1,
|
|
291
|
+
class: "company-name"
|
|
292
|
+
}, ne = { class: "top-right-text-wrapper" }, se = { key: 0 }, ce = { key: 1 }, le = { class: "title-text" }, de = ["innerHTML"], me = { class: "flex w-full justify-between" }, ue = {
|
|
293
|
+
key: 0,
|
|
294
|
+
class: "data-group"
|
|
295
|
+
}, pe = { class: "label-text caps" }, ye = { class: "data-text" }, he = {
|
|
296
|
+
key: 1,
|
|
297
|
+
class: "data-group"
|
|
298
|
+
}, ge = { class: "label-text caps" }, fe = { class: "data-text" }, _e = {
|
|
299
|
+
key: 0,
|
|
300
|
+
class: "data-group"
|
|
301
|
+
}, ve = { class: "label-text caps" }, be = { class: "data-text" };
|
|
302
|
+
function ke(e, o, t, c, d, a) {
|
|
303
|
+
const m = h("DocumentLogotype"), g = h("TextEditor");
|
|
304
|
+
return n(), s("section", oe, [
|
|
305
|
+
i("div", ae, [
|
|
306
|
+
o[2] || (o[2] = i("div", { class: "doc-summary-top-wrapper__background" }, null, -1)),
|
|
307
|
+
i("div", ie, [
|
|
308
|
+
t.showLogo && (t.logotype || t.companyLogotype) || e.canEdit ? (n(), _(m, {
|
|
309
|
+
key: 0,
|
|
310
|
+
"model-value": t.logotype,
|
|
311
|
+
"show-logo": t.showLogo,
|
|
312
|
+
"company-logotype": t.companyLogotype,
|
|
313
|
+
"has-hover": t.hasHover,
|
|
314
|
+
"onUpdate:modelValue": o[0] || (o[0] = (p) => e.$emit("update:logotype", p))
|
|
315
|
+
}, null, 8, ["model-value", "show-logo", "company-logotype", "has-hover"])) : (n(), s("div", re, r(t.senderName), 1)),
|
|
316
|
+
i("div", ne, [
|
|
317
|
+
t.sentAt ? (n(), s("div", se, r(e.$formatDate(t.sentAt)), 1)) : l("", !0),
|
|
318
|
+
t.docNumber ? (n(), s("div", ce, " #" + r(t.docNumber), 1)) : l("", !0)
|
|
319
|
+
])
|
|
320
|
+
]),
|
|
321
|
+
i("div", le, [
|
|
322
|
+
e.canEdit ? (n(), _(g, {
|
|
323
|
+
key: 1,
|
|
324
|
+
ref: "editor",
|
|
325
|
+
"model-value": t.docName,
|
|
326
|
+
placeholder: e.$t("name.placeholder"),
|
|
327
|
+
extensions: {
|
|
328
|
+
bulletList: !1,
|
|
329
|
+
heading: [1, 2, 3],
|
|
330
|
+
bold: !1,
|
|
331
|
+
link: !1,
|
|
332
|
+
underline: !1,
|
|
333
|
+
blockquote: !0,
|
|
334
|
+
table: !1
|
|
335
|
+
},
|
|
336
|
+
unstyled: "",
|
|
337
|
+
class: "no-drag",
|
|
338
|
+
static: "",
|
|
339
|
+
style: { "will-change": "opacity" },
|
|
340
|
+
"onUpdate:modelValue": o[1] || (o[1] = (p) => e.$emit("update:doc-name", p))
|
|
341
|
+
}, null, 8, ["model-value", "placeholder"])) : (n(), s("div", {
|
|
342
|
+
key: 0,
|
|
343
|
+
class: "quill-custom",
|
|
344
|
+
innerHTML: t.docName
|
|
345
|
+
}, null, 8, de))
|
|
346
|
+
]),
|
|
347
|
+
i("div", me, [
|
|
348
|
+
t.expiresAt ? (n(), s("div", ue, [
|
|
349
|
+
i("div", pe, r(e._document.$t("replyBy")), 1),
|
|
350
|
+
i("div", ye, r(e.$formatDate(t.expiresAt)), 1)
|
|
351
|
+
])) : l("", !0),
|
|
352
|
+
t.docType !== "document" ? (n(), s("div", he, [
|
|
353
|
+
i("div", ge, r(e._document.$t("document").capitalize()), 1),
|
|
354
|
+
i("div", fe, r(e._document.$t(`series.${t.docType}`).capitalize()), 1)
|
|
355
|
+
])) : l("", !0),
|
|
356
|
+
c.docWidth >= 576 ? (n(), s(V, { key: 2 }, [
|
|
357
|
+
t.estimatedTime ? (n(), s("div", _e, [
|
|
358
|
+
i("div", ve, r(e.$t("estimatedTime")), 1),
|
|
359
|
+
i("div", be, r(e._document.$t("approx")) + " " + r(t.estimatedTime), 1)
|
|
360
|
+
])) : l("", !0)
|
|
361
|
+
], 64)) : l("", !0)
|
|
362
|
+
])
|
|
363
|
+
])
|
|
364
|
+
]);
|
|
365
|
+
}
|
|
366
|
+
const Se = /* @__PURE__ */ b(te, [["render", ke], ["__scopeId", "data-v-8f85211e"]]), we = {
|
|
367
|
+
name: "PriceHeader",
|
|
368
|
+
components: {
|
|
369
|
+
SummaryTop: Se,
|
|
370
|
+
SummaryBottom: ee,
|
|
371
|
+
BlockMedia: A
|
|
372
|
+
},
|
|
373
|
+
emits: ["input"],
|
|
374
|
+
mixins: [
|
|
375
|
+
v([
|
|
376
|
+
"media",
|
|
377
|
+
"backgroundColor",
|
|
378
|
+
"documentName",
|
|
379
|
+
"showPriceSummary",
|
|
380
|
+
"showLogo",
|
|
381
|
+
"logotype"
|
|
382
|
+
])
|
|
383
|
+
],
|
|
384
|
+
props: {
|
|
385
|
+
_document: {
|
|
386
|
+
type: Object,
|
|
387
|
+
default: () => ({})
|
|
388
|
+
},
|
|
389
|
+
_value: {
|
|
390
|
+
type: Object,
|
|
391
|
+
default: () => ({})
|
|
392
|
+
},
|
|
393
|
+
hasHover: {
|
|
394
|
+
type: Boolean,
|
|
395
|
+
default: !1
|
|
396
|
+
}
|
|
397
|
+
},
|
|
398
|
+
computed: {
|
|
399
|
+
internalName: {
|
|
400
|
+
get() {
|
|
401
|
+
var e;
|
|
402
|
+
return this.documentName || `<p data-typography="title">${((e = this._document.data) == null ? void 0 : e.name) || ""}</p>`;
|
|
403
|
+
},
|
|
404
|
+
set(e) {
|
|
405
|
+
this.documentName = e, this.$emit("input", {
|
|
406
|
+
key: "data.name",
|
|
407
|
+
value: F(e).trim().slice(0, 255)
|
|
408
|
+
});
|
|
409
|
+
}
|
|
410
|
+
},
|
|
411
|
+
company() {
|
|
412
|
+
return this._document.sender.company;
|
|
413
|
+
},
|
|
414
|
+
prices() {
|
|
415
|
+
return this._document.prices;
|
|
416
|
+
},
|
|
417
|
+
estimatedTimeString() {
|
|
418
|
+
var t, c;
|
|
419
|
+
const { value: e, unitType: o } = ((c = (t = this._document) == null ? void 0 : t.data) == null ? void 0 : c.estimatedTime) || {};
|
|
420
|
+
return !e || !o ? null : this.$tc(`${o}`, { count: e });
|
|
421
|
+
},
|
|
422
|
+
sendAtShowDate() {
|
|
423
|
+
const { sentAt: e, scheduledFirstDelivery: o } = this._document;
|
|
424
|
+
return e || (o ? o.sendAt : null);
|
|
425
|
+
},
|
|
426
|
+
summaryBottom() {
|
|
427
|
+
var c;
|
|
428
|
+
let e = {
|
|
429
|
+
show: !1,
|
|
430
|
+
backgroundColor: this.backgroundColor || this._document.theme.priceSummaryBackground,
|
|
431
|
+
documentCurrency: this._document.currency,
|
|
432
|
+
vatType: this._document.vatType
|
|
433
|
+
}, { showPriceSummary: o } = this;
|
|
434
|
+
typeof o != "boolean" && ({ showPriceSummary: o } = this._document.theme);
|
|
435
|
+
const t = ((c = this._document.packageGroups) == null ? void 0 : c.packages) || [];
|
|
436
|
+
return t.length > 1 ? e = {
|
|
437
|
+
...e,
|
|
438
|
+
show: o,
|
|
439
|
+
base: { prices: this.prices },
|
|
440
|
+
options: t.filter(({ toggable: d }) => d).map(({ prices: d }) => ({ prices: d }))
|
|
441
|
+
} : e = {
|
|
442
|
+
...e,
|
|
443
|
+
show: o && this._document.readPrices && (this.prices.total || this.prices.type.some(
|
|
444
|
+
(d) => ["openAccMaxPrice", "openAcc"].includes(d)
|
|
445
|
+
)),
|
|
446
|
+
base: { prices: this.prices }
|
|
447
|
+
}, this.canEdit && o && (e.show = !0), e.documentCurrency || (e.show = !1), e;
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}, Te = { class: "doc-jumbotron-wrapper" };
|
|
451
|
+
function xe(e, o, t, c, d, a) {
|
|
452
|
+
var k, S;
|
|
453
|
+
const m = h("BlockMedia"), g = h("SummaryTop"), p = h("SummaryBottom");
|
|
454
|
+
return n(), s("div", null, [
|
|
455
|
+
i("div", Te, [
|
|
456
|
+
x(m, {
|
|
457
|
+
media: {
|
|
458
|
+
...e.media,
|
|
459
|
+
resourceUrl: ((k = e.media) == null ? void 0 : k.resourceUrl) || t._document.theme.background,
|
|
460
|
+
overlayColor: ((S = e.media) == null ? void 0 : S.overlayColor) || t._document.theme.backgroundFilter
|
|
461
|
+
},
|
|
462
|
+
class: "price-media-wrapper"
|
|
463
|
+
}, null, 8, ["media"]),
|
|
464
|
+
x(g, {
|
|
465
|
+
"show-logo": e.showLogo,
|
|
466
|
+
"onUpdate:showLogo": o[0] || (o[0] = (y) => e.showLogo = y),
|
|
467
|
+
logotype: e.logotype,
|
|
468
|
+
"onUpdate:logotype": o[1] || (o[1] = (y) => e.logotype = y),
|
|
469
|
+
"doc-name": a.internalName,
|
|
470
|
+
"onUpdate:docName": o[2] || (o[2] = (y) => a.internalName = y),
|
|
471
|
+
_document: t._document,
|
|
472
|
+
"company-logotype": a.company.logotype,
|
|
473
|
+
"sender-name": a.company.name,
|
|
474
|
+
"doc-type": t._document.docNumber.series,
|
|
475
|
+
"doc-number": t._document.docNumber.value,
|
|
476
|
+
"sent-at": a.sendAtShowDate,
|
|
477
|
+
"expires-at": t._document.expiresAt,
|
|
478
|
+
"estimated-time": a.estimatedTimeString,
|
|
479
|
+
"has-hover": t.hasHover
|
|
480
|
+
}, null, 8, ["show-logo", "logotype", "doc-name", "_document", "company-logotype", "sender-name", "doc-type", "doc-number", "sent-at", "expires-at", "estimated-time", "has-hover"])
|
|
481
|
+
]),
|
|
482
|
+
a.summaryBottom.show ? (n(), _(p, P({ key: 0 }, a.summaryBottom, { _document: t._document }), null, 16, ["_document"])) : l("", !0)
|
|
483
|
+
]);
|
|
484
|
+
}
|
|
485
|
+
const Le = /* @__PURE__ */ b(we, [["render", xe], ["__scopeId", "data-v-3628151e"]]);
|
|
486
|
+
export {
|
|
487
|
+
Le as default
|
|
488
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { m as u, U as h, V as f, W as d, _ as p, S as m } from "./main-Cb-nyil1.js";
|
|
2
|
+
import { d as y } from "./debounce-DNl99Gyo.js";
|
|
3
|
+
const g = {
|
|
4
|
+
name: "SearchApi",
|
|
5
|
+
props: {
|
|
6
|
+
customSearch: {
|
|
7
|
+
type: Object,
|
|
8
|
+
default: () => ({})
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
data() {
|
|
12
|
+
return {
|
|
13
|
+
defaultSearch: {
|
|
14
|
+
project: !0,
|
|
15
|
+
endCustomer: !1,
|
|
16
|
+
article: !1,
|
|
17
|
+
extensionArticle: !1,
|
|
18
|
+
// Articles in any authenticated CRM
|
|
19
|
+
document: !1
|
|
20
|
+
},
|
|
21
|
+
isLoading: !1,
|
|
22
|
+
emptyQuery: null,
|
|
23
|
+
// String to track last query that was empty, if a new query starts with this string we do not have to search again
|
|
24
|
+
hasSearchedAll: !1
|
|
25
|
+
// Helper to keep track when some search types have not yet searched due min query length
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
computed: {
|
|
29
|
+
...u({
|
|
30
|
+
allAuthenticatedCRMs: "settings/allAuthenticatedCRMs",
|
|
31
|
+
can: "application/can"
|
|
32
|
+
}),
|
|
33
|
+
typesToFetch() {
|
|
34
|
+
return Object.keys(this.customSearch).length ? Object.keys(this.customSearch).filter(
|
|
35
|
+
(t) => this.customSearch[t]
|
|
36
|
+
) : Object.keys(this.defaultSearch).filter(
|
|
37
|
+
(t) => this.defaultSearch[t]
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
methods: {
|
|
42
|
+
canFetchType(t) {
|
|
43
|
+
return t === "endCustomer" ? this.can("endCustomers", "read") : !0;
|
|
44
|
+
},
|
|
45
|
+
async fetch({ query: t, start: a = null, end: r = null }) {
|
|
46
|
+
const e = this.typesToFetch.reduce(
|
|
47
|
+
(i, n) => ({ ...i, [n]: [] }),
|
|
48
|
+
{}
|
|
49
|
+
), s = t.toLowerCase();
|
|
50
|
+
if (this.emptyQuery && s && s.startsWith(this.emptyQuery) || (this.emptyQuery = null, this.hasSearchedAll = !0, !s)) return e;
|
|
51
|
+
try {
|
|
52
|
+
const i = [], n = Object.keys(this.defaultSearch);
|
|
53
|
+
(this.typesToFetch || []).forEach((c) => {
|
|
54
|
+
n.includes(c) && i.push(
|
|
55
|
+
(async () => {
|
|
56
|
+
let o = [];
|
|
57
|
+
c === "document" ? o = await this.fetchDocuments(s, a, r) : c === "extensionArticle" ? o = await this.fetchExtensionArticles(s, a, r) : o = await this.fetchType(c, s, a, r), e[c] = o;
|
|
58
|
+
})()
|
|
59
|
+
);
|
|
60
|
+
}), await Promise.all(i);
|
|
61
|
+
} finally {
|
|
62
|
+
this.isLoading = !1;
|
|
63
|
+
}
|
|
64
|
+
return Object.keys(e).every(
|
|
65
|
+
(i) => e[i].length === 0
|
|
66
|
+
) && this.hasSearchedAll && (this.emptyQuery = s), e;
|
|
67
|
+
},
|
|
68
|
+
async fetchType(t, a, r, e) {
|
|
69
|
+
if (!this.canFetchType(t)) return [];
|
|
70
|
+
const { data: s } = await h("search", {
|
|
71
|
+
type: t,
|
|
72
|
+
query: a,
|
|
73
|
+
...r !== null && e !== null && { start: r, end: e }
|
|
74
|
+
});
|
|
75
|
+
return s;
|
|
76
|
+
},
|
|
77
|
+
async fetchDocuments(t, a, r) {
|
|
78
|
+
const e = t.replace(/[-[\]{}()*+?.,\\/^$|#]/g, "\\$&"), s = {
|
|
79
|
+
$or: [
|
|
80
|
+
{ "data.name": { $regex: e, $options: "i" } },
|
|
81
|
+
{ "docNumber.value": { $regex: e, $options: "i" } },
|
|
82
|
+
{
|
|
83
|
+
clients: {
|
|
84
|
+
$elemMatch: {
|
|
85
|
+
$or: ["name", "email", "socialNo", "orgNo"].map((n) => ({
|
|
86
|
+
[n]: { $regex: e, $options: "i" }
|
|
87
|
+
}))
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
]
|
|
92
|
+
}, { data: l } = await f("/document", {
|
|
93
|
+
params: {
|
|
94
|
+
lean: !0,
|
|
95
|
+
filter: encodeURIComponent(JSON.stringify(s)),
|
|
96
|
+
fields: "clients,data.name,projectId,docNumber,createdAt",
|
|
97
|
+
...a !== null && r !== null && { skip: a, limit: r - a }
|
|
98
|
+
}
|
|
99
|
+
}), { items: i = [] } = l || {};
|
|
100
|
+
return i;
|
|
101
|
+
},
|
|
102
|
+
async fetchExtensionArticles(t) {
|
|
103
|
+
const a = [];
|
|
104
|
+
return await Promise.all(
|
|
105
|
+
this.allAuthenticatedCRMs.map(async (r) => {
|
|
106
|
+
try {
|
|
107
|
+
if (r === "pipedrive" && t.length < 2) {
|
|
108
|
+
this.hasSearchedAll = !1;
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
const { data: e } = await d.search(r, {
|
|
112
|
+
query: t,
|
|
113
|
+
type: "article"
|
|
114
|
+
});
|
|
115
|
+
e && Array.isArray(e) && a.push(...e);
|
|
116
|
+
} catch {
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
), a;
|
|
120
|
+
},
|
|
121
|
+
triggerSearch: y(async function({ q: a, cb: r, start: e, end: s }) {
|
|
122
|
+
this.isLoading = !0;
|
|
123
|
+
const l = await this.fetch({ query: a, start: e, end: s });
|
|
124
|
+
return this.isLoading = !1, r(l);
|
|
125
|
+
}, 500)
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
function S(t, a, r, e, s, l) {
|
|
129
|
+
return m(t.$slots, "default", {
|
|
130
|
+
fetch: ({ q: i, cb: n, start: c = null, end: o = null }) => (s.isLoading = !0, l.triggerSearch({ q: i, cb: n, start: c, end: o })),
|
|
131
|
+
isLoading: s.isLoading
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
const w = /* @__PURE__ */ p(g, [["render", S]]);
|
|
135
|
+
export {
|
|
136
|
+
w as S
|
|
137
|
+
};
|