@progressive-development/pd-contact 0.1.69 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/index.js +10 -0
  2. package/dist/locales/be.js +20 -0
  3. package/dist/locales/de.js +20 -0
  4. package/dist/locales/en.js +20 -0
  5. package/dist/node_modules/@progressive-development/pd-forms/pd-checkbox.js +2 -0
  6. package/dist/node_modules/@progressive-development/pd-forms/pd-form-container.js +2 -0
  7. package/dist/node_modules/@progressive-development/pd-forms/pd-form-row.js +2 -0
  8. package/dist/node_modules/@progressive-development/pd-forms/pd-hover-box.js +2 -0
  9. package/dist/node_modules/@progressive-development/pd-forms/pd-input.js +2 -0
  10. package/dist/node_modules/@progressive-development/pd-forms/pd-radio-group.js +2 -0
  11. package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseInputElement.js +86 -0
  12. package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUi.js +33 -0
  13. package/dist/node_modules/@progressive-development/pd-forms/src/PdBaseUiInput.js +229 -0
  14. package/dist/node_modules/@progressive-development/pd-forms/src/PdCheckbox.js +230 -0
  15. package/dist/node_modules/@progressive-development/pd-forms/src/PdFormContainer.js +167 -0
  16. package/dist/node_modules/@progressive-development/pd-forms/src/PdFormRow.js +92 -0
  17. package/dist/node_modules/@progressive-development/pd-forms/src/PdHoverBox.js +108 -0
  18. package/dist/node_modules/@progressive-development/pd-forms/src/PdInput.js +79 -0
  19. package/dist/node_modules/@progressive-development/pd-forms/src/PdRadioGroup.js +72 -0
  20. package/dist/node_modules/@progressive-development/pd-forms/src/shared-input-field-styles.js +152 -0
  21. package/dist/node_modules/@progressive-development/pd-forms/src/shared-input-styles.js +64 -0
  22. package/dist/node_modules/@progressive-development/pd-icon/pd-icon.js +4 -0
  23. package/dist/node_modules/@progressive-development/pd-icon/src/PdIcon.js +595 -0
  24. package/dist/node_modules/lit-html/directive.js +27 -0
  25. package/dist/node_modules/lit-html/directives/class-map.js +36 -0
  26. package/dist/node_modules/lit-html/lit-html.js +242 -0
  27. package/dist/pd-contact.js +2 -0
  28. package/dist/src/PdContact.js +616 -0
  29. package/package.json +46 -22
  30. package/.editorconfig +0 -29
  31. package/.storybook/main.js +0 -3
  32. package/.storybook/server.mjs +0 -8
  33. package/demo/index.html +0 -29
  34. package/index.js +0 -1
  35. package/pd-contact.js +0 -3
  36. package/src/PdContact.js +0 -623
  37. package/stories/index.stories.js +0 -78
  38. package/test/pd-contact.test.js +0 -32
  39. package/web-dev-server.config.mjs +0 -27
  40. package/web-test-runner.config.mjs +0 -41
package/src/PdContact.js DELETED
@@ -1,623 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 PD Progressive Development UG. All rights reserved.
4
- */
5
-
6
- import { LitElement, html, css } from 'lit';
7
-
8
- import { PDFontStyles } from '@progressive-development/pd-shared-styles';
9
-
10
- import '@progressive-development/pd-icon/pd-icon.js';
11
-
12
- import '@progressive-development/pd-forms/pd-checkbox.js';
13
- import '@progressive-development/pd-forms/pd-form-container.js';
14
- import '@progressive-development/pd-forms/pd-form-row.js';
15
- import '@progressive-development/pd-forms/pd-input.js';
16
- import '@progressive-development/pd-forms/pd-radio-group.js';
17
-
18
- const countryPrefixes = {
19
- de: "+49", // Deutschland
20
- be: "+32", // Belgien
21
- nl: "+31", // Niederland
22
- fr: "+33", // Frankreich
23
- es: "+34", // Spanien
24
- };
25
-
26
- function transformPhone(phone, country) {
27
- if (!phone || typeof phone !== "string") {
28
- return ""; // Ungültige Eingabe zurücksetzen
29
- }
30
-
31
- // Hol das Länderpräfix basierend auf dem übergebenen Land
32
- const countryPrefix = countryPrefixes[country];
33
- if (!countryPrefix) {
34
- throw new Error(`Unbekanntes Land: ${country}`);
35
- }
36
-
37
- // Entferne alle Leerzeichen und Sonderzeichen (außer "+")
38
- const cleanedPhone = phone.replace(/\s+/g, "").replace(/[^0-9+]/g, "");
39
-
40
- // Prüfe, ob die Nummer mit "+" beginnt (internationale Nummer)
41
- if (cleanedPhone.startsWith("+")) {
42
- return cleanedPhone; // Nummer ist bereits international
43
- }
44
-
45
- // Prüfe, ob die Nummer mit "0" beginnt und füge das Ländercode-Präfix hinzu
46
- if (cleanedPhone.startsWith("0")) {
47
- return countryPrefix + cleanedPhone.slice(1); // "0" durch Präfix ersetzen
48
- }
49
-
50
- // Wenn die Nummer weder mit "+" noch "0" beginnt, ist sie ungültig
51
- return "";
52
- }
53
-
54
-
55
- export class PdContact extends LitElement {
56
- static get styles() {
57
- return [
58
- PDFontStyles,
59
- css`
60
- :host {
61
- display: block;
62
- }
63
-
64
- .contact {
65
- display: flex;
66
- flex-direction: column;
67
- }
68
-
69
- address {
70
- color: var(--pd-contact-address-col, var(--pd-default-font-content-col));
71
- line-height: 1.8;
72
- font-style: normal;
73
- }
74
-
75
- dl {
76
- margin: 0;
77
- padding: 0;
78
- }
79
-
80
- dt {
81
- font-weight: bold;
82
- padding-top: 10px;
83
- color: var(--pd-contact-address-title-col, var(--pd-default-font-title-col));
84
- }
85
-
86
- dd {
87
- font-weight: 400;
88
- font-size: 1em;
89
- margin: 0;
90
- padding: 0;
91
- }
92
-
93
- dd.larger {
94
- padding-top: 3px;
95
- padding-bottom: 5px;
96
- }
97
-
98
- .contact-form {
99
- --row-padding-top: 10px;
100
- }
101
-
102
- .link-icon {
103
- --pd-icon-bg-col-active: #859900;
104
- --pd-icon-bg-col-hover: #859900;
105
- --pd-icon-size: 14px;
106
- --pd-icon-stroke-col-active: white;
107
- --pd-icon-col-active: white;
108
- }
109
-
110
- .link-item {
111
- display: flex;
112
- align-items: center;
113
- text-decoration: none;
114
- color: var(--pd-default-font-link-col, inherit);
115
- }
116
-
117
- .link-item:hover {
118
- color: var(--pd-default-font-link-col-hover, #451A46) ;
119
- }
120
-
121
- `];
122
- }
123
-
124
- static get properties() {
125
- return {
126
-
127
- addressTitle: { type: String },
128
- addressRef: { type: String },
129
- /**
130
- * show (true) or not (false) tel number as link
131
- */
132
- phoneMailLink: { type: Boolean },
133
- /**
134
- * summary (true) or view (false) contact data
135
- */
136
- summary: { type: Boolean },
137
- /**
138
- * List with required contact fields, if not set use default (previous existing values to be consitent during update)
139
- */
140
- requiredFields: { type: Array },
141
- contact: { type: Object },
142
- match: { type: Object },
143
- /**
144
- * address type, business (true) or private (false), refactor, ist state internal? => _business, state:true
145
- */
146
- _business: { type: Boolean, state: true },
147
- _errorMap: { type: Object },
148
- };
149
- }
150
-
151
- constructor() {
152
- super();
153
- this.addressTitle = 'Adres';
154
- this.requiredFields = [];
155
- this.summary = false;
156
- this.match = {};
157
- this._business = false;
158
- this._errorMap = new Map();
159
- }
160
-
161
- update(changedProperties) {
162
- if (changedProperties.has("contact") && this.contact) {
163
- this._business = this.contact.business;
164
- }
165
- super.update(changedProperties);
166
- }
167
-
168
- connectedCallback() {
169
- super.connectedCallback();
170
- // add validation event listener
171
- this.addEventListener('validate-form', this._validateForm);
172
- }
173
-
174
- disconnectedCallback() {
175
- super.connectedCallback();
176
- // add validation event listener
177
- this.removeEventListener('validate-form', this._validateForm);
178
- }
179
-
180
- firstUpdated() {
181
- this.addEventListener('key-pressed', e => {
182
- this._errorMap.set(e.detail.name, '');
183
- super.requestUpdate();
184
- });
185
-
186
- // first validation if form is already filled (edit)
187
- if (this.contact) {
188
- const detail = {
189
- errorMap: new Map()
190
- }
191
- this.shadowRoot?.getElementById("contactContainerId")?.dispatchEvent(
192
- new CustomEvent("validate-form", {detail})
193
- );
194
- }
195
- }
196
-
197
- render() {
198
- return html`
199
- <div class="contact">
200
- ${this.summary ? this._renderViewContact() : this._renderEditContact()}
201
- </div>
202
- `;
203
- }
204
-
205
- _renderEditContact() {
206
- return html`
207
- <pd-form-container id="contactContainerId" requiredFieldInfo>
208
- <pd-form-row id="testFormId">
209
- <pd-radio-group
210
- class="quarter3"
211
- label="Type"
212
- required
213
- value="${this._getRadioValue()}"
214
- @field-change="${this._switchAddressType}"
215
- style="--group-gap: 20px;"
216
- >
217
- <pd-checkbox value="${this.contact ? !this.contact.business : true}" valueName="private"
218
- >Particulier</pd-checkbox
219
- >
220
- <pd-checkbox valueName="business" value="${this.contact ? this.contact.business : false}">Onderneming</pd-checkbox>
221
- </pd-radio-group>
222
- </pd-form-row>
223
-
224
- ${this._business
225
- ? html`
226
- <pd-form-row class="contact-form">
227
- <pd-input
228
- id="compNameId"
229
- class="quarter3"
230
- label="Naam onderneming"
231
- ?required="${this._isRequired("companyName")}"
232
- value="${this.contact ? this.contact.companyName : ""}"
233
- valueName="companyName"
234
- autoCompleteName="organization"
235
- ></pd-input>
236
- </pd-form-row>
237
- <pd-form-row class="contact-form">
238
- <pd-input
239
- id="vatId"
240
- class="quarter3"
241
- label="Ondernemingsnr"
242
- ?required="${this._isRequired("vatNr")}"
243
- field-type="vat"
244
- valueName="vatNr"
245
- value="${this.contact ? this.contact.vatNr : ""}"
246
- autoCompleteName="vat"
247
- ></pd-input>
248
- </pd-form-row>
249
- `
250
- : html`
251
- <pd-form-row class="contact-form">
252
- <pd-input
253
- id="firstNameId"
254
- class="quarter3"
255
- label="Voornaam"
256
- valueName="firstName"
257
- value="${this.contact ? this.contact.firstName : ""}"
258
- autoCompleteName="given-name"
259
- ?required="${this._isRequired("firstName")}"
260
- ></pd-input>
261
- </pd-form-row>
262
- <pd-form-row class="contact-form">
263
- <pd-input
264
- id="lastNameId"
265
- class="quarter3"
266
- label="Naam"
267
- valueName="lastName"
268
- value="${this.contact ? this.contact.lastName : ""}"
269
- autoCompleteName="family-name"
270
- ?required="${this._isRequired("lastName")}"
271
- ></pd-input>
272
- </pd-form-row>
273
- `}
274
- <pd-form-row class="contact-form">
275
- <pd-input
276
- id="streetId"
277
- class="quarter2"
278
- label="Straat"
279
- valueName="street"
280
- value="${this.contact ? this.contact.street : ""}"
281
- autoCompleteName="street-address"
282
- ?required="${this._isRequired("street")}"
283
- ></pd-input>
284
- <pd-input
285
- id="streetNrId"
286
- class="quarter1"
287
- label="Nr"
288
- valueName="streetNr"
289
- value="${this.contact ? this.contact.streetNr : ""}"
290
- ?required="${this._isRequired("streetNr")}"
291
- ></pd-input>
292
- </pd-form-row>
293
- <pd-form-row class="contact-form">
294
- ${this.match && this.match.zip
295
- ? html`
296
- <pd-input
297
- readonly
298
- id="zipId"
299
- class="quarter1"
300
- label="Postcode"
301
- valueName="zip"
302
- value="${this.match ? this.match.zip || '' : ''}"
303
- ></pd-input>
304
- `
305
- : html`
306
- <pd-input
307
- id="zipId"
308
- class="quarter1"
309
- label="Postcode"
310
- field-type="number"
311
- valueName="zip"
312
- value="${this.contact ? this.contact.zip : ""}"
313
- autoCompleteName="postal-code"
314
- ?required="${this._isRequired("zip")}"
315
- ></pd-input>
316
- `}
317
- <pd-input
318
- id="cityId"
319
- class="quarter2"
320
- label="Plaats"
321
- valueName="city"
322
- value="${this.contact ? this.contact.city : ""}"
323
- autoCompleteName="locality"
324
- ?required="${this._isRequired("city")}"
325
- ></pd-input>
326
- </pd-form-row>
327
- <pd-form-row class="contact-form">
328
- <pd-input
329
- class="quarter3"
330
- id="additionalHintId"
331
- label="Extra informatie"
332
- value="${this.contact ? this.contact.additionalHint : ""}"
333
- ></pd-input>
334
- </pd-form-row>
335
- <pd-form-row class="contact-form">
336
- <pd-input
337
- id="phoneId"
338
- class="quarter3"
339
- label="Telefoon"
340
- name="phone"
341
- valueName="phone1"
342
- value="${this.contact ? this.contact.phone1 : ""}"
343
- field-type="phone"
344
- autoCompleteName="tel"
345
- ?required="${this._isRequired("phone1")}"
346
- ></pd-input>
347
- </pd-form-row>
348
- <pd-form-row class="contact-form">
349
- <pd-input
350
- id="mailId"
351
- class="quarter3"
352
- label="E-mail"
353
- field-type="mail"
354
- valueName="email"
355
- value="${this.contact ? this.contact.email : ""}"
356
- autoCompleteName="email"
357
- ?required="${this._isRequired("email")}"
358
- ></pd-input>
359
- </pd-form-row>
360
- </pd-form-container>
361
- `;
362
- }
363
-
364
- _getRadioValue() {
365
- if (this.contact) {
366
- return this.contact.business ? "business" : "private";
367
- }
368
- return "private";
369
- }
370
-
371
- _renderViewContact() {
372
-
373
- if(!this.contact) {
374
- return html`<p>Contact undefined</p>`;
375
- }
376
-
377
- const trPhoneNr = transformPhone(this.contact.phone1, this.contact.country || "be");
378
- return html`
379
- <address>
380
- <dl>
381
- <dt>${this.addressTitle}</dt>
382
- ${this.contact
383
- ? html`
384
- <dd>${this.contact.companyName}</dd>
385
- <dd>${this.contact.vatNr}</dd>
386
- <dd>${this._getFullName()}</dd>
387
- <dd>${this._getFullStreet()}</dd>
388
- <dd>${this._getFullLocation()}</dd>
389
- ${this.contact.additionalHint ? html`<dd>${this.contact.additionalHint}</dd>` : ''}
390
- <dd>${this.contact.country}</dd>
391
-
392
- ${this.contact.phone1 ? html`
393
- <dd class="larger">${this.phoneMailLink && trPhoneNr ? html`
394
- <a href="${`tel:${trPhoneNr}`}"
395
- aria-label="${`Phone call: ${this.contact.phone1}`}"
396
- class="link-item">
397
- <span style="margin-right: 8px;">${this.contact.phone1}</span>
398
- <pd-icon activeIcon icon="phoneIcon" class="round link-icon"></pd-icon>
399
- </a>
400
- ` : this.contact.phone1}</dd>
401
- ` : ''}
402
-
403
- ${this.contact.email ? html`
404
- <dd class="larger">${this.phoneMailLink ? html`
405
- <a href="${`mailto:${this.contact.email}`}"
406
- aria-label="${`Send mail: ${this.contact.email}`}"
407
- class="link-item">
408
- <span style="margin-right: 8px;">${this.contact.email}</span>
409
- <pd-icon activeIcon icon="mailIcon" class="round link-icon"></pd-icon>
410
- </a>
411
- ` : this.contact.email}</dd>
412
- ` : ''}
413
-
414
- ${this.contact.btw
415
- ? html`<dt>BTW</dt>
416
- <dd>${this.contact.btw}</dd>`
417
- : ''}
418
- ${this.contact.kbc
419
- ? html`<dt>Bankgegevens</dt>
420
- <dd>${this.contact.kbc}</dd>
421
- <dd>${this.contact.bank}</dd>`
422
- : ''}
423
- `
424
- : html`${this.addressRef || '--'}`}
425
- </dl>
426
- </address>
427
- `;
428
- }
429
-
430
- _switchAddressType(e) {
431
- this._business = e.detail.name === 'business';
432
- }
433
-
434
- _isRequired(field) {
435
- return this.requiredFields && this.requiredFields.length > 0 ?
436
- this.requiredFields.includes(field) : false;
437
- }
438
-
439
- /*
440
- validateInput() {
441
- const matchForValidate = this.match || {};
442
-
443
- const companyName = this.business
444
- ? this.shadowRoot.getElementById('compNameId').value
445
- : undefined;
446
- const vatNr = this.business
447
- ? this.shadowRoot.getElementById('vatId').value
448
- : undefined;
449
- const firstName = this.business
450
- ? undefined
451
- : this.shadowRoot.getElementById('firstNameId').value;
452
- const lastName = this.business
453
- ? undefined
454
- : this.shadowRoot.getElementById('lastNameId').value;
455
- const street = this.shadowRoot.getElementById('streetId').value;
456
- const streetNr = this.shadowRoot.getElementById('streetNrId').value;
457
- const additionalHint =
458
- this.shadowRoot.getElementById('additionalHintId').value;
459
- const zip = this.shadowRoot.getElementById('zipId').value;
460
- const city = this.shadowRoot.getElementById('cityId').value;
461
- const phone1 = this.shadowRoot.getElementById('phoneId').value;
462
- const email = this.shadowRoot.getElementById('mailId').value;
463
-
464
- const newErrorMap = new Map();
465
-
466
- const reqFieldFunc = (field, key, type, mustMatch) => {
467
- if (!field || field === '') {
468
- newErrorMap.set(
469
- key,
470
- type !== 'phone'
471
- ? 'Vul dit veld in.'
472
- : 'Vul dit veld in. Gebruik +32 494 667085.'
473
- );
474
- } else if (mustMatch && field !== mustMatch) {
475
- newErrorMap.set(key, `Not match ${mustMatch}`);
476
- } else {
477
- switch (type) {
478
- case 'vat':
479
- // eslint-disable-next-line no-restricted-globals
480
- if (!newErrorMap.has(key) && !PdContact._vatIsValid(field)) {
481
- newErrorMap.set(key, 'Formaat BE0123456789 vereist');
482
- }
483
- break;
484
- case 'number':
485
- // eslint-disable-next-line no-restricted-globals
486
- if (!newErrorMap.has(key) && isNaN(field)) {
487
- newErrorMap.set(key, 'Alleen nummers toegestaan');
488
- }
489
- break;
490
- case 'mail':
491
- if (!newErrorMap.has(key) && !PdContact._mailIsValid(field)) {
492
- newErrorMap.set(key, 'Ongeldig e-mailadres');
493
- }
494
- break;
495
- case 'phone':
496
- if (!newErrorMap.has(key) && !PdContact._phoneIsValid(field)) {
497
- newErrorMap.set(
498
- key,
499
- 'Ongeldig telefoonnummer, gebruik +32 494 667085.'
500
- );
501
- }
502
- break;
503
- default:
504
- console.warn('Undefined field: ', type);
505
- }
506
- }
507
- };
508
-
509
- if (this.business) {
510
- reqFieldFunc(companyName, 'companyName');
511
- reqFieldFunc(vatNr, 'vatNr', 'vat');
512
- } else {
513
- reqFieldFunc(firstName, 'firstName');
514
- reqFieldFunc(lastName, 'lastName');
515
- }
516
- reqFieldFunc(street, 'street');
517
- reqFieldFunc(streetNr, 'streetNr');
518
- reqFieldFunc(zip, 'zip', 'number', matchForValidate.zip);
519
- reqFieldFunc(city, 'city');
520
- reqFieldFunc(phone1, 'phone1', 'phone');
521
- reqFieldFunc(email, 'email', 'mail');
522
- this._errorMap = newErrorMap;
523
-
524
- return new Promise((resolve, reject) => {
525
- if (newErrorMap.size > 0) {
526
- reject();
527
- } else {
528
- this.contact = {
529
- business: this.business,
530
- companyName,
531
- vatNr,
532
- firstName,
533
- lastName,
534
- street,
535
- streetNr,
536
- additionalHint,
537
- zip,
538
- city,
539
- phone1,
540
- email,
541
- };
542
- resolve(this.contact);
543
- }
544
- });
545
- }
546
- */
547
-
548
- _validateForm(e) {
549
- if (e.detail && !e.detail.singleElement) {
550
- this.shadowRoot.getElementById("contactContainerId").dispatchEvent(
551
- new CustomEvent("validate-form", {
552
- detail: e.detail
553
- })
554
- );
555
-
556
- // set prepared form, if no validation error occured
557
- if (e.detail.errorMap.size === 0 && e.detail.formData) {
558
- e.detail.formData[this.id] = this._setFormData();
559
- }
560
- }
561
- }
562
-
563
- _setFormData() {
564
- const companyName = this._business
565
- ? this.shadowRoot.getElementById('compNameId').value
566
- : undefined;
567
- const vatNr = this._business
568
- ? this.shadowRoot.getElementById('vatId').value
569
- : undefined;
570
- const firstName = this._business
571
- ? undefined
572
- : this.shadowRoot.getElementById('firstNameId').value;
573
- const lastName = this._business
574
- ? undefined
575
- : this.shadowRoot.getElementById('lastNameId').value;
576
- const street = this.shadowRoot.getElementById('streetId').value;
577
- const streetNr = this.shadowRoot.getElementById('streetNrId').value;
578
- const additionalHint =
579
- this.shadowRoot.getElementById('additionalHintId').value;
580
- const zip = this.shadowRoot.getElementById('zipId').value;
581
- const city = this.shadowRoot.getElementById('cityId').value;
582
- const phone1 = this.shadowRoot.getElementById('phoneId').value;
583
- const email = this.shadowRoot.getElementById('mailId').value;
584
-
585
- return {
586
- business: this._business,
587
- companyName,
588
- vatNr,
589
- firstName,
590
- lastName,
591
- street,
592
- streetNr,
593
- additionalHint,
594
- zip,
595
- city,
596
- phone1,
597
- email,
598
- };
599
- }
600
-
601
- _getFullName() {
602
- return PdContact._getFullVal(this.contact.firstName, this.contact.lastName);
603
- }
604
-
605
- _getFullStreet() {
606
- return PdContact._getFullVal(this.contact.street, this.contact.streetNr);
607
- }
608
-
609
- _getFullLocation() {
610
- return PdContact._getFullVal(this.contact.zip, this.contact.city);
611
- }
612
-
613
- static _getFullVal(val1, val2, elseStr) {
614
- let fullVal = '';
615
- if (val1) {
616
- fullVal += val1;
617
- }
618
- if (val2) {
619
- fullVal += ` ${val2}`;
620
- }
621
- return fullVal.length === 0 ? elseStr : fullVal;
622
- }
623
- }
@@ -1,78 +0,0 @@
1
- import { html } from 'lit';
2
- import '../pd-contact.js';
3
-
4
- export default {
5
- title: 'PdContact/Contact',
6
- component: 'pd-contact',
7
- argTypes: {
8
- },
9
- };
10
-
11
- function Template() {
12
- return html`
13
- <h3>Edit Contact</h3>
14
- <pd-contact></pd-contact>
15
- `;
16
- }
17
-
18
- function TemplateView({summary, phoneMailLink}) {
19
- console.log(summary);
20
- return html`
21
- <h3>View Contact</h3>
22
- <pd-contact ?summary="${summary}" ?phoneMailLink="${phoneMailLink}" .contact="${{
23
- firstName: 'Peter',
24
- lastName: 'Musterman',
25
- street: 'Musterstrasse',
26
- streetNr: '23b',
27
- zip: '9040',
28
- city: 'Gent',
29
- phone1: '0221 992344234',
30
- mobil: '0175/9923443',
31
- email: 'peter@muster.be'
32
- }}"></pd-contact>`;
33
- }
34
-
35
- function TemplateViewBusiness({summary}) {
36
- console.log(summary);
37
- return html`
38
- <h3>View Contact</h3>
39
- <pd-contact ?summary="${summary}" .contact="${{
40
- business: true,
41
- companyName: 'PD Progressive Develpoment',
42
- vatNr: "DE0123456789",
43
- street: 'Musterstrasse',
44
- streetNr: '23b',
45
- zip: '9040',
46
- city: 'Gent',
47
- phone1: '0221 992344234',
48
- mobil: '0175/9923443',
49
- email: 'peter@muster.be'
50
- }}"></pd-contact>`;
51
- }
52
-
53
- export const ContactForm = Template.bind({});
54
- ContactForm.args = {
55
- };
56
-
57
- export const ContactView = TemplateView.bind({});
58
- ContactView.args = {
59
- summary: "true"
60
- };
61
-
62
- export const ContactViewPhone = TemplateView.bind({});
63
- ContactViewPhone.args = {
64
- summary: "true",
65
- phoneMailLink: "true"
66
- };
67
-
68
- export const ContactPreparedForm = TemplateView.bind({});
69
- ContactView.args = {
70
- summary: "false"
71
- };
72
-
73
- export const ContactPreparedFormCompany = TemplateViewBusiness.bind({});
74
- ContactView.args = {
75
- summary: "false",
76
- phoneCallLink: "false"
77
- };
78
-