@progressive-development/pd-contact 0.5.10 → 0.6.1

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.
@@ -1,666 +0,0 @@
1
- import { LitElement, css, html } from "lit";
2
- import { msg, str } from "@lit/localize";
3
- import { PDFontStyles } from "@progressive-development/pd-shared-styles";
4
- import "@progressive-development/pd-icon/pd-icon";
5
- import "@progressive-development/pd-forms/pd-checkbox";
6
- import "@progressive-development/pd-forms/pd-form-container";
7
- import "@progressive-development/pd-forms/pd-form-row";
8
- import "@progressive-development/pd-forms/pd-input";
9
- import "@progressive-development/pd-forms/pd-select";
10
- import "@progressive-development/pd-forms/pd-radio-group";
11
- /**
12
- * @license
13
- * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
14
- */
15
- const countryPrefixes = {
16
- de: "+49",
17
- // Deutschland
18
- be: "+32",
19
- // Belgien
20
- nl: "+31",
21
- // Niederland
22
- fr: "+33",
23
- // Frankreich
24
- es: "+34"
25
- // Spanien
26
- };
27
- function transformPhone(phone, country) {
28
- if (!phone || typeof phone !== "string") {
29
- return "";
30
- }
31
- const countryPrefix = countryPrefixes[country];
32
- if (!countryPrefix) {
33
- throw new Error(`Unbekanntes Land: ${country}`);
34
- }
35
- const cleanedPhone = phone.replace(/\s+/g, "").replace(/[^0-9+]/g, "");
36
- if (cleanedPhone.startsWith("+")) {
37
- return cleanedPhone;
38
- }
39
- if (cleanedPhone.startsWith("0")) {
40
- return countryPrefix + cleanedPhone.slice(1);
41
- }
42
- return "";
43
- }
44
- const C_TYPE = "type";
45
- const C_COMPANY = "companyName";
46
- const C_BTWNR = "vatNr";
47
- const C_FIRSTNAME = "firstName";
48
- const C_LASTNAME = "lastName";
49
- const C_STREET = "street";
50
- const C_CITY = "city";
51
- const C_ADDITIONAL = "additionalHint";
52
- const C_PROPERTY_DATE = "propertyDate";
53
- const C_PHONE1 = "phone1";
54
- const C_EMAIL = "email";
55
- const yearSelection = [
56
- { value: "UNDEF", name: msg("Baujahr auswählen", { id: "pd.contact.property.year.selection" }) },
57
- { value: "<2014", name: "< 2014" },
58
- { value: "2014", name: "2014" },
59
- { value: "2015", name: "2015" },
60
- { value: "2016", name: "2016" },
61
- { value: "2017", name: "2017" },
62
- { value: "2018", name: "2018" },
63
- { value: "2019", name: "2019" },
64
- { value: "2020", name: "2020" },
65
- { value: "2021", name: "2021" },
66
- { value: "2022", name: "2022" },
67
- { value: "2023", name: "2023" },
68
- { value: "2024", name: "2024" },
69
- { value: "2025", name: "2025" }
70
- ];
71
- class PdContact extends LitElement {
72
- static get properties() {
73
- return {
74
- addressTitle: { type: String },
75
- addressRef: { type: String },
76
- /**
77
- * show (true) or not (false) tel number as link
78
- */
79
- phoneMailLink: { type: Boolean },
80
- /**
81
- * summary (true) or view (false) contact data
82
- */
83
- summary: { type: Boolean },
84
- /**
85
- * withPropertyDate (true) input for property date
86
- */
87
- withPropertyDate: { type: Boolean },
88
- /**
89
- * List with required contact fields, if not set use default (previous existing values to be consitent during update)
90
- */
91
- requiredFields: { type: Array },
92
- /**
93
- * List with showing input fields, if not set show all
94
- */
95
- inputFields: { type: Array },
96
- contact: { type: Object },
97
- match: { type: Object },
98
- /**
99
- * address type, business (true) or private (false), refactor, ist state internal? => _business, state:true
100
- */
101
- _business: { type: Boolean, state: true },
102
- _errorMap: { type: Object }
103
- };
104
- }
105
- static get styles() {
106
- return [
107
- PDFontStyles,
108
- css`
109
- :host {
110
- display: block;
111
- }
112
-
113
- .contact {
114
- display: flex;
115
- flex-direction: column;
116
- }
117
-
118
- address {
119
- color: var(--pd-contact-address-col, var(--pd-default-font-content-col));
120
- line-height: 1.8;
121
- font-style: normal;
122
- }
123
-
124
- dl {
125
- margin: 0;
126
- padding: 0;
127
- }
128
-
129
- dt {
130
- font-weight: bold;
131
- padding-top: 10px;
132
- color: var(--pd-contact-address-title-col, var(--pd-default-font-title-col));
133
- }
134
-
135
- dd {
136
- font-weight: 400;
137
- font-size: 1em;
138
- margin: 0;
139
- padding: 0;
140
- }
141
-
142
- dd.larger {
143
- padding-top: 3px;
144
- padding-bottom: 5px;
145
- }
146
-
147
- .contact-form {
148
- --row-padding-top: 10px;
149
- }
150
-
151
- .link-icon {
152
- --pd-icon-bg-col-active: #859900;
153
- --pd-icon-bg-col-hover: #859900;
154
- --pd-icon-size: 14px;
155
- --pd-icon-stroke-col-active: white;
156
- --pd-icon-col-active: white;
157
- }
158
-
159
- .link-item {
160
- display: flex;
161
- align-items: center;
162
- text-decoration: none;
163
- color: var(--pd-default-font-link-col, inherit);
164
- }
165
-
166
- .link-item:hover {
167
- color: var(--pd-default-font-link-col-hover, #451A46) ;
168
- }
169
-
170
- `
171
- ];
172
- }
173
- constructor() {
174
- super();
175
- this.addressTitle = msg("Adresse", { id: "pd.contact.address.title" });
176
- this.requiredFields = [];
177
- this.inputFields = [];
178
- this.summary = false;
179
- this.match = {};
180
- this._business = false;
181
- this._errorMap = /* @__PURE__ */ new Map();
182
- }
183
- update(changedProperties) {
184
- if (changedProperties.has("contact") && this.contact) {
185
- this._business = this.contact.business;
186
- }
187
- super.update(changedProperties);
188
- }
189
- connectedCallback() {
190
- super.connectedCallback();
191
- this.addEventListener("validate-form", this._validateForm);
192
- }
193
- disconnectedCallback() {
194
- super.connectedCallback();
195
- this.removeEventListener("validate-form", this._validateForm);
196
- }
197
- firstUpdated() {
198
- var _a, _b;
199
- this.addEventListener("key-pressed", (e) => {
200
- this._errorMap.set(e.detail.name, "");
201
- super.requestUpdate();
202
- });
203
- if (this.contact) {
204
- const detail = {
205
- errorMap: /* @__PURE__ */ new Map()
206
- };
207
- (_b = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById("contactContainerId")) == null ? void 0 : _b.dispatchEvent(
208
- new CustomEvent("validate-form", { detail })
209
- );
210
- }
211
- }
212
- render() {
213
- return html`
214
- <div class="contact">
215
- ${this.summary ? this._renderViewContact() : this._renderEditContact()}
216
- </div>
217
- `;
218
- }
219
- _renderEditContact() {
220
- return html`
221
- <pd-form-container id="contactContainerId" requiredFieldInfo>
222
-
223
- ${this.inputFields.length === 0 || this._showInput(C_TYPE) ? html`
224
- <pd-form-row id="testFormId">
225
- <pd-radio-group
226
- class="quarter3"
227
- label="${msg("Typ", { id: "pd.contact.label.type" })}"
228
- required
229
- value="${this._getRadioValue()}"
230
- @field-change="${this._switchAddressType}"
231
- style="--group-gap: 20px;"
232
- >
233
- <pd-checkbox value="${this.contact ? !this.contact.business : true}" valueName="private"
234
- >${msg("Privatperson", { id: "pd.contact.check.private" })}</pd-checkbox
235
- >
236
- <pd-checkbox valueName="business" value="${this.contact ? this.contact.business : false}">${msg("Unternehmen", { id: "pd.contact.check.company" })}</pd-checkbox>
237
- </pd-radio-group>
238
- </pd-form-row>
239
- ` : ""}
240
-
241
- ${this._business ? html`
242
- ${this.inputFields.length === 0 || this._showInput(C_COMPANY) ? html`
243
- <pd-form-row class="contact-form">
244
- <pd-input
245
- id="compNameId"
246
- class="quarter3"
247
- label="${msg("Name des Unternehmen", { id: "pd.contact.label.company" })}"
248
- ?required="${this._isRequired(C_COMPANY)}"
249
- value="${this.contact ? this.contact.companyName : ""}"
250
- valueName="companyName"
251
- autoCompleteName="organization"
252
- ></pd-input>
253
- </pd-form-row>
254
- ` : ""}
255
- ${this.inputFields.length === 0 || this._showInput(C_BTWNR) ? html`
256
- <pd-form-row class="contact-form">
257
- <pd-input
258
- id="vatId"
259
- class="quarter3"
260
- label="${msg("USt-IdNr.", { id: "pd.contact.label.btw" })}"
261
- ?required="${this._isRequired(C_BTWNR)}"
262
- field-type="vat"
263
- valueName="vatNr"
264
- value="${this.contact ? this.contact.vatNr : ""}"
265
- autoCompleteName="vat"
266
- ></pd-input>
267
- </pd-form-row>
268
- ` : ""}
269
- ` : html`
270
- ${this.inputFields.length === 0 || this._showInput(C_FIRSTNAME) ? html`
271
- <pd-form-row class="contact-form">
272
- <pd-input
273
- id="firstNameId"
274
- class="quarter3"
275
- label="${msg("Vorname", { id: "pd.contact.label.firstName" })}"
276
- valueName="firstName"
277
- value="${this.contact ? this.contact.firstName : ""}"
278
- autoCompleteName="given-name"
279
- ?required="${this._isRequired(C_FIRSTNAME)}"
280
- ></pd-input>
281
- </pd-form-row>
282
- ` : ""}
283
- ${this.inputFields.length === 0 || this._showInput(C_LASTNAME) ? html`
284
- <pd-form-row class="contact-form">
285
- <pd-input
286
- id="lastNameId"
287
- class="quarter3"
288
- label="${msg("Nachname", { id: "pd.contact.label.lastName" })}"
289
- valueName="lastName"
290
- value="${this.contact ? this.contact.lastName : ""}"
291
- autoCompleteName="family-name"
292
- ?required="${this._isRequired(C_LASTNAME)}"
293
- ></pd-input>
294
- </pd-form-row>
295
- ` : ""}
296
- `}
297
- ${this.inputFields.length === 0 || this._showInput(C_STREET) ? html`
298
- <pd-form-row class="contact-form">
299
- <pd-input
300
- id="streetId"
301
- class="quarter2"
302
- label="${msg("Strasse", { id: "pd.contact.label.street" })}"
303
- valueName="street"
304
- value="${this.contact ? this.contact.street : ""}"
305
- autoCompleteName="street-address"
306
- ?required="${this._isRequired(C_STREET)}"
307
- ></pd-input>
308
- <pd-input
309
- id="streetNrId"
310
- class="quarter1"
311
- label="${msg("Nr.", { id: "pd.contact.label.streetNr" })}"
312
- valueName="streetNr"
313
- value="${this.contact ? this.contact.streetNr : ""}"
314
- ?required="${this._isRequired("streetNr")}"
315
- ></pd-input>
316
- </pd-form-row>
317
- ` : ""}
318
- ${this.inputFields.length === 0 || this._showInput(C_CITY) ? html`
319
- <pd-form-row class="contact-form">
320
- ${this.match && this.match.zip ? html`
321
- <pd-input
322
- readonly
323
- id="zipId"
324
- class="quarter1"
325
- label="${msg("PLZ", { id: "pd.contact.label.zip" })}"
326
- valueName="zip"
327
- value="${this.match ? this.match.zip || "" : ""}"
328
- ></pd-input>
329
- ` : html`
330
- <pd-input
331
- id="zipId"
332
- class="quarter1"
333
- label="${msg("PLZ", { id: "pd.contact.label.zip" })}"
334
- field-type="number"
335
- valueName="zip"
336
- value="${this.contact ? this.contact.zip : ""}"
337
- autoCompleteName="postal-code"
338
- ?required="${this._isRequired("zip")}"
339
- ></pd-input>
340
- `}
341
- <pd-input
342
- id="cityId"
343
- class="quarter2"
344
- label="${msg("Ort", { id: "pd.contact.label.city" })}"
345
- valueName="city"
346
- value="${this.contact ? this.contact.city : ""}"
347
- autoCompleteName="locality"
348
- ?required="${this._isRequired(C_CITY)}"
349
- ></pd-input>
350
- </pd-form-row>
351
- ` : ""}
352
- ${this.inputFields.length === 0 || this._showInput(C_ADDITIONAL) ? html`
353
- <pd-form-row class="contact-form">
354
- <pd-input
355
- class="quarter3"
356
- id="additionalHintId"
357
- label="${msg("Addresszusatz", { id: "pd.contact.label.additional" })}"
358
- value="${this.contact ? this.contact.additionalHint : ""}"
359
- ></pd-input>
360
- </pd-form-row>
361
- ` : ""}
362
- ${this.withPropertyDate ? html`
363
- <pd-form-row class="contact-form">
364
- <pd-select
365
- class="quarter3"
366
- id="propertyDateId"
367
- label="${msg("Datum der Immobilie", { id: "pd.contact.label.propertyDate" })}"
368
- value="${this.contact ? this.contact.propertyDate : ""}"
369
- .values="${yearSelection}"
370
- ?required="${this._isRequired(C_PROPERTY_DATE)}"
371
- ></pd-select>
372
- </pd-form-row>
373
- ` : ""}
374
- ${this.inputFields.length === 0 || this._showInput(C_PHONE1) ? html`
375
- <pd-form-row class="contact-form">
376
- <pd-input
377
- id="phoneId"
378
- class="quarter3"
379
- label="${msg("Telefon", { id: "pd.contact.label.phone" })}"
380
- name="phone"
381
- valueName="phone1"
382
- value="${this.contact ? this.contact.phone1 : ""}"
383
- field-type="phone"
384
- autoCompleteName="tel"
385
- ?required="${this._isRequired(C_PHONE1)}"
386
- ></pd-input>
387
- </pd-form-row>
388
- ` : ""}
389
- ${this.inputFields.length === 0 || this._showInput(C_EMAIL) ? html`
390
- <pd-form-row class="contact-form">
391
- <pd-input
392
- id="mailId"
393
- class="quarter3"
394
- label="${msg("E-mail", { id: "pd.contact.label.email" })}"
395
- field-type="mail"
396
- valueName="email"
397
- value="${this.contact ? this.contact.email : ""}"
398
- autoCompleteName="email"
399
- ?required="${this._isRequired(C_EMAIL)}"
400
- ></pd-input>
401
- </pd-form-row>
402
- ` : ""}
403
- </pd-form-container>
404
- `;
405
- }
406
- _getRadioValue() {
407
- if (this.contact) {
408
- return this.contact.business ? "business" : "private";
409
- }
410
- return "private";
411
- }
412
- _renderViewContact() {
413
- if (!this.contact) {
414
- return html`<p>Contact undefined</p>`;
415
- }
416
- const trPhoneNr = transformPhone(this.contact.phone1, this.contact.country || "be");
417
- return html`
418
- <address>
419
- <dl>
420
- <dt>${this.addressTitle}</dt>
421
- ${this.contact ? html`
422
- <dd>${this.contact.companyName}</dd>
423
- <dd>${this.contact.vatNr}</dd>
424
- <dd>${this._getFullName()}</dd>
425
- <dd>${this._getFullStreet()}</dd>
426
- <dd>${this._getFullLocation()}</dd>
427
- ${this.contact.additionalHint ? html`<dd>${this.contact.additionalHint}</dd>` : ""}
428
- ${this.contact.propertyDate ? html`<dd>${msg(str`Baujahr: ${this.contact.propertyDate}`, { id: "pd.contact.label.summary.propertyDate" })}</dd>` : ""}
429
- <dd>${this.contact.country}</dd>
430
-
431
- ${this.contact.phone1 ? html`
432
- <dd class="larger">${this.phoneMailLink && trPhoneNr ? html`
433
- <a href="${`tel:${trPhoneNr}`}"
434
- aria-label="${`Phone call: ${this.contact.phone1}`}"
435
- class="link-item">
436
- <span style="margin-right: 8px;">${this.contact.phone1}</span>
437
- <pd-icon activeIcon icon="phoneIcon" class="round link-icon"></pd-icon>
438
- </a>
439
- ` : this.contact.phone1}</dd>
440
- ` : ""}
441
-
442
- ${this.contact.email ? html`
443
- <dd class="larger">${this.phoneMailLink ? html`
444
- <a href="${`mailto:${this.contact.email}`}"
445
- aria-label="${`Send mail: ${this.contact.email}`}"
446
- class="link-item">
447
- <span style="margin-right: 8px;">${this.contact.email}</span>
448
- <pd-icon activeIcon icon="mailIcon" class="round link-icon"></pd-icon>
449
- </a>
450
- ` : this.contact.email}</dd>
451
- ` : ""}
452
-
453
- ${this.contact.btw ? html`<dt>BTW</dt>
454
- <dd>${this.contact.btw}</dd>` : ""}
455
- ${this.contact.kbc ? html`<dt>Bankgegevens</dt>
456
- <dd>${this.contact.kbc}</dd>
457
- <dd>${this.contact.bank}</dd>` : ""}
458
- ` : html`${this.addressRef || "--"}`}
459
- </dl>
460
- </address>
461
- `;
462
- }
463
- _switchAddressType(e) {
464
- this._business = e.detail.name === "business";
465
- }
466
- _isRequired(field) {
467
- return this.requiredFields && this.requiredFields.length > 0 ? this.requiredFields.includes(field) : false;
468
- }
469
- _showInput(field) {
470
- return this.inputFields && this.inputFields.length > 0 ? this.inputFields.includes(field) : false;
471
- }
472
- /*
473
- validateInput() {
474
- const matchForValidate = this.match || {};
475
-
476
- const companyName = this.business
477
- ? this.shadowRoot.getElementById('compNameId').value
478
- : undefined;
479
- const vatNr = this.business
480
- ? this.shadowRoot.getElementById('vatId').value
481
- : undefined;
482
- const firstName = this.business
483
- ? undefined
484
- : this.shadowRoot.getElementById('firstNameId').value;
485
- const lastName = this.business
486
- ? undefined
487
- : this.shadowRoot.getElementById('lastNameId').value;
488
- const street = this.shadowRoot.getElementById('streetId').value;
489
- const streetNr = this.shadowRoot.getElementById('streetNrId').value;
490
- const additionalHint =
491
- this.shadowRoot.getElementById('additionalHintId').value;
492
- const zip = this.shadowRoot.getElementById('zipId').value;
493
- const city = this.shadowRoot.getElementById('cityId').value;
494
- const phone1 = this.shadowRoot.getElementById('phoneId').value;
495
- const email = this.shadowRoot.getElementById('mailId').value;
496
-
497
- const newErrorMap = new Map();
498
-
499
- const reqFieldFunc = (field, key, type, mustMatch) => {
500
- if (!field || field === '') {
501
- newErrorMap.set(
502
- key,
503
- type !== 'phone'
504
- ? 'Vul dit veld in.'
505
- : 'Vul dit veld in. Gebruik +32 494 667085.'
506
- );
507
- } else if (mustMatch && field !== mustMatch) {
508
- newErrorMap.set(key, `Not match ${mustMatch}`);
509
- } else {
510
- switch (type) {
511
- case 'vat':
512
- // eslint-disable-next-line no-restricted-globals
513
- if (!newErrorMap.has(key) && !PdContact._vatIsValid(field)) {
514
- newErrorMap.set(key, 'Formaat BE0123456789 vereist');
515
- }
516
- break;
517
- case 'number':
518
- // eslint-disable-next-line no-restricted-globals
519
- if (!newErrorMap.has(key) && isNaN(field)) {
520
- newErrorMap.set(key, 'Alleen nummers toegestaan');
521
- }
522
- break;
523
- case 'mail':
524
- if (!newErrorMap.has(key) && !PdContact._mailIsValid(field)) {
525
- newErrorMap.set(key, 'Ongeldig e-mailadres');
526
- }
527
- break;
528
- case 'phone':
529
- if (!newErrorMap.has(key) && !PdContact._phoneIsValid(field)) {
530
- newErrorMap.set(
531
- key,
532
- 'Ongeldig telefoonnummer, gebruik +32 494 667085.'
533
- );
534
- }
535
- break;
536
- default:
537
- console.warn('Undefined field: ', type);
538
- }
539
- }
540
- };
541
-
542
- if (this.business) {
543
- reqFieldFunc(companyName, 'companyName');
544
- reqFieldFunc(vatNr, 'vatNr', 'vat');
545
- } else {
546
- reqFieldFunc(firstName, 'firstName');
547
- reqFieldFunc(lastName, 'lastName');
548
- }
549
- reqFieldFunc(street, 'street');
550
- reqFieldFunc(streetNr, 'streetNr');
551
- reqFieldFunc(zip, 'zip', 'number', matchForValidate.zip);
552
- reqFieldFunc(city, 'city');
553
- reqFieldFunc(phone1, 'phone1', 'phone');
554
- reqFieldFunc(email, 'email', 'mail');
555
- this._errorMap = newErrorMap;
556
-
557
- return new Promise((resolve, reject) => {
558
- if (newErrorMap.size > 0) {
559
- reject();
560
- } else {
561
- this.contact = {
562
- business: this.business,
563
- companyName,
564
- vatNr,
565
- firstName,
566
- lastName,
567
- street,
568
- streetNr,
569
- additionalHint,
570
- zip,
571
- city,
572
- phone1,
573
- email,
574
- };
575
- resolve(this.contact);
576
- }
577
- });
578
- }
579
- */
580
- _validateForm(e) {
581
- if (e.detail && !e.detail.singleElement) {
582
- this.shadowRoot.getElementById("contactContainerId").dispatchEvent(
583
- new CustomEvent("validate-form", {
584
- detail: e.detail
585
- })
586
- );
587
- if (e.detail.errorMap.size === 0 && e.detail.formData) {
588
- e.detail.formData[this.id] = this._setFormData();
589
- }
590
- }
591
- }
592
- _setFormData() {
593
- const elCompanyName = this._business ? this.shadowRoot.getElementById("compNameId") : void 0;
594
- const companyName = elCompanyName ? elCompanyName.value : void 0;
595
- const elVatNr = this._business ? this.shadowRoot.getElementById("vatId") : void 0;
596
- const vatNr = elVatNr ? elVatNr.value : void 0;
597
- const elFirstName = this._business ? void 0 : this.shadowRoot.getElementById("firstNameId");
598
- const firstName = elFirstName ? elFirstName.value : void 0;
599
- const elLastName = this._business ? void 0 : this.shadowRoot.getElementById("lastNameId");
600
- const lastName = elLastName ? elLastName.value : void 0;
601
- const elStreet = this.shadowRoot.getElementById("streetId");
602
- const street = elStreet ? elStreet.value : void 0;
603
- const elStreetNr = this.shadowRoot.getElementById("streetNrId");
604
- const streetNr = elStreetNr ? elStreetNr.value : void 0;
605
- const elAdditionalHint = this.shadowRoot.getElementById("additionalHintId");
606
- const additionalHint = elAdditionalHint ? elAdditionalHint.value : void 0;
607
- const elPropertyDate = this.withPropertyDate ? this.shadowRoot.getElementById("propertyDateId") : void 0;
608
- const propertyDate = elPropertyDate ? elPropertyDate.value : void 0;
609
- const elZip = this.shadowRoot.getElementById("zipId");
610
- const zip = elZip ? elZip.value : void 0;
611
- const elCity = this.shadowRoot.getElementById("cityId");
612
- const city = elCity ? elCity.value : void 0;
613
- const elPhone1 = this.shadowRoot.getElementById("phoneId");
614
- const phone1 = elPhone1 ? elPhone1.value : void 0;
615
- const elEmail = this.shadowRoot.getElementById("mailId");
616
- const email = elEmail ? elEmail.value : void 0;
617
- return {
618
- business: this._business,
619
- companyName,
620
- vatNr,
621
- firstName,
622
- lastName,
623
- street,
624
- streetNr,
625
- additionalHint,
626
- propertyDate,
627
- zip,
628
- city,
629
- phone1,
630
- email
631
- };
632
- }
633
- _getFullName() {
634
- return PdContact._getFullVal(this.contact.firstName, this.contact.lastName);
635
- }
636
- _getFullStreet() {
637
- return PdContact._getFullVal(this.contact.street, this.contact.streetNr);
638
- }
639
- _getFullLocation() {
640
- return PdContact._getFullVal(this.contact.zip, this.contact.city);
641
- }
642
- static _getFullVal(val1, val2, elseStr) {
643
- let fullVal = "";
644
- if (val1) {
645
- fullVal += val1;
646
- }
647
- if (val2) {
648
- fullVal += ` ${val2}`;
649
- }
650
- return fullVal.length === 0 ? elseStr : fullVal;
651
- }
652
- }
653
- export {
654
- C_ADDITIONAL,
655
- C_BTWNR,
656
- C_CITY,
657
- C_COMPANY,
658
- C_EMAIL,
659
- C_FIRSTNAME,
660
- C_LASTNAME,
661
- C_PHONE1,
662
- C_PROPERTY_DATE,
663
- C_STREET,
664
- C_TYPE,
665
- PdContact
666
- };