@cling-se/widget 0.14.4 → 0.14.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +4 -4
- package/README.md +40 -40
- package/dist/AddClientCallout-BMc-v9rJ.js +46 -0
- package/dist/AnswerModal-Cu0Ke5pl.js +3874 -0
- package/dist/AttachmentItem-Co8pVvtv.js +78 -0
- package/dist/BaseDatePicker-P5iq-XAp.js +3183 -0
- package/dist/BaseUpload-BDWnWTxr.js +1977 -0
- package/dist/BlockMedia-B_UiePCr.js +76 -0
- package/dist/CCallout-Bbp9ya9n.js +59 -0
- package/dist/CCurrencyDropdown-Cw39vJWw.js +246 -0
- package/dist/CDropdownItem-BjYnhZJr.js +538 -0
- package/dist/CField.vue_vue_type_style_index_0_lang-l0sNRNKZ.js +1 -0
- package/dist/CFormField-CeJ58aN2.js +241 -0
- package/dist/CPhoneFormat-BZnmeEeW.js +62 -0
- package/dist/CPriceInput-B07d19qq.js +112 -0
- package/dist/CTabs.vue_vue_type_style_index_0_scoped_e02a6440_lang-l0sNRNKZ.js +1 -0
- package/dist/ClientAutocomplete-9iM1pR9l.js +78 -0
- package/dist/ClientModal-fw8f6UvL.js +625 -0
- package/dist/ColorPicker-uu6vKe8o.js +2879 -0
- package/dist/CompanyModal-5t4yhKL4.js +141 -0
- package/dist/ContentWrapper-DwcOQ21l.js +183 -0
- package/dist/CoverBlockSettings-cCCXzAZ0.js +275 -0
- package/dist/DocAnswer-9lbgqHRX.js +36 -0
- package/dist/DocDetails-CoLL_tHs.js +246 -0
- package/dist/DocForm-DUjcuHJe.js +7273 -0
- package/dist/DocFormSend-LawcXcM2.js +143 -0
- package/dist/DocLinks-pJT9HpjR.js +38 -0
- package/dist/DocModalBase-xUoskL63.js +28 -0
- package/dist/DocPrint-ClEJBiAg.js +240 -0
- package/dist/DocReceipt-x_YsXPnG.js +210 -0
- package/dist/DocSendReminder-Dbz8CkAz.js +137 -0
- package/dist/DocTextEditor-AqBE7jZj.js +17181 -0
- package/dist/DocTimeline-hq2asPzr.js +481 -0
- package/dist/DocumentClient-TmtHqfiw.js +136 -0
- package/dist/DocumentLayout-CRAp8mfk.js +4909 -0
- package/dist/DocumentLogotype-emSjQ21f.js +87 -0
- package/dist/DocumentVoided-BOjiWBK6.js +25 -0
- package/dist/EmbedInput-B3LFGEee.js +113 -0
- package/dist/EmbedSettings-BYPJTGQf.js +72 -0
- package/dist/ErrorCallout-CwgYHBkg.js +28 -0
- package/dist/FilePreviewModal-81sSrDGg.js +81 -0
- package/dist/Flag-DGFvUTQZ.js +114 -0
- package/dist/HeaderSettings-BGpkzcbj.js +392 -0
- package/dist/ImageSelectModal-Cimviyuy.js +84 -0
- package/dist/ImageUploadWrapper-qJDHCf8T.js +1604 -0
- package/dist/Index-18w_qMQH.js +25 -0
- package/dist/Index-9_R8_myc.js +77 -0
- package/dist/Index-BKoXW7GK.js +84 -0
- package/dist/Index-BL3-tRGt.js +642 -0
- package/dist/Index-BNfAA-ZJ.js +154 -0
- package/dist/Index-BOxSvAug.js +144 -0
- package/dist/Index-BQgW1jlH.js +45 -0
- package/dist/Index-BXAqgXVi.js +150 -0
- package/dist/Index-BgK_WC0d.js +140 -0
- package/dist/Index-BkUzlQaQ.js +107 -0
- package/dist/Index-BpyYa9LR.js +171 -0
- package/dist/Index-ByzGXUoc.js +292 -0
- package/dist/Index-C1lsSfnX.js +52 -0
- package/dist/Index-C9sq_RDg.js +223 -0
- package/dist/Index-CDEh3GAi.js +26 -0
- package/dist/Index-CEG-Hiv6.js +69 -0
- package/dist/Index-CMUg61_b.js +33 -0
- package/dist/Index-CObGPoQv.js +62 -0
- package/dist/Index-CPNUsaOS.js +57 -0
- package/dist/Index-CegW1Rim.js +98 -0
- package/dist/Index-CoSt-Bws.js +31 -0
- package/dist/Index-CpDgldnz.js +70 -0
- package/dist/Index-CqImx-rG.js +55 -0
- package/dist/Index-CrOD4_xj.js +58 -0
- package/dist/Index-DBCNVVm5.js +24 -0
- package/dist/Index-DGG1S8uJ.js +559 -0
- package/dist/Index-DRWS2z82.js +2402 -0
- package/dist/Index-DXRgZZNj.js +61 -0
- package/dist/Index-DY5gAUnE.js +754 -0
- package/dist/Index-Dr7mVlBb.js +49 -0
- package/dist/Index-Dx944wv-.js +21 -0
- package/dist/Index-Eq3JlTKK.js +46 -0
- package/dist/Index-Sr3emNkE.js +25 -0
- package/dist/Index-VshOfaom.js +32 -0
- package/dist/InputToggleRow-CQsaayf-.js +57 -0
- package/dist/ManualPopover-CFXm5cQy.js +58 -0
- package/dist/MediaWrapper-Cn0Yr4ce.js +23 -0
- package/dist/NotBindingText-CNiszGqn.js +32 -0
- package/dist/PackageGroup-BVys9ouj.js +699 -0
- package/dist/PdfTerms-Bbns-jMY.js +36 -0
- package/dist/PdfViewer-B1zzZU4Y.js +374 -0
- package/dist/PlainHtml-CARRbTxi.js +20 -0
- package/dist/PriceHeader-CqeC9Lhb.js +339 -0
- package/dist/SearchApi-bB9FLxUq.js +161 -0
- package/dist/Setup-p3Du_uf8.js +50 -0
- package/dist/SmartList-P5ZfTWBb.js +83 -0
- package/dist/TermsSettings-CQ8TGwBV.js +102 -0
- package/dist/ThemeColorRow-DMWVlFRU.js +67 -0
- package/dist/ToggleBinding-BPaYWgqP.js +38 -0
- package/dist/UploadModal-9O4HTVZm.js +95 -0
- package/dist/VideoPlayerInput-5KybfY7N.js +93 -0
- package/dist/VideoPlayerSettings-xSW8tcTZ.js +61 -0
- package/dist/VideoSelectModal-BbaNAxGH.js +100 -0
- package/dist/anime.es-BrPTThYb.js +858 -0
- package/dist/answerDocumentMixin-S-Bmv15G.js +51 -0
- package/dist/color-TdtKxwVa.js +19 -0
- package/dist/debounce-B_0g8OVh.js +84 -0
- package/dist/dom-CJxkno7i.js +91 -0
- package/dist/favicon.ico +0 -0
- package/dist/focusDrawerMixin-DhsqWZUo.js +22 -0
- package/dist/formComponentsInstall-UG7a9vjZ.js +2499 -0
- package/dist/formDrawerState-BMQrWaBt.js +20 -0
- package/dist/formValidationMixin-DUu0omWT.js +49 -0
- package/dist/i18nMessages-Chz_lxGG.js +17 -0
- package/dist/index-B3R_uKML.js +347 -0
- package/dist/index-B4aiQXsr.js +166 -0
- package/dist/index-C50JSDKO.js +3916 -0
- package/dist/index-CJ9AvuZH.js +102 -0
- package/dist/index-Czyda2Ej.js +492 -0
- package/dist/index-myOYAnwV.js +81 -0
- package/dist/index.es.js +35 -0
- package/dist/index.umd.js +3148 -0
- package/dist/main-B9t0ybqW.js +56739 -0
- package/dist/mapFormMixin-ETYhBLl2.js +72 -0
- package/dist/omit-DtTfKAed.js +31 -0
- package/dist/publicSenderState-DD1lN9CR.js +21 -0
- package/dist/splitpanes-BHUVsCZF.js +382 -0
- package/dist/style.css +4 -0
- package/dist/throttle-qziKkJJX.js +18 -0
- package/dist/tinycolor-CMC8Xp7x.js +633 -0
- package/dist/tippy.esm-DjbYjfS2.js +1799 -0
- package/dist/utils-C5Rg0fQC.js +108 -0
- package/dist/vuedraggable.umd-CE3WmaEQ.js +3161 -0
- package/dist/vuex.esm-DKGl8mcw.js +467 -0
- package/package.json +1 -1
- package/tsconfig.json +26 -26
- package/tsconfig.node.json +10 -10
- package/tsconfig.paths.json +17 -17
- package/vite.config.ts +61 -61
|
@@ -0,0 +1,625 @@
|
|
|
1
|
+
import { C as v } from "./ClientAutocomplete-9iM1pR9l.js";
|
|
2
|
+
import { E as p, a9 as y, I as C, n as u, b as l, d as b, c as _, g as c, aa as $, y as w } from "./main-B9t0ybqW.js";
|
|
3
|
+
import { w as f } from "./CDropdownItem-BjYnhZJr.js";
|
|
4
|
+
import { v as r } from "./index-Czyda2Ej.js";
|
|
5
|
+
import { m as g, b as x, a as k } from "./vuex.esm-DKGl8mcw.js";
|
|
6
|
+
import { o as N } from "./omit-DtTfKAed.js";
|
|
7
|
+
function h(a) {
|
|
8
|
+
if (typeof a > "u")
|
|
9
|
+
throw Error("Missing param inputParam");
|
|
10
|
+
let e = a;
|
|
11
|
+
Number.isInteger(e) && (e = e.toString());
|
|
12
|
+
let t = 0;
|
|
13
|
+
const i = e.length, n = i % 2;
|
|
14
|
+
let s, o;
|
|
15
|
+
for (s = 0; s < i; s += 1)
|
|
16
|
+
o = parseInt(e.charAt(s), 10), s % 2 === n && (o *= 2), o > 9 && (o -= 9), t += o;
|
|
17
|
+
return t % 10 === 0;
|
|
18
|
+
}
|
|
19
|
+
function m(a) {
|
|
20
|
+
let e = a.replace(/ /g, "");
|
|
21
|
+
return e = e.replace(/-/g, ""), !h(e) || (e = [e.slice(0, 6), "-", e.slice(6)].join(""), !e.match(/^(\d{6})-(\d{4})$/)) ? !1 : e;
|
|
22
|
+
}
|
|
23
|
+
function d(a) {
|
|
24
|
+
if (typeof a > "u" || a === null || a === "")
|
|
25
|
+
return !1;
|
|
26
|
+
let e = a.trim().replace(/[^0-9]+/g, "");
|
|
27
|
+
if (e.length !== 10 && e.length !== 12)
|
|
28
|
+
return !1;
|
|
29
|
+
if (e.length === 10) {
|
|
30
|
+
const n = e.substring(0, 2), s = (/* @__PURE__ */ new Date()).getFullYear(), o = parseInt(
|
|
31
|
+
s.toString().substring(2, 2),
|
|
32
|
+
10
|
|
33
|
+
);
|
|
34
|
+
parseInt(n, 10) === 19 || parseInt(n, 10) === 20 || (parseInt(n, 10) >= 0 && parseInt(n, 10) <= o ? e = `20${e}` : e = `19${e}`);
|
|
35
|
+
}
|
|
36
|
+
return (/* @__PURE__ */ new Date()).getFullYear() - parseInt(e.substring(0, 4), 10) < 16 ? !1 : h(e.substring(2)) ? e : !1;
|
|
37
|
+
}
|
|
38
|
+
const I = {
|
|
39
|
+
sv: {
|
|
40
|
+
title: "Mottagare",
|
|
41
|
+
updateButton: "Spara mottagare",
|
|
42
|
+
individual: "Privatperson",
|
|
43
|
+
reference: "Referens",
|
|
44
|
+
workAddressSubLabel: "Där arbetet utförs",
|
|
45
|
+
showMore: "Visa fler fält",
|
|
46
|
+
seperateWorkAddress: {
|
|
47
|
+
false: "Arbetsadress som ovan",
|
|
48
|
+
true: "Annan"
|
|
49
|
+
},
|
|
50
|
+
placeholders: {
|
|
51
|
+
name: "Mottagarens namn",
|
|
52
|
+
companyName: "Företagets namn",
|
|
53
|
+
socialNo: "10 eller 12 siffror",
|
|
54
|
+
orgNo: "Företagets org-nr",
|
|
55
|
+
reference: "Er referens",
|
|
56
|
+
cellphone: "Mobilnummer",
|
|
57
|
+
address: "Gatuadress"
|
|
58
|
+
},
|
|
59
|
+
validations: {
|
|
60
|
+
name: {
|
|
61
|
+
required: "Vem är din kund?"
|
|
62
|
+
},
|
|
63
|
+
orgNo: {
|
|
64
|
+
personalNumber: "Personnumret är inte giltigt"
|
|
65
|
+
},
|
|
66
|
+
realOrgNo: {
|
|
67
|
+
realOrgNo: "Organisationsnumret är inte giltigt"
|
|
68
|
+
},
|
|
69
|
+
reference: {
|
|
70
|
+
required: "Vem är din referens?"
|
|
71
|
+
},
|
|
72
|
+
email: {
|
|
73
|
+
required: "E-post saknas",
|
|
74
|
+
email: "E-posten är ogiltig"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
signMethod: {
|
|
78
|
+
button: {
|
|
79
|
+
title: "Standard - knapptryck",
|
|
80
|
+
content: "Bevisnivå: IP-adress, tidpunkt och enhet."
|
|
81
|
+
},
|
|
82
|
+
bankId: {
|
|
83
|
+
title: "BankId",
|
|
84
|
+
content: "Samma säkerhetsgrad som bankerna har."
|
|
85
|
+
},
|
|
86
|
+
signature: {
|
|
87
|
+
title: "Standard",
|
|
88
|
+
content: "Bevisnivå: IP-adress, tidpunkt och enhet."
|
|
89
|
+
},
|
|
90
|
+
inPerson: {
|
|
91
|
+
title: "Fysisk underskrift",
|
|
92
|
+
content: "Signatur på utskrivet dokument"
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
en: {
|
|
97
|
+
title: "Recipient",
|
|
98
|
+
updateButton: "Save recipient",
|
|
99
|
+
individual: "Individual",
|
|
100
|
+
reference: "Contact",
|
|
101
|
+
workAddressSubLabel: "Where work is going to be performed",
|
|
102
|
+
showMore: "Show additional fields",
|
|
103
|
+
seperateWorkAddress: {
|
|
104
|
+
false: "Work address same as above",
|
|
105
|
+
true: "Other"
|
|
106
|
+
},
|
|
107
|
+
placeholders: {
|
|
108
|
+
name: "Recipient name",
|
|
109
|
+
companyName: "Company name",
|
|
110
|
+
socialNo: "10 or 12 numbers",
|
|
111
|
+
orgNo: "Company registration number",
|
|
112
|
+
reference: "Name",
|
|
113
|
+
cellphone: "Cellphone",
|
|
114
|
+
address: "Street"
|
|
115
|
+
},
|
|
116
|
+
validations: {
|
|
117
|
+
name: {
|
|
118
|
+
required: "Who's your contact person?"
|
|
119
|
+
},
|
|
120
|
+
orgNo: {
|
|
121
|
+
personalNumber: "Invalid social security number"
|
|
122
|
+
},
|
|
123
|
+
realOrgNo: {
|
|
124
|
+
realOrgNo: "Invalid organisation number"
|
|
125
|
+
},
|
|
126
|
+
reference: {
|
|
127
|
+
required: "Missing contact name"
|
|
128
|
+
},
|
|
129
|
+
email: {
|
|
130
|
+
required: "Email missing",
|
|
131
|
+
email: "Invalid email"
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
signMethod: {
|
|
135
|
+
button: {
|
|
136
|
+
title: "Standard - button",
|
|
137
|
+
content: "Level of proof: IP address, timestamp and device."
|
|
138
|
+
},
|
|
139
|
+
bankId: {
|
|
140
|
+
title: "BankID",
|
|
141
|
+
content: "Same level of proof as the banks use."
|
|
142
|
+
},
|
|
143
|
+
signature: {
|
|
144
|
+
title: "Signature",
|
|
145
|
+
content: "Level of proof: IP address, timestamp and device."
|
|
146
|
+
},
|
|
147
|
+
inPerson: {
|
|
148
|
+
title: "In person",
|
|
149
|
+
content: "Signature on print document"
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}, { mapFields: S } = p({
|
|
154
|
+
getterType: "forms/getField",
|
|
155
|
+
mutationType: "forms/updateField"
|
|
156
|
+
}), F = {
|
|
157
|
+
name: "FormClient",
|
|
158
|
+
i18nOptions: {
|
|
159
|
+
namespaces: "formClient",
|
|
160
|
+
messages: I
|
|
161
|
+
},
|
|
162
|
+
components: {
|
|
163
|
+
ClientAutocomplete: v,
|
|
164
|
+
Animation: y
|
|
165
|
+
},
|
|
166
|
+
mixins: [f],
|
|
167
|
+
props: {
|
|
168
|
+
requireReference: {
|
|
169
|
+
type: Boolean,
|
|
170
|
+
default: !0
|
|
171
|
+
},
|
|
172
|
+
searchEnabled: {
|
|
173
|
+
type: Boolean,
|
|
174
|
+
default: !1
|
|
175
|
+
},
|
|
176
|
+
validateOrgNo: {
|
|
177
|
+
type: Boolean,
|
|
178
|
+
default: !1
|
|
179
|
+
},
|
|
180
|
+
simpleForm: {
|
|
181
|
+
type: Boolean,
|
|
182
|
+
default: !1
|
|
183
|
+
},
|
|
184
|
+
inputFocusOnMount: {
|
|
185
|
+
type: String,
|
|
186
|
+
default: ""
|
|
187
|
+
},
|
|
188
|
+
// Optional field with prop sync, if within the context of documents
|
|
189
|
+
documentRole: {
|
|
190
|
+
type: String,
|
|
191
|
+
default: ""
|
|
192
|
+
},
|
|
193
|
+
// Optional field with prop sync, if within the context of documents
|
|
194
|
+
answerMethod: {
|
|
195
|
+
type: Object,
|
|
196
|
+
default: null
|
|
197
|
+
},
|
|
198
|
+
signOptions: {
|
|
199
|
+
type: Array,
|
|
200
|
+
default: () => []
|
|
201
|
+
},
|
|
202
|
+
isPublicForm: {
|
|
203
|
+
type: Boolean,
|
|
204
|
+
default: !1
|
|
205
|
+
}
|
|
206
|
+
},
|
|
207
|
+
validations() {
|
|
208
|
+
return [
|
|
209
|
+
this.name,
|
|
210
|
+
this.orgNo,
|
|
211
|
+
this.reference,
|
|
212
|
+
this.email,
|
|
213
|
+
this.cellphone
|
|
214
|
+
].some((e) => !!e) ? {
|
|
215
|
+
orgNo: {
|
|
216
|
+
personalNumber(e) {
|
|
217
|
+
return !this.validateOrgNo || !e ? !0 : this.isIndivid ? d(e) : m(e) || d(e);
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
reference: {
|
|
221
|
+
required: r.requiredIf((e) => e.requireReference && !e.isIndivid)
|
|
222
|
+
},
|
|
223
|
+
email: {
|
|
224
|
+
email: r.email
|
|
225
|
+
}
|
|
226
|
+
} : {
|
|
227
|
+
name: {
|
|
228
|
+
required: r.required
|
|
229
|
+
},
|
|
230
|
+
orgNo: {
|
|
231
|
+
required: r.requiredIf((e) => e.type === "company")
|
|
232
|
+
},
|
|
233
|
+
cellphone: {
|
|
234
|
+
required: r.requiredIf((e) => !e.isIndivid)
|
|
235
|
+
},
|
|
236
|
+
reference: {
|
|
237
|
+
required: r.requiredIf((e) => !e.isIndivid)
|
|
238
|
+
},
|
|
239
|
+
email: {
|
|
240
|
+
required: r.requiredIf((e) => !e.isIndivid)
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
},
|
|
244
|
+
computed: {
|
|
245
|
+
...S({
|
|
246
|
+
id: "endCustomer.id",
|
|
247
|
+
type: "endCustomer.customerType",
|
|
248
|
+
name: "endCustomer.name",
|
|
249
|
+
realOrgNo: "endCustomer.org_no",
|
|
250
|
+
reference: "endCustomer.reference",
|
|
251
|
+
email: "endCustomer.email",
|
|
252
|
+
street: "endCustomer.street",
|
|
253
|
+
zip: "endCustomer.zip",
|
|
254
|
+
city: "endCustomer.city",
|
|
255
|
+
cellphone: "endCustomer.cellphone",
|
|
256
|
+
cellphoneRegion: "endCustomer.cellphoneRegion",
|
|
257
|
+
separateWorkAddress: "endCustomer.separateWorkAddress",
|
|
258
|
+
workStreet: "endCustomer.workStreet",
|
|
259
|
+
workZip: "endCustomer.workZip",
|
|
260
|
+
workCity: "endCustomer.workCity",
|
|
261
|
+
reverseVat: "endCustomer.reverseVat",
|
|
262
|
+
doUpdateEndCustomer: "endCustomer.doUpdateEndCustomer"
|
|
263
|
+
}),
|
|
264
|
+
...g({
|
|
265
|
+
isPosting: "endCustomers/isPosting",
|
|
266
|
+
companyRegion: "application/companyRegion",
|
|
267
|
+
feature: "application/feature"
|
|
268
|
+
}),
|
|
269
|
+
messages() {
|
|
270
|
+
return {
|
|
271
|
+
name: {
|
|
272
|
+
required: this.$t("validations.name.required")
|
|
273
|
+
},
|
|
274
|
+
orgNo: {
|
|
275
|
+
personalNumber: this.$t("validations.orgNo.personalNumber")
|
|
276
|
+
},
|
|
277
|
+
realOrgNo: {
|
|
278
|
+
personalNumber: this.$t("validations.realOrgNo.realOrgNo")
|
|
279
|
+
},
|
|
280
|
+
reference: {
|
|
281
|
+
required: this.$t("validations.reference.required")
|
|
282
|
+
},
|
|
283
|
+
email: {
|
|
284
|
+
required: this.$t("validations.email.required"),
|
|
285
|
+
email: this.$t("validations.email.email")
|
|
286
|
+
}
|
|
287
|
+
};
|
|
288
|
+
},
|
|
289
|
+
orgNo: {
|
|
290
|
+
get() {
|
|
291
|
+
return this.realOrgNo;
|
|
292
|
+
},
|
|
293
|
+
set(a) {
|
|
294
|
+
const e = this.isIndivid ? d(a) : m(a) || d(a);
|
|
295
|
+
return this.validateOrgNo && e ? (this.realOrgNo = e, !0) : (this.realOrgNo = a, !0);
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
isIndivid() {
|
|
299
|
+
return this.type === "individual";
|
|
300
|
+
}
|
|
301
|
+
},
|
|
302
|
+
watch: {
|
|
303
|
+
type(a) {
|
|
304
|
+
C.setItem("defaultClientType", a);
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
mounted() {
|
|
308
|
+
this.$refs[this.inputFocusOnMount] ? this.$refs[this.inputFocusOnMount].$el.querySelector("input").focus() : this.$refs.name.$el.querySelector("input").focus();
|
|
309
|
+
},
|
|
310
|
+
methods: {
|
|
311
|
+
validateForm() {
|
|
312
|
+
return this.$v.$touch(), this.$v.$invalid ? !1 : (this.$emit("submit", !0), !0);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
var M = function() {
|
|
317
|
+
var e = this, t = e._self._c;
|
|
318
|
+
return t("div", { staticClass: "form-client" }, [e.simpleForm ? t("form", { on: { submit: function(i) {
|
|
319
|
+
return i.preventDefault(), e.validateForm.apply(null, arguments);
|
|
320
|
+
} } }, [t("div", { staticClass: "space-between flex flex-wrap items-center pb-6" }, [t("div", { staticClass: "flex-grow", staticStyle: { "font-weight": "600", "font-size": "20px" } }, [e._v(" " + e._s(e.$t("_common:recipient").capitalize()) + " ")]), t("div", { staticClass: "type-toggle" }, [t("div", { staticClass: "type-toggle-button", class: { active: e.type === "individual" }, on: { click: function(i) {
|
|
321
|
+
e.type = "individual";
|
|
322
|
+
} } }, [e._v(" " + e._s(e.$t("individual")) + " ")]), t("div", { staticClass: "type-toggle-button", class: { active: e.type === "company" }, on: { click: function(i) {
|
|
323
|
+
e.type = "company";
|
|
324
|
+
} } }, [e._v(" " + e._s(e.$t("_common:company").capitalize()) + " ")])])]), t("CField", { staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { label: e.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(), validator: e.$v.name, messages: e.messages.name, "label-position": "inside" } }, [t("ClientAutocomplete", { ref: "name", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"), "search-enabled": e.searchEnabled, "show-loading": !0 }, on: { setClient: function(i) {
|
|
325
|
+
return e.$emit("setClient", i);
|
|
326
|
+
} }, model: { value: e.name, callback: function(i) {
|
|
327
|
+
e.name = i;
|
|
328
|
+
}, expression: "name" } })], 1), t("Animation", [e.isIndivid ? e._e() : t("CField", { staticClass: "pb-4", attrs: { validator: e.$v.reference, messages: e.messages.reference, label: e.$t("reference").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "reference", attrs: { placeholder: e.$t("placeholders.reference") }, model: { value: e.reference, callback: function(i) {
|
|
329
|
+
e.reference = i;
|
|
330
|
+
}, expression: "reference" } })], 1)], 1), t("CField", { staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { validator: e.$v.email, messages: e.messages.email, label: e.$t("_common:email").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "email", attrs: { placeholder: e.$t("_common:email").capitalize() }, model: { value: e.email, callback: function(i) {
|
|
331
|
+
e.email = typeof i == "string" ? i.trim() : i;
|
|
332
|
+
}, expression: "email" } })], 1), t("CPhoneInput", { ref: "cellphone", staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { label: e.$t("_common:cellphone").capitalize(), placeholder: e.$t("placeholders.cellphone"), region: e.cellphoneRegion, "default-region": e.companyRegion, "label-position": "inside" }, on: { "update:region": function(i) {
|
|
333
|
+
e.cellphoneRegion = i;
|
|
334
|
+
} }, model: { value: e.cellphone, callback: function(i) {
|
|
335
|
+
e.cellphone = i;
|
|
336
|
+
}, expression: "cellphone" } }), e.documentRole ? t("CDropdown", { staticStyle: { "margin-bottom": "calc(1 * var(--rem))" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", staticStyle: { width: "100%" }, attrs: { slot: "trigger", "dropdown-icon": !0, "icon-props": {
|
|
337
|
+
stroke: "hsl(0, 0%, 50%)"
|
|
338
|
+
}, "icon-left": e.documentRole === "signee" ? "pen-tool" : "eye", type: "none", pattern: "secondary" }, slot: "trigger" }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)) + " ")]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.label`)) + " ")])])]), e._l(["signee", "recipient", "approver"], function(i) {
|
|
339
|
+
return t("CDropdownItem", { key: i, attrs: { "icon-left": i === "signee" ? "pen-tool" : "eye", "icon-props": {
|
|
340
|
+
stroke: "hsl(0, 0%, 50%)"
|
|
341
|
+
} }, on: { click: function(n) {
|
|
342
|
+
return e.$emit("update:document-role", i);
|
|
343
|
+
} } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${i}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${i}.label`)) + " ")])])]);
|
|
344
|
+
})], 2) : e._e(), t("CButton", { attrs: { type: "secondary", pattern: "tertiary", size: "small", "icon-left": "arrow-right" }, on: { click: function(i) {
|
|
345
|
+
return e.$emit("show-more");
|
|
346
|
+
} } }, [e._v(" " + e._s(e.$t("showMore").capitalize()) + " ")]), t("CButton", { staticClass: "mt-4", staticStyle: { padding: "16px", "border-radius": "8px", height: "100%", "font-size": "14px", "font-weight": "600", "box-shadow": "0 2px 4px -1px rgba(0, 0, 0, 0.1)" }, attrs: { loading: e.isPosting, "native-type": "submit", type: "secondary", wide: "", size: "medium" } }, [e._v(" " + e._s(e.$t("updateButton")) + " ")])], 1) : t("div", { class: { "column-only": e.windowWidth <= 600 } }, [t("div", { staticClass: "flex items-center justify-center", staticStyle: { "margin-bottom": "calc(2.5 * var(--rem))" } }, [t("div", { staticClass: "type-toggle" }, [t("div", { staticClass: "type-toggle-button", class: { active: e.type === "individual" }, on: { click: function(i) {
|
|
347
|
+
e.type = "individual";
|
|
348
|
+
} } }, [e._v(" " + e._s(e.$t("individual")) + " ")]), t("div", { staticClass: "type-toggle-button", class: { active: e.type === "company" }, on: { click: function(i) {
|
|
349
|
+
e.type = "company";
|
|
350
|
+
} } }, [e._v(" " + e._s(e.$t("_common:company").capitalize()) + " ")])])]), t("CField", { staticClass: "flex", attrs: { grouped: "" } }, [t("CField", { attrs: { label: e.isIndivid ? e.$t("_common:name").capitalize() : e.$t("_common:company").capitalize(), validator: e.$v.name, messages: e.messages.name, "label-position": "inside", expanded: "" } }, [t("ClientAutocomplete", { ref: "name", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.name") : e.$t("placeholders.companyName"), "show-loading": !0, "search-enabled": e.searchEnabled }, on: { setClient: function(i) {
|
|
351
|
+
return e.$emit("setClient", i);
|
|
352
|
+
} }, model: { value: e.name, callback: function(i) {
|
|
353
|
+
e.name = i;
|
|
354
|
+
}, expression: "name" } })], 1), t("CField", { attrs: { label: e.isIndivid ? e.$t("_common:socialNo").capitalize() : e.$t("_common:orgNoShort").capitalize(), validator: e.$v.orgNo, messages: e.isIndivid ? e.messages.orgNo : e.messages.realOrgNo, "label-position": "inside", expanded: "" } }, [t("CInput", { ref: "orgNo", attrs: { placeholder: e.isIndivid ? e.$t("placeholders.socialNo") : e.$t("placeholders.orgNo") }, model: { value: e.orgNo, callback: function(i) {
|
|
355
|
+
e.orgNo = i;
|
|
356
|
+
}, expression: "orgNo" } })], 1)], 1), t("Animation", [e.type && !e.isIndivid ? t("CField", { staticClass: "pb-4", attrs: { validator: e.$v.reference, messages: e.messages.reference, label: e.$t("_common:reference").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "reference", attrs: { placeholder: e.$t("placeholders.reference") }, model: { value: e.reference, callback: function(i) {
|
|
357
|
+
e.reference = i;
|
|
358
|
+
}, expression: "reference" } })], 1) : e._e(), e.type && !e.isIndivid && e.feature("reverseVat") && e.feature("regionSE") ? t("CField", { staticStyle: { "padding-left": "0.5em", "margin-bottom": "calc(2 * var(--rem))" } }, [t("CCheckbox", { attrs: { size: "normal" }, model: { value: e.reverseVat, callback: function(i) {
|
|
359
|
+
e.reverseVat = i;
|
|
360
|
+
}, expression: "reverseVat" } }, [e._v(" " + e._s(e.$t("_common:vat.reverseVat")) + " ")])], 1) : e._e()], 1), t("CField", { staticClass: "flex", attrs: { grouped: "" } }, [t("CField", { staticClass: "flex-1", attrs: { validator: e.$v.email, messages: e.messages.email, label: e.$t("_common:email").capitalize(), "label-position": "inside", expanded: "" } }, [t("CInput", { ref: "email", attrs: { placeholder: e.$t("_common:email").capitalize() }, model: { value: e.email, callback: function(i) {
|
|
361
|
+
e.email = typeof i == "string" ? i.trim() : i;
|
|
362
|
+
}, expression: "email" } })], 1), t("CPhoneInput", { staticClass: "flex-1", staticStyle: { "margin-bottom": "calc(1.5 * var(--rem))" }, attrs: { label: e.$t("_common:cellphone").capitalize(), placeholder: e.$t("placeholders.cellphone"), region: e.cellphoneRegion, "default-region": e.companyRegion, "label-position": "inside" }, on: { "update:region": function(i) {
|
|
363
|
+
e.cellphoneRegion = i;
|
|
364
|
+
} }, model: { value: e.cellphone, callback: function(i) {
|
|
365
|
+
e.cellphone = i;
|
|
366
|
+
}, expression: "cellphone" } })], 1), t("CField", { attrs: { label: e.$t("_common:address").capitalize(), "label-position": "inside" } }, [t("CInput", { ref: "street", attrs: { placeholder: e.$t("placeholders.address") }, model: { value: e.street, callback: function(i) {
|
|
367
|
+
e.street = i;
|
|
368
|
+
}, expression: "street" } })], 1), t("CField", { staticClass: "force-two flex", attrs: { grouped: "" } }, [t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "zip", attrs: { placeholder: e.$t("_common:zip").capitalize() }, model: { value: e.zip, callback: function(i) {
|
|
369
|
+
e.zip = i;
|
|
370
|
+
}, expression: "zip" } })], 1), t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "city", attrs: { placeholder: e.$t("_common:city").capitalize() }, model: { value: e.city, callback: function(i) {
|
|
371
|
+
e.city = i;
|
|
372
|
+
}, expression: "city" } })], 1)], 1), t("CField", { staticClass: "flex" }, [t("CRadio", { staticStyle: { "margin-bottom": "0.5em" }, attrs: { "native-value": !1, type: "secondary", size: "small" }, model: { value: e.separateWorkAddress, callback: function(i) {
|
|
373
|
+
e.separateWorkAddress = i;
|
|
374
|
+
}, expression: "separateWorkAddress" } }, [e._v(" " + e._s(e.$t("seperateWorkAddress.false")) + " ")]), t("CRadio", { staticStyle: { "margin-bottom": "0.5em" }, attrs: { "native-value": !0, type: "secondary", size: "small" }, model: { value: e.separateWorkAddress, callback: function(i) {
|
|
375
|
+
e.separateWorkAddress = i;
|
|
376
|
+
}, expression: "separateWorkAddress" } }, [e._v(" " + e._s(e.$t("seperateWorkAddress.true")) + " ")])], 1), t("Animation", [e.type && e.separateWorkAddress ? t("div", [t("CField", { attrs: { label: e.$t("_common:addressWork").capitalize() + ` ( ${e.$t("workAddressSubLabel")} )` } }, [t("CInput", { ref: "workStreet", attrs: { placeholder: e.$t("placeholders.address") }, model: { value: e.workStreet, callback: function(i) {
|
|
377
|
+
e.workStreet = i;
|
|
378
|
+
}, expression: "workStreet" } })], 1), t("CField", { staticClass: "force-two flex", attrs: { grouped: "" } }, [t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "workZip", attrs: { placeholder: e.$t("_common:zip").capitalize(), expanded: "" }, model: { value: e.workZip, callback: function(i) {
|
|
379
|
+
e.workZip = i;
|
|
380
|
+
}, expression: "workZip" } })], 1), t("CField", { attrs: { expanded: "" } }, [t("CInput", { ref: "workCity", attrs: { placeholder: e.$t("_common:city").capitalize(), expanded: "" }, model: { value: e.workCity, callback: function(i) {
|
|
381
|
+
e.workCity = i;
|
|
382
|
+
}, expression: "workCity" } })], 1)], 1)], 1) : e._e()]), e.documentRole || e.answerMethod ? t("CField", { staticClass: "flex pt-4", attrs: { grouped: "" } }, [e.documentRole ? t("div", { staticClass: "dropdown-field-wrapper flex min-w-0 flex-col" }, [t("div", { staticClass: "my-1 text-sm text-gray-600" }, [e._v(" " + e._s(e.$t("_common:documentRole.title")) + " ")]), t("CDropdown", { staticStyle: { "margin-bottom": "calc(1 * var(--rem))" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", attrs: { slot: "trigger", "dropdown-icon": !0, "icon-props": {
|
|
383
|
+
stroke: "hsl(0, 0%, 50%)"
|
|
384
|
+
}, "icon-left": e.documentRole === "signee" ? "pen-tool" : "eye", type: "none", pattern: "secondary", expanded: "" }, slot: "trigger" }, [t("div", { staticClass: "py-1 leading-5" }, [t("div", [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.description`)) + " ")]), t("div", { staticClass: "text-xs opacity-70" }, [e._v(" " + e._s(e.$t(`_common:documentRole.${e.documentRole}.label`)) + " ")])])]), e._l(["signee", "recipient", "approver"], function(i) {
|
|
385
|
+
return t("CDropdownItem", { key: i, attrs: { "icon-left": i === "signee" ? "pen-tool" : "eye", "icon-props": {
|
|
386
|
+
stroke: "hsl(0, 0%, 50%)"
|
|
387
|
+
} }, on: { click: function(n) {
|
|
388
|
+
return e.$emit("update:document-role", i);
|
|
389
|
+
} } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`_common:documentRole.${i}.description`)))]), t("div", { staticStyle: { "font-size": "12px", opacity: "0.7" } }, [e._v(" " + e._s(e.$t(`_common:documentRole.${i}.label`)) + " ")])])]);
|
|
390
|
+
})], 2)], 1) : e._e(), e.answerMethod ? t("div", { staticClass: "dropdown-field-wrapper flex min-w-0 flex-col" }, [t("div", { staticClass: "my-1 text-sm text-gray-600" }, [e._v(" " + e._s(e.$t("_common:signMethod.title")) + " ")]), t("CDropdown", { staticStyle: { "margin-bottom": "calc(1 * var(--rem))" }, attrs: { expanded: "" } }, [t("CButton", { staticClass: "is-left", attrs: { slot: "trigger", "dropdown-icon": !0, type: "none", pattern: "secondary", expanded: "" }, slot: "trigger" }, [t("div", { staticClass: "max-w-[calc(16_*_var(--rem))] py-1 leading-5" }, [t("div", [e._v(e._s(e.$t(`signMethod.${e.answerMethod.accept}.title`)))]), t("div", { staticClass: "truncate text-xs opacity-70" }, [e._v(" " + e._s(e.$t(`signMethod.${e.answerMethod.accept}.content`)) + " ")])])]), e._l(e.signOptions, function(i) {
|
|
391
|
+
return t("CDropdownItem", { key: i, on: { click: function(n) {
|
|
392
|
+
return e.$emit("update:answer-method", {
|
|
393
|
+
...e.answerMethod,
|
|
394
|
+
accept: i
|
|
395
|
+
});
|
|
396
|
+
} } }, [t("div", { staticStyle: { "line-height": "1.25", padding: "4px 0" } }, [t("div", [e._v(e._s(e.$t(`signMethod.${i}.title`)))]), t("div", { staticClass: "max-w-[calc(12_*_var(--rem))] truncate", staticStyle: { "font-size": "12px", opacity: "0.7", "text-wrap": "wrap" } }, [e._v(" " + e._s(e.$t(`signMethod.${i}.content`)) + " ")])])]);
|
|
397
|
+
})], 2)], 1) : e._e()]) : e._e(), t("div", { staticStyle: { "margin-top": "calc(3 * var(--rem))" } }, [t("CButton", { staticStyle: { padding: "16px", "border-radius": "8px", height: "100%", "font-size": "14px", "font-weight": "600", "box-shadow": "0 2px 4px -1px rgba(0, 0, 0, 0.1)" }, attrs: { loading: e.isPosting, type: "secondary", wide: "" }, on: { click: e.validateForm } }, [e._v(e._s(e.$t("updateButton")))])], 1)], 1)]);
|
|
398
|
+
}, z = [], O = /* @__PURE__ */ u(
|
|
399
|
+
F,
|
|
400
|
+
M,
|
|
401
|
+
z,
|
|
402
|
+
!1,
|
|
403
|
+
null,
|
|
404
|
+
"99750061"
|
|
405
|
+
);
|
|
406
|
+
const R = O.exports, { mapFields: q } = p({
|
|
407
|
+
getterType: "forms/getField",
|
|
408
|
+
mutationType: "forms/updateField"
|
|
409
|
+
}), A = {
|
|
410
|
+
name: "ClientModal",
|
|
411
|
+
i18nOptions: {
|
|
412
|
+
namespaces: "clientModal",
|
|
413
|
+
messages: {
|
|
414
|
+
en: {
|
|
415
|
+
unsavedDialog: {
|
|
416
|
+
title: "Unsaved changes",
|
|
417
|
+
message: "Are you sure you want to cancel?",
|
|
418
|
+
cancel: "No",
|
|
419
|
+
submit: "Yes"
|
|
420
|
+
},
|
|
421
|
+
removeDialog: {
|
|
422
|
+
title: "Remove recipient",
|
|
423
|
+
message: "Would you like to remove recipient from the document?"
|
|
424
|
+
}
|
|
425
|
+
},
|
|
426
|
+
sv: {
|
|
427
|
+
unsavedDialog: {
|
|
428
|
+
title: "Osparade ändringar",
|
|
429
|
+
message: "Är du säker på att du vill avbryta?",
|
|
430
|
+
cancel: "Stanna kvar",
|
|
431
|
+
submit: "Ja, stäng"
|
|
432
|
+
},
|
|
433
|
+
removeDialog: {
|
|
434
|
+
title: "Ta bort mottagare",
|
|
435
|
+
message: "Vill du ta bort mottagaren från dokumentet?"
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
components: {
|
|
441
|
+
FormClient: R
|
|
442
|
+
},
|
|
443
|
+
mixins: [f],
|
|
444
|
+
props: {
|
|
445
|
+
documentClientIndex: {
|
|
446
|
+
type: Number,
|
|
447
|
+
default: 0
|
|
448
|
+
},
|
|
449
|
+
signOrder: {
|
|
450
|
+
type: Number,
|
|
451
|
+
default: 0
|
|
452
|
+
},
|
|
453
|
+
inputFocusOnMount: {
|
|
454
|
+
type: String,
|
|
455
|
+
default: ""
|
|
456
|
+
},
|
|
457
|
+
forceExpand: {
|
|
458
|
+
type: Boolean,
|
|
459
|
+
default: !1
|
|
460
|
+
},
|
|
461
|
+
signOptions: {
|
|
462
|
+
type: Array,
|
|
463
|
+
default: () => ["signature", "inPerson"]
|
|
464
|
+
},
|
|
465
|
+
setFormValue: {
|
|
466
|
+
type: Function,
|
|
467
|
+
required: !0
|
|
468
|
+
},
|
|
469
|
+
removeFormValue: {
|
|
470
|
+
type: Function,
|
|
471
|
+
required: !0
|
|
472
|
+
},
|
|
473
|
+
// Optional prop if this modal is mounted from public form
|
|
474
|
+
isPublicForm: {
|
|
475
|
+
type: Boolean,
|
|
476
|
+
default: !1
|
|
477
|
+
}
|
|
478
|
+
},
|
|
479
|
+
data() {
|
|
480
|
+
var e;
|
|
481
|
+
let a = l(this.formData, "data.defaultAnswerMethod.accept") || "signature";
|
|
482
|
+
return (e = this.signOptions) != null && e.length && !this.signOptions.includes(a) && ([a] = this.signOptions), {
|
|
483
|
+
storedNewClient: {
|
|
484
|
+
documentRole: "signee",
|
|
485
|
+
answerMethod: {
|
|
486
|
+
accept: a,
|
|
487
|
+
deny: "button"
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
isLoading: !1,
|
|
491
|
+
hasChanged: !1,
|
|
492
|
+
showMore: !1
|
|
493
|
+
};
|
|
494
|
+
},
|
|
495
|
+
computed: {
|
|
496
|
+
...q({
|
|
497
|
+
endCustomer: "endCustomer"
|
|
498
|
+
}),
|
|
499
|
+
...x("forms", {
|
|
500
|
+
formData: (a) => a.document2
|
|
501
|
+
}),
|
|
502
|
+
...g({
|
|
503
|
+
can: "application/can",
|
|
504
|
+
feature: "application/feature",
|
|
505
|
+
defaultClientType: "endCustomers/defaultClientType"
|
|
506
|
+
}),
|
|
507
|
+
validateOrgNo() {
|
|
508
|
+
return !!(this.feature("bankId") || this.isPublicForm && b[_.brand].defaultRegion === "SE");
|
|
509
|
+
},
|
|
510
|
+
existsOnDocument() {
|
|
511
|
+
return !!l(this.formData, `clients[${this.documentClientIndex}]`);
|
|
512
|
+
}
|
|
513
|
+
},
|
|
514
|
+
created() {
|
|
515
|
+
this.forceExpand && (this.showMore = !0);
|
|
516
|
+
const a = l(
|
|
517
|
+
this.formData,
|
|
518
|
+
`clients[${this.documentClientIndex}]`,
|
|
519
|
+
{}
|
|
520
|
+
);
|
|
521
|
+
this.loadForm(a), ["endCustomer", "storedNewClient"].forEach(
|
|
522
|
+
(e) => this.$watch(e, {
|
|
523
|
+
deep: !0,
|
|
524
|
+
handler() {
|
|
525
|
+
this.hasChanged = !0;
|
|
526
|
+
}
|
|
527
|
+
})
|
|
528
|
+
);
|
|
529
|
+
},
|
|
530
|
+
methods: {
|
|
531
|
+
...k({
|
|
532
|
+
saveClient: c.FORM_SUBMIT_ENDCUSTOMER,
|
|
533
|
+
showMessage: c.SHOW_MESSAGE
|
|
534
|
+
}),
|
|
535
|
+
omit: N,
|
|
536
|
+
loadForm(a = {}) {
|
|
537
|
+
this.storedNewClient = Object.assign(this.storedNewClient, a), this.endCustomer = $({
|
|
538
|
+
type: this.defaultClientType(),
|
|
539
|
+
...a
|
|
540
|
+
});
|
|
541
|
+
},
|
|
542
|
+
async onSave() {
|
|
543
|
+
this.isLoading = !0;
|
|
544
|
+
let a = l(this.endCustomer, "id");
|
|
545
|
+
if (!this.isPublicForm) {
|
|
546
|
+
let e = !1;
|
|
547
|
+
this.endCustomer && (this.endCustomer.id ? this.can("endCustomers", "modify", this.endCustomer.id) && (e = !0) : this.can("endCustomers", "create") && (e = !0)), e && (a = await this.saveClient());
|
|
548
|
+
}
|
|
549
|
+
this.setFormValue({
|
|
550
|
+
key: `clients[${this.documentClientIndex}]`,
|
|
551
|
+
value: w(
|
|
552
|
+
{ ...this.endCustomer, ...a && { id: a } },
|
|
553
|
+
{ ...this.storedNewClient, signOrder: this.signOrder }
|
|
554
|
+
)
|
|
555
|
+
}), this.$emit("close"), this.isLoading = !1;
|
|
556
|
+
},
|
|
557
|
+
removeClient() {
|
|
558
|
+
this.showMessage({
|
|
559
|
+
displayType: "dialog",
|
|
560
|
+
type: "danger",
|
|
561
|
+
title: this.$t("removeDialog.title"),
|
|
562
|
+
message: this.$t("removeDialog.message"),
|
|
563
|
+
actions: {
|
|
564
|
+
cancel: {
|
|
565
|
+
text: this.$t("_common:cancel"),
|
|
566
|
+
callback: "cancel"
|
|
567
|
+
},
|
|
568
|
+
submit: {
|
|
569
|
+
text: this.$t("_common:remove"),
|
|
570
|
+
callback: () => {
|
|
571
|
+
this.removeFormValue(`clients[${this.documentClientIndex}]`), this.$emit("close");
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
}
|
|
575
|
+
});
|
|
576
|
+
},
|
|
577
|
+
close() {
|
|
578
|
+
return !this.hasChanged || !this.showMore ? this.$emit("close") : this.showMessage({
|
|
579
|
+
displayType: "dialog",
|
|
580
|
+
type: "danger",
|
|
581
|
+
title: this.$t("unsavedDialog.title"),
|
|
582
|
+
message: this.$t("unsavedDialog.message"),
|
|
583
|
+
actions: {
|
|
584
|
+
cancel: {
|
|
585
|
+
text: this.$t("unsavedDialog.cancel"),
|
|
586
|
+
callback: "cancel"
|
|
587
|
+
},
|
|
588
|
+
submit: {
|
|
589
|
+
text: this.$t("unsavedDialog.submit"),
|
|
590
|
+
callback: () => this.$emit("close")
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
});
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
var D = function() {
|
|
598
|
+
var e = this, t = e._self._c;
|
|
599
|
+
return t("div", { staticClass: "font-primary fixed inset-0 z-[1000] grid place-items-center overflow-auto bg-black bg-opacity-10 max-sm:block max-sm:min-h-full max-sm:w-full max-sm:overflow-auto sm:py-4", on: { "&click": function(i) {
|
|
600
|
+
return i.target !== i.currentTarget ? null : e.close.apply(null, arguments);
|
|
601
|
+
} } }, [t("div", { staticClass: "max-sm:h-initial relative mx-auto flex flex-col items-center rounded-xl bg-white p-10 text-lg max-sm:min-h-full max-sm:w-full max-sm:rounded-none max-sm:pt-16" }, [t("CButton", { staticClass: "z-2 absolute right-4 top-4", class: e.showMore ? "" : "sm:!hidden", attrs: { pattern: "tertiary", type: "none", circle: "", icon: "x" }, on: { click: e.close } }), t("FormClient", { staticClass: "max-w-full p-0", class: [e.showMore ? "w-[520px]" : "w-[360px]"], attrs: { "search-enabled": !0, "require-reference": !1, "simple-form": !e.showMore, "input-focus-on-mount": e.inputFocusOnMount, "document-role": e.storedNewClient.documentRole, "answer-method": e.storedNewClient.answerMethod, "sign-options": e.signOptions, "validate-org-no": e.validateOrgNo, "is-public-form": e.isPublicForm }, on: { "update:documentRole": function(i) {
|
|
602
|
+
return e.$set(e.storedNewClient, "documentRole", i);
|
|
603
|
+
}, "update:document-role": function(i) {
|
|
604
|
+
return e.$set(e.storedNewClient, "documentRole", i);
|
|
605
|
+
}, "update:answerMethod": function(i) {
|
|
606
|
+
return e.$set(e.storedNewClient, "answerMethod", i);
|
|
607
|
+
}, "update:answer-method": function(i) {
|
|
608
|
+
return e.$set(e.storedNewClient, "answerMethod", i);
|
|
609
|
+
}, setClient: function(i) {
|
|
610
|
+
e.loadForm(e.omit(i, ["answerMethod"]));
|
|
611
|
+
}, submit: e.onSave, "show-more": function(i) {
|
|
612
|
+
e.showMore = !0;
|
|
613
|
+
} } }), e.existsOnDocument && e.mq === "sm" ? t("CButton", { staticClass: "mt-4 text-sm", attrs: { type: "danger", pattern: "secondary", wide: "" }, on: { click: e.removeClient } }, [e._v(" " + e._s(e.$t("_common:remove")) + " ")]) : e._e()], 1)]);
|
|
614
|
+
}, B = [], E = /* @__PURE__ */ u(
|
|
615
|
+
A,
|
|
616
|
+
D,
|
|
617
|
+
B,
|
|
618
|
+
!1,
|
|
619
|
+
null,
|
|
620
|
+
null
|
|
621
|
+
);
|
|
622
|
+
const U = E.exports;
|
|
623
|
+
export {
|
|
624
|
+
U as default
|
|
625
|
+
};
|