@cling-se/widget 0.15.1 → 0.15.3
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/dist/{AddClientCallout-XGs5vmVP.js → AddClientCallout-8s5a1_CZ.js} +3 -3
- package/dist/{AnswerModal-Djvpd4kg.js → AnswerModal-Cnp43tGo.js} +3 -3
- package/dist/{AttachmentItem-C_5E8Fa4.js → AttachmentItem-BP85gcjP.js} +6 -4
- package/dist/{BaseDatePicker-BpGzPBp_.js → BaseDatePicker-C27CsTzy.js} +486 -482
- package/dist/{BaseUpload-Dm5C-j0L.js → BaseUpload-DnhS3hGx.js} +2 -2
- package/dist/{BlockMedia-DbiVw803.js → BlockMedia-D4nhek2s.js} +1 -1
- package/dist/{CCallout-DL9smLC_.js → CCallout-CQjRcxpC.js} +1 -1
- package/dist/{CCurrencyDropdown--RshYh6V.js → CCurrencyDropdown-BT01qBGg.js} +24 -20
- package/dist/{CDropdownItem-Bzbrlurh.js → CDropdownItem-BSPNul90.js} +1 -1
- package/dist/{CFormField-DABM0TLB.js → CFormField-Cz_jNazS.js} +1 -1
- package/dist/{CPhoneFormat-BhzciB_P.js → CPhoneFormat-C017AoM0.js} +1 -1
- package/dist/{CPriceInput-DVZ4OVfI.js → CPriceInput-jktMjvwx.js} +20 -16
- package/dist/ClientAutocomplete-B3z6RPXr.js +82 -0
- package/dist/{ClientModal-BSUhx0YR.js → ClientModal-DLtFhJya.js} +31 -25
- package/dist/{ColorPicker-BpTmTnpR.js → ColorPicker-MQmVGbvm.js} +1 -1
- package/dist/{CompanyModal-C7LZybS4.js → CompanyModal-Qx5xMku0.js} +4 -4
- package/dist/{ContentWrapper-DlRJSB1H.js → ContentWrapper-B9NQqp2q.js} +63 -55
- package/dist/{CoverBlockSettings-Cxxex_lN.js → CoverBlockSettings-Bcz_W5I3.js} +5 -5
- package/dist/{DocAnswer-B-MxL_1t.js → DocAnswer-BlxFv_Gc.js} +2 -2
- package/dist/{DocDetails-DjBrxQ_R.js → DocDetails-dGcYGJpp.js} +42 -38
- package/dist/{DocForm-Beoj5wra.js → DocForm-C6o_XBcW.js} +915 -879
- package/dist/{DocFormSend-D_v5NC6u.js → DocFormSend-_prtxNIf.js} +11 -7
- package/dist/{DocLinks-CojBcyHP.js → DocLinks-Dp495SCS.js} +2 -2
- package/dist/{DocModalBase-BgduKHWe.js → DocModalBase-B0wYq3ft.js} +1 -1
- package/dist/{DocPrint-BCscbY6G.js → DocPrint-CURxofeU.js} +1 -1
- package/dist/{DocReceipt-Dxn5vcAc.js → DocReceipt-DgGcBRVH.js} +5 -3
- package/dist/{DocSendReminder-YpVUkgYH.js → DocSendReminder-CPty4svi.js} +1 -1
- package/dist/{DocTextEditor-In_CaKPA.js → DocTextEditor-BYsXFRLg.js} +67 -63
- package/dist/{DocTimeline-DU9nUQUH.js → DocTimeline-CHg1QykR.js} +7 -5
- package/dist/{DocumentClient-D5Eo9CcZ.js → DocumentClient-CZ6N73pQ.js} +5 -5
- package/dist/{DocumentLayout-BQ-wP5NB.js → DocumentLayout-CiszuoQc.js} +277 -271
- package/dist/{DocumentLogotype-CDG2k8N2.js → DocumentLogotype-BgFCWcwC.js} +17 -15
- package/dist/{DocumentVoided-B-bk6BHd.js → DocumentVoided-DT2hhHk2.js} +1 -1
- package/dist/{EmbedInput-8xfYdX6Q.js → EmbedInput-aLmvzK1I.js} +2 -2
- package/dist/{EmbedSettings-CzNKHRWA.js → EmbedSettings-BZipciy9.js} +2 -2
- package/dist/ErrorCallout-CNxSDsr_.js +27 -0
- package/dist/{FilePreviewModal-Dq8oaKBy.js → FilePreviewModal-DxdksQiy.js} +2 -2
- package/dist/{Flag-Fs-s9E60.js → Flag-3OyFDPsP.js} +1 -1
- package/dist/{HeaderSettings-DdmyTypr.js → HeaderSettings-DeoSRi6O.js} +18 -14
- package/dist/{ImageSelectModal-BXyTJKrO.js → ImageSelectModal-DvQz2VPi.js} +13 -11
- package/dist/{ImageUploadWrapper-B8D5l07p.js → ImageUploadWrapper-CNQRdHF9.js} +2 -2
- package/dist/{Index-BnCsHbZ1.js → Index-3bD76d9q.js} +6 -6
- package/dist/{Index-SkCtzHwt.js → Index-B0n1UOOA.js} +4 -4
- package/dist/{Index-BU8ft1y6.js → Index-B3Q09phm.js} +4 -4
- package/dist/{Index-V2Givdp2.js → Index-B9_POjpY.js} +5 -5
- package/dist/{Index-CgRP1XiQ.js → Index-BDCgilFk.js} +2 -2
- package/dist/{Index-Dl-EHPWj.js → Index-BEpKb8IR.js} +3 -3
- package/dist/{Index-YDDq9NSQ.js → Index-BIv8flFB.js} +8 -8
- package/dist/{Index-BcL9ebMW.js → Index-BNJ2KHKc.js} +2 -2
- package/dist/{Index-0aodZg_n.js → Index-BeMeWDIf.js} +5 -5
- package/dist/{Index-hz-7LKR4.js → Index-BglKAnNq.js} +21 -17
- package/dist/{Index-9uS4_N--.js → Index-BiVwDgqW.js} +2 -2
- package/dist/{Index-DmUOBV3i.js → Index-BjdxeF4C.js} +2 -2
- package/dist/{Index-BowtUux0.js → Index-C-CE21WK.js} +5 -5
- package/dist/{Index-B8_vIbXh.js → Index-CDKq7Fx6.js} +4 -4
- package/dist/{Index-CkqDhbLd.js → Index-CJeSVpRh.js} +2 -2
- package/dist/{Index-C8SV-RPw.js → Index-CPjAXBMU.js} +5 -5
- package/dist/{Index-BiApZ1Ic.js → Index-CTk6Nh-I.js} +7 -7
- package/dist/{Index-CqB099xV.js → Index-CTqdaykO.js} +3 -3
- package/dist/{Index-DPo796kj.js → Index-CWj2vDHc.js} +17 -15
- package/dist/{Index-NagcpUmI.js → Index-CXibuEkU.js} +1 -1
- package/dist/{Index-BMY2m8rD.js → Index-CePHdKi2.js} +4 -4
- package/dist/{Index-Db_zxCDU.js → Index-Cfc0Q0AG.js} +5 -5
- package/dist/Index-Ch5j2tqD.js +41 -0
- package/dist/{Index-DLSht_p3.js → Index-CjfCyQlB.js} +4 -4
- package/dist/{Index-BDA5wus0.js → Index-Cr6DlYGN.js} +2 -2
- package/dist/{Index-wpr5rBje.js → Index-CvRNeJ4U.js} +7 -7
- package/dist/{Index-B8XLiKic.js → Index-D-l3i9vY.js} +3 -3
- package/dist/{Index-C8Gsbm1Z.js → Index-D1NwTUs-.js} +5 -5
- package/dist/{Index-EGUIgf2A.js → Index-FC1UsElU.js} +4 -4
- package/dist/{Index-C2ZwmSbs.js → Index-PUFeH_1z.js} +4 -4
- package/dist/{Index-DcGgVbKe.js → Index-S3LqU0A0.js} +9 -7
- package/dist/{Index-C-OSub91.js → Index-jIIHHGh3.js} +376 -350
- package/dist/{Index-BYsgDllD.js → Index-q04Dwxrr.js} +17 -15
- package/dist/{Index-B68-YXDK.js → Index-w5DWfGOc.js} +4 -4
- package/dist/{InputToggleRow-J8fqDcd7.js → InputToggleRow-CvHvRdsn.js} +1 -1
- package/dist/{ManualPopover-BkAZ-cLE.js → ManualPopover-DxE-6-Sp.js} +13 -11
- package/dist/{MediaWrapper-BUQroqgd.js → MediaWrapper-DNi80fbw.js} +3 -3
- package/dist/{NotBindingText-DEjIIRIy.js → NotBindingText-D2rYFVxr.js} +2 -2
- package/dist/{PackageGroup-BXsk0x4O.js → PackageGroup-6ar8HjPo.js} +8 -8
- package/dist/{PdfTerms-vLidfDfk.js → PdfTerms-B-lbU_6H.js} +2 -2
- package/dist/{PdfViewer-Cyl_FcY1.js → PdfViewer-B5qbLLtd.js} +21 -21
- package/dist/PlainHtml-CIMtcn2F.js +27 -0
- package/dist/{PriceHeader-BV254rc3.js → PriceHeader-BSpj_-5M.js} +6 -6
- package/dist/{SearchApi-HLHEy8AM.js → SearchApi-Cwgf52EV.js} +2 -2
- package/dist/{Setup-DuCP6m5-.js → Setup-CRmiH9lD.js} +1 -1
- package/dist/{SmartList-C0IKb8qw.js → SmartList-D6AvxfSL.js} +1 -1
- package/dist/{TermsSettings-bHhM9dtD.js → TermsSettings-DEO1O460.js} +7 -5
- package/dist/{ThemeColorRow-MgU9X4Tj.js → ThemeColorRow-Cy1NKEIG.js} +14 -12
- package/dist/{ToggleBinding-gjKO_LN5.js → ToggleBinding-BvIUt1Jx.js} +8 -6
- package/dist/{UploadModal-QuXCJkzY.js → UploadModal-C1j-GeMD.js} +4 -4
- package/dist/{VideoPlayerInput-XebqdCEO.js → VideoPlayerInput-BmbrquN6.js} +3 -3
- package/dist/{VideoPlayerSettings-DMxguTAv.js → VideoPlayerSettings-B7HpBoWX.js} +2 -2
- package/dist/VideoSelectModal-CeaG2tME.js +104 -0
- package/dist/{answerDocumentMixin-BaVqM_ri.js → answerDocumentMixin-AcDG8Byi.js} +3 -3
- package/dist/{debounce-DUUqRe1d.js → debounce-HJoaSvIY.js} +1 -1
- package/dist/{focusDrawerMixin-BFQK8OUc.js → focusDrawerMixin-CBYjpEGL.js} +1 -1
- package/dist/{formComponentsInstall-qLhjQ7Rl.js → formComponentsInstall-DMoWrprH.js} +229 -223
- package/dist/{formDrawerState-BT31echi.js → formDrawerState-DYSBcjo4.js} +1 -1
- package/dist/{formValidationMixin-DWRJGUXb.js → formValidationMixin-Dqlhg0R2.js} +1 -1
- package/dist/{index-CLbtIs9u.js → index-CFe1BJZJ.js} +1 -1
- package/dist/{index-Dpx08x9s.js → index-CFwLDxbi.js} +5 -5
- package/dist/{index-BYMG8jiP.js → index-CFx0cpeM.js} +1 -1
- package/dist/{index-CO1KeOmj.js → index-CKZmpLr6.js} +69 -45
- package/dist/{index-Dsxyi-7P.js → index-CLOsPxCh.js} +14 -12
- package/dist/{index-DSOWfTTb.js → index-zzCfHTf8.js} +1 -1
- package/dist/index.es.js +3 -3
- package/dist/index.umd.js +142 -142
- package/dist/{main-CRQiO-g7.js → main-BIwKzAN8.js} +7329 -7275
- package/dist/{mapFormMixin-C9fs0AV5.js → mapFormMixin-e2PJ431T.js} +1 -1
- package/dist/{omit-tP4ZEy3Q.js → omit-CpamclWf.js} +3 -3
- package/dist/{publicSenderState-CApNsACD.js → publicSenderState-D-_7UwjT.js} +1 -1
- package/dist/style.css +2 -2
- package/dist/{throttle-B4S8Wjwz.js → throttle-B2yMLA5N.js} +2 -2
- package/dist/{tinycolor-PkULT0yA.js → tinycolor-vIxz4Xgi.js} +1 -1
- package/dist/{tippy.esm-C5HrjSHu.js → tippy.esm-DiOYviyf.js} +57 -53
- package/dist/{utils-j0eN0bhD.js → utils-CFXqaEy7.js} +1 -1
- package/dist/{vuedraggable.umd-BPB1Hmn2.js → vuedraggable.umd-DDT8qZBI.js} +1 -1
- package/package.json +1 -1
- package/dist/ClientAutocomplete-C9yyFzJ9.js +0 -78
- package/dist/ErrorCallout-Bh8OsLfY.js +0 -28
- package/dist/Index-CVSBD1f6.js +0 -31
- package/dist/PlainHtml-SVyW9vV2.js +0 -20
- package/dist/VideoSelectModal-B5AlGSUz.js +0 -100
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { m as y } from "./mapFormMixin-
|
|
2
|
-
import { E as
|
|
3
|
-
import {
|
|
1
|
+
import { m as y } from "./mapFormMixin-e2PJ431T.js";
|
|
2
|
+
import { E as S } from "./ErrorCallout-CNxSDsr_.js";
|
|
3
|
+
import { aJ as L, aK as P, aL as E, aM as z, aN as B, aO as W, k as j, aP as F, n as u, g as p, w as k, aG as N, aQ as w, aR as H, r as C, ar as f, ai as q, aS as U, as as G, aT as K, aU as Y, aV as T, p as Z, b as o, Y as g, z as J, B as Q, aW as X, t as ee, aa as te } from "./main-BIwKzAN8.js";
|
|
4
4
|
import { m as h, a as v } from "./vuex.esm-DKGl8mcw.js";
|
|
5
|
-
import { T as ie } from "./DocTextEditor-
|
|
6
|
-
import { W as
|
|
7
|
-
import { o as V } from "./omit-
|
|
8
|
-
import { d as
|
|
9
|
-
import { C as x } from "./CPriceInput-
|
|
10
|
-
import { S as ne } from "./SearchApi-
|
|
11
|
-
import { v as re } from "./index-
|
|
12
|
-
import { w as oe } from "./CDropdownItem-
|
|
5
|
+
import { T as ie } from "./DocTextEditor-BYsXFRLg.js";
|
|
6
|
+
import { W as ae } from "./DocumentLayout-CiszuoQc.js";
|
|
7
|
+
import { o as V } from "./omit-CpamclWf.js";
|
|
8
|
+
import { d as se } from "./vuedraggable.umd-DDT8qZBI.js";
|
|
9
|
+
import { C as x } from "./CPriceInput-jktMjvwx.js";
|
|
10
|
+
import { S as ne } from "./SearchApi-Cwgf52EV.js";
|
|
11
|
+
import { v as re } from "./index-CFx0cpeM.js";
|
|
12
|
+
import { w as oe } from "./CDropdownItem-BSPNul90.js";
|
|
13
13
|
const ce = [
|
|
14
14
|
"unit",
|
|
15
15
|
"m2",
|
|
@@ -29,23 +29,23 @@ const ce = [
|
|
|
29
29
|
];
|
|
30
30
|
function le() {
|
|
31
31
|
}
|
|
32
|
-
var ue = le, b = L, de = ue, pe =
|
|
33
|
-
return new b(
|
|
34
|
-
} : de, fe = me, ve = E, ge = z, ye = B, _e = W, ke = fe, $e =
|
|
35
|
-
function be(
|
|
36
|
-
var i = -1, n = ge,
|
|
32
|
+
var ue = le, b = L, de = ue, pe = P, he = 1 / 0, me = b && 1 / pe(new b([, -0]))[1] == he ? function(a) {
|
|
33
|
+
return new b(a);
|
|
34
|
+
} : de, fe = me, ve = E, ge = z, ye = B, _e = W, ke = fe, $e = P, xe = 200;
|
|
35
|
+
function be(a, e, t) {
|
|
36
|
+
var i = -1, n = ge, s = a.length, r = !0, c = [], l = c;
|
|
37
37
|
if (t)
|
|
38
38
|
r = !1, n = ye;
|
|
39
|
-
else if (
|
|
40
|
-
var _ = e ? null : ke(
|
|
39
|
+
else if (s >= xe) {
|
|
40
|
+
var _ = e ? null : ke(a);
|
|
41
41
|
if (_)
|
|
42
42
|
return $e(_);
|
|
43
43
|
r = !1, n = _e, l = new ve();
|
|
44
44
|
} else
|
|
45
45
|
l = e ? [] : c;
|
|
46
46
|
e:
|
|
47
|
-
for (; ++i <
|
|
48
|
-
var d =
|
|
47
|
+
for (; ++i < s; ) {
|
|
48
|
+
var d = a[i], m = e ? e(d) : d;
|
|
49
49
|
if (d = t || d !== 0 ? d : 0, r && m === m) {
|
|
50
50
|
for (var I = l.length; I--; )
|
|
51
51
|
if (l[I] === m)
|
|
@@ -56,12 +56,12 @@ function be(s, e, t) {
|
|
|
56
56
|
}
|
|
57
57
|
return c;
|
|
58
58
|
}
|
|
59
|
-
var we = be, Ce =
|
|
60
|
-
function Ie(
|
|
61
|
-
return
|
|
59
|
+
var we = be, Ce = F, Te = we;
|
|
60
|
+
function Ie(a, e) {
|
|
61
|
+
return a && a.length ? Te(a, Ce(e)) : [];
|
|
62
62
|
}
|
|
63
63
|
var Ae = Ie;
|
|
64
|
-
const
|
|
64
|
+
const Se = /* @__PURE__ */ j(Ae), Pe = {
|
|
65
65
|
name: "PackageGroupSelect",
|
|
66
66
|
i18nOptions: {
|
|
67
67
|
namespaces: "PackageGroupSelect",
|
|
@@ -131,28 +131,28 @@ const Pe = /* @__PURE__ */ F(Ae), Se = {
|
|
|
131
131
|
var Ve = function() {
|
|
132
132
|
var e = this, t = e._self._c;
|
|
133
133
|
return t("div", { staticClass: "font-inter", staticStyle: { padding: "calc(2 * var(--rem)) 0 calc(1 * var(--rem)) 0", color: "#111" } }, [t("div", { staticStyle: { "font-size": "18px", "font-weight": "600", "text-align": "center", "margin-bottom": "calc(1.5 * var(--rem))" } }, [e._v(" " + e._s(e.$t("title")) + " ")]), t("div", [t("div", { staticClass: "options", class: { "is-700-or-less": e.parentSize.width <= 700 } }, e._l(e.options, function(i, n) {
|
|
134
|
-
return t("div", { key: n, staticClass: "package-group-option", style: { backgroundColor: i.background }, on: { click: function(
|
|
134
|
+
return t("div", { key: n, staticClass: "package-group-option", style: { backgroundColor: i.background }, on: { click: function(s) {
|
|
135
135
|
return e.$emit("input", i.value);
|
|
136
|
-
} } }, [t("div", { staticClass: "package-group-option__illustration" }, [i.value === "single" ? t("div", { staticClass: "package-group-option__illustration-card animate" }, [e._m(0, !0)]) : e._e(), i.value === "radio" ? e._l(3, function(
|
|
137
|
-
return t("div", { key:
|
|
136
|
+
} } }, [t("div", { staticClass: "package-group-option__illustration" }, [i.value === "single" ? t("div", { staticClass: "package-group-option__illustration-card animate" }, [e._m(0, !0)]) : e._e(), i.value === "radio" ? e._l(3, function(s) {
|
|
137
|
+
return t("div", { key: s, staticClass: "package-group-option__illustration-card", class: { animate: s === 2 } }, [t("div", { staticStyle: { width: "8px", height: "8px", "border-radius": "50%", "margin-right": "10px" }, style: s === 2 && {
|
|
138
138
|
boxShadow: `0 0 0 1px white, 0 0 0 2px ${i.background}`,
|
|
139
139
|
backgroundColor: i.background
|
|
140
140
|
} }), e._m(1, !0)]);
|
|
141
|
-
}) : e._e(), i.value === "checkbox" ? e._l(3, function(
|
|
142
|
-
return t("div", { key:
|
|
141
|
+
}) : e._e(), i.value === "checkbox" ? e._l(3, function(s) {
|
|
142
|
+
return t("div", { key: s, staticClass: "package-group-option__illustration-card", class: { animate: s !== 3 } }, [t("div", { staticStyle: { height: "12px", width: "12px", "border-radius": "2px", "background-color": "hsl(0, 0%, 76%)", "margin-right": "10px", color: "white", padding: "1px", display: "inline-flex", "align-items": "center", "justify-content": "center" }, style: s !== 3 && { backgroundColor: i.background } }, [t("CIcon", { attrs: { type: s !== 3 ? "check" : "empty", "stroke-width": "5", size: "8" } })], 1), e._m(2, !0)]);
|
|
143
143
|
}) : e._e()], 2), t("div", [t("div", { staticClass: "package-group-option__title" }, [e._v(" " + e._s(i.title) + " ")]), t("div", { staticClass: "package-group-option__subtitle", domProps: { innerHTML: e._s(i.subTitle) } })])]);
|
|
144
144
|
}), 0)])]);
|
|
145
145
|
}, Re = [function() {
|
|
146
|
-
var
|
|
146
|
+
var a = this, e = a._self._c;
|
|
147
147
|
return e("div", { staticStyle: { flex: "1 1 auto" } }, [e("div", { staticClass: "bg-gray-100", staticStyle: { width: "40%", height: "10px", "margin-bottom": "8px" } }), e("div", { staticClass: "bg-gray-100", staticStyle: { width: "80%", height: "10px" } })]);
|
|
148
148
|
}, function() {
|
|
149
|
-
var
|
|
149
|
+
var a = this, e = a._self._c;
|
|
150
150
|
return e("div", { staticStyle: { flex: "1 1 auto" } }, [e("div", { staticClass: "bg-gray-100", staticStyle: { width: "40%", height: "10px", "margin-bottom": "8px" } }), e("div", { staticClass: "bg-gray-100", staticStyle: { width: "80%", height: "10px" } })]);
|
|
151
151
|
}, function() {
|
|
152
|
-
var
|
|
152
|
+
var a = this, e = a._self._c;
|
|
153
153
|
return e("div", { staticStyle: { flex: "1 1 auto" } }, [e("div", { staticClass: "bg-gray-100", staticStyle: { width: "40%", height: "10px", "margin-bottom": "8px" } }), e("div", { staticClass: "bg-gray-100", staticStyle: { width: "80%", height: "10px" } })]);
|
|
154
154
|
}], De = /* @__PURE__ */ u(
|
|
155
|
-
|
|
155
|
+
Pe,
|
|
156
156
|
Ve,
|
|
157
157
|
Re,
|
|
158
158
|
!1,
|
|
@@ -193,23 +193,23 @@ const Oe = De.exports, Me = {
|
|
|
193
193
|
ids: "articles/articleIdList"
|
|
194
194
|
}),
|
|
195
195
|
whiteList() {
|
|
196
|
-
const
|
|
196
|
+
const a = [];
|
|
197
197
|
if (this.$refs.dropdown !== void 0) {
|
|
198
198
|
const e = this.$refs.dropdown.querySelectorAll("*");
|
|
199
199
|
for (const t of e)
|
|
200
|
-
|
|
200
|
+
a.push(t);
|
|
201
201
|
}
|
|
202
202
|
if (this.$refs.input !== void 0) {
|
|
203
203
|
const e = this.$refs.input.$el.querySelectorAll("*");
|
|
204
204
|
for (const t of e)
|
|
205
|
-
|
|
205
|
+
a.push(t);
|
|
206
206
|
}
|
|
207
|
-
return
|
|
207
|
+
return a;
|
|
208
208
|
}
|
|
209
209
|
},
|
|
210
210
|
watch: {
|
|
211
|
-
searchResults(
|
|
212
|
-
|
|
211
|
+
searchResults(a, e) {
|
|
212
|
+
a.length !== e.length && (this.selectedIndex = 0);
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
215
|
created() {
|
|
@@ -225,12 +225,12 @@ const Oe = De.exports, Me = {
|
|
|
225
225
|
loadArticles: p.LOAD_ARTICLES
|
|
226
226
|
}),
|
|
227
227
|
priceFormat: k,
|
|
228
|
-
search(
|
|
229
|
-
this.$emit("input", e), !this.viewSettings.isPublicForm &&
|
|
228
|
+
search(a, e) {
|
|
229
|
+
this.$emit("input", e), !this.viewSettings.isPublicForm && a({
|
|
230
230
|
q: e,
|
|
231
231
|
cb: ({ article: t = [], extensionArticle: i = [] }) => {
|
|
232
232
|
this.searchResults = [
|
|
233
|
-
...t.sort((n,
|
|
233
|
+
...t.sort((n, s) => n.usedTimes > s.usedTimes ? -1 : 1),
|
|
234
234
|
...i
|
|
235
235
|
], !this.isOpen && this.searchResults.length && this.showResults();
|
|
236
236
|
}
|
|
@@ -240,11 +240,11 @@ const Oe = De.exports, Me = {
|
|
|
240
240
|
focus() {
|
|
241
241
|
this.$refs.input.focus();
|
|
242
242
|
},
|
|
243
|
-
onFocus(
|
|
244
|
-
this.isFocus = !0, this.$emit("focus",
|
|
243
|
+
onFocus(a) {
|
|
244
|
+
this.isFocus = !0, this.$emit("focus", a);
|
|
245
245
|
},
|
|
246
|
-
onBlur(
|
|
247
|
-
this.isFocus = !1, this.$emit("blur",
|
|
246
|
+
onBlur(a) {
|
|
247
|
+
this.isFocus = !1, this.$emit("blur", a);
|
|
248
248
|
},
|
|
249
249
|
showResults() {
|
|
250
250
|
this.isOpen = !0;
|
|
@@ -252,15 +252,15 @@ const Oe = De.exports, Me = {
|
|
|
252
252
|
hideResults() {
|
|
253
253
|
this.isOpen = !1;
|
|
254
254
|
},
|
|
255
|
-
onSelect(
|
|
256
|
-
this.$emit("select",
|
|
255
|
+
onSelect(a) {
|
|
256
|
+
this.$emit("select", a), this.hideResults(), this.$refs.input && this.$refs.input.blur();
|
|
257
257
|
},
|
|
258
|
-
onClickOutside(
|
|
259
|
-
this.whiteList.indexOf(
|
|
258
|
+
onClickOutside(a) {
|
|
259
|
+
this.whiteList.indexOf(a.target) < 0 && this.hideResults();
|
|
260
260
|
},
|
|
261
|
-
onKeydown({ keyCode:
|
|
261
|
+
onKeydown({ keyCode: a }) {
|
|
262
262
|
if (this.isOpen) {
|
|
263
|
-
switch (
|
|
263
|
+
switch (a) {
|
|
264
264
|
case 38:
|
|
265
265
|
this.selectedIndex > 0 && this.selectedIndex--;
|
|
266
266
|
break;
|
|
@@ -297,13 +297,17 @@ var Le = function() {
|
|
|
297
297
|
return !n.type.indexOf("key") && e._k(n.keyCode, "tab", 9, n.key, "Tab") ? null : e.hideResults.apply(null, arguments);
|
|
298
298
|
}, function(n) {
|
|
299
299
|
return !n.type.indexOf("key") && e._k(n.keyCode, "escape", void 0, n.key, void 0) ? null : e.hideResults.apply(null, arguments);
|
|
300
|
-
}] }
|
|
300
|
+
}] }, scopedSlots: e._u([{ key: "prefix", fn: function() {
|
|
301
|
+
return [e._t("prefix")];
|
|
302
|
+
}, proxy: !0 }, { key: "suffix", fn: function() {
|
|
303
|
+
return [e._t("suffix")];
|
|
304
|
+
}, proxy: !0 }], null, !0) }, "CInput", {
|
|
301
305
|
...e.$attrs,
|
|
302
306
|
...e.$props
|
|
303
|
-
}, !1)
|
|
304
|
-
} }]
|
|
305
|
-
return t("div", { key: n, staticClass: "r-item", class: { active: e.selectedIndex === n }, on: { "!click": function(
|
|
306
|
-
return
|
|
307
|
+
}, !1))];
|
|
308
|
+
} }]) }), e.isOpen ? t("div", { ref: "dropdown", staticClass: "r-container" }, e._l(e.searchResults, function(i, n) {
|
|
309
|
+
return t("div", { key: n, staticClass: "r-item", class: { active: e.selectedIndex === n }, on: { "!click": function(s) {
|
|
310
|
+
return s.stopPropagation(), e.onSelect(i);
|
|
307
311
|
} } }, [t("div", { staticClass: "r-item-title truncate-text" }, [e._v(e._s(i.name))]), t("div", { staticClass: "r-item-details" }, [i.externalReference && i.externalReference.service ? t("div", { staticStyle: { width: "18px", height: "18px", "border-radius": "2px", "background-color": "hsl(0, 0%, 60%)", display: "inline-flex", "justify-content": "center", "align-items": "center" } }, [t("CIcon", { staticStyle: { color: "white" }, attrs: { type: i.externalReference.service, size: "14" } })], 1) : e._e(), i.article_no ? t("div", [e._v(e._s(i.article_no))]) : e._e(), i.price ? t("div", [e._v(" " + e._s(e.priceFormat(i.price, { currency: i.currency })) + " ")]) : e._e(), i.vat ? t("div", [e._v(" " + e._s(e.$t("vat.sharedTitle").capitalize()) + " " + e._s(i.vat) + "% ")]) : e._e()]), e.selectedIndex === n ? t("div", { staticClass: "r-item-icon" }, [t("CIcon", { attrs: { type: "corner-down-left", size: "16" } })], 1) : e._e()]);
|
|
308
312
|
}), 0) : e._e()], 1);
|
|
309
313
|
}, Ee = [], ze = /* @__PURE__ */ u(
|
|
@@ -312,7 +316,7 @@ var Le = function() {
|
|
|
312
316
|
Ee,
|
|
313
317
|
!1,
|
|
314
318
|
null,
|
|
315
|
-
"
|
|
319
|
+
"aa485cb9"
|
|
316
320
|
);
|
|
317
321
|
const R = ze.exports, A = {
|
|
318
322
|
isDeductable: !1,
|
|
@@ -320,9 +324,9 @@ const R = ze.exports, A = {
|
|
|
320
324
|
greenRot15: !1,
|
|
321
325
|
greenRot20: !1,
|
|
322
326
|
greenRot50: !1
|
|
323
|
-
}, $ = (
|
|
327
|
+
}, $ = (a, e = "", t) => {
|
|
324
328
|
let i = {
|
|
325
|
-
...
|
|
329
|
+
...a,
|
|
326
330
|
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
327
331
|
// Trigger updatedAt as it us used to decide which houseWork to prioritize
|
|
328
332
|
};
|
|
@@ -332,21 +336,21 @@ const R = ze.exports, A = {
|
|
|
332
336
|
[t]: !0
|
|
333
337
|
}), N(i.quantity) !== "number" && (i.quantity = 0), w(i);
|
|
334
338
|
}, D = ({
|
|
335
|
-
stored:
|
|
339
|
+
stored: a,
|
|
336
340
|
current: e,
|
|
337
341
|
hidePrice: t = !1,
|
|
338
342
|
activeHouseWorkType: i
|
|
339
343
|
}) => {
|
|
340
344
|
let n = H({
|
|
341
|
-
...
|
|
345
|
+
...a,
|
|
342
346
|
quantity: 1,
|
|
343
347
|
showPrice: !t,
|
|
344
348
|
id: null,
|
|
345
|
-
ArticleId:
|
|
349
|
+
ArticleId: a.id,
|
|
346
350
|
packageId: e.packageId
|
|
347
351
|
});
|
|
348
352
|
if (i) {
|
|
349
|
-
const
|
|
353
|
+
const s = (l = []) => l.reduce((_, d) => ({ ..._, [d]: !1 }), {}), c = Object.values(
|
|
350
354
|
V({
|
|
351
355
|
rot: "isDeductable",
|
|
352
356
|
rut: "isRut",
|
|
@@ -355,16 +359,16 @@ const R = ze.exports, A = {
|
|
|
355
359
|
greenRot50: "greenRot50"
|
|
356
360
|
}, [i])
|
|
357
361
|
);
|
|
358
|
-
c.some((l) => !!n[l]) && (n = { ...n, ...
|
|
362
|
+
c.some((l) => !!n[l]) && (n = { ...n, ...s(c) });
|
|
359
363
|
}
|
|
360
364
|
return n;
|
|
361
|
-
}, Be = (
|
|
362
|
-
const t = C(
|
|
363
|
-
switch (
|
|
365
|
+
}, Be = (a, e = null) => {
|
|
366
|
+
const t = C(a.currency, e);
|
|
367
|
+
switch (a.priceType) {
|
|
364
368
|
case "approx":
|
|
365
369
|
return `${q.t("_common:approx")} ${t}`;
|
|
366
370
|
case "openAcc":
|
|
367
|
-
return `${t}/${f(
|
|
371
|
+
return `${t}/${f(a.unitType)}`;
|
|
368
372
|
case "markup":
|
|
369
373
|
return "%";
|
|
370
374
|
default:
|
|
@@ -429,7 +433,7 @@ const R = ze.exports, A = {
|
|
|
429
433
|
messages: O
|
|
430
434
|
},
|
|
431
435
|
components: {
|
|
432
|
-
ErrorCallout:
|
|
436
|
+
ErrorCallout: S,
|
|
433
437
|
ArticleAutocomplete: R,
|
|
434
438
|
CPriceInput: x
|
|
435
439
|
},
|
|
@@ -489,27 +493,27 @@ const R = ze.exports, A = {
|
|
|
489
493
|
get() {
|
|
490
494
|
return this.value || {};
|
|
491
495
|
},
|
|
492
|
-
set(
|
|
493
|
-
this.$emit("input",
|
|
496
|
+
set(a) {
|
|
497
|
+
this.$emit("input", a);
|
|
494
498
|
}
|
|
495
499
|
},
|
|
496
500
|
details() {
|
|
497
|
-
const
|
|
501
|
+
const a = [], {
|
|
498
502
|
priceType: e,
|
|
499
503
|
quantity: t,
|
|
500
504
|
unitType: i,
|
|
501
505
|
price: n,
|
|
502
|
-
vat:
|
|
506
|
+
vat: s,
|
|
503
507
|
discount: r,
|
|
504
508
|
discountType: c
|
|
505
509
|
} = this.article;
|
|
506
|
-
if (e !== "fixed" &&
|
|
510
|
+
if (e !== "fixed" && a.push({ title: this.$t(`priceTypeShort.${e}`) }), U(this.article)) {
|
|
507
511
|
const l = G(this.article);
|
|
508
|
-
|
|
512
|
+
a.push({
|
|
509
513
|
title: this.$t(`_common:deduction.${l}_percentage`)
|
|
510
514
|
});
|
|
511
515
|
}
|
|
512
|
-
return t && ["fixed", "approx"].includes(e) && (i !== "unit" || t > 1) &&
|
|
516
|
+
return t && ["fixed", "approx"].includes(e) && (i !== "unit" || t > 1) && a.push({
|
|
513
517
|
title: f(this.article.unitType, {
|
|
514
518
|
count: t,
|
|
515
519
|
includeCount: !0
|
|
@@ -518,24 +522,24 @@ const R = ze.exports, A = {
|
|
|
518
522
|
icon: '<svg style="margin: 0 4px;" width="6" height="6" viewBox="0 0 148 141" xmlns="http://www.w3.org/2000/svg"><path d="M73.742787 92.65535l-34.444359 47.40859-18.607391-13.51906 34.060775-46.88064L0 61.8743 7.107391 40 62 57.83569V0h23v57.99346L140.378182 40l7.107391 21.8743-54.751812 17.78994 34.060775 46.88064-18.607391 13.51906-34.444358-47.40859z" fill="currentColor" fill-rule="evenodd"/></svg>',
|
|
519
523
|
subTitle: k(n, {
|
|
520
524
|
showZero: !0,
|
|
521
|
-
withVat: this.isIncVat ?
|
|
525
|
+
withVat: this.isIncVat ? s : !1,
|
|
522
526
|
currency: this.article.currency,
|
|
523
527
|
decimals: 2,
|
|
524
528
|
hideZeroDecimals: !0
|
|
525
529
|
})
|
|
526
530
|
}
|
|
527
|
-
}), r &&
|
|
531
|
+
}), r && a.push({
|
|
528
532
|
title: "-" + (c === "fixed" ? k(r, {
|
|
529
|
-
withVat: this.isIncVat ?
|
|
533
|
+
withVat: this.isIncVat ? s : !1,
|
|
530
534
|
currency: this.article.currency
|
|
531
535
|
}) : `${r / 100} %`),
|
|
532
536
|
detailClass: "discount"
|
|
533
|
-
}),
|
|
537
|
+
}), a;
|
|
534
538
|
}
|
|
535
539
|
},
|
|
536
540
|
methods: {
|
|
537
|
-
updateArticle(
|
|
538
|
-
this.article = $(this.article,
|
|
541
|
+
updateArticle(a, e) {
|
|
542
|
+
this.article = $(this.article, a, e);
|
|
539
543
|
},
|
|
540
544
|
onTotalPriceInputFocus() {
|
|
541
545
|
(this.article.discount || this.article.quantity !== 1) && this.$emit("open-modal", { focusEl: "priceInput" });
|
|
@@ -543,12 +547,12 @@ const R = ze.exports, A = {
|
|
|
543
547
|
focusName() {
|
|
544
548
|
this.$refs.name.focus();
|
|
545
549
|
},
|
|
546
|
-
errorMessage(
|
|
547
|
-
return
|
|
550
|
+
errorMessage(a) {
|
|
551
|
+
return a.$error && a.article.name.$error && !a.article.name.maxLength ? this.$t("validations.name.maxLength") : null;
|
|
548
552
|
}
|
|
549
553
|
}
|
|
550
554
|
};
|
|
551
|
-
var
|
|
555
|
+
var je = function() {
|
|
552
556
|
var e = this, t = e._self._c;
|
|
553
557
|
return t("div", { staticClass: "article-wrapper", class: {
|
|
554
558
|
"has-details": e.details.length,
|
|
@@ -570,15 +574,17 @@ var Fe = function() {
|
|
|
570
574
|
activeHouseWorkType: e.activeHouseWorkType
|
|
571
575
|
})
|
|
572
576
|
), e.$emit("select");
|
|
573
|
-
} }
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
577
|
+
} }, scopedSlots: e._u([{ key: "suffix", fn: function() {
|
|
578
|
+
return [e.hideControls ? e._e() : t("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: {
|
|
579
|
+
content: e.$t("openModalTooltip"),
|
|
580
|
+
delay: { show: 300, hide: 0 }
|
|
581
|
+
}, expression: `{
|
|
582
|
+
content: $t('openModalTooltip'),
|
|
583
|
+
delay: { show: 300, hide: 0 }
|
|
584
|
+
}` }], staticClass: "article-button fade-in", on: { click: function(i) {
|
|
585
|
+
return e.$emit("open-modal");
|
|
586
|
+
} } }, [t("CIcon", { attrs: { type: "cog", size: "18" } })], 1)];
|
|
587
|
+
}, proxy: !0 }]) }), e.hidePriceInput ? e._e() : t("CPriceInput", { key: e.rootPriceType + e.article.priceType + e.article.unitType, staticClass: "form-control form-control-right", staticStyle: { flex: "1 1", "min-width": "200px" }, attrs: { value: e.article.totalAmount, currency: e.article.currency, "is-inc-vat": e.article.priceType !== "markup" && e.isIncVat, vat: e.article.vat, placeholder: e.$t("_common:price.price").capitalize(), "price-type": e.article.priceType, "unit-label": e.articleUnitLabel(e.article.unitType) }, on: { input: function(i) {
|
|
582
588
|
return e.updateArticle(i, "price");
|
|
583
589
|
}, "update:currency": function(i) {
|
|
584
590
|
return e.$emit("update:currency", i);
|
|
@@ -590,16 +596,16 @@ var Fe = function() {
|
|
|
590
596
|
e.enableRemove && e.$emit("remove");
|
|
591
597
|
} } }), t("CIcon", { staticClass: "a-control-button fade-in move-button article-draggable-handle", class: { "c-hidden": !e.enableRemove }, attrs: { circle: "", type: "handle", size: "18" } })]], 2), e.details.length ? t("div", { staticClass: "article-details-wrapper", staticStyle: { cursor: "pointer" }, on: { click: function(i) {
|
|
592
598
|
return e.$emit("open-modal");
|
|
593
|
-
} } }, e._l(e.details, function({ title: i, icon: n, subTitle:
|
|
594
|
-
return t("div", { key: c, staticClass: "article-details-item", class: [r] }, [e._v(" " + e._s(i) + " "), n ? t("div", { domProps: { innerHTML: e._s(n) } }) : e._e(), e._v(" " + e._s(
|
|
599
|
+
} } }, e._l(e.details, function({ title: i, icon: n, subTitle: s = "", detailClass: r = "" }, c) {
|
|
600
|
+
return t("div", { key: c, staticClass: "article-details-item", class: [r] }, [e._v(" " + e._s(i) + " "), n ? t("div", { domProps: { innerHTML: e._s(n) } }) : e._e(), e._v(" " + e._s(s) + " ")]);
|
|
595
601
|
}), 0) : e._e(), e.$v.$invalid && e.$v.$dirty ? t("ErrorCallout", { attrs: { message: e.errorMessage(e.$v) } }) : e._e()], 1);
|
|
596
|
-
},
|
|
602
|
+
}, Fe = [], Ne = /* @__PURE__ */ u(
|
|
597
603
|
We,
|
|
598
|
-
Fe,
|
|
599
604
|
je,
|
|
605
|
+
Fe,
|
|
600
606
|
!1,
|
|
601
607
|
null,
|
|
602
|
-
"
|
|
608
|
+
"417bbfef"
|
|
603
609
|
);
|
|
604
610
|
const He = Ne.exports, qe = {
|
|
605
611
|
props: {
|
|
@@ -619,8 +625,8 @@ const He = Ne.exports, qe = {
|
|
|
619
625
|
this.removeKeyHandler();
|
|
620
626
|
},
|
|
621
627
|
methods: {
|
|
622
|
-
getNavTooltip(
|
|
623
|
-
return
|
|
628
|
+
getNavTooltip(a) {
|
|
629
|
+
return a === -1 ? {
|
|
624
630
|
content: `
|
|
625
631
|
<div style='margin-bottom: 0.6em;'>
|
|
626
632
|
${this.$t("show", { thing: this.$t("previous") })}
|
|
@@ -632,7 +638,7 @@ const He = Ne.exports, qe = {
|
|
|
632
638
|
</div>
|
|
633
639
|
`,
|
|
634
640
|
html: !0
|
|
635
|
-
} :
|
|
641
|
+
} : a === 1 ? {
|
|
636
642
|
content: `
|
|
637
643
|
<div style='margin-bottom: 0.6em;'>
|
|
638
644
|
${this.$t("show", { thing: this.$t("next") })}
|
|
@@ -644,18 +650,18 @@ const He = Ne.exports, qe = {
|
|
|
644
650
|
</div>
|
|
645
651
|
`,
|
|
646
652
|
html: !0
|
|
647
|
-
} :
|
|
653
|
+
} : a === "close" ? {
|
|
648
654
|
content: '<div style="margin-bottom: 0.6em;">Stäng</div><div style="text-align: center; opacity: 0.85;"><svg width="30" height="20" xmlns="http://www.w3.org/2000/svg" viewBox="17 0 105.5 72" style="enable-background:new 17 0 105.5 72"><path d="M103.3 70.3H36.2c-9.6 0-17.5-7.9-17.5-17.5V19.2c0-9.6 7.9-17.5 17.5-17.5h67.1c9.6 0 17.5 7.9 17.5 17.5v33.6c0 9.6-7.9 17.5-17.5 17.5z" style="fill:none;stroke:currentColor;stroke-width:3;stroke-miterlimit:10"/><path style="fill:none" d="M17 17.8h105.5V49H17z"/><path fill="currentColor" d="M46.6 38.2c.1 5 3.3 7.1 7 7.1 2.6 0 4.2-.5 5.6-1l.6 2.6c-1.3.6-3.5 1.3-6.8 1.3-6.3 0-10-4.1-10-10.2s3.6-11 9.5-11c6.6 0 8.4 5.8 8.4 9.6 0 .8-.1 1.3-.1 1.7l-14.2-.1zm10.9-2.7c0-2.4-1-6-5.1-6-3.7 0-5.4 3.4-5.7 6h10.8zM65.1 43.9c1.1.7 3 1.5 4.9 1.5 2.7 0 3.9-1.3 3.9-3 0-1.8-1-2.7-3.8-3.7-3.7-1.3-5.4-3.3-5.4-5.8 0-3.3 2.6-6 7-6 2.1 0 3.9.6 5 1.3l-.9 2.7c-.8-.5-2.3-1.2-4.2-1.2-2.2 0-3.4 1.3-3.4 2.8 0 1.7 1.2 2.4 3.9 3.4 3.5 1.3 5.3 3.1 5.3 6.1 0 3.6-2.8 6.1-7.6 6.1-2.2 0-4.3-.5-5.7-1.4l1-2.8zM96.7 46.9c-1 .5-3.1 1.2-5.8 1.2-6.1 0-10.1-4.2-10.1-10.4 0-6.3 4.3-10.8 10.9-10.8 2.2 0 4.1.5 5.1 1l-.8 2.9c-.9-.5-2.3-1-4.3-1-4.7 0-7.2 3.4-7.2 7.7 0 4.7 3 7.6 7.1 7.6 2.1 0 3.5-.5 4.5-1l.6 2.8z"/></svg></div>',
|
|
649
655
|
html: !0
|
|
650
656
|
} : null;
|
|
651
657
|
},
|
|
652
|
-
onKeyUp(
|
|
658
|
+
onKeyUp(a) {
|
|
653
659
|
const e = document.activeElement;
|
|
654
|
-
!(e.hasAttribute("contenteditable") || ["input", "textarea"].includes(e.tagName.toLowerCase())) && (parseInt(
|
|
655
|
-
const i =
|
|
660
|
+
!(e.hasAttribute("contenteditable") || ["input", "textarea"].includes(e.tagName.toLowerCase())) && (parseInt(a.keyCode, 10) === 37 && this.$emit("go", -1), parseInt(a.keyCode, 10) === 39 && this.$emit("go", 1));
|
|
661
|
+
const i = a.key || a.keyCode;
|
|
656
662
|
if (i === "Escape" || i === "Esc" || i === 27) {
|
|
657
663
|
const n = this.$modal.getOpenInstances();
|
|
658
|
-
if (
|
|
664
|
+
if (a.defaultPrevented || n.length)
|
|
659
665
|
return;
|
|
660
666
|
this.$emit("close");
|
|
661
667
|
}
|
|
@@ -736,8 +742,8 @@ const Ye = Ke.exports, Ze = {
|
|
|
736
742
|
unitById: "unitTypes/byId"
|
|
737
743
|
}),
|
|
738
744
|
unitItems() {
|
|
739
|
-
return (this.idList || []).map((
|
|
740
|
-
const e = this.unitById(
|
|
745
|
+
return (this.idList || []).map((a) => {
|
|
746
|
+
const e = this.unitById(a), t = f(e.value);
|
|
741
747
|
return {
|
|
742
748
|
...e,
|
|
743
749
|
label: t,
|
|
@@ -751,8 +757,8 @@ const Ye = Ke.exports, Ze = {
|
|
|
751
757
|
watch: {
|
|
752
758
|
stateUnitIds: {
|
|
753
759
|
immediate: !0,
|
|
754
|
-
handler(
|
|
755
|
-
this.idList =
|
|
760
|
+
handler(a) {
|
|
761
|
+
this.idList = a || [];
|
|
756
762
|
}
|
|
757
763
|
}
|
|
758
764
|
},
|
|
@@ -763,22 +769,22 @@ const Ye = Ke.exports, Ze = {
|
|
|
763
769
|
updateUnit: p.UPDATE_UNIT_TYPE,
|
|
764
770
|
deleteUnit: p.DELETE_UNIT_TYPE
|
|
765
771
|
}),
|
|
766
|
-
onEdit(
|
|
767
|
-
this.selectedValue = { ...
|
|
772
|
+
onEdit(a) {
|
|
773
|
+
this.selectedValue = { ...a }, this.$refs.unitInput && this.$refs.unitInput.focus();
|
|
768
774
|
},
|
|
769
775
|
async submit() {
|
|
770
|
-
const { id:
|
|
776
|
+
const { id: a, value: e } = this.selectedValue || {};
|
|
771
777
|
if (!e)
|
|
772
778
|
throw new Error("New unitTypes need truthy value!");
|
|
773
779
|
const t = `$${e}`;
|
|
774
|
-
|
|
780
|
+
a ? await this.updateUnit({ id: a, body: { value: t } }) : await this.createUnit({ body: { value: t } }), this.reset(), this.$parent.$emit("select", t), this.close();
|
|
775
781
|
},
|
|
776
|
-
async remove(
|
|
782
|
+
async remove(a, e) {
|
|
777
783
|
if (this.removeConfirmIndex !== e) {
|
|
778
784
|
this.removeConfirmIndex = e;
|
|
779
785
|
return;
|
|
780
786
|
}
|
|
781
|
-
await this.deleteUnit({ id:
|
|
787
|
+
await this.deleteUnit({ id: a }), this.reset(), this.removeConfirmIndex = null;
|
|
782
788
|
},
|
|
783
789
|
reset() {
|
|
784
790
|
this.selectedValue = { id: null, value: "" };
|
|
@@ -786,8 +792,8 @@ const Ye = Ke.exports, Ze = {
|
|
|
786
792
|
close() {
|
|
787
793
|
this.$emit("close");
|
|
788
794
|
},
|
|
789
|
-
async onDrop({ removedIndex:
|
|
790
|
-
|
|
795
|
+
async onDrop({ removedIndex: a, addedIndex: e }) {
|
|
796
|
+
a === null && e === null || a !== e && (this.idList = T(this.idList, a, e), await Z(
|
|
791
797
|
"/unitType/setPositions",
|
|
792
798
|
{ ids: this.idList },
|
|
793
799
|
{ invalidateCache: { type: "unitType" } }
|
|
@@ -799,18 +805,20 @@ var Je = function() {
|
|
|
799
805
|
var e = this, t = e._self._c;
|
|
800
806
|
return t("div", { staticClass: "modal-overlay font-inter", on: { "&click": function(i) {
|
|
801
807
|
return i.target !== i.currentTarget ? null : e.close.apply(null, arguments);
|
|
802
|
-
} } }, [t("div", { staticClass: "unit-modal-root font-inter", staticStyle: { position: "relative" } }, [t("div", { staticStyle: { padding: "calc(1.5 * var(--rem))" } }, [t("div", { staticStyle: { "font-weight": "600", "font-size": "18px", "margin-bottom": "calc(1.5 * var(--rem))" } }, [t("span", [e._v(e._s(e.$t("_common:add", { thing: e.$t("_common:unitType.unitType_plural") })))]), t("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: { content: e.$t("tooltip"), html: !0 }, expression: "{ content: $t('tooltip'), html: true }" }], staticClass: "text-gray-400", staticStyle: { "margin-left": "0.5em" }, attrs: { type: "info", size: "15" } })], 1), t("CField", { staticStyle: { margin: "0" }, attrs: { grouped: "" } }, [t("CInput", { ref: "unitInput", staticClass: "unit-input", attrs: { placeholder: e.$t("_common:name").capitalize(), expanded: "", filled: "" },
|
|
808
|
+
} } }, [t("div", { staticClass: "unit-modal-root font-inter", staticStyle: { position: "relative" } }, [t("div", { staticStyle: { padding: "calc(1.5 * var(--rem))" } }, [t("div", { staticStyle: { "font-weight": "600", "font-size": "18px", "margin-bottom": "calc(1.5 * var(--rem))" } }, [t("span", [e._v(e._s(e.$t("_common:add", { thing: e.$t("_common:unitType.unitType_plural") })))]), t("CIcon", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: { content: e.$t("tooltip"), html: !0 }, expression: "{ content: $t('tooltip'), html: true }" }], staticClass: "text-gray-400", staticStyle: { "margin-left": "0.5em" }, attrs: { type: "info", size: "15" } })], 1), t("CField", { staticStyle: { margin: "0" }, attrs: { grouped: "" } }, [t("CInput", { ref: "unitInput", staticClass: "unit-input", attrs: { placeholder: e.$t("_common:name").capitalize(), expanded: "", filled: "" }, scopedSlots: e._u([e.selectedValue.id ? { key: "suffix", fn: function() {
|
|
809
|
+
return [t("CButton", { staticStyle: { "border-radius": "4px" }, attrs: { icon: "x", type: "none", pattern: "tertiary", size: "small" }, on: { click: e.reset } })];
|
|
810
|
+
}, proxy: !0 } : null], null, !0), model: { value: e.selectedValue.value, callback: function(i) {
|
|
803
811
|
e.$set(e.selectedValue, "value", typeof i == "string" ? i.trim() : i);
|
|
804
|
-
}, expression: "selectedValue.value" } }
|
|
805
|
-
return t("DragItem", { key: i.id }, [t("div", { staticClass: "unit-modal-list-item", class: { "is-editing": e.selectedValue.id === i.id }, on: { "&mouseover": function(
|
|
812
|
+
}, expression: "selectedValue.value" } }), t("div", { staticClass: "control" }, [t("CButton", { attrs: { loading: e.isPosting, disabled: !e.selectedValue.value, type: "secondary" }, on: { click: e.submit } }, [e._v(" " + e._s(e.selectedValue.id ? e.$t("_common:save") : e.$t("_common:add")) + " ")])], 1)], 1)], 1), t("div", { staticStyle: { "border-top": "1px solid hsl(0, 0%, 88%)", overflow: "auto", "max-height": "360px" } }, [t("div", { staticClass: "text-gray-400", staticStyle: { "font-size": "14px", padding: "calc(1 * var(--rem)) calc(1.5 * var(--rem)) 0", "font-weight": "500" } }, [e._v(" " + e._s(e.$t("_common:unit_plural").capitalize()) + " ")]), t("div", { staticClass: "unit-modal-list" }, [e.unitItems.length ? e._e() : t("div", { staticClass: "unit-modal-list-empty" }, [e._v(" " + e._s(e.$t("_common:add", { thing: e.$t("_common:unit_plural") })) + " ")]), t("DragList", { attrs: { "drop-placeholder": { className: "drag-drop-placeholder" }, "drag-class": "is-dragged", "lock-axis": "y", "drag-handle-selector": ".drag-handle" }, on: { drop: e.onDrop } }, e._l(e.unitItems, function(i, n) {
|
|
813
|
+
return t("DragItem", { key: i.id }, [t("div", { staticClass: "unit-modal-list-item", class: { "is-editing": e.selectedValue.id === i.id }, on: { "&mouseover": function(s) {
|
|
806
814
|
e.hoverIndex = n;
|
|
807
|
-
}, "&mouseleave": function(
|
|
815
|
+
}, "&mouseleave": function(s) {
|
|
808
816
|
e.hoverIndex = null;
|
|
809
|
-
}, click: function(
|
|
817
|
+
}, click: function(s) {
|
|
810
818
|
return e.onEdit(i);
|
|
811
|
-
} } }, [t("div", { staticClass: "drag-handle" }, [t("CIcon", { staticClass: "text-gray-300", attrs: { type: "handle", size: "16" } })], 1), t("div", { staticStyle: { "padding-left": "0.5em" } }, [e._v(" " + e._s(i.label) + " ")]), t("span", { directives: [{ name: "show", rawName: "v-show", value: e.removeConfirmIndex === n, expression: "removeConfirmIndex === i" }], staticClass: "delete-confirm" }, [e._v(" " + e._s(e.$t("_common:remove")) + "? ")]), t("div", { staticClass: "unittype-buttons" }, [e.hoverIndex === n || e.removeConfirmIndex === n ? t("CButton", { attrs: { type: e.removeConfirmIndex === n ? "danger" : "none", pattern: e.removeConfirmIndex === n ? "primary" : "tertiary", circle: "", icon: "x", size: "small" }, on: { click: function(
|
|
812
|
-
return
|
|
813
|
-
}, blur: function(
|
|
819
|
+
} } }, [t("div", { staticClass: "drag-handle" }, [t("CIcon", { staticClass: "text-gray-300", attrs: { type: "handle", size: "16" } })], 1), t("div", { staticStyle: { "padding-left": "0.5em" } }, [e._v(" " + e._s(i.label) + " ")]), t("span", { directives: [{ name: "show", rawName: "v-show", value: e.removeConfirmIndex === n, expression: "removeConfirmIndex === i" }], staticClass: "delete-confirm" }, [e._v(" " + e._s(e.$t("_common:remove")) + "? ")]), t("div", { staticClass: "unittype-buttons" }, [e.hoverIndex === n || e.removeConfirmIndex === n ? t("CButton", { attrs: { type: e.removeConfirmIndex === n ? "danger" : "none", pattern: e.removeConfirmIndex === n ? "primary" : "tertiary", circle: "", icon: "x", size: "small" }, on: { click: function(s) {
|
|
820
|
+
return s.stopPropagation(), s.preventDefault(), e.remove(i.id, n);
|
|
821
|
+
}, blur: function(s) {
|
|
814
822
|
e.removeConfirmIndex = null;
|
|
815
823
|
} } }) : e._e(), t("CButton", { attrs: { icon: "edit", size: "small", type: "none", pattern: "tertiary", circle: "" } })], 1)])]);
|
|
816
824
|
}), 1)], 1)])])]);
|
|
@@ -820,7 +828,7 @@ var Je = function() {
|
|
|
820
828
|
Qe,
|
|
821
829
|
!1,
|
|
822
830
|
null,
|
|
823
|
-
"
|
|
831
|
+
"e5a5ef4e"
|
|
824
832
|
);
|
|
825
833
|
const et = Xe.exports, tt = {
|
|
826
834
|
name: "ArticleUnitSelect",
|
|
@@ -845,7 +853,7 @@ const et = Xe.exports, tt = {
|
|
|
845
853
|
unitById: "unitTypes/byId"
|
|
846
854
|
}),
|
|
847
855
|
unitItems() {
|
|
848
|
-
return this.isPublicForm ? ce : (this.unitIds || []).map((
|
|
856
|
+
return this.isPublicForm ? ce : (this.unitIds || []).map((a) => this.unitById(a)).map(({ value: a }) => a);
|
|
849
857
|
}
|
|
850
858
|
},
|
|
851
859
|
created() {
|
|
@@ -862,7 +870,7 @@ const et = Xe.exports, tt = {
|
|
|
862
870
|
{},
|
|
863
871
|
{},
|
|
864
872
|
{
|
|
865
|
-
select: (
|
|
873
|
+
select: (a) => this.$emit("input", a)
|
|
866
874
|
}
|
|
867
875
|
);
|
|
868
876
|
}
|
|
@@ -872,24 +880,28 @@ var it = function() {
|
|
|
872
880
|
var e = this, t = e._self._c;
|
|
873
881
|
return t("CDropdown", e._b({ attrs: { value: e.value, scrollable: "" }, on: { input: function(i) {
|
|
874
882
|
return e.$emit("input", i);
|
|
875
|
-
} }
|
|
883
|
+
} }, scopedSlots: e._u([{ key: "trigger", fn: function() {
|
|
884
|
+
return [e._t("default", function() {
|
|
885
|
+
return [t("CButton", { attrs: { type: "none", pattern: "tertiary" } }, [e._v(" " + e._s(e.articleUnitLabel(e.value)) + " ")])];
|
|
886
|
+
})];
|
|
887
|
+
}, proxy: !0 }, { key: "footer", fn: function() {
|
|
888
|
+
return [e.isPublicForm ? e._e() : t("CButton", { staticClass: "edit-button", attrs: { type: "none", pattern: "secondary", size: "small" }, on: { click: e.openEditModal } }, [e._v(" " + e._s(e.$t("_common:edit", { thing: e.$t("_common:unit_plural") })) + " ")])];
|
|
889
|
+
}, proxy: !0 }], null, !0) }, "CDropdown", {
|
|
876
890
|
position: "is-bottom-left",
|
|
877
891
|
maxHeight: "240px",
|
|
878
892
|
...e.$attrs
|
|
879
|
-
}, !1),
|
|
880
|
-
return [t("CButton", { attrs: { slot: "trigger", type: "none", pattern: "tertiary" }, slot: "trigger" }, [e._v(" " + e._s(e.articleUnitLabel(e.value)) + " ")])];
|
|
881
|
-
}, { slot: "trigger" }), e._l(e.unitItems, function(i, n) {
|
|
893
|
+
}, !1), e._l(e.unitItems, function(i, n) {
|
|
882
894
|
return t("CDropdownItem", { key: `${i}-${n}`, attrs: { value: i } }, [e._v(" " + e._s(e.articleUnitLabel(i)) + " ")]);
|
|
883
|
-
}),
|
|
884
|
-
},
|
|
895
|
+
}), 1);
|
|
896
|
+
}, at = [], st = /* @__PURE__ */ u(
|
|
885
897
|
tt,
|
|
886
898
|
it,
|
|
887
|
-
|
|
899
|
+
at,
|
|
888
900
|
!1,
|
|
889
901
|
null,
|
|
890
|
-
"
|
|
902
|
+
"cf05a2ff"
|
|
891
903
|
);
|
|
892
|
-
const nt =
|
|
904
|
+
const nt = st.exports, rt = {
|
|
893
905
|
name: "ArticleModal",
|
|
894
906
|
i18nOptions: {
|
|
895
907
|
namespaces: "ArticleModal",
|
|
@@ -984,8 +996,8 @@ const nt = at.exports, rt = {
|
|
|
984
996
|
get() {
|
|
985
997
|
return this.articleList[this.index] || {};
|
|
986
998
|
},
|
|
987
|
-
set(
|
|
988
|
-
this.$emit("input",
|
|
999
|
+
set(a) {
|
|
1000
|
+
this.$emit("input", a);
|
|
989
1001
|
}
|
|
990
1002
|
},
|
|
991
1003
|
useVat() {
|
|
@@ -995,52 +1007,52 @@ const nt = at.exports, rt = {
|
|
|
995
1007
|
return o(this, "_document.vatType") || "";
|
|
996
1008
|
},
|
|
997
1009
|
checkboxItems() {
|
|
998
|
-
const { article:
|
|
1010
|
+
const { article: a } = this || {}, { priceType: e } = this.article || {}, t = [
|
|
999
1011
|
...e !== "markup" ? [
|
|
1000
1012
|
{
|
|
1001
1013
|
label: this.$t("discount").capitalize(),
|
|
1002
|
-
value:
|
|
1014
|
+
value: a.discount || this.showDiscountInput,
|
|
1003
1015
|
onClick: () => {
|
|
1004
1016
|
this.showDiscountInput || this.focusEl("discountInput"), this.showDiscountInput = !this.showDiscountInput;
|
|
1005
1017
|
}
|
|
1006
1018
|
}
|
|
1007
1019
|
] : [],
|
|
1008
|
-
...this.getCompanySetting("showRot") ||
|
|
1020
|
+
...this.getCompanySetting("showRot") || a.isDeductable ? [
|
|
1009
1021
|
{
|
|
1010
1022
|
label: this.$t("_common:deduction.rot"),
|
|
1011
1023
|
value: this.article.isDeductable,
|
|
1012
|
-
onClick: () => this.updateArticle(!
|
|
1024
|
+
onClick: () => this.updateArticle(!a.isDeductable, "isDeductable")
|
|
1013
1025
|
}
|
|
1014
1026
|
] : [],
|
|
1015
|
-
...this.getCompanySetting("showRut") ||
|
|
1027
|
+
...this.getCompanySetting("showRut") || a.isRut ? [
|
|
1016
1028
|
{
|
|
1017
1029
|
label: this.$t("_common:deduction.rut"),
|
|
1018
|
-
value:
|
|
1019
|
-
onClick: () => this.updateArticle(!
|
|
1030
|
+
value: a.isRut,
|
|
1031
|
+
onClick: () => this.updateArticle(!a.isRut, "isRut")
|
|
1020
1032
|
}
|
|
1021
1033
|
] : [],
|
|
1022
|
-
...
|
|
1034
|
+
...a.greenRot15 ? [
|
|
1023
1035
|
{
|
|
1024
1036
|
label: this.$t("_common:deduction.greenRot15_percentage"),
|
|
1025
|
-
value:
|
|
1026
|
-
onClick: () => this.updateArticle(!
|
|
1037
|
+
value: a.greenRot15,
|
|
1038
|
+
onClick: () => this.updateArticle(!a.greenRot15, "greenRot15")
|
|
1027
1039
|
}
|
|
1028
1040
|
] : [],
|
|
1029
|
-
...this.getCompanySetting("showGreenRot") ||
|
|
1041
|
+
...this.getCompanySetting("showGreenRot") || a.greenRot20 || a.greenRot50 ? [
|
|
1030
1042
|
{
|
|
1031
1043
|
label: this.$t("_common:deduction.greenRot20_percentage"),
|
|
1032
|
-
value:
|
|
1033
|
-
onClick: () => this.updateArticle(!
|
|
1044
|
+
value: a.greenRot20,
|
|
1045
|
+
onClick: () => this.updateArticle(!a.greenRot20, "greenRot20")
|
|
1034
1046
|
},
|
|
1035
1047
|
{
|
|
1036
1048
|
label: this.$t("_common:deduction.greenRot50_percentage"),
|
|
1037
|
-
value:
|
|
1038
|
-
onClick: () => this.updateArticle(!
|
|
1049
|
+
value: a.greenRot50,
|
|
1050
|
+
onClick: () => this.updateArticle(!a.greenRot50, "greenRot50")
|
|
1039
1051
|
}
|
|
1040
1052
|
] : []
|
|
1041
1053
|
];
|
|
1042
1054
|
if (this.allowHidePrice) {
|
|
1043
|
-
const { showPrice: i } =
|
|
1055
|
+
const { showPrice: i } = a || {};
|
|
1044
1056
|
t.push({
|
|
1045
1057
|
label: this.$t("hidePriceLabel"),
|
|
1046
1058
|
value: !i,
|
|
@@ -1052,28 +1064,28 @@ const nt = at.exports, rt = {
|
|
|
1052
1064
|
priceTypeOptions() {
|
|
1053
1065
|
if (!this.enablePriceTypes || this.rootPriceType === "fixed")
|
|
1054
1066
|
return [];
|
|
1055
|
-
const { priceType:
|
|
1067
|
+
const { priceType: a } = this.article, e = (i) => this.$t(`priceTypeTooltips.${i}`), t = [
|
|
1056
1068
|
{
|
|
1057
1069
|
label: this.$t("price.fixed"),
|
|
1058
1070
|
tooltip: e("fixed"),
|
|
1059
|
-
value:
|
|
1071
|
+
value: a === "fixed",
|
|
1060
1072
|
onClick: () => this.updateArticle("fixed", "priceType")
|
|
1061
1073
|
}
|
|
1062
1074
|
];
|
|
1063
1075
|
return this.rootPriceType === "approx" && t.push({
|
|
1064
1076
|
label: this.$t("price.approx"),
|
|
1065
1077
|
tooltip: e("approx"),
|
|
1066
|
-
value:
|
|
1078
|
+
value: a === "approx",
|
|
1067
1079
|
onClick: () => this.updateArticle("approx", "priceType")
|
|
1068
1080
|
}), this.rootPriceType.startsWith("openAcc") && (t.push({
|
|
1069
1081
|
label: this.$t("price.openAcc"),
|
|
1070
1082
|
tooltip: e("openAcc"),
|
|
1071
|
-
value:
|
|
1083
|
+
value: a === "openAcc",
|
|
1072
1084
|
onClick: () => this.updateArticle("openAcc", "priceType")
|
|
1073
1085
|
}), t.push({
|
|
1074
1086
|
label: this.$t("price.markup"),
|
|
1075
1087
|
tooltip: e("markup"),
|
|
1076
|
-
value:
|
|
1088
|
+
value: a === "markup",
|
|
1077
1089
|
onClick: () => this.updateArticle("markup", "priceType")
|
|
1078
1090
|
})), t;
|
|
1079
1091
|
}
|
|
@@ -1081,29 +1093,29 @@ const nt = at.exports, rt = {
|
|
|
1081
1093
|
watch: {
|
|
1082
1094
|
index: {
|
|
1083
1095
|
immediate: !0,
|
|
1084
|
-
handler(
|
|
1085
|
-
|
|
1096
|
+
handler(a, e) {
|
|
1097
|
+
a !== e && (this.showDiscountInput = !1);
|
|
1086
1098
|
}
|
|
1087
1099
|
},
|
|
1088
1100
|
isIncVat: {
|
|
1089
1101
|
immediate: !0,
|
|
1090
|
-
handler(
|
|
1091
|
-
this.setPricesIncVat = !!
|
|
1102
|
+
handler(a) {
|
|
1103
|
+
this.setPricesIncVat = !!a;
|
|
1092
1104
|
}
|
|
1093
1105
|
},
|
|
1094
1106
|
"article.discount": {
|
|
1095
1107
|
immediate: !0,
|
|
1096
|
-
handler(
|
|
1097
|
-
|
|
1108
|
+
handler(a) {
|
|
1109
|
+
a && (this.showDiscountInput = !0);
|
|
1098
1110
|
}
|
|
1099
1111
|
},
|
|
1100
1112
|
"article.priceType": {
|
|
1101
|
-
handler(
|
|
1102
|
-
|
|
1113
|
+
handler(a) {
|
|
1114
|
+
a === "markup" && (this.showDiscountInput = !1), ["openAcc", "markup"].includes(a) && this.updateArticle(1, "quantity");
|
|
1103
1115
|
}
|
|
1104
1116
|
},
|
|
1105
|
-
showDiscountInput(
|
|
1106
|
-
|
|
1117
|
+
showDiscountInput(a) {
|
|
1118
|
+
a || this.updateArticle(0, "discount");
|
|
1107
1119
|
}
|
|
1108
1120
|
},
|
|
1109
1121
|
mounted() {
|
|
@@ -1116,36 +1128,36 @@ const nt = at.exports, rt = {
|
|
|
1116
1128
|
...v({
|
|
1117
1129
|
createArticle: p.DO_CREATE_ARTICLE
|
|
1118
1130
|
}),
|
|
1119
|
-
onCustomVatBlur(
|
|
1120
|
-
o(
|
|
1131
|
+
onCustomVatBlur(a) {
|
|
1132
|
+
o(a, "target.value") || "" || this.updateArticle(0, "vat");
|
|
1121
1133
|
},
|
|
1122
|
-
onCustomVatInput(
|
|
1123
|
-
const e = o(
|
|
1134
|
+
onCustomVatInput(a) {
|
|
1135
|
+
const e = o(a, "target.value") || "";
|
|
1124
1136
|
if (!e)
|
|
1125
1137
|
return;
|
|
1126
1138
|
let t = e > 100 ? e.slice(0, e.length - 1) : e;
|
|
1127
1139
|
t < 0 && (t = 0), this.updateArticle(Number.parseFloat(t), "vat");
|
|
1128
1140
|
},
|
|
1129
|
-
updateArticle(
|
|
1130
|
-
this.article = $(this.article,
|
|
1141
|
+
updateArticle(a, e) {
|
|
1142
|
+
this.article = $(this.article, a, e);
|
|
1131
1143
|
},
|
|
1132
1144
|
close() {
|
|
1133
1145
|
this.$emit("close");
|
|
1134
1146
|
},
|
|
1135
|
-
onKeydown(
|
|
1136
|
-
|
|
1147
|
+
onKeydown(a) {
|
|
1148
|
+
a.keyCode === 13 && a.shiftKey && (a.preventDefault(), this.addNewArticle());
|
|
1137
1149
|
},
|
|
1138
|
-
onGo(
|
|
1139
|
-
const e = this.index +
|
|
1150
|
+
onGo(a) {
|
|
1151
|
+
const e = this.index + a;
|
|
1140
1152
|
this.articleList[e] && (this.close(), this.$emit("open-modal", e));
|
|
1141
1153
|
},
|
|
1142
1154
|
async addNewArticle() {
|
|
1143
1155
|
this.$v.$invalid || await this.saveArticle(), this.$emit("add", { openModal: !0 }), this.close();
|
|
1144
1156
|
},
|
|
1145
|
-
focusEl(
|
|
1157
|
+
focusEl(a) {
|
|
1146
1158
|
this.$nextTick(() => {
|
|
1147
1159
|
this.$nextTick(() => {
|
|
1148
|
-
this.$refs[
|
|
1160
|
+
this.$refs[a] && this.$refs[a].focus && this.$refs[a].focus();
|
|
1149
1161
|
});
|
|
1150
1162
|
});
|
|
1151
1163
|
},
|
|
@@ -1155,8 +1167,8 @@ const nt = at.exports, rt = {
|
|
|
1155
1167
|
});
|
|
1156
1168
|
},
|
|
1157
1169
|
toggleDiscountType() {
|
|
1158
|
-
let
|
|
1159
|
-
this.article.discountType === "fixed" && (
|
|
1170
|
+
let a = "fixed";
|
|
1171
|
+
this.article.discountType === "fixed" && (a = "percentage"), this.updateArticle(a, "discountType");
|
|
1160
1172
|
},
|
|
1161
1173
|
async onSaveArticle() {
|
|
1162
1174
|
if (this.$v.$invalid) {
|
|
@@ -1168,11 +1180,11 @@ const nt = at.exports, rt = {
|
|
|
1168
1180
|
async saveArticle() {
|
|
1169
1181
|
if (this.viewSettings.isPublicForm)
|
|
1170
1182
|
return;
|
|
1171
|
-
let { ArticleId:
|
|
1172
|
-
!
|
|
1183
|
+
let { ArticleId: a } = this.article;
|
|
1184
|
+
!a && ((t) => typeof t == "string" && !!t.trim())(this.article.name) && (a = await this.createArticle({
|
|
1173
1185
|
body: this.article,
|
|
1174
1186
|
showMessage: !1
|
|
1175
|
-
}), this.article = { ...this.article, ArticleId:
|
|
1187
|
+
}), this.article = { ...this.article, ArticleId: a });
|
|
1176
1188
|
}
|
|
1177
1189
|
}
|
|
1178
1190
|
};
|
|
@@ -1211,25 +1223,29 @@ var ot = function() {
|
|
|
1211
1223
|
e.setPricesIncVat = !e.setPricesIncVat;
|
|
1212
1224
|
} } }, [e._v(" " + e._s(e._document.$t(`vat.${e.setPricesIncVat ? "incVat" : "exVat"}`)) + " ")]) : e._e()], 1), e.showDiscountInput ? t("div", { staticClass: "flex", staticStyle: { "margin-bottom": "1.5em" } }, [t("CField", { staticClass: "label-selector form-control form-control-left flex-grow", staticStyle: { "margin-bottom": "0" }, attrs: { label: e.$t("discount").capitalize(), "label-position": "inside" } }, [t("CPriceInput", { ref: "discountInput", staticClass: "input-selector", attrs: { value: e.article.discount, currency: e.article.currency, "is-inc-vat": e.article.discountType !== "percentage" && e.setPricesIncVat, vat: e.article.vat, "suffix-class": "text-gray-400" }, on: { input: function(i) {
|
|
1213
1225
|
e.updateArticle(Math.abs(i), "discount");
|
|
1214
|
-
} }
|
|
1226
|
+
} }, scopedSlots: e._u([e.article.discountType === "fixed" ? { key: "suffix", fn: function() {
|
|
1227
|
+
return [e._v(" " + e._s(e._document.$t(`vat.${e.setPricesIncVat ? "incVat" : "exVat"}`)) + " ")];
|
|
1228
|
+
}, proxy: !0 } : { key: "suffix", fn: function() {
|
|
1229
|
+
return [e._v(" " + e._s(e.getCurrencySymbol(e.article.currency)) + " ")];
|
|
1230
|
+
}, proxy: !0 }], null, !0) })], 1), t("div", { staticClass: "select-css form-control form-control-right", staticStyle: { width: "5em" }, on: { click: function(i) {
|
|
1215
1231
|
return e.updateArticle(
|
|
1216
1232
|
e.article.discountType === "percentage" ? "fixed" : "percentage",
|
|
1217
1233
|
"discountType"
|
|
1218
1234
|
);
|
|
1219
1235
|
} } }, [e._v(" " + e._s(e.article.discountType === "percentage" ? "%" : e.getCurrencySymbol(e.article.currency)) + " ")])], 1) : e._e()], t("div", { staticStyle: { margin: "calc(1 * var(--rem)) calc(-0.5 * var(--rem))" } }, [e.useVat ? [e.feature("regionSE") && Number.isInteger(e.article.vat) ? t("select", { staticClass: "select-css tag-item no-chevron", staticStyle: { display: "inline", "min-height": "initial", background: "hsl(0, 0%, 94%)", "border-color": "hsl(0, 0%, 94%)", color: "hsl(0, 0%, 30%)" }, domProps: { value: e.article.vat }, on: { input: function(i) {
|
|
1220
1236
|
e.updateArticle(Number.parseFloat(i.target.value), "vat");
|
|
1221
|
-
} } }, e._l(e.vatOptions, function({ translation: i, value: n },
|
|
1222
|
-
return t("option", { key:
|
|
1223
|
-
}), 0) : t("span", { staticClass: "select-css tag-item no-chevron", staticStyle: { display: "inline", "min-height": "initial", background: "hsl(0, 0%, 94%)", "border-color": "hsl(0, 0%, 94%)", color: "hsl(0, 0%, 30%)" } }, [e._v(" " + e._s(e._document.$t("vat").capitalize()) + " "), t("input", { staticStyle: { width: "calc(2.5 * var(--rem))", display: "inline", background: "hsl(0, 0%, 94%)", "border-color": "hsl(0, 0%, 94%)", color: "hsl(0, 0%, 30%)" }, attrs: { type: "number" }, domProps: { value: e.article.vat || 0 }, on: { blur: e.onCustomVatBlur, input: e.onCustomVatInput } }), e._v(" % ")])] : e._e(), e.priceTypeOptions.length ? t("div", { staticClass: "tag-group", staticStyle: { display: "flex", "flex-direction": "row", "flex-wrap": "wrap", "margin-top": "1em" } }, e._l(e.priceTypeOptions, function({ label: i, value: n, onClick:
|
|
1237
|
+
} } }, e._l(e.vatOptions, function({ translation: i, value: n }, s) {
|
|
1238
|
+
return t("option", { key: s, domProps: { value: n } }, [e._v(" " + e._s(e.$t(`vat.${e.vatType}`)) + " " + e._s(i) + " ")]);
|
|
1239
|
+
}), 0) : t("span", { staticClass: "select-css tag-item no-chevron", staticStyle: { display: "inline", "min-height": "initial", background: "hsl(0, 0%, 94%)", "border-color": "hsl(0, 0%, 94%)", color: "hsl(0, 0%, 30%)" } }, [e._v(" " + e._s(e._document.$t("vat").capitalize()) + " "), t("input", { staticStyle: { width: "calc(2.5 * var(--rem))", display: "inline", background: "hsl(0, 0%, 94%)", "border-color": "hsl(0, 0%, 94%)", color: "hsl(0, 0%, 30%)" }, attrs: { type: "number" }, domProps: { value: e.article.vat || 0 }, on: { blur: e.onCustomVatBlur, input: e.onCustomVatInput } }), e._v(" % ")])] : e._e(), e.priceTypeOptions.length ? t("div", { staticClass: "tag-group", staticStyle: { display: "flex", "flex-direction": "row", "flex-wrap": "wrap", "margin-top": "1em" } }, e._l(e.priceTypeOptions, function({ label: i, value: n, onClick: s, tooltip: r }, c) {
|
|
1224
1240
|
return t("div", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: {
|
|
1225
1241
|
content: r,
|
|
1226
1242
|
delay: { show: 300, hide: 0 }
|
|
1227
1243
|
}, expression: `{
|
|
1228
1244
|
content: tooltip,
|
|
1229
1245
|
delay: { show: 300, hide: 0 }
|
|
1230
|
-
}` }], key: i + c, staticClass: "tag-item", class: { active: n }, on: { click:
|
|
1231
|
-
}), 0) : e._e(), t("div", { staticStyle: { display: "flex", "flex-direction": "row", "flex-wrap": "wrap", "margin-top": "1em" } }, e._l(e.checkboxItems, function({ label: i, value: n, onClick:
|
|
1232
|
-
return t("div", { key: i + r, staticClass: "tag-item", class: { active: n }, on: { click:
|
|
1246
|
+
}` }], key: i + c, staticClass: "tag-item", class: { active: n }, on: { click: s } }, [e._v(" " + e._s(i) + " ")]);
|
|
1247
|
+
}), 0) : e._e(), t("div", { staticStyle: { display: "flex", "flex-direction": "row", "flex-wrap": "wrap", "margin-top": "1em" } }, e._l(e.checkboxItems, function({ label: i, value: n, onClick: s }, r) {
|
|
1248
|
+
return t("div", { key: i + r, staticClass: "tag-item", class: { active: n }, on: { click: s } }, [e._v(" " + e._s(i) + " ")]);
|
|
1233
1249
|
}), 0)], 2)], 2)]), t("div", { staticClass: "flex space-x-4 overflow-hidden p-4 md:p-9" }, [t("CButton", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: {
|
|
1234
1250
|
offset: 7,
|
|
1235
1251
|
html: !0,
|
|
@@ -1269,7 +1285,7 @@ var ot = function() {
|
|
|
1269
1285
|
ct,
|
|
1270
1286
|
!1,
|
|
1271
1287
|
null,
|
|
1272
|
-
"
|
|
1288
|
+
"06421912"
|
|
1273
1289
|
);
|
|
1274
1290
|
const ut = lt.exports, dt = {
|
|
1275
1291
|
i18nOptions: {
|
|
@@ -1294,8 +1310,8 @@ const ut = lt.exports, dt = {
|
|
|
1294
1310
|
// eslint-disable-next-line vue/no-reserved-component-names
|
|
1295
1311
|
Article: He,
|
|
1296
1312
|
ArticleModal: ut,
|
|
1297
|
-
WithDimensions:
|
|
1298
|
-
draggable:
|
|
1313
|
+
WithDimensions: ae,
|
|
1314
|
+
draggable: se
|
|
1299
1315
|
},
|
|
1300
1316
|
mixins: [y([])],
|
|
1301
1317
|
props: {
|
|
@@ -1350,24 +1366,24 @@ const ut = lt.exports, dt = {
|
|
|
1350
1366
|
return o(this, "_document.vatType");
|
|
1351
1367
|
},
|
|
1352
1368
|
showVatToggle() {
|
|
1353
|
-
return this.useVat && (this.setPricesIncVat || (this.articles || []).some(({ vat:
|
|
1369
|
+
return this.useVat && (this.setPricesIncVat || (this.articles || []).some(({ vat: a }) => a !== null));
|
|
1354
1370
|
}
|
|
1355
1371
|
},
|
|
1356
1372
|
watch: {
|
|
1357
1373
|
activeHouseWorkType: {
|
|
1358
1374
|
immediate: !0,
|
|
1359
|
-
handler(
|
|
1360
|
-
this.toggleDeductions(
|
|
1375
|
+
handler(a) {
|
|
1376
|
+
this.toggleDeductions(a);
|
|
1361
1377
|
}
|
|
1362
1378
|
},
|
|
1363
|
-
isIndivid(
|
|
1364
|
-
|
|
1379
|
+
isIndivid(a) {
|
|
1380
|
+
a || this.toggleDeductions(!1);
|
|
1365
1381
|
},
|
|
1366
|
-
setPricesIncVat(
|
|
1382
|
+
setPricesIncVat(a) {
|
|
1367
1383
|
this.updateArticlesVatOption(), this.showMessage({
|
|
1368
1384
|
type: "info",
|
|
1369
1385
|
message: this.$t("vatOption.message", {
|
|
1370
|
-
vatOption: this.$t(`_common:vat.${
|
|
1386
|
+
vatOption: this.$t(`_common:vat.${a ? "incVat" : "exVat"}`, {
|
|
1371
1387
|
thing: this.$t("_common:vat.sharedTitle")
|
|
1372
1388
|
})
|
|
1373
1389
|
}),
|
|
@@ -1379,38 +1395,38 @@ const ut = lt.exports, dt = {
|
|
|
1379
1395
|
...v({
|
|
1380
1396
|
showMessage: p.SHOW_MESSAGE
|
|
1381
1397
|
}),
|
|
1382
|
-
openModal(
|
|
1383
|
-
this.selectedIndex =
|
|
1398
|
+
openModal(a, { focusEl: e = "" } = {}) {
|
|
1399
|
+
this.selectedIndex = a, this.showModal = !0, e && this.$nextTick(() => {
|
|
1384
1400
|
this.$nextTick(() => {
|
|
1385
1401
|
this.$refs.articleModal && this.$refs.articleModal.focusEl(e);
|
|
1386
1402
|
});
|
|
1387
1403
|
});
|
|
1388
1404
|
},
|
|
1389
|
-
updateArticleObject(
|
|
1405
|
+
updateArticleObject(a, e) {
|
|
1390
1406
|
const t = e;
|
|
1391
|
-
this.isIndivid || (t.isDeductable = !1, t.isRut = !1, t.greenRot15 = !1, t.greenRot20 = !1, t.greenRot50 = !1), this.$emit("input", { index:
|
|
1407
|
+
this.isIndivid || (t.isDeductable = !1, t.isRut = !1, t.greenRot15 = !1, t.greenRot20 = !1, t.greenRot50 = !1), this.$emit("input", { index: a, value: t });
|
|
1392
1408
|
},
|
|
1393
|
-
onRemoveArticle(
|
|
1394
|
-
this.$emit("remove",
|
|
1409
|
+
onRemoveArticle(a) {
|
|
1410
|
+
this.$emit("remove", a);
|
|
1395
1411
|
},
|
|
1396
|
-
onEsc(
|
|
1397
|
-
|
|
1412
|
+
onEsc(a, e) {
|
|
1413
|
+
a === this.articles.length - 1 && ["name", "price", "discount"].every((t) => !e[t]) && this.onRemoveArticle(a);
|
|
1398
1414
|
},
|
|
1399
1415
|
changeVat() {
|
|
1400
1416
|
this.$emit("update:setPricesIncVat", !this.setPricesIncVat);
|
|
1401
1417
|
},
|
|
1402
1418
|
updateArticlesVatOption() {
|
|
1403
|
-
this.articles.forEach((
|
|
1404
|
-
if (
|
|
1419
|
+
this.articles.forEach((a, e) => {
|
|
1420
|
+
if (a.priceType === "markup")
|
|
1405
1421
|
return;
|
|
1406
|
-
let t = g({ amount:
|
|
1407
|
-
(100 +
|
|
1422
|
+
let t = g({ amount: a.price }).divide(
|
|
1423
|
+
(100 + a.vat) * 0.01
|
|
1408
1424
|
);
|
|
1409
|
-
this.setPricesIncVat || (t = g({ amount:
|
|
1410
|
-
(100 +
|
|
1425
|
+
this.setPricesIncVat || (t = g({ amount: a.price }).multiply(
|
|
1426
|
+
(100 + a.vat) * 0.01
|
|
1411
1427
|
)), this.updateArticleObject(
|
|
1412
1428
|
e,
|
|
1413
|
-
w({ ...
|
|
1429
|
+
w({ ...a, price: t.getAmount() })
|
|
1414
1430
|
);
|
|
1415
1431
|
});
|
|
1416
1432
|
},
|
|
@@ -1423,33 +1439,33 @@ const ut = lt.exports, dt = {
|
|
|
1423
1439
|
openLastArticle() {
|
|
1424
1440
|
this.$nextTick(() => this.openModal(this.articles.length - 1));
|
|
1425
1441
|
},
|
|
1426
|
-
toggleDeductions(
|
|
1442
|
+
toggleDeductions(a) {
|
|
1427
1443
|
const e = {
|
|
1428
1444
|
rot: "isDeductable",
|
|
1429
1445
|
rut: "isRut",
|
|
1430
1446
|
greenRot15: "greenRot15",
|
|
1431
1447
|
greenRot20: "greenRot20",
|
|
1432
1448
|
greenRot50: "greenRot50"
|
|
1433
|
-
}, t = (i = []) => i.reduce((n,
|
|
1434
|
-
e[
|
|
1435
|
-
const
|
|
1436
|
-
if (
|
|
1437
|
-
const r = { ...i, ...t(
|
|
1449
|
+
}, t = (i = []) => i.reduce((n, s) => ({ ...n, [s]: !1 }), {});
|
|
1450
|
+
e[a] ? this.articles.forEach((i, n) => {
|
|
1451
|
+
const s = Object.values(V(e, [a]));
|
|
1452
|
+
if (s.some((r) => !!i[r])) {
|
|
1453
|
+
const r = { ...i, ...t(s) };
|
|
1438
1454
|
this.$emit("input", { index: n, value: r });
|
|
1439
1455
|
}
|
|
1440
|
-
}) :
|
|
1441
|
-
const
|
|
1442
|
-
if (
|
|
1443
|
-
const r = { ...i, ...t(
|
|
1456
|
+
}) : a === !1 && this.articles.forEach((i, n) => {
|
|
1457
|
+
const s = Object.values(e);
|
|
1458
|
+
if (s.some((r) => !!i[r])) {
|
|
1459
|
+
const r = { ...i, ...t(s) };
|
|
1444
1460
|
this.$emit("input", { index: n, value: r });
|
|
1445
1461
|
}
|
|
1446
1462
|
});
|
|
1447
1463
|
},
|
|
1448
|
-
onChange(
|
|
1449
|
-
const { added: e, moved: t, removed: i } =
|
|
1464
|
+
onChange(a) {
|
|
1465
|
+
const { added: e, moved: t, removed: i } = a;
|
|
1450
1466
|
if (e) {
|
|
1451
|
-
const { newIndex: n, element:
|
|
1452
|
-
this.$emit("insert", { index: n, value:
|
|
1467
|
+
const { newIndex: n, element: s } = e;
|
|
1468
|
+
this.$emit("insert", { index: n, value: s });
|
|
1453
1469
|
} else if (t) {
|
|
1454
1470
|
const n = T(
|
|
1455
1471
|
this.articles,
|
|
@@ -1474,23 +1490,23 @@ var pt = function() {
|
|
|
1474
1490
|
animation: 150,
|
|
1475
1491
|
ghostClass: "article-ghost",
|
|
1476
1492
|
handle: ".article-draggable-handle"
|
|
1477
|
-
}, !1), [t("transition-group", { staticStyle: { position: "relative", transition: "100ms" }, attrs: { name: "article-list" } }, e._l(e.articlesWithTotal, function(n,
|
|
1493
|
+
}, !1), [t("transition-group", { staticStyle: { position: "relative", transition: "100ms" }, attrs: { name: "article-list" } }, e._l(e.articlesWithTotal, function(n, s) {
|
|
1478
1494
|
return t("Article", { key: n._uniqueId || 0, ref: "articleItem", refInFor: !0, staticClass: "article-item", attrs: { value: n, width: i, "hide-price-input": e.hidePriceInput, "hide-price-on-new": e.hidePriceOnNew, "is-inc-vat": e.setPricesIncVat, "hide-controls": e.hideControls, "root-price-type": e.rootPriceType, "active-house-work-type": e.activeHouseWorkType }, on: { "update:currency": function(r) {
|
|
1479
1495
|
return e.$emit("update:currency", r);
|
|
1480
1496
|
}, input: function(r) {
|
|
1481
|
-
return e.updateArticleObject(
|
|
1497
|
+
return e.updateArticleObject(s, r);
|
|
1482
1498
|
}, focus: function(r) {
|
|
1483
1499
|
return e.$emit("focus");
|
|
1484
1500
|
}, remove: function(r) {
|
|
1485
|
-
return e.onRemoveArticle(
|
|
1501
|
+
return e.onRemoveArticle(s);
|
|
1486
1502
|
}, "open-modal": function(r) {
|
|
1487
|
-
return e.openModal(
|
|
1503
|
+
return e.openModal(s, r);
|
|
1488
1504
|
}, add: function(r) {
|
|
1489
|
-
|
|
1505
|
+
s === e.articlesWithTotal.length - 1 && e.$emit("add");
|
|
1490
1506
|
}, select: function(r) {
|
|
1491
|
-
|
|
1507
|
+
s === e.articlesWithTotal.length - 1 && e.$emit("add");
|
|
1492
1508
|
}, esc: function(r) {
|
|
1493
|
-
return e.onEsc(
|
|
1509
|
+
return e.onEsc(s, n);
|
|
1494
1510
|
} } });
|
|
1495
1511
|
}), 1)], 1)];
|
|
1496
1512
|
} }]) }), t("Portal", { attrs: { to: "modal" } }, [e.showModal && e.articlesWithTotal[e.selectedIndex] ? t("ArticleModal", { ref: "articleModal", attrs: { _document: e._document, index: e.selectedIndex, "article-list": e.articlesWithTotal, "hide-price-input": e.hidePriceInput, "hide-price-on-new": e.hidePriceOnNew, "is-inc-vat": e.setPricesIncVat, "root-price-type": e.rootPriceType, currency: e.currency, "active-house-work-type": e.activeHouseWorkType, "view-settings": e.viewSettings }, on: { "update:currency": function(i) {
|
|
@@ -1551,9 +1567,9 @@ const ft = mt.exports, vt = {
|
|
|
1551
1567
|
})
|
|
1552
1568
|
},
|
|
1553
1569
|
watch: {
|
|
1554
|
-
isIncVat(
|
|
1570
|
+
isIncVat(a) {
|
|
1555
1571
|
let e = g({ amount: this.value }).divide(1.25);
|
|
1556
|
-
|
|
1572
|
+
a || (e = g({ amount: this.value }).multiply(125 * 0.01)), this.$emit("input", e.getAmount());
|
|
1557
1573
|
}
|
|
1558
1574
|
}
|
|
1559
1575
|
};
|
|
@@ -1561,7 +1577,11 @@ var gt = function() {
|
|
|
1561
1577
|
var e = this, t = e._self._c;
|
|
1562
1578
|
return t("div", { staticClass: "flex w-full justify-end" }, [t("CPriceInput", { staticClass: "mt-4 max-w-[275px] text-sm", attrs: { value: e.value, currency: e.currency, "is-inc-vat": e.isIncVat, vat: 25, placeholder: e.$t("maxTotalLabel"), min: "0", "prefix-class": "text-gray-400", "suffix-class": "text-gray-400" }, on: { input: function(i) {
|
|
1563
1579
|
return e.$emit("input", i);
|
|
1564
|
-
} }
|
|
1580
|
+
} }, scopedSlots: e._u([{ key: "prefix", fn: function() {
|
|
1581
|
+
return [e._v(e._s(e.$t("price.maxPrice").capitalize()))];
|
|
1582
|
+
}, proxy: !0 }, { key: "suffix", fn: function() {
|
|
1583
|
+
return [t("span", [e._v(" " + e._s(e.getCurrencySymbol(e.currency)) + " " + e._s(e.$t(`vat.${e.isIncVat ? "incVat" : "exVat"}`, { thing: e.$t(`vat.${e.vatType}`) })) + " ")])];
|
|
1584
|
+
}, proxy: !0 }]) })], 1);
|
|
1565
1585
|
}, yt = [], _t = /* @__PURE__ */ u(
|
|
1566
1586
|
vt,
|
|
1567
1587
|
gt,
|
|
@@ -1585,18 +1605,20 @@ const kt = _t.exports, $t = {
|
|
|
1585
1605
|
};
|
|
1586
1606
|
var xt = function() {
|
|
1587
1607
|
var e = this, t = e._self._c;
|
|
1588
|
-
return t("div", { staticClass: "flex justify-end" }, [t("CDropdown", { attrs: { value: e.value }
|
|
1608
|
+
return t("div", { staticClass: "flex justify-end" }, [t("CDropdown", { attrs: { value: e.value }, scopedSlots: e._u([{ key: "trigger", fn: function() {
|
|
1609
|
+
return [t("CButton", { staticClass: "price-type-button" }, [e._v(" " + e._s(e.$t("price.pricing").capitalize()) + ": "), t("span", [e._v(e._s(e.$t(`price.${e.value}`)))])])];
|
|
1610
|
+
}, proxy: !0 }]) }, e._l(e.priceTypeOptions, function(i) {
|
|
1589
1611
|
return t("CDropdownItem", { key: i, staticClass: "text-right", attrs: { value: i }, on: { click: function(n) {
|
|
1590
1612
|
return e.$emit("input", i);
|
|
1591
1613
|
} } }, [e._v(" " + e._s(e.$t(`price.${i}`)) + " ")]);
|
|
1592
|
-
})
|
|
1614
|
+
}), 1)], 1);
|
|
1593
1615
|
}, bt = [], wt = /* @__PURE__ */ u(
|
|
1594
1616
|
$t,
|
|
1595
1617
|
xt,
|
|
1596
1618
|
bt,
|
|
1597
1619
|
!1,
|
|
1598
1620
|
null,
|
|
1599
|
-
"
|
|
1621
|
+
"413621dd"
|
|
1600
1622
|
);
|
|
1601
1623
|
const Ct = wt.exports, Tt = {
|
|
1602
1624
|
name: "EditDeduction",
|
|
@@ -1629,13 +1651,13 @@ const Ct = wt.exports, Tt = {
|
|
|
1629
1651
|
};
|
|
1630
1652
|
},
|
|
1631
1653
|
watch: {
|
|
1632
|
-
houseWorkType(
|
|
1633
|
-
|
|
1654
|
+
houseWorkType(a) {
|
|
1655
|
+
a || (this.houseWorkManualAmount = null);
|
|
1634
1656
|
}
|
|
1635
1657
|
},
|
|
1636
1658
|
methods: {
|
|
1637
|
-
setDeduction(
|
|
1638
|
-
this.internalValue = g({ amount: this.total }).multiply(
|
|
1659
|
+
setDeduction(a) {
|
|
1660
|
+
this.internalValue = g({ amount: this.total }).multiply(a).getAmount();
|
|
1639
1661
|
},
|
|
1640
1662
|
showModal() {
|
|
1641
1663
|
this.internalValue = this.houseWorkAmount, this.$modal.show(`deduction-modal-${this._uid}`);
|
|
@@ -1675,7 +1697,7 @@ var It = function() {
|
|
|
1675
1697
|
} } }, [e._v(" " + e._s(e.$t("reset")) + " ")])], 1)]), e.houseWorkManualAmount ? t("portal", { attrs: { order: 2, to: "document-nav-bottom" } }, [t("div", { staticClass: "housework-manual-nav", on: { click: function(i) {
|
|
1676
1698
|
return e.$modal.show(`deduction-modal-${e._uid}`);
|
|
1677
1699
|
} } }, [t("svg", { staticClass: "css-i6dzq1", staticStyle: { "margin-right": "0.5em" }, attrs: { viewBox: "0 0 24 24", width: "12", height: "12", stroke: "currentColor", "stroke-width": "2", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" } }, [t("path", { attrs: { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" } }), t("line", { attrs: { x1: "12", y1: "9", x2: "12", y2: "13" } }), t("line", { attrs: { x1: "12", y1: "17", x2: "12.01", y2: "17" } })]), e._v(" " + e._s(e.$t("deduction.manualType", { type: e.houseWorkType })) + " " + e._s(e.$t("using")) + " ")])]) : e._e()], 1);
|
|
1678
|
-
}, At = [],
|
|
1700
|
+
}, At = [], St = /* @__PURE__ */ u(
|
|
1679
1701
|
Tt,
|
|
1680
1702
|
It,
|
|
1681
1703
|
At,
|
|
@@ -1683,10 +1705,10 @@ var It = function() {
|
|
|
1683
1705
|
null,
|
|
1684
1706
|
"f3ba2092"
|
|
1685
1707
|
);
|
|
1686
|
-
const
|
|
1708
|
+
const Pt = St.exports, Vt = {
|
|
1687
1709
|
name: "Pricing",
|
|
1688
1710
|
components: {
|
|
1689
|
-
EditDeduction:
|
|
1711
|
+
EditDeduction: Pt
|
|
1690
1712
|
},
|
|
1691
1713
|
props: {
|
|
1692
1714
|
_document: {
|
|
@@ -1772,10 +1794,10 @@ const St = Pt.exports, Vt = {
|
|
|
1772
1794
|
}));
|
|
1773
1795
|
},
|
|
1774
1796
|
prices() {
|
|
1775
|
-
const { prices:
|
|
1797
|
+
const { prices: a } = this._document.packageGroups.getPackageById(
|
|
1776
1798
|
this.packageId
|
|
1777
1799
|
);
|
|
1778
|
-
return
|
|
1800
|
+
return a;
|
|
1779
1801
|
},
|
|
1780
1802
|
showHouseWork() {
|
|
1781
1803
|
return !!o(this.prices, "region.houseWorkType", !1) || !!o(this.prices, "region.houseWorkManualAmount", !1);
|
|
@@ -1787,7 +1809,7 @@ var Rt = function() {
|
|
|
1787
1809
|
return t("div", { staticClass: "price-bubble" }, [t("div", { staticClass: "flex w-full items-center justify-between" }, [e.showHouseWork ? t("EditDeduction", e._g({ ref: "deduction", attrs: { disabled: !e.get(e.prices, "region.houseWorkType", !1), _document: e._document, _value: {
|
|
1788
1810
|
houseWorkManualAmount: `${e.basePath}.data.prices.region.houseWorkManualAmount`
|
|
1789
1811
|
}, "house-work-type": e.prices.region.houseWorkType, "house-work-amount": e.prices.region.houseWorkAmount, total: e.prices.subTotal + e.prices.taxAmount } }, e.$listeners)) : e._e()], 1), t("div", e._l(e.priceArray, function(i, n) {
|
|
1790
|
-
return t("div", { key: n, staticClass: "price-row flex w-full justify-between", class: [i.classList || ""] }, [t("div", { staticClass: "price-label" }, [e._v(" " + e._s(i.label.capitalize()) + " "), i.subLabel ? t("span", { staticClass: "pricing-sub-label" }, [e._v(" " + e._s(i.subLabel) + " ")]) : e._e(), i.action ? t("span", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("edit", { thing: e.$t("deduction.deduction") }), expression: "$t('edit', { thing: $t('deduction.deduction') })" }], staticClass: "pricing-action", on: { click: function(
|
|
1812
|
+
return t("div", { key: n, staticClass: "price-row flex w-full justify-between", class: [i.classList || ""] }, [t("div", { staticClass: "price-label" }, [e._v(" " + e._s(i.label.capitalize()) + " "), i.subLabel ? t("span", { staticClass: "pricing-sub-label" }, [e._v(" " + e._s(i.subLabel) + " ")]) : e._e(), i.action ? t("span", { directives: [{ name: "tooltip", rawName: "v-tooltip", value: e.$t("edit", { thing: e.$t("deduction.deduction") }), expression: "$t('edit', { thing: $t('deduction.deduction') })" }], staticClass: "pricing-action", on: { click: function(s) {
|
|
1791
1813
|
i.action && i.action();
|
|
1792
1814
|
} } }, [t("svg", { attrs: { viewBox: "0 0 24 24", width: "15", height: "15", stroke: "currentColor", "stroke-width": "2.5", fill: "none", "stroke-linecap": "round", "stroke-linejoin": "round" } }, [t("path", { attrs: { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" } }), t("path", { attrs: { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" } })])]) : e._e()]), t("div", { staticClass: "price-value" }, [e._v(" " + e._s(i.prefix) + " " + e._s(i.value) + " ")])]);
|
|
1793
1815
|
}), 0)]);
|
|
@@ -1881,7 +1903,7 @@ const Mt = Ot.exports, Lt = {
|
|
|
1881
1903
|
return this._document.allArticles;
|
|
1882
1904
|
},
|
|
1883
1905
|
mappedPackageArticles() {
|
|
1884
|
-
return (this.articles || []).map((
|
|
1906
|
+
return (this.articles || []).map((a, e) => ({ ...a, i: e })).filter(({ packageId: a }) => a === this.packageId);
|
|
1885
1907
|
},
|
|
1886
1908
|
internalDescription: {
|
|
1887
1909
|
get() {
|
|
@@ -1891,16 +1913,16 @@ const Mt = Ot.exports, Lt = {
|
|
|
1891
1913
|
this._document._doc
|
|
1892
1914
|
);
|
|
1893
1915
|
},
|
|
1894
|
-
set(
|
|
1895
|
-
this.description = Q(
|
|
1916
|
+
set(a) {
|
|
1917
|
+
this.description = Q(a);
|
|
1896
1918
|
}
|
|
1897
1919
|
}
|
|
1898
1920
|
},
|
|
1899
1921
|
watch: {
|
|
1900
|
-
priceType(
|
|
1901
|
-
if (!(
|
|
1902
|
-
if (
|
|
1903
|
-
const t =
|
|
1922
|
+
priceType(a, e) {
|
|
1923
|
+
if (!(a && a.startsWith("open") && e && e.startsWith("open"))) {
|
|
1924
|
+
if (a) {
|
|
1925
|
+
const t = a.startsWith("open") ? "openAcc" : a;
|
|
1904
1926
|
this.mappedPackageArticles.forEach((i, n) => {
|
|
1905
1927
|
this.onArticleInput({
|
|
1906
1928
|
index: n,
|
|
@@ -1913,7 +1935,7 @@ const Mt = Ot.exports, Lt = {
|
|
|
1913
1935
|
});
|
|
1914
1936
|
}
|
|
1915
1937
|
}
|
|
1916
|
-
|
|
1938
|
+
a !== "openAccMaxPrice" && (this.maxTotal = null);
|
|
1917
1939
|
}
|
|
1918
1940
|
},
|
|
1919
1941
|
methods: {
|
|
@@ -1922,18 +1944,18 @@ const Mt = Ot.exports, Lt = {
|
|
|
1922
1944
|
},
|
|
1923
1945
|
// Article Methods
|
|
1924
1946
|
createEmptyArticle() {
|
|
1925
|
-
const
|
|
1947
|
+
const a = this.newArticle({
|
|
1926
1948
|
priceType: this.priceType.startsWith("open") ? "openAcc" : this.priceType,
|
|
1927
1949
|
packageId: this.packageId,
|
|
1928
1950
|
currency: this.currency
|
|
1929
1951
|
});
|
|
1930
1952
|
this.$emit("input", {
|
|
1931
1953
|
key: "articles",
|
|
1932
|
-
value: [...this.articles,
|
|
1954
|
+
value: [...this.articles, a]
|
|
1933
1955
|
});
|
|
1934
1956
|
},
|
|
1935
|
-
onArticleInput({ index:
|
|
1936
|
-
const { i: t } = this.mappedPackageArticles[
|
|
1957
|
+
onArticleInput({ index: a, value: e }) {
|
|
1958
|
+
const { i: t } = this.mappedPackageArticles[a], i = X(e, [
|
|
1937
1959
|
"allowRot",
|
|
1938
1960
|
"allowRut",
|
|
1939
1961
|
"isIncVat",
|
|
@@ -1942,13 +1964,13 @@ const Mt = Ot.exports, Lt = {
|
|
|
1942
1964
|
]);
|
|
1943
1965
|
i.currency = this.currency, this.$emit("input", { key: `articles[${[t]}]`, value: i });
|
|
1944
1966
|
},
|
|
1945
|
-
onArticleAdd({ openModal:
|
|
1946
|
-
this.createEmptyArticle(),
|
|
1967
|
+
onArticleAdd({ openModal: a = !1 } = {}) {
|
|
1968
|
+
this.createEmptyArticle(), a ? this.$refs.articleList.openLastArticle() : this.$refs.articleList.focusLastArticle();
|
|
1947
1969
|
},
|
|
1948
|
-
onInsert({ index:
|
|
1970
|
+
onInsert({ index: a, value: e }) {
|
|
1949
1971
|
const t = ee(this.mappedPackageArticles).add(
|
|
1950
1972
|
{ ...e, packageId: this.packageId },
|
|
1951
|
-
|
|
1973
|
+
a
|
|
1952
1974
|
);
|
|
1953
1975
|
this.$emit("input", {
|
|
1954
1976
|
key: "articles",
|
|
@@ -1960,18 +1982,18 @@ const Mt = Ot.exports, Lt = {
|
|
|
1960
1982
|
]
|
|
1961
1983
|
});
|
|
1962
1984
|
},
|
|
1963
|
-
onArticleRemove(
|
|
1964
|
-
const { i: e } = this.mappedPackageArticles[
|
|
1985
|
+
onArticleRemove(a) {
|
|
1986
|
+
const { i: e } = this.mappedPackageArticles[a];
|
|
1965
1987
|
this.$emit("remove", { key: `articles[${[e]}]` });
|
|
1966
1988
|
},
|
|
1967
|
-
onArticleMove(
|
|
1989
|
+
onArticleMove(a) {
|
|
1968
1990
|
this.$emit("input", {
|
|
1969
1991
|
key: "articles",
|
|
1970
1992
|
value: [
|
|
1971
1993
|
...this.articles.filter(
|
|
1972
1994
|
({ packageId: e }) => e !== this.packageId
|
|
1973
1995
|
),
|
|
1974
|
-
...
|
|
1996
|
+
...a
|
|
1975
1997
|
]
|
|
1976
1998
|
});
|
|
1977
1999
|
}
|
|
@@ -1979,7 +2001,9 @@ const Mt = Ot.exports, Lt = {
|
|
|
1979
2001
|
};
|
|
1980
2002
|
var Et = function() {
|
|
1981
2003
|
var e = this, t = e._self._c;
|
|
1982
|
-
return t("div", { staticClass: "min-h-0 rounded-md border border-gray-200 bg-white text-black" }, [t("div", { staticClass: "flex w-full items-center justify-between bg-gray-100 py-1 pl-4 pr-1 text-sm font-medium text-gray-600" }, [t("div", [e._v(" " + e._s(e.type === "single" ? e.$t("single") : e.type === "radio" || e.toggable ? e.$t("option") : e.$t("base")) + " ")]), e.type !== "single" ? t("CDropdown", { staticClass: "ml-4"
|
|
2004
|
+
return t("div", { staticClass: "min-h-0 rounded-md border border-gray-200 bg-white text-black" }, [t("div", { staticClass: "flex w-full items-center justify-between bg-gray-100 py-1 pl-4 pr-1 text-sm font-medium text-gray-600" }, [t("div", [e._v(" " + e._s(e.type === "single" ? e.$t("single") : e.type === "radio" || e.toggable ? e.$t("option") : e.$t("base")) + " ")]), e.type !== "single" ? t("CDropdown", { staticClass: "ml-4", scopedSlots: e._u([{ key: "trigger", fn: function() {
|
|
2005
|
+
return [t("CButton", { staticClass: "is-thinner opacity-70", attrs: { size: "small", type: "text", pattern: "secondary" } }, [e._v(" " + e._s(e.$t("_common:change")) + " ")])];
|
|
2006
|
+
}, proxy: !0 }], null, !1, 3891513618) }, [e.toggable ? [t("CDropdownItem", { attrs: { value: e.isSelectedDefault, toggle: !0, "close-on-click": !1 }, on: { click: function(i) {
|
|
1983
2007
|
return e.$emit("update:isSelectedDefault", !e.isSelectedDefault);
|
|
1984
2008
|
} } }, [e._v(" " + e._s(e.$t("selected")) + " ")]), t("CDropdownItem", { attrs: { separator: "" } })] : e._e(), t("CDropdownItem", { attrs: { "icon-left": "arrow-up", disabled: !e.moveOptions.up }, on: { click: function(i) {
|
|
1985
2009
|
return e.$emit("move", -1);
|
|
@@ -2033,16 +2057,16 @@ var Et = function() {
|
|
|
2033
2057
|
zt,
|
|
2034
2058
|
!1,
|
|
2035
2059
|
null,
|
|
2036
|
-
"
|
|
2060
|
+
"d34c5127"
|
|
2037
2061
|
);
|
|
2038
|
-
const Wt = Bt.exports,
|
|
2062
|
+
const Wt = Bt.exports, jt = (a) => (a || []).slice(0, 1).map((e) => ({
|
|
2039
2063
|
...e,
|
|
2040
2064
|
isSelected: !0,
|
|
2041
2065
|
isSelectedDefault: !0,
|
|
2042
2066
|
toggable: !1
|
|
2043
|
-
})),
|
|
2044
|
-
const e = o(
|
|
2045
|
-
return (
|
|
2067
|
+
})), Ft = (a) => {
|
|
2068
|
+
const e = o(a, "0.data.prices.type") || "fixed";
|
|
2069
|
+
return (a || []).map((t, i) => ({
|
|
2046
2070
|
...t,
|
|
2047
2071
|
toggable: !0,
|
|
2048
2072
|
...i === 0 ? {
|
|
@@ -2058,9 +2082,9 @@ const Wt = Bt.exports, Ft = (s) => (s || []).slice(0, 1).map((e) => ({
|
|
|
2058
2082
|
}
|
|
2059
2083
|
}
|
|
2060
2084
|
}));
|
|
2061
|
-
}, Nt = (
|
|
2085
|
+
}, Nt = (a = []) => {
|
|
2062
2086
|
let e = !1;
|
|
2063
|
-
return
|
|
2087
|
+
return a.map((t) => {
|
|
2064
2088
|
const i = {
|
|
2065
2089
|
...t,
|
|
2066
2090
|
// if any earlier pkg is selected, deselect pkg, otherwise keep as is
|
|
@@ -2073,14 +2097,14 @@ const Wt = Bt.exports, Ft = (s) => (s || []).slice(0, 1).map((e) => ({
|
|
|
2073
2097
|
return (i.isSelected || i.isSelectedDefault) && (e = !0), i;
|
|
2074
2098
|
}, []);
|
|
2075
2099
|
};
|
|
2076
|
-
function Ht(
|
|
2077
|
-
if (
|
|
2078
|
-
return Ft(...e);
|
|
2079
|
-
if (s === "checkbox")
|
|
2100
|
+
function Ht(a, ...e) {
|
|
2101
|
+
if (a === "single")
|
|
2080
2102
|
return jt(...e);
|
|
2081
|
-
if (
|
|
2103
|
+
if (a === "checkbox")
|
|
2104
|
+
return Ft(...e);
|
|
2105
|
+
if (a === "radio")
|
|
2082
2106
|
return Nt(...e);
|
|
2083
|
-
throw new Error(`Package filter type '${
|
|
2107
|
+
throw new Error(`Package filter type '${a}' is not implemented`);
|
|
2084
2108
|
}
|
|
2085
2109
|
const qt = {
|
|
2086
2110
|
name: "PackageGroupEdit",
|
|
@@ -2120,7 +2144,7 @@ const qt = {
|
|
|
2120
2144
|
}
|
|
2121
2145
|
},
|
|
2122
2146
|
components: {
|
|
2123
|
-
ErrorCallout:
|
|
2147
|
+
ErrorCallout: S,
|
|
2124
2148
|
PackageItem: Wt,
|
|
2125
2149
|
PackageGroupSelect: Oe
|
|
2126
2150
|
},
|
|
@@ -2155,13 +2179,13 @@ const qt = {
|
|
|
2155
2179
|
newArticle: "articles/getNewArticle"
|
|
2156
2180
|
}),
|
|
2157
2181
|
internalPackages() {
|
|
2158
|
-
return this.packages.map((
|
|
2182
|
+
return this.packages.map((a, e) => ({ ...a, index: e }));
|
|
2159
2183
|
},
|
|
2160
2184
|
topRowPackages() {
|
|
2161
|
-
return this.type === "checkbox" ? this.internalPackages.filter(({ toggable:
|
|
2185
|
+
return this.type === "checkbox" ? this.internalPackages.filter(({ toggable: a }) => a === !1) : this.internalPackages;
|
|
2162
2186
|
},
|
|
2163
2187
|
bottomRowPackages() {
|
|
2164
|
-
return this.type === "checkbox" ? this.internalPackages.filter(({ toggable:
|
|
2188
|
+
return this.type === "checkbox" ? this.internalPackages.filter(({ toggable: a }) => a === !0) : [];
|
|
2165
2189
|
},
|
|
2166
2190
|
group() {
|
|
2167
2191
|
return this._document.packageGroups.getPackageGroupUniqId(
|
|
@@ -2196,18 +2220,18 @@ const qt = {
|
|
|
2196
2220
|
...v({
|
|
2197
2221
|
showMessage: p.SHOW_MESSAGE
|
|
2198
2222
|
}),
|
|
2199
|
-
setPricesIncVatAsDefault(
|
|
2223
|
+
setPricesIncVatAsDefault(a = {}) {
|
|
2200
2224
|
this.$emit("input", {
|
|
2201
2225
|
key: "data.formSettings.setPricesIncVat",
|
|
2202
2226
|
value: this.defaultVatInput === "incVat",
|
|
2203
|
-
options:
|
|
2227
|
+
options: a
|
|
2204
2228
|
});
|
|
2205
2229
|
},
|
|
2206
|
-
onSelectType(
|
|
2207
|
-
this.type =
|
|
2230
|
+
onSelectType(a) {
|
|
2231
|
+
this.type = a;
|
|
2208
2232
|
const { type: e, packages: t } = this.persistedGroup || {};
|
|
2209
2233
|
if (e && t && t.length)
|
|
2210
|
-
this.addPersistedGroup(
|
|
2234
|
+
this.addPersistedGroup(a), a !== e && this.showMessage({
|
|
2211
2235
|
type: "info",
|
|
2212
2236
|
message: this.$t("reset.message"),
|
|
2213
2237
|
actions: {
|
|
@@ -2220,28 +2244,28 @@ const qt = {
|
|
|
2220
2244
|
}
|
|
2221
2245
|
});
|
|
2222
2246
|
else {
|
|
2223
|
-
if (
|
|
2247
|
+
if (a === "checkbox")
|
|
2224
2248
|
return;
|
|
2225
2249
|
this.addPackage({});
|
|
2226
2250
|
}
|
|
2227
2251
|
},
|
|
2228
|
-
addPersistedGroup(
|
|
2252
|
+
addPersistedGroup(a) {
|
|
2229
2253
|
if (!this.persistedGroup || !this.persistedGroup.type)
|
|
2230
2254
|
return;
|
|
2231
2255
|
let { packages: e, articles: t } = this.persistedGroup;
|
|
2232
2256
|
if (!e.length)
|
|
2233
2257
|
return;
|
|
2234
|
-
if (
|
|
2258
|
+
if (a !== this.persistedGroup.type && (e = Ht(a, e)), a === "single" && t.length) {
|
|
2235
2259
|
const [{ packageId: n }] = e;
|
|
2236
|
-
t = t.filter((
|
|
2260
|
+
t = t.filter((s) => s.packageId === n);
|
|
2237
2261
|
}
|
|
2238
|
-
const i =
|
|
2262
|
+
const i = Se(
|
|
2239
2263
|
[...this._document.allArticles || [], ...t || []],
|
|
2240
2264
|
(n) => n._uniqueId
|
|
2241
2265
|
);
|
|
2242
2266
|
this.$emit("input", { key: "articles", value: i }), this.$emit("input", { key: `${[this._value.packages]}`, value: e });
|
|
2243
2267
|
},
|
|
2244
|
-
addPackage(
|
|
2268
|
+
addPackage(a = {}) {
|
|
2245
2269
|
const e = te(), t = this.type === "checkbox" && this.packages.length ? this.packages[0].data.prices.type : "fixed", i = this.currency || this.defaultCurrency, n = {
|
|
2246
2270
|
isSelected: this.type === "single",
|
|
2247
2271
|
isSelectedDefault: this.type === "single",
|
|
@@ -2255,7 +2279,7 @@ const qt = {
|
|
|
2255
2279
|
currency: i
|
|
2256
2280
|
}
|
|
2257
2281
|
},
|
|
2258
|
-
...
|
|
2282
|
+
...a
|
|
2259
2283
|
};
|
|
2260
2284
|
this.$emit("input", { key: this._value.packages, value: n }), this.$emit("input", {
|
|
2261
2285
|
key: "articles",
|
|
@@ -2265,21 +2289,21 @@ const qt = {
|
|
|
2265
2289
|
currency: i
|
|
2266
2290
|
})
|
|
2267
2291
|
}), this.$nextTick(() => {
|
|
2268
|
-
const
|
|
2269
|
-
|
|
2292
|
+
const s = document.getElementById(`package-name-${e}`);
|
|
2293
|
+
s && s.focus();
|
|
2270
2294
|
});
|
|
2271
2295
|
},
|
|
2272
|
-
onInputPriceType(
|
|
2296
|
+
onInputPriceType(a, e) {
|
|
2273
2297
|
this.type === "checkbox" && this.packages.forEach((t, i) => {
|
|
2274
|
-
i !==
|
|
2298
|
+
i !== a && this.$emit("input", {
|
|
2275
2299
|
key: `${[this._value.packages]}[${[i]}].data.prices.type`,
|
|
2276
2300
|
value: e
|
|
2277
2301
|
});
|
|
2278
2302
|
});
|
|
2279
2303
|
},
|
|
2280
|
-
onInputSelectedDefault(
|
|
2304
|
+
onInputSelectedDefault(a, e) {
|
|
2281
2305
|
this.type === "radio" && !e || (this.type === "radio" && e && this.packages.forEach((t, i) => {
|
|
2282
|
-
i !==
|
|
2306
|
+
i !== a && (this.$emit("input", {
|
|
2283
2307
|
key: `${[this._value.packages]}[${[i]}].isSelectedDefault`,
|
|
2284
2308
|
value: !1
|
|
2285
2309
|
}), this.$emit("input", {
|
|
@@ -2287,22 +2311,22 @@ const qt = {
|
|
|
2287
2311
|
value: !1
|
|
2288
2312
|
}));
|
|
2289
2313
|
}), this.$emit("input", {
|
|
2290
|
-
key: `${[this._value.packages]}[${[
|
|
2314
|
+
key: `${[this._value.packages]}[${[a]}].isSelectedDefault`,
|
|
2291
2315
|
value: e
|
|
2292
2316
|
}), this.$emit("input", {
|
|
2293
|
-
key: `${[this._value.packages]}[${[
|
|
2317
|
+
key: `${[this._value.packages]}[${[a]}].isSelected`,
|
|
2294
2318
|
value: e
|
|
2295
2319
|
}));
|
|
2296
2320
|
},
|
|
2297
|
-
removeByIndex(
|
|
2298
|
-
const { packageId: e } = this.packages[
|
|
2321
|
+
removeByIndex(a) {
|
|
2322
|
+
const { packageId: e } = this.packages[a], t = this._document.allArticles.filter(
|
|
2299
2323
|
({ packageId: i }) => i !== e
|
|
2300
2324
|
);
|
|
2301
|
-
this.$emit("input", { key: "articles", value: t }), this.$emit("remove", { key: `${[this._value.packages]}[${[
|
|
2325
|
+
this.$emit("input", { key: "articles", value: t }), this.$emit("remove", { key: `${[this._value.packages]}[${[a]}]` });
|
|
2302
2326
|
},
|
|
2303
2327
|
async onResetType() {
|
|
2304
|
-
const
|
|
2305
|
-
([i, n],
|
|
2328
|
+
const a = this.packages.map((i) => i.packageId), [e, t] = this._document.allArticles.reduce(
|
|
2329
|
+
([i, n], s) => a.includes(s.packageId) ? [[...i, s], n] : [i, [...n, s]],
|
|
2306
2330
|
[[], []]
|
|
2307
2331
|
);
|
|
2308
2332
|
this.$emit("update:persisted-group", {
|
|
@@ -2311,19 +2335,21 @@ const qt = {
|
|
|
2311
2335
|
articles: e
|
|
2312
2336
|
}), this.$emit("input", { key: "articles", value: t }), this.$emit("input", { key: `${[this._value.packages]}`, value: [] }), this.type = "";
|
|
2313
2337
|
},
|
|
2314
|
-
moveOptions(
|
|
2338
|
+
moveOptions(a, e) {
|
|
2315
2339
|
const t = { up: !1, down: !1 };
|
|
2316
|
-
return
|
|
2340
|
+
return a > 0 && (t.up = !0), a < e - 1 && (t.down = !0), t;
|
|
2317
2341
|
},
|
|
2318
|
-
moveItem(
|
|
2319
|
-
const t = T(this.packages,
|
|
2342
|
+
moveItem(a, e) {
|
|
2343
|
+
const t = T(this.packages, a, e);
|
|
2320
2344
|
this.$emit("input", { key: this._value.packages, value: t });
|
|
2321
2345
|
}
|
|
2322
2346
|
}
|
|
2323
2347
|
};
|
|
2324
2348
|
var Ut = function() {
|
|
2325
2349
|
var e = this, t = e._self._c;
|
|
2326
|
-
return t("div", { staticClass: "package-group-root font-inter" }, [e.type ? [t("div", { staticStyle: { position: "absolute", right: "0", top: "-10px", transform: "translateY(-100%)", "z-index": "2" } }, [t("CDropdown",
|
|
2350
|
+
return t("div", { staticClass: "package-group-root font-inter" }, [e.type ? [t("div", { staticStyle: { position: "absolute", right: "0", top: "-10px", transform: "translateY(-100%)", "z-index": "2" } }, [t("CDropdown", { scopedSlots: e._u([{ key: "trigger", fn: function() {
|
|
2351
|
+
return [t("CButton", { attrs: { type: "none", size: "normal", pattern: "secondary", icon: "more-horizontal", circle: "" } })];
|
|
2352
|
+
}, proxy: !0 }]) }, [t("CDropdownItem", { on: { click: e.onResetType } }, [e._v(e._s(e.$t("_common:change", { thing: e.$t("_common:price.proposal").toLowerCase() })))]), t("CDropdownItem", { attrs: { value: !!e.hideGroupPrice, "close-on-click": !1, toggle: "" }, on: { input: function(i) {
|
|
2327
2353
|
e.hideGroupPrice = i;
|
|
2328
2354
|
} } }, [e._v(" " + e._s(e.$t("hideGroupPrice")) + " ")])], 1)], 1), e.type === "checkbox" && !e.internalPackages.find((i) => i.toggable === !1) ? t("CCallout", { staticClass: "w-full", attrs: { title: e.$t("base") } }, [t("div", { staticClass: "pb-4" }, [e._v(" " + e._s(e.$t("basePlaceholder")) + " ")]), t("CButton", { staticStyle: { "font-weight": "600" }, attrs: { type: "secondary", size: "small" }, on: { click: function(i) {
|
|
2329
2355
|
return e.addPackage({
|
|
@@ -2341,21 +2367,21 @@ var Ut = function() {
|
|
|
2341
2367
|
maxTotal: `${e._value.packages}[${i.index}].data.prices.maxTotal`,
|
|
2342
2368
|
basePath: `${e._value.packages}[${i.index}]`,
|
|
2343
2369
|
currency: `${e._value.packages}[${i.index}].data.prices.currency`
|
|
2344
|
-
}, type: e.type, "active-house-work-type": e.houseWorkType, toggable: i.toggable, "package-id": i.packageId, "move-options": e.moveOptions(n, e.topRowPackages.length) }, on: { input: function(
|
|
2345
|
-
return e.$emit("input",
|
|
2346
|
-
}, add: function(
|
|
2347
|
-
return e.$emit("add",
|
|
2348
|
-
}, "update:isSelectedDefault": (
|
|
2370
|
+
}, type: e.type, "active-house-work-type": e.houseWorkType, toggable: i.toggable, "package-id": i.packageId, "move-options": e.moveOptions(n, e.topRowPackages.length) }, on: { input: function(s) {
|
|
2371
|
+
return e.$emit("input", s);
|
|
2372
|
+
}, add: function(s) {
|
|
2373
|
+
return e.$emit("add", s);
|
|
2374
|
+
}, "update:isSelectedDefault": (s) => e.onInputSelectedDefault(i.index, s), "update:priceType": (s) => e.onInputPriceType(i.index, s), "update:setPricesIncVat": (s) => {
|
|
2349
2375
|
e.$emit("input", {
|
|
2350
2376
|
key: "data.formSettings.setPricesIncVat",
|
|
2351
|
-
value:
|
|
2377
|
+
value: s
|
|
2352
2378
|
}), e.setPricesDirty = !0;
|
|
2353
|
-
}, "update:currency": (
|
|
2354
|
-
return e.$emit("remove",
|
|
2355
|
-
}, "remove-package": function(
|
|
2379
|
+
}, "update:currency": (s) => e.$emit("input", { key: "currency", value: s }), remove: function(s) {
|
|
2380
|
+
return e.$emit("remove", s);
|
|
2381
|
+
}, "remove-package": function(s) {
|
|
2356
2382
|
return e.removeByIndex(i.index);
|
|
2357
|
-
}, move: function(
|
|
2358
|
-
return e.moveItem(i.index, e.topRowPackages[n +
|
|
2383
|
+
}, move: function(s) {
|
|
2384
|
+
return e.moveItem(i.index, e.topRowPackages[n + s].index);
|
|
2359
2385
|
} } })], 1);
|
|
2360
2386
|
}), 0), e.type === "checkbox" && e.topRowPackages.length && e.bottomRowPackages.length ? t("div", { staticStyle: { width: "calc(5 * var(--rem))", height: "1px", "margin-left": "calc(50% - calc(2.5 * var(--rem)))", "border-top": "2px dashed hsl(0, 0%, 85%)" } }) : e._e(), e.type === "checkbox" ? [t("transition-group", { staticStyle: { "margin-bottom": "calc(1 * var(--rem))" }, attrs: { name: "section-list", tag: "div" } }, e._l(e.bottomRowPackages, function(i, n) {
|
|
2361
2387
|
return t("div", { key: i.packageId, staticClass: "section-item", staticStyle: { padding: "calc(1 * var(--rem)) 0" } }, [t("PackageItem", { staticClass: "package-item", attrs: { _document: e._document, _value: {
|
|
@@ -2367,21 +2393,21 @@ var Ut = function() {
|
|
|
2367
2393
|
maxTotal: `${e._value.packages}[${i.index}].data.prices.maxTotal`,
|
|
2368
2394
|
basePath: `${e._value.packages}[${i.index}]`,
|
|
2369
2395
|
currency: `${e._value.packages}[${i.index}].data.prices.currency`
|
|
2370
|
-
}, type: e.type, "active-house-work-type": e.houseWorkType, "package-id": i.packageId, "move-options": e.moveOptions(n, e.bottomRowPackages.length) }, on: { input: function(
|
|
2371
|
-
return e.$emit("input",
|
|
2372
|
-
}, add: function(
|
|
2373
|
-
return e.$emit("add",
|
|
2374
|
-
}, "update:isSelectedDefault": (
|
|
2396
|
+
}, type: e.type, "active-house-work-type": e.houseWorkType, "package-id": i.packageId, "move-options": e.moveOptions(n, e.bottomRowPackages.length) }, on: { input: function(s) {
|
|
2397
|
+
return e.$emit("input", s);
|
|
2398
|
+
}, add: function(s) {
|
|
2399
|
+
return e.$emit("add", s);
|
|
2400
|
+
}, "update:isSelectedDefault": (s) => e.onInputSelectedDefault(i.index, s), "update:priceType": (s) => e.onInputPriceType(i.index, s), "update:setPricesIncVat": (s) => {
|
|
2375
2401
|
e.$emit("input", {
|
|
2376
2402
|
key: "data.formSettings.setPricesIncVat",
|
|
2377
|
-
value:
|
|
2403
|
+
value: s
|
|
2378
2404
|
}), e.setPricesDirty = !0;
|
|
2379
|
-
}, remove: function(
|
|
2380
|
-
return e.$emit("remove",
|
|
2381
|
-
}, "remove-package": function(
|
|
2405
|
+
}, remove: function(s) {
|
|
2406
|
+
return e.$emit("remove", s);
|
|
2407
|
+
}, "remove-package": function(s) {
|
|
2382
2408
|
return e.removeByIndex(i.index);
|
|
2383
|
-
}, move: function(
|
|
2384
|
-
return e.moveItem(i.index, e.bottomRowPackages[n +
|
|
2409
|
+
}, move: function(s) {
|
|
2410
|
+
return e.moveItem(i.index, e.bottomRowPackages[n + s].index);
|
|
2385
2411
|
} } })], 1);
|
|
2386
2412
|
}), 0)] : e._e(), e.type !== "single" || !e.packages.length ? t("div", { staticClass: "flex w-full flex-col items-center justify-center" }, [t("div", { staticStyle: { width: "100%" } }, [e.type === "radio" && !e.packages.length ? t("div", { staticClass: "package-placeholder bg-gray-100", staticStyle: { color: "hsl(0, 0%, 24%)", "font-weight": "500" } }, [t("svg", { staticStyle: { "vertical-align": "text-bottom", "margin-right": "3px" }, attrs: { width: "16", height: "16", viewBox: "0 0 18 14", xmlns: "http://www.w3.org/2000/svg" } }, [t("path", { attrs: { d: "M8.03.22c.3.3.3.77 0 1.06L5.56 3.75h6.88L9.97 1.28A.75.75 0 1111.03.21l3.53 3.54h2.69a.75.75 0 010 1.5h-.12l-1.17 6.4a2.25 2.25 0 01-2.21 1.85h-9.5a2.25 2.25 0 01-2.21-1.84L.87 5.26H.75a.75.75 0 010-1.5h2.69L6.97.21c.3-.3.77-.3 1.06 0zM2.4 5.25L3.5 11.4c.07.35.38.61.74.61h9.5c.36 0 .67-.26.74-.61l1.11-6.14H2.4zm3.1 1.5c.41-.06.8.22.86.63l.38 2.25a.75.75 0 11-1.48.24l-.37-2.25c-.07-.4.2-.8.61-.86zm7 0c.4.08.68.47.61.87l-.37 2.25a.75.75 0 11-1.48-.24l.38-2.25a.75.75 0 01.86-.62zm-3.5 0c.41 0 .75.34.75.75v2.25a.75.75 0 01-1.5 0V7.5c0-.41.34-.75.75-.75z", fill: "#000", "fill-rule": "evenodd" } })]), e._v(" " + e._s(e.$t("selectablePlaceholder")) + " ")]) : e._e()]), e.validator.$invalid && e.validator.$dirty ? t("ErrorCallout", { staticStyle: { margin: "calc(1 * var(--rem)) 0 calc(1 * var(--rem)) 0" }, attrs: { message: e.$t("error.minOnePackage") } }) : e._e(), t("div", { staticClass: "flex w-full" }, [t("CButton", { staticStyle: { "border-color": "hsl(0, 0%, 82%)" }, attrs: { type: "secondary", outlined: "", "icon-left": "plus" }, on: { click: function(i) {
|
|
2387
2413
|
return e.addPackage();
|
|
@@ -2394,7 +2420,7 @@ var Ut = function() {
|
|
|
2394
2420
|
Gt,
|
|
2395
2421
|
!1,
|
|
2396
2422
|
null,
|
|
2397
|
-
"
|
|
2423
|
+
"1cbab1d2"
|
|
2398
2424
|
);
|
|
2399
2425
|
const oi = Kt.exports;
|
|
2400
2426
|
export {
|