@progressive-development/pd-contact 0.6.25 → 0.9.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.
@@ -0,0 +1,549 @@
1
+ import { LitElement, css, html } from 'lit';
2
+ import { property, state, query } from 'lit/decorators.js';
3
+ import { msg, str } from '@lit/localize';
4
+ import { PdFontStyles, PdColorStyles } from '@progressive-development/pd-shared-styles';
5
+ import '@progressive-development/pd-icon/pd-icon';
6
+ import '@progressive-development/pd-forms/pd-checkbox';
7
+ import '@progressive-development/pd-forms/pd-form-container';
8
+ import '@progressive-development/pd-forms/pd-form-row';
9
+ import '@progressive-development/pd-forms/pd-input';
10
+ import '@progressive-development/pd-forms/pd-select';
11
+ import '@progressive-development/pd-forms/pd-radio-group';
12
+ import { C_TYPE, C_COMPANY, C_BTWNR, C_FIRSTNAME, C_LASTNAME, C_STREET, C_CITY, C_ZIP, C_ADDITIONAL, C_PROPERTY_DATE, C_PHONE1, C_EMAIL } from '../types.js';
13
+
14
+ var __defProp = Object.defineProperty;
15
+ var __decorateClass = (decorators, target, key, kind) => {
16
+ var result = void 0 ;
17
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
18
+ if (decorator = decorators[i])
19
+ result = (decorator(target, key, result) ) || result;
20
+ if (result) __defProp(target, key, result);
21
+ return result;
22
+ };
23
+ const countryPrefixes = {
24
+ de: "+49",
25
+ // Deutschland
26
+ be: "+32",
27
+ // Belgien
28
+ nl: "+31",
29
+ // Niederland
30
+ fr: "+33",
31
+ // Frankreich
32
+ es: "+34"
33
+ // Spanien
34
+ };
35
+ function transformPhone(phone, country) {
36
+ if (!phone || typeof phone !== "string") return "";
37
+ const countryPrefix = countryPrefixes[country];
38
+ if (!countryPrefix) throw new Error(`Unbekanntes Land: ${country}`);
39
+ const cleanedPhone = phone.replace(/\s+/g, "").replace(/[^0-9+]/g, "");
40
+ if (cleanedPhone.startsWith("+")) return cleanedPhone;
41
+ if (cleanedPhone.startsWith("0"))
42
+ return countryPrefix + cleanedPhone.slice(1);
43
+ return "";
44
+ }
45
+ const yearSelection = [
46
+ {
47
+ value: "UNDEF",
48
+ name: msg("Baujahr auswählen", {
49
+ id: "pd.contact.property.year.selection"
50
+ })
51
+ },
52
+ ...Array.from({ length: 2025 - 2014 + 1 }, (_, i) => {
53
+ const year = (2014 + i).toString();
54
+ return { value: year, name: year };
55
+ })
56
+ ];
57
+ const _PdContact = class _PdContact extends LitElement {
58
+ constructor() {
59
+ super(...arguments);
60
+ this.addressTitle = msg("Adresse", { id: "pd.contact.address.title" });
61
+ this.phoneMailLink = false;
62
+ this.summary = false;
63
+ this.withPropertyDate = false;
64
+ this.requiredFields = [];
65
+ this.inputFields = [];
66
+ this._business = false;
67
+ }
68
+ static {
69
+ this.styles = [
70
+ PdFontStyles,
71
+ PdColorStyles,
72
+ css`
73
+ :host {
74
+ display: block;
75
+ }
76
+
77
+ .contact {
78
+ display: flex;
79
+ flex-direction: column;
80
+ }
81
+
82
+ address {
83
+ color: var(
84
+ --pd-contact-address-col,
85
+ var(--pd-default-font-content-col)
86
+ );
87
+ line-height: 1.8;
88
+ font-style: normal;
89
+ }
90
+
91
+ dl {
92
+ margin: 0;
93
+ padding: 0;
94
+ }
95
+
96
+ dt {
97
+ font-weight: bold;
98
+ padding-top: 10px;
99
+ color: var(
100
+ --pd-contact-address-title-col,
101
+ var(--pd-default-font-title-col)
102
+ );
103
+ }
104
+
105
+ dd {
106
+ font-weight: 400;
107
+ font-size: 1em;
108
+ margin: 0;
109
+ padding: 0;
110
+ }
111
+
112
+ dd.larger {
113
+ padding-top: 3px;
114
+ padding-bottom: 5px;
115
+ }
116
+
117
+ .contact-form {
118
+ --row-padding-top: 10px;
119
+ }
120
+
121
+ .link-icon {
122
+ --pd-icon-bg-col-active: #859900;
123
+ --pd-icon-bg-col-hover: #859900;
124
+ --pd-icon-size: 14px;
125
+ --pd-icon-col-active: white;
126
+ }
127
+
128
+ .link-item {
129
+ display: flex;
130
+ align-items: center;
131
+ text-decoration: none;
132
+ color: var(--pd-default-font-link-col, inherit);
133
+ }
134
+
135
+ .link-item:hover {
136
+ color: var(--pd-default-font-link-col-hover, #451a46);
137
+ }
138
+ `
139
+ ];
140
+ }
141
+ willUpdate(changedProps) {
142
+ if (changedProps.has("contact") && this.contact) {
143
+ this._business = this.contact.business ?? false;
144
+ }
145
+ }
146
+ render() {
147
+ return html`
148
+ <div class="contact">
149
+ ${this.summary ? this._renderViewContact() : this._renderEditContact()}
150
+ </div>
151
+ `;
152
+ }
153
+ _renderEditContact() {
154
+ return html`
155
+ <pd-form-container id="contactContainerId" requiredFieldInfo autoTrimm>
156
+ ${this.inputFields.length === 0 || this._showInput(C_TYPE) ? html`
157
+ <pd-form-row>
158
+ <pd-radio-group
159
+ id="contactTypeRadioId"
160
+ class="quarter3"
161
+ label="${msg("Typ", { id: "pd.contact.label.type" })}"
162
+ required
163
+ initValue="${this._getRadioValue()}"
164
+ @pd-form-element-change="${this._switchAddressType}"
165
+ style="--group-gap: 20px;"
166
+ >
167
+ <pd-checkbox
168
+ checkType="RADIO"
169
+ initValue="${this.contact ? !this.contact.business : true}"
170
+ valueName="private"
171
+ >${msg("Privatperson", {
172
+ id: "pd.contact.check.private"
173
+ })}</pd-checkbox
174
+ >
175
+ <pd-checkbox
176
+ checkType="RADIO"
177
+ valueName="business"
178
+ initValue="${this.contact ? this.contact.business || false : false}"
179
+ >${msg("Unternehmen", {
180
+ id: "pd.contact.check.company"
181
+ })}</pd-checkbox
182
+ >
183
+ </pd-radio-group>
184
+ </pd-form-row>
185
+ ` : ""}
186
+ ${this._business ? html`
187
+ ${this.inputFields.length === 0 || this._showInput(C_COMPANY) ? html`
188
+ <pd-form-row class="contact-form">
189
+ <pd-input
190
+ id="compNameId"
191
+ class="quarter3"
192
+ label="${msg("Name des Unternehmen", {
193
+ id: "pd.contact.label.company"
194
+ })}"
195
+ ?required="${this._isRequired(C_COMPANY)}"
196
+ initValue="${this.contact?.companyName || ""}"
197
+ valueName="companyName"
198
+ autoCompleteName="organization"
199
+ ></pd-input>
200
+ </pd-form-row>
201
+ ` : ""}
202
+ ${this.inputFields.length === 0 || this._showInput(C_BTWNR) ? html`
203
+ <pd-form-row class="contact-form">
204
+ <pd-input
205
+ id="vatId"
206
+ class="quarter3"
207
+ label="${msg("USt-IdNr.", {
208
+ id: "pd.contact.label.btw"
209
+ })}"
210
+ ?required="${this._isRequired(C_BTWNR)}"
211
+ fieldType="vat"
212
+ valueName="vatNr"
213
+ initValue="${this.contact?.vatNr || ""}"
214
+ autoCompleteName="vat"
215
+ ></pd-input>
216
+ </pd-form-row>
217
+ ` : ""}
218
+ ` : html`
219
+ ${this.inputFields.length === 0 || this._showInput(C_FIRSTNAME) ? html`
220
+ <pd-form-row class="contact-form">
221
+ <pd-input
222
+ id="firstNameId"
223
+ class="quarter3"
224
+ label="${msg("Vorname", {
225
+ id: "pd.contact.label.firstName"
226
+ })}"
227
+ valueName="firstName"
228
+ initValue="${this.contact?.firstName || ""}"
229
+ autoCompleteName="given-name"
230
+ ?required="${this._isRequired(C_FIRSTNAME)}"
231
+ ></pd-input>
232
+ </pd-form-row>
233
+ ` : ""}
234
+ ${this.inputFields.length === 0 || this._showInput(C_LASTNAME) ? html`
235
+ <pd-form-row class="contact-form">
236
+ <pd-input
237
+ id="lastNameId"
238
+ class="quarter3"
239
+ label="${msg("Nachname", {
240
+ id: "pd.contact.label.lastName"
241
+ })}"
242
+ valueName="lastName"
243
+ initValue="${this.contact?.lastName || ""}"
244
+ autoCompleteName="family-name"
245
+ ?required="${this._isRequired(C_LASTNAME)}"
246
+ ></pd-input>
247
+ </pd-form-row>
248
+ ` : ""}
249
+ `}
250
+ ${this.inputFields.length === 0 || this._showInput(C_STREET) ? html`
251
+ <pd-form-row class="contact-form">
252
+ <pd-input
253
+ id="streetId"
254
+ class="quarter2"
255
+ label="${msg("Strasse", { id: "pd.contact.label.street" })}"
256
+ valueName="street"
257
+ initValue="${this.contact?.street || ""}"
258
+ autoCompleteName="street-address"
259
+ ?required="${this._isRequired(C_STREET)}"
260
+ ></pd-input>
261
+ <pd-input
262
+ id="streetNrId"
263
+ class="quarter1"
264
+ label="${msg("Nr.", { id: "pd.contact.label.streetNr" })}"
265
+ valueName="streetNr"
266
+ initValue="${this.contact?.streetNr || ""}"
267
+ ?required="${this._isRequired(C_STREET)}"
268
+ ></pd-input>
269
+ </pd-form-row>
270
+ ` : ""}
271
+ ${this.inputFields.length === 0 || this._showInput(C_CITY) ? html`
272
+ <pd-form-row class="contact-form">
273
+ ${this.match && this.match.zip ? html`
274
+ <pd-input
275
+ readonly
276
+ id="zipId"
277
+ class="quarter1"
278
+ label="${msg("PLZ", { id: "pd.contact.label.zip" })}"
279
+ valueName="zip"
280
+ initValue="${this.match.zip}"
281
+ ></pd-input>
282
+ ` : html`
283
+ <pd-input
284
+ id="zipId"
285
+ class="quarter1"
286
+ label="${msg("PLZ", { id: "pd.contact.label.zip" })}"
287
+ fieldType="number"
288
+ valueName="zip"
289
+ initValue="${this.contact?.zip || ""}"
290
+ autoCompleteName="postal-code"
291
+ ?required="${this._isRequired(C_ZIP)}"
292
+ ></pd-input>
293
+ `}
294
+ <pd-input
295
+ id="cityId"
296
+ class="quarter2"
297
+ label="${msg("Ort", { id: "pd.contact.label.city" })}"
298
+ valueName="city"
299
+ initValue="${this.contact?.city || ""}"
300
+ autoCompleteName="locality"
301
+ ?required="${this._isRequired(C_CITY)}"
302
+ ></pd-input>
303
+ </pd-form-row>
304
+ ` : ""}
305
+ ${this.inputFields.length === 0 || this._showInput(C_ADDITIONAL) ? html`
306
+ <pd-form-row class="contact-form">
307
+ <pd-input
308
+ class="quarter3"
309
+ id="additionalHintId"
310
+ label="${msg("Addresszusatz", {
311
+ id: "pd.contact.label.additional"
312
+ })}"
313
+ initValue="${this.contact?.additionalHint || ""}"
314
+ valueName="additionalHint"
315
+ ?required="${this._isRequired(C_ADDITIONAL)}"
316
+ ></pd-input>
317
+ </pd-form-row>
318
+ ` : ""}
319
+ ${this.withPropertyDate ? html`
320
+ <pd-form-row class="contact-form">
321
+ <pd-select
322
+ class="quarter3"
323
+ id="propertyDateId"
324
+ label="${msg("Datum der Immobilie", {
325
+ id: "pd.contact.label.propertyDate"
326
+ })}"
327
+ initValue="${this.contact?.propertyDate || ""}"
328
+ .values="${yearSelection}"
329
+ ?required="${this._isRequired(C_PROPERTY_DATE)}"
330
+ ></pd-select>
331
+ </pd-form-row>
332
+ ` : ""}
333
+ ${this.inputFields.length === 0 || this._showInput(C_PHONE1) ? html`
334
+ <pd-form-row class="contact-form">
335
+ <pd-input
336
+ id="phoneId"
337
+ class="quarter3"
338
+ label="${msg("Telefon", { id: "pd.contact.label.phone" })}"
339
+ name="phone"
340
+ valueName="phone1"
341
+ initValue="${this.contact?.phone1 || ""}"
342
+ fieldType="phone"
343
+ autoCompleteName="tel"
344
+ ?required="${this._isRequired(C_PHONE1)}"
345
+ ></pd-input>
346
+ </pd-form-row>
347
+ ` : ""}
348
+ ${this.inputFields.length === 0 || this._showInput(C_EMAIL) ? html`
349
+ <pd-form-row class="contact-form">
350
+ <pd-input
351
+ id="mailId"
352
+ class="quarter3"
353
+ label="${msg("E-mail", { id: "pd.contact.label.email" })}"
354
+ fieldType="mail"
355
+ valueName="email"
356
+ initValue="${this.contact?.email || ""}"
357
+ autoCompleteName="email"
358
+ ?required="${this._isRequired(C_EMAIL)}"
359
+ ></pd-input>
360
+ </pd-form-row>
361
+ ` : ""}
362
+ </pd-form-container>
363
+ `;
364
+ }
365
+ _getRadioValue() {
366
+ if (this.contact) {
367
+ return this.contact.business ? "business" : "private";
368
+ }
369
+ return "private";
370
+ }
371
+ _renderViewContact() {
372
+ if (!this.contact) return html`<p>Contact undefined</p>`;
373
+ const trPhoneNr = transformPhone(
374
+ this.contact.phone1 || "",
375
+ this.contact.country || "be"
376
+ );
377
+ return html`
378
+ <address>
379
+ <dl>
380
+ <dt>${this.addressTitle}</dt>
381
+ <dd>${this.contact.companyName}</dd>
382
+ <dd>${this.contact.vatNr}</dd>
383
+ <dd>${this._getFullName()}</dd>
384
+ <dd>${this._getFullStreet()}</dd>
385
+ <dd>${this._getFullLocation()}</dd>
386
+ ${this.contact.additionalHint ? html`<dd>${this.contact.additionalHint}</dd>` : ""}
387
+ ${this.contact.propertyDate ? html`<dd>
388
+ ${msg(str`Baujahr: ${this.contact.propertyDate}`, {
389
+ id: "pd.contact.label.summary.propertyDate"
390
+ })}
391
+ </dd>` : ""}
392
+ <dd>${this.contact.country}</dd>
393
+
394
+ ${this.contact.phone1 ? html` <dd class="larger">
395
+ ${this.phoneMailLink && trPhoneNr ? html` <a
396
+ href="tel:${trPhoneNr}"
397
+ aria-label="Phone call: ${this.contact.phone1}"
398
+ class="link-item"
399
+ >
400
+ <span style="margin-right: 8px;"
401
+ >${this.contact.phone1}</span
402
+ >
403
+ <pd-icon
404
+ activeIcon
405
+ icon="phoneIcon"
406
+ class="round link-icon"
407
+ ></pd-icon>
408
+ </a>` : this.contact.phone1}
409
+ </dd>` : ""}
410
+ ${this.contact.email ? html` <dd class="larger">
411
+ ${this.phoneMailLink ? html` <a
412
+ href="mailto:${this.contact.email}"
413
+ aria-label="Send mail: ${this.contact.email}"
414
+ class="link-item"
415
+ >
416
+ <span style="margin-right: 8px;"
417
+ >${this.contact.email}</span
418
+ >
419
+ <pd-icon
420
+ activeIcon
421
+ icon="mailIcon"
422
+ class="round link-icon"
423
+ ></pd-icon>
424
+ </a>` : this.contact.email}
425
+ </dd>` : ""}
426
+ ${this.contact.btw ? html` <dt>BTW</dt>
427
+ <dd>${this.contact.btw}</dd>` : ""}
428
+ ${this.contact.kbc ? html` <dt>Bankgegevens</dt>
429
+ <dd>${this.contact.kbc}</dd>
430
+ <dd>${this.contact.bank}</dd>` : ""}
431
+ </dl>
432
+ </address>
433
+ `;
434
+ }
435
+ get valid() {
436
+ return this._contactForm?.valid === true;
437
+ }
438
+ async triggerValidate() {
439
+ return this._contactForm?.triggerValidate();
440
+ }
441
+ getValues() {
442
+ const contactFormValues = this._contactForm?.getValues().origin;
443
+ console.log("VAlues:", contactFormValues);
444
+ const commonValues = {
445
+ business: this._business,
446
+ street: contactFormValues.street,
447
+ streetNr: contactFormValues.streetNr,
448
+ zip: contactFormValues.zip,
449
+ city: contactFormValues.city,
450
+ additionalHint: contactFormValues.additionalHint,
451
+ propertyDate: contactFormValues.propertyDate,
452
+ phone1: contactFormValues.phone1,
453
+ email: contactFormValues.email
454
+ // No input fields for following values
455
+ //country?: string;
456
+ //btw?: string;
457
+ //kbc?: string;
458
+ //bank?: string;
459
+ };
460
+ return this._business ? {
461
+ ...commonValues,
462
+ companyName: contactFormValues.companyName,
463
+ vatNr: contactFormValues.vatNr
464
+ } : {
465
+ ...commonValues,
466
+ firstName: contactFormValues.firstName,
467
+ lastName: contactFormValues.lastName
468
+ };
469
+ }
470
+ _switchAddressType(e) {
471
+ console.log("Do switch", e);
472
+ if (e.detail.name === "contactTypeRadioId") {
473
+ this._business = e.detail.value === "business";
474
+ }
475
+ e.stopPropagation();
476
+ }
477
+ _isRequired(field) {
478
+ return this.requiredFields.length > 0 ? this.requiredFields.includes(field) : false;
479
+ }
480
+ _showInput(field) {
481
+ return this.inputFields.length > 0 ? this.inputFields.includes(field) : true;
482
+ }
483
+ _setFormData() {
484
+ const getInput = (id) => this.shadowRoot?.getElementById(id)?.value;
485
+ return {
486
+ business: this._business,
487
+ companyName: this._business ? getInput("compNameId") : void 0,
488
+ vatNr: this._business ? getInput("vatId") : void 0,
489
+ firstName: !this._business ? getInput("firstNameId") : void 0,
490
+ lastName: !this._business ? getInput("lastNameId") : void 0,
491
+ street: getInput("streetId"),
492
+ streetNr: getInput("streetNrId"),
493
+ additionalHint: getInput("additionalHintId"),
494
+ propertyDate: this.withPropertyDate ? getInput("propertyDateId") : void 0,
495
+ zip: getInput("zipId"),
496
+ city: getInput("cityId"),
497
+ phone1: getInput("phoneId"),
498
+ email: getInput("mailId")
499
+ };
500
+ }
501
+ _getFullName() {
502
+ return _PdContact._getFullVal(
503
+ this.contact?.firstName,
504
+ this.contact?.lastName
505
+ );
506
+ }
507
+ _getFullStreet() {
508
+ return _PdContact._getFullVal(this.contact?.street, this.contact?.streetNr);
509
+ }
510
+ _getFullLocation() {
511
+ return _PdContact._getFullVal(this.contact?.zip, this.contact?.city);
512
+ }
513
+ static _getFullVal(val1, val2, fallback = "") {
514
+ return [val1, val2].filter(Boolean).join(" ") || fallback;
515
+ }
516
+ };
517
+ __decorateClass([
518
+ property()
519
+ ], _PdContact.prototype, "addressTitle");
520
+ __decorateClass([
521
+ property({ type: Boolean })
522
+ ], _PdContact.prototype, "phoneMailLink");
523
+ __decorateClass([
524
+ property({ type: Boolean })
525
+ ], _PdContact.prototype, "summary");
526
+ __decorateClass([
527
+ property({ type: Boolean })
528
+ ], _PdContact.prototype, "withPropertyDate");
529
+ __decorateClass([
530
+ property({ type: Array })
531
+ ], _PdContact.prototype, "requiredFields");
532
+ __decorateClass([
533
+ property({ type: Array })
534
+ ], _PdContact.prototype, "inputFields");
535
+ __decorateClass([
536
+ property({ type: Object })
537
+ ], _PdContact.prototype, "contact");
538
+ __decorateClass([
539
+ property({ type: Object })
540
+ ], _PdContact.prototype, "match");
541
+ __decorateClass([
542
+ state()
543
+ ], _PdContact.prototype, "_business");
544
+ __decorateClass([
545
+ query("#contactContainerId")
546
+ ], _PdContact.prototype, "_contactForm");
547
+ let PdContact = _PdContact;
548
+
549
+ export { PdContact };
@@ -1,7 +1,7 @@
1
1
  import { StoryObj } from '@storybook/web-components';
2
2
  declare const meta: {
3
3
  title: string;
4
- render: ({ inputFields, requiredFields, withPropertyDate, contact }: import('@storybook/web-components').Args) => import('lit-html').TemplateResult<1>;
4
+ render: ({ inputFields, requiredFields, withPropertyDate, contact }: import('@storybook/web-components').Args) => import('lit').TemplateResult<1>;
5
5
  argTypes: {};
6
6
  };
7
7
  export default meta;
@@ -15,4 +15,4 @@ export declare const ContactFormWithInputFields2: Story;
15
15
  export declare const ContactPreparedForm: Story;
16
16
  export declare const ContactPreparedFormCompany: Story;
17
17
  export declare const ContactPreparedFormPropertyDate: Story;
18
- //# sourceMappingURL=contact-edit.stories.d.ts.map
18
+ //# sourceMappingURL=pd-contact-edit.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-contact-edit.stories.d.ts","sourceRoot":"","sources":["../../src/pd-contact/pd-contact-edit.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAehE,OAAO,iBAAiB,CAAC;AAGzB,QAAA,MAAM,IAAI;;;;CAmCM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AA2BtB,eAAO,MAAM,WAAW,EAAE,KAEzB,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAevC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,KAIxC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAIrC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,KAIzC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,KAIzC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAIjC,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,KAIxC,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,KAQ7C,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { StoryObj } from '@storybook/web-components';
2
2
  declare const meta: {
3
3
  title: string;
4
- render: ({ summary, phoneMailLink, contact, withPropertyDate }: import('@storybook/web-components').Args) => import('lit-html').TemplateResult<1>;
4
+ render: ({ summary, phoneMailLink, contact, withPropertyDate }: import('@storybook/web-components').Args) => import('lit').TemplateResult<1>;
5
5
  argTypes: {};
6
6
  };
7
7
  export default meta;
@@ -10,4 +10,4 @@ export declare const ContactView: Story;
10
10
  export declare const ContactCompanyView: Story;
11
11
  export declare const ContactViewPropertyDate: Story;
12
12
  export declare const ContactViewPhone: Story;
13
- //# sourceMappingURL=contact-view.stories.d.ts.map
13
+ //# sourceMappingURL=pd-contact-view.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-contact-view.stories.d.ts","sourceRoot":"","sources":["../../src/pd-contact/pd-contact-view.stories.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAQ,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,iBAAiB,CAAC;AAGzB,QAAA,MAAM,IAAI;;;;CAYM,CAAC;AAEjB,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC;AA2BtB,eAAO,MAAM,WAAW,EAAE,KAKzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,KAKhC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,KAQrC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAM9B,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { PdContact } from './PdContact.js';
2
+ export { PdContact };
3
+ //# sourceMappingURL=pd-contact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pd-contact.d.ts","sourceRoot":"","sources":["../../src/pd-contact/pd-contact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAO3C,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -1,60 +1,2 @@
1
- import { LitElement, PropertyValues, CSSResultGroup } from 'lit';
2
- import { PdContactData, PdContactMatch } from './types';
3
- export declare class PdContact extends LitElement {
4
- /**
5
- * Title shown above address block.
6
- */
7
- addressTitle: string;
8
- /**
9
- * If true, phone and email are rendered as clickable links with icons.
10
- */
11
- phoneMailLink: boolean;
12
- /**
13
- * If true, render only summary view instead of full editable form.
14
- */
15
- summary: boolean;
16
- /**
17
- * Whether the Baujahr / propertyDate should be shown in the form.
18
- * TODO: Refactor, give selectable property dates from outside, show if set
19
- */
20
- withPropertyDate: boolean;
21
- /**
22
- * List of required input field keys (optional).
23
- */
24
- requiredFields: string[];
25
- /**
26
- * List of fields to be rendered (optional).
27
- */
28
- inputFields: string[];
29
- /**
30
- * Contact object to show or edit.
31
- */
32
- contact?: PdContactData;
33
- /**
34
- * Optional location match data.
35
- */
36
- match?: PdContactMatch;
37
- /**
38
- * Business or private contact (internal flag).
39
- */
40
- private _business;
41
- private _contactForm;
42
- static styles: CSSResultGroup;
43
- willUpdate(changedProps: PropertyValues<this>): void;
44
- render(): import('lit-html').TemplateResult<1>;
45
- private _renderEditContact;
46
- private _getRadioValue;
47
- private _renderViewContact;
48
- get valid(): boolean;
49
- triggerValidate(): Promise<boolean>;
50
- getValues(): PdContactData;
51
- private _switchAddressType;
52
- private _isRequired;
53
- private _showInput;
54
- private _setFormData;
55
- private _getFullName;
56
- private _getFullStreet;
57
- private _getFullLocation;
58
- private static _getFullVal;
59
- }
60
- //# sourceMappingURL=pd-contact.d.ts.map
1
+ export * from './pd-contact/pd-contact'
2
+ export {}