@progressive-development/pd-order 0.7.11 → 1.0.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.
- package/LICENSE +21 -2
- package/README.md +31 -57
- package/dist/generated/locales/be.d.ts +2 -1
- package/dist/generated/locales/be.d.ts.map +1 -1
- package/dist/generated/locales/de.d.ts +2 -1
- package/dist/generated/locales/de.d.ts.map +1 -1
- package/dist/generated/locales/en.d.ts +2 -1
- package/dist/generated/locales/en.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -12
- package/dist/locales/be.js +4 -6
- package/dist/locales/de.js +4 -7
- package/dist/locales/en.js +4 -6
- package/dist/pd-order-contacts/PdOrderContacts.d.ts +50 -0
- package/dist/pd-order-contacts/PdOrderContacts.d.ts.map +1 -0
- package/dist/pd-order-contacts/PdOrderContacts.js +383 -0
- package/dist/pd-order-contacts/pd-order-contacts.d.ts +3 -0
- package/dist/pd-order-contacts/pd-order-contacts.d.ts.map +1 -0
- package/dist/pd-order-contacts/pd-order-contacts.stories.d.ts +65 -0
- package/dist/pd-order-contacts/pd-order-contacts.stories.d.ts.map +1 -0
- package/dist/pd-order-contacts.d.ts +2 -45
- package/dist/pd-order-contacts.js +6 -387
- package/dist/pd-order-summary/PdOrderSummary.d.ts +39 -0
- package/dist/pd-order-summary/PdOrderSummary.d.ts.map +1 -0
- package/dist/pd-order-summary/PdOrderSummary.js +241 -0
- package/dist/pd-order-summary/pd-order-summary.d.ts +3 -0
- package/dist/pd-order-summary/pd-order-summary.d.ts.map +1 -0
- package/dist/pd-order-summary/pd-order-summary.stories.d.ts +59 -0
- package/dist/pd-order-summary/pd-order-summary.stories.d.ts.map +1 -0
- package/dist/pd-order-summary.d.ts +2 -38
- package/dist/pd-order-summary.js +6 -248
- package/dist/stories/test-impl/test-summary.d.ts +1 -1
- package/dist/stories/test-impl/test-summary.d.ts.map +1 -1
- package/package.json +34 -52
- package/dist/pd-order-contacts.d.ts.map +0 -1
- package/dist/pd-order-summary.d.ts.map +0 -1
- package/dist/stories/pd-order-contacts.stories.d.ts +0 -17
- package/dist/stories/pd-order-contacts.stories.d.ts.map +0 -1
- package/dist/stories/pd-order-summary.stories.d.ts +0 -13
- package/dist/stories/pd-order-summary.stories.d.ts.map +0 -1
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
import { css, LitElement, nothing, html } from 'lit';
|
|
2
|
+
import { property, state } from 'lit/decorators.js';
|
|
3
|
+
import { localized, msg } from '@lit/localize';
|
|
4
|
+
import '@progressive-development/pd-content/pd-collapse-group';
|
|
5
|
+
import '@progressive-development/pd-content/pd-collapse';
|
|
6
|
+
import '@progressive-development/pd-contact/pd-contact';
|
|
7
|
+
import '@progressive-development/pd-forms/pd-checkbox';
|
|
8
|
+
|
|
9
|
+
var __defProp = Object.defineProperty;
|
|
10
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
11
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
12
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
13
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
14
|
+
if (decorator = decorators[i])
|
|
15
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
16
|
+
if (kind && result) __defProp(target, key, result);
|
|
17
|
+
return result;
|
|
18
|
+
};
|
|
19
|
+
let PdOrderContacts = class extends LitElement {
|
|
20
|
+
constructor() {
|
|
21
|
+
super(...arguments);
|
|
22
|
+
this.summary = false;
|
|
23
|
+
this.contactTitle = {};
|
|
24
|
+
this.requiredFields = [];
|
|
25
|
+
this.withPayment = false;
|
|
26
|
+
this.withPropertyOwner = false;
|
|
27
|
+
this.withPropertyDate = false;
|
|
28
|
+
this._ownBillingContact = false;
|
|
29
|
+
this._ownAdminContact = false;
|
|
30
|
+
this._isPropertyOwner = false;
|
|
31
|
+
}
|
|
32
|
+
update(changedProps) {
|
|
33
|
+
if (changedProps.has("billingContact")) {
|
|
34
|
+
this._ownBillingContact = !!this.billingContact;
|
|
35
|
+
}
|
|
36
|
+
if (changedProps.has("adminContact")) {
|
|
37
|
+
this._ownAdminContact = !!this.adminContact;
|
|
38
|
+
}
|
|
39
|
+
if (changedProps.has("propertyContact")) {
|
|
40
|
+
this._isPropertyOwner = !!this.propertyContact;
|
|
41
|
+
}
|
|
42
|
+
super.update(changedProps);
|
|
43
|
+
}
|
|
44
|
+
render() {
|
|
45
|
+
return this.summary ? this._renderSummary() : this._renderEditContacts();
|
|
46
|
+
}
|
|
47
|
+
_renderEditContacts() {
|
|
48
|
+
return html`
|
|
49
|
+
<pd-collapse-group>
|
|
50
|
+
<pd-collapse id="orderContactCollapseId">
|
|
51
|
+
<div slot="header">
|
|
52
|
+
${this.contactTitle.orderInputContact ?? msg("Adresse", {
|
|
53
|
+
id: "pd.order.contacts.orderContact.inputHeader"
|
|
54
|
+
})}
|
|
55
|
+
</div>
|
|
56
|
+
<pd-contact
|
|
57
|
+
id="orderContactId"
|
|
58
|
+
class="collapse-contact"
|
|
59
|
+
slot="content"
|
|
60
|
+
.requiredFields="${this.requiredFields}"
|
|
61
|
+
.contact="${this.orderContact}"
|
|
62
|
+
.match="${this.match}"
|
|
63
|
+
?withPropertyDate="${!this._isPropertyOwner && this.withPropertyDate}"
|
|
64
|
+
></pd-contact>
|
|
65
|
+
</pd-collapse>
|
|
66
|
+
|
|
67
|
+
${this.withPayment ? html`
|
|
68
|
+
<pd-collapse id="billingContactCollapseId">
|
|
69
|
+
<div slot="header">
|
|
70
|
+
${this.contactTitle.billingInputContact ?? msg("Rechnungsadresse (optional)", {
|
|
71
|
+
id: "pd.order.contacts.billingContact.inputHeader"
|
|
72
|
+
})}
|
|
73
|
+
</div>
|
|
74
|
+
<div slot="content">
|
|
75
|
+
${this._ownBillingContact ? html`
|
|
76
|
+
<p>
|
|
77
|
+
<a @click="${() => this._ownBillingContact = false}"
|
|
78
|
+
>${msg(
|
|
79
|
+
"Kundenadresse als Rechnungsadresse verwenden"
|
|
80
|
+
)}</a
|
|
81
|
+
>
|
|
82
|
+
</p>
|
|
83
|
+
<pd-contact
|
|
84
|
+
id="billingContactId"
|
|
85
|
+
class="collapse-contact"
|
|
86
|
+
.requiredFields="${this.requiredFields}"
|
|
87
|
+
.contact="${this.billingContact}"
|
|
88
|
+
></pd-contact>
|
|
89
|
+
` : html`
|
|
90
|
+
<p>
|
|
91
|
+
${msg(
|
|
92
|
+
"Rechnungsadresse entspricht der Kundenadresse."
|
|
93
|
+
)}
|
|
94
|
+
</p>
|
|
95
|
+
<p>
|
|
96
|
+
<a @click=${() => this._ownBillingContact = true}
|
|
97
|
+
>${msg("Neue Rechnungsadresse hinzufügen")}</a
|
|
98
|
+
>
|
|
99
|
+
</p>
|
|
100
|
+
`}
|
|
101
|
+
</div>
|
|
102
|
+
</pd-collapse>
|
|
103
|
+
` : nothing}
|
|
104
|
+
${this.withPropertyOwner ? html`
|
|
105
|
+
<div class="property-owner-box">
|
|
106
|
+
<pd-checkbox
|
|
107
|
+
id="isPropertyOwnerId"
|
|
108
|
+
initValue="${this._isPropertyOwner}"
|
|
109
|
+
@pd-form-element-change="${(e) => {
|
|
110
|
+
this._isPropertyOwner = e.detail.value === "true";
|
|
111
|
+
}}"
|
|
112
|
+
>
|
|
113
|
+
${msg("Ist der Kunde Vermieter?", {
|
|
114
|
+
id: "pd.order.contacts.propertyContact.checkBox"
|
|
115
|
+
})}
|
|
116
|
+
</pd-checkbox>
|
|
117
|
+
|
|
118
|
+
${this._isPropertyOwner ? html`
|
|
119
|
+
<pd-collapse
|
|
120
|
+
id="propertyContactCollapseId"
|
|
121
|
+
style="padding-top: 20px;"
|
|
122
|
+
>
|
|
123
|
+
<div slot="header">
|
|
124
|
+
${this.contactTitle.propertyInputContact ?? msg("Adresse der Immobilie")}
|
|
125
|
+
</div>
|
|
126
|
+
<div slot="content">
|
|
127
|
+
<pd-contact
|
|
128
|
+
id="propertyContactId"
|
|
129
|
+
class="collapse-contact"
|
|
130
|
+
.requiredFields="${[
|
|
131
|
+
"street",
|
|
132
|
+
"streetNr",
|
|
133
|
+
"zip",
|
|
134
|
+
"city"
|
|
135
|
+
]}"
|
|
136
|
+
.inputFields="${[
|
|
137
|
+
"street",
|
|
138
|
+
"city",
|
|
139
|
+
"additionalHint"
|
|
140
|
+
]}"
|
|
141
|
+
.contact="${this.propertyContact}"
|
|
142
|
+
?withPropertyDate="${this.withPropertyDate}"
|
|
143
|
+
></pd-contact>
|
|
144
|
+
</div>
|
|
145
|
+
</pd-collapse>
|
|
146
|
+
|
|
147
|
+
<pd-collapse id="adminContactCollapseId">
|
|
148
|
+
<div slot="header">
|
|
149
|
+
${this.contactTitle.adminInputContact ?? msg("Adresse der Verwaltung (optional)")}
|
|
150
|
+
</div>
|
|
151
|
+
<div slot="content">
|
|
152
|
+
${this._ownAdminContact ? html`
|
|
153
|
+
<p>
|
|
154
|
+
<a
|
|
155
|
+
@click="${() => this._ownAdminContact = false}"
|
|
156
|
+
>${msg(
|
|
157
|
+
"Kundenadresse als Verwaltungsadresse verwenden"
|
|
158
|
+
)}</a
|
|
159
|
+
>
|
|
160
|
+
</p>
|
|
161
|
+
<pd-contact
|
|
162
|
+
id="adminContactId"
|
|
163
|
+
class="collapse-contact"
|
|
164
|
+
.requiredFields="${this.requiredFields}"
|
|
165
|
+
.contact="${this.adminContact}"
|
|
166
|
+
></pd-contact>
|
|
167
|
+
` : html`
|
|
168
|
+
<p>
|
|
169
|
+
${msg(
|
|
170
|
+
"Verwaltungsadresse entspricht der Kundenadresse."
|
|
171
|
+
)}
|
|
172
|
+
</p>
|
|
173
|
+
<p>
|
|
174
|
+
<a
|
|
175
|
+
@click="${() => this._ownAdminContact = true}"
|
|
176
|
+
>${msg(
|
|
177
|
+
"Neue Verwaltungsadresse hinzufügen"
|
|
178
|
+
)}</a
|
|
179
|
+
>
|
|
180
|
+
</p>
|
|
181
|
+
`}
|
|
182
|
+
</div>
|
|
183
|
+
</pd-collapse>
|
|
184
|
+
` : nothing}
|
|
185
|
+
</div>
|
|
186
|
+
` : nothing}
|
|
187
|
+
</pd-collapse-group>
|
|
188
|
+
`;
|
|
189
|
+
}
|
|
190
|
+
_renderSummary() {
|
|
191
|
+
return html`
|
|
192
|
+
<div class="summary-box">
|
|
193
|
+
${this.orderContact ? html`
|
|
194
|
+
<pd-contact
|
|
195
|
+
addressTitle="${this.contactTitle.orderSummaryContact ?? msg("Adresse")}"
|
|
196
|
+
.contact="${this.orderContact}"
|
|
197
|
+
summary
|
|
198
|
+
></pd-contact>
|
|
199
|
+
` : nothing}
|
|
200
|
+
${this.billingContact ? html`
|
|
201
|
+
<pd-contact
|
|
202
|
+
addressTitle="${this.contactTitle.billingSummaryContact ?? msg("Rechnungsadresse")}"
|
|
203
|
+
.contact="${this.billingContact}"
|
|
204
|
+
summary
|
|
205
|
+
></pd-contact>
|
|
206
|
+
` : nothing}
|
|
207
|
+
${this.propertyContact ? html`
|
|
208
|
+
<pd-contact
|
|
209
|
+
addressTitle="${this.contactTitle.propertySummaryContact ?? msg("Immobilie")}"
|
|
210
|
+
.contact="${this.propertyContact}"
|
|
211
|
+
summary
|
|
212
|
+
></pd-contact>
|
|
213
|
+
` : nothing}
|
|
214
|
+
${this.adminContact ? html`
|
|
215
|
+
<pd-contact
|
|
216
|
+
addressTitle="${this.contactTitle.adminSummaryContact ?? msg("Verwaltung")}"
|
|
217
|
+
.contact="${this.adminContact}"
|
|
218
|
+
summary
|
|
219
|
+
></pd-contact>
|
|
220
|
+
` : nothing}
|
|
221
|
+
</div>
|
|
222
|
+
`;
|
|
223
|
+
}
|
|
224
|
+
get valid() {
|
|
225
|
+
for (const { id, condition = true } of this._getCollapseMap()) {
|
|
226
|
+
if (!condition) continue;
|
|
227
|
+
const element = this.shadowRoot?.getElementById(id);
|
|
228
|
+
if (!element?.valid) {
|
|
229
|
+
return false;
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return true;
|
|
233
|
+
}
|
|
234
|
+
async triggerValidate() {
|
|
235
|
+
let firstInvalidCollapseId = null;
|
|
236
|
+
const collapseMap = this._getCollapseMap();
|
|
237
|
+
console.log("Map: ", collapseMap);
|
|
238
|
+
for (const { id, collapse, condition = true } of collapseMap) {
|
|
239
|
+
if (!condition) continue;
|
|
240
|
+
const element = this.shadowRoot?.getElementById(id);
|
|
241
|
+
if (!element) continue;
|
|
242
|
+
const result = await element.triggerValidate();
|
|
243
|
+
console.log("PdContact triggerValidate: ", result);
|
|
244
|
+
if (!result && !firstInvalidCollapseId) {
|
|
245
|
+
firstInvalidCollapseId = collapse;
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
if (firstInvalidCollapseId) {
|
|
249
|
+
console.log("PdContact open failed: ", firstInvalidCollapseId);
|
|
250
|
+
const collapseEl = this.shadowRoot?.getElementById(
|
|
251
|
+
firstInvalidCollapseId
|
|
252
|
+
);
|
|
253
|
+
if (collapseEl) {
|
|
254
|
+
collapseEl.active = true;
|
|
255
|
+
}
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
return true;
|
|
259
|
+
}
|
|
260
|
+
getValues() {
|
|
261
|
+
const contactValues = {};
|
|
262
|
+
for (const { id, condition = true } of this._getCollapseMap()) {
|
|
263
|
+
if (!condition) continue;
|
|
264
|
+
contactValues[id] = this.shadowRoot?.getElementById(id)?.getValues();
|
|
265
|
+
}
|
|
266
|
+
return contactValues;
|
|
267
|
+
}
|
|
268
|
+
_getCollapseMap() {
|
|
269
|
+
return [
|
|
270
|
+
{ id: "orderContactId", collapse: "orderContactCollapseId" },
|
|
271
|
+
{
|
|
272
|
+
id: "billingContactId",
|
|
273
|
+
collapse: "billingContactCollapseId",
|
|
274
|
+
condition: this._ownBillingContact
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
id: "propertyContactId",
|
|
278
|
+
collapse: "propertyContactCollapseId",
|
|
279
|
+
condition: this._isPropertyOwner
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
id: "adminContactId",
|
|
283
|
+
collapse: "adminContactCollapseId",
|
|
284
|
+
condition: this._isPropertyOwner && this._ownAdminContact
|
|
285
|
+
}
|
|
286
|
+
];
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
PdOrderContacts.styles = [
|
|
290
|
+
css`
|
|
291
|
+
:host {
|
|
292
|
+
display: block;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
p {
|
|
296
|
+
color: var(--pd-default-font-content-col);
|
|
297
|
+
font-size: var(--pd-default-font-content-size);
|
|
298
|
+
font-family: var(--pd-default-font-content-family);
|
|
299
|
+
max-width: 1000px;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
a {
|
|
303
|
+
cursor: pointer;
|
|
304
|
+
font-family: var(--pd-default-font-link-family);
|
|
305
|
+
font-size: var(--pd-default-font-link-size);
|
|
306
|
+
color: var(--pd-default-font-link-col);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
a:hover {
|
|
310
|
+
color: var(--pd-default-font-link-col-hover);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.collapse-contact {
|
|
314
|
+
padding: 10px;
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.summary-box {
|
|
318
|
+
display: flex;
|
|
319
|
+
flex-wrap: wrap;
|
|
320
|
+
gap: 10px;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.summary-box pd-contact {
|
|
324
|
+
min-width: 150px;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.property-owner-box {
|
|
328
|
+
border: 2px solid var(--pd-default-col);
|
|
329
|
+
border-radius: var(--pd-radius-lg);
|
|
330
|
+
padding: var(--pd-spacing-lg);
|
|
331
|
+
margin: var(--pd-spacing-lg) 0;
|
|
332
|
+
background-color: var(--pd-default-bg-light-col);
|
|
333
|
+
box-shadow: var(--pd-shadow-md);
|
|
334
|
+
}
|
|
335
|
+
`
|
|
336
|
+
];
|
|
337
|
+
__decorateClass([
|
|
338
|
+
property({ type: Boolean })
|
|
339
|
+
], PdOrderContacts.prototype, "summary", 2);
|
|
340
|
+
__decorateClass([
|
|
341
|
+
property({ type: Object })
|
|
342
|
+
], PdOrderContacts.prototype, "contactTitle", 2);
|
|
343
|
+
__decorateClass([
|
|
344
|
+
property({ type: Array })
|
|
345
|
+
], PdOrderContacts.prototype, "requiredFields", 2);
|
|
346
|
+
__decorateClass([
|
|
347
|
+
property({ type: Object })
|
|
348
|
+
], PdOrderContacts.prototype, "orderContact", 2);
|
|
349
|
+
__decorateClass([
|
|
350
|
+
property({ type: Object })
|
|
351
|
+
], PdOrderContacts.prototype, "billingContact", 2);
|
|
352
|
+
__decorateClass([
|
|
353
|
+
property({ type: Object })
|
|
354
|
+
], PdOrderContacts.prototype, "adminContact", 2);
|
|
355
|
+
__decorateClass([
|
|
356
|
+
property({ type: Object })
|
|
357
|
+
], PdOrderContacts.prototype, "propertyContact", 2);
|
|
358
|
+
__decorateClass([
|
|
359
|
+
property({ type: Boolean })
|
|
360
|
+
], PdOrderContacts.prototype, "withPayment", 2);
|
|
361
|
+
__decorateClass([
|
|
362
|
+
property({ type: Boolean })
|
|
363
|
+
], PdOrderContacts.prototype, "withPropertyOwner", 2);
|
|
364
|
+
__decorateClass([
|
|
365
|
+
property({ type: Boolean })
|
|
366
|
+
], PdOrderContacts.prototype, "withPropertyDate", 2);
|
|
367
|
+
__decorateClass([
|
|
368
|
+
property({ type: Object })
|
|
369
|
+
], PdOrderContacts.prototype, "match", 2);
|
|
370
|
+
__decorateClass([
|
|
371
|
+
state()
|
|
372
|
+
], PdOrderContacts.prototype, "_ownBillingContact", 2);
|
|
373
|
+
__decorateClass([
|
|
374
|
+
state()
|
|
375
|
+
], PdOrderContacts.prototype, "_ownAdminContact", 2);
|
|
376
|
+
__decorateClass([
|
|
377
|
+
state()
|
|
378
|
+
], PdOrderContacts.prototype, "_isPropertyOwner", 2);
|
|
379
|
+
PdOrderContacts = __decorateClass([
|
|
380
|
+
localized()
|
|
381
|
+
], PdOrderContacts);
|
|
382
|
+
|
|
383
|
+
export { PdOrderContacts };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-order-contacts.d.ts","sourceRoot":"","sources":["../../src/pd-order-contacts/pd-order-contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAOvD,OAAO,EAAE,eAAe,EAAE,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Meta, StoryObj } from '@storybook/web-components-vite';
|
|
2
|
+
import { PdContactData } from '@progressive-development/pd-contact';
|
|
3
|
+
/**
|
|
4
|
+
* Story arguments interface for pd-order-contacts component.
|
|
5
|
+
* Maps to the component's public API for multi-contact order forms.
|
|
6
|
+
*/
|
|
7
|
+
interface PdOrderContactsArgs {
|
|
8
|
+
/** Show read-only summary mode */
|
|
9
|
+
summary: boolean;
|
|
10
|
+
/** Enable billing address option */
|
|
11
|
+
withPayment: boolean;
|
|
12
|
+
/** Enable property owner/landlord options */
|
|
13
|
+
withPropertyOwner: boolean;
|
|
14
|
+
/** Enable property date field */
|
|
15
|
+
withPropertyDate: boolean;
|
|
16
|
+
/** Required field names per contact */
|
|
17
|
+
requiredFields: string[];
|
|
18
|
+
/** Primary order contact data */
|
|
19
|
+
orderContact?: PdContactData;
|
|
20
|
+
/** Optional billing contact data */
|
|
21
|
+
billingContact?: PdContactData;
|
|
22
|
+
/** Optional admin contact data */
|
|
23
|
+
adminContact?: PdContactData;
|
|
24
|
+
/** Optional property address data */
|
|
25
|
+
propertyContact?: PdContactData;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* ## pd-order-contacts
|
|
29
|
+
*
|
|
30
|
+
* Multi-contact management component for order workflows with collapsible
|
|
31
|
+
* address sections for order, billing, property, and admin contacts.
|
|
32
|
+
*
|
|
33
|
+
* ### Features
|
|
34
|
+
* - Primary order contact form (always visible)
|
|
35
|
+
* - Optional billing address section with toggle
|
|
36
|
+
* - Optional property owner section with landlord checkbox
|
|
37
|
+
* - Optional property date field
|
|
38
|
+
* - Admin/management contact for property owners
|
|
39
|
+
* - Summary mode for read-only display of all contacts
|
|
40
|
+
* - Form validation with required field support across all contacts
|
|
41
|
+
* - Collapsible sections via pd-collapse-group
|
|
42
|
+
*
|
|
43
|
+
* ### Form Methods
|
|
44
|
+
* - `triggerValidate()` — validates all visible contacts, opens first invalid section
|
|
45
|
+
* - `getValues()` — returns all visible contact data
|
|
46
|
+
* - `valid` — getter for current validation state
|
|
47
|
+
*/
|
|
48
|
+
declare const meta: Meta<PdOrderContactsArgs>;
|
|
49
|
+
export default meta;
|
|
50
|
+
type Story = StoryObj<PdOrderContactsArgs>;
|
|
51
|
+
/** Default empty order contacts form with a single address section. Interactive via Controls panel. */
|
|
52
|
+
export declare const Default: Story;
|
|
53
|
+
/** Form with pre-populated order contact data. */
|
|
54
|
+
export declare const Prepopulated: Story;
|
|
55
|
+
/** Form with billing address section enabled — shows toggle to add separate billing address. */
|
|
56
|
+
export declare const WithBilling: Story;
|
|
57
|
+
/** Form with property owner section — includes landlord checkbox, property address, and admin contact. */
|
|
58
|
+
export declare const WithPropertyOwner: Story;
|
|
59
|
+
/** All features enabled with pre-populated data across all contact sections. */
|
|
60
|
+
export declare const FullyConfigured: Story;
|
|
61
|
+
/** Read-only summary showing all configured contacts side by side. */
|
|
62
|
+
export declare const SummaryMode: Story;
|
|
63
|
+
/** Form with all fields marked as required — triggers validation on submit. */
|
|
64
|
+
export declare const RequiredFields: Story;
|
|
65
|
+
//# sourceMappingURL=pd-order-contacts.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pd-order-contacts.stories.d.ts","sourceRoot":"","sources":["../../src/pd-order-contacts/pd-order-contacts.stories.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAGrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACzE,OAAO,6CAA6C,CAAC;AAGrD,OAAO,wBAAwB,CAAC;AAMhC;;;GAGG;AACH,UAAU,mBAAmB;IAC3B,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,oCAAoC;IACpC,WAAW,EAAE,OAAO,CAAC;IACrB,6CAA6C;IAC7C,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iCAAiC;IACjC,gBAAgB,EAAE,OAAO,CAAC;IAC1B,uCAAuC;IACvC,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,iCAAiC;IACjC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,oCAAoC;IACpC,cAAc,CAAC,EAAE,aAAa,CAAC;IAC/B,kCAAkC;IAClC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,qCAAqC;IACrC,eAAe,CAAC,EAAE,aAAa,CAAC;CACjC;AA0FD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,mBAAmB,CAkGnC,CAAC;AAEF,eAAe,IAAI,CAAC;AACpB,KAAK,KAAK,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAAC;AAM3C,uGAAuG;AACvG,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAMjC,kDAAkD;AAClD,eAAO,MAAM,YAAY,EAAE,KAI1B,CAAC;AAMF,gGAAgG;AAChG,eAAO,MAAM,WAAW,EAAE,KAKzB,CAAC;AAMF,0GAA0G;AAC1G,eAAO,MAAM,iBAAiB,EAAE,KAc/B,CAAC;AAMF,gFAAgF;AAChF,eAAO,MAAM,eAAe,EAAE,KAkB7B,CAAC;AAMF,sEAAsE;AACtE,eAAO,MAAM,WAAW,EAAE,KA8CzB,CAAC;AAMF,+EAA+E;AAC/E,eAAO,MAAM,cAAc,EAAE,KAI5B,CAAC"}
|
|
@@ -1,45 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Renders and manages contact input sections for order processing.
|
|
5
|
-
* Supports optional billing address, property owner info and admin contact.
|
|
6
|
-
*
|
|
7
|
-
* @fires validate-form - Triggers validation of embedded contact components.
|
|
8
|
-
* @slot - General slot
|
|
9
|
-
*/
|
|
10
|
-
export declare class PdOrderContacts extends LitElement {
|
|
11
|
-
/** Zeigt die Komponente im Zusammenfassungsmodus (read-only) */
|
|
12
|
-
summary: boolean;
|
|
13
|
-
/** Überschriften für die einzelnen Kontaktsektionen */
|
|
14
|
-
contactTitle: Record<string, string>;
|
|
15
|
-
/** Liste erforderlicher Eingabefelder je Kontakt (z.B. ['street', 'zip']) */
|
|
16
|
-
requiredFields: string[];
|
|
17
|
-
/** Kontaktadresse des Auftraggebers */
|
|
18
|
-
orderContact?: PdContactData;
|
|
19
|
-
/** Optionale separate Rechnungsadresse */
|
|
20
|
-
billingContact?: PdContactData;
|
|
21
|
-
/** Optionale Verwaltungsadresse */
|
|
22
|
-
adminContact?: PdContactData;
|
|
23
|
-
/** Adresse der Immobilie, falls abweichend */
|
|
24
|
-
propertyContact?: PdContactData;
|
|
25
|
-
/** Aktiviert die Option zur separaten Rechnungsadresse */
|
|
26
|
-
withPayment: boolean;
|
|
27
|
-
/** Aktiviert die Option zur Verwaltung von Vermieterinformationen */
|
|
28
|
-
withPropertyOwner: boolean;
|
|
29
|
-
withPropertyDate: boolean;
|
|
30
|
-
/** Optionaler Match-Parameter zur Feldvalidierung oder Mapping-Zwecken */
|
|
31
|
-
match?: PdContactMatch;
|
|
32
|
-
private _ownBillingContact;
|
|
33
|
-
private _ownAdminContact;
|
|
34
|
-
private _isPropertyOwner;
|
|
35
|
-
static styles: CSSResultGroup;
|
|
36
|
-
update(changedProps: PropertyValues<this>): void;
|
|
37
|
-
protected render(): import('lit-html').TemplateResult<1>;
|
|
38
|
-
private _renderEditContacts;
|
|
39
|
-
private _renderSummary;
|
|
40
|
-
get valid(): boolean;
|
|
41
|
-
triggerValidate(): Promise<boolean>;
|
|
42
|
-
getValues(): any;
|
|
43
|
-
private _getCollapseMap;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=pd-order-contacts.d.ts.map
|
|
1
|
+
export * from './pd-order-contacts/pd-order-contacts'
|
|
2
|
+
export {}
|