@progressive-development/pd-order 0.6.2 → 0.6.4
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.
|
@@ -34,13 +34,13 @@ export declare class PdOrderContacts extends LitElement {
|
|
|
34
34
|
private _ownAdminContact;
|
|
35
35
|
private _isPropertyOwner;
|
|
36
36
|
static styles: CSSResultGroup;
|
|
37
|
-
connectedCallback(): void;
|
|
38
|
-
disconnectedCallback(): void;
|
|
39
37
|
protected firstUpdated(): void;
|
|
40
38
|
protected updated(changed: Map<string | number | symbol, unknown>): void;
|
|
41
39
|
protected render(): import('lit-html').TemplateResult<1>;
|
|
42
40
|
private _renderEditContacts;
|
|
43
41
|
private _renderSummary;
|
|
44
|
-
|
|
42
|
+
get valid(): boolean;
|
|
43
|
+
triggerValidate(): Promise<boolean>;
|
|
44
|
+
private _getCollapseMap;
|
|
45
45
|
}
|
|
46
46
|
//# sourceMappingURL=pd-order-contacts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pd-order-contacts.d.ts","sourceRoot":"","sources":["../src/pd-order-contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,cAAc,EAAE,MAAM,KAAK,CAAC;AAIrE,OAAO,
|
|
1
|
+
{"version":3,"file":"pd-order-contacts.d.ts","sourceRoot":"","sources":["../src/pd-order-contacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,cAAc,EAAE,MAAM,KAAK,CAAC;AAIrE,OAAO,uDAAuD,CAAC;AAC/D,OAAO,iDAAiD,CAAC;AACzD,OAAO,gDAAgD,CAAC;AACxD,OAAO,+CAA+C,CAAC;AAGvD,OAAO,EACL,aAAa,EACb,cAAc,EACf,MAAM,qCAAqC,CAAC;AAE7C;;;;;;GAMG;AACH,qBAEa,eAAgB,SAAQ,UAAU;IAC7C,gEAAgE;IAEhE,OAAO,UAAS;IAEhB,uDAAuD;IAEvD,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAM;IAE1C,6EAA6E;IAE7E,cAAc,EAAE,MAAM,EAAE,CAAM;IAE9B,uCAAuC;IAEvC,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,0CAA0C;IAE1C,cAAc,CAAC,EAAE,aAAa,CAAC;IAE/B,mCAAmC;IAEnC,YAAY,CAAC,EAAE,aAAa,CAAC;IAE7B,8CAA8C;IAE9C,eAAe,CAAC,EAAE,aAAa,CAAC;IAEhC,0DAA0D;IAE1D,WAAW,UAAS;IAEpB,qEAAqE;IAErE,iBAAiB,UAAS;IAE1B,mFAAmF;IAEnF,gBAAgB,UAAS;IAEzB,0EAA0E;IAE1E,KAAK,CAAC,EAAE,cAAc,CAAC;IAGvB,OAAO,CAAC,kBAAkB,CAAS;IAGnC,OAAO,CAAC,gBAAgB,CAAS;IAGjC,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAgB,MAAM,EAAE,cAAc,CAgDpC;IAGF,SAAS,CAAC,YAAY,IAAI,IAAI;IAS9B,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAYxE,SAAS,CAAC,MAAM;IAIhB,OAAO,CAAC,mBAAmB;IAuJ3B,OAAO,CAAC,cAAc;IA+CtB,IAAW,KAAK,YAQf;IAEY,eAAe,IAAI,OAAO,CAAC,OAAO,CAAC;IAgBhD,OAAO,CAAC,eAAe;CAoBxB"}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { css, LitElement, nothing, html } from "lit";
|
|
2
2
|
import { property, state, customElement } from "lit/decorators.js";
|
|
3
3
|
import { localized, msg } from "@lit/localize";
|
|
4
|
+
import "@progressive-development/pd-content/pd-collapse-group";
|
|
4
5
|
import "@progressive-development/pd-content/pd-collapse";
|
|
5
6
|
import "@progressive-development/pd-contact/pd-contact";
|
|
6
7
|
import "@progressive-development/pd-forms/pd-checkbox";
|
|
7
|
-
import "@progressive-development/pd-forms/pd-form-row";
|
|
8
|
-
import "@progressive-development/pd-forms/pd-radio-group";
|
|
9
8
|
import { PdFontStyles } from "@progressive-development/pd-shared-styles";
|
|
10
9
|
var __defProp = Object.defineProperty;
|
|
11
10
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -30,17 +29,7 @@ let PdOrderContacts = class extends LitElement {
|
|
|
30
29
|
this._ownAdminContact = false;
|
|
31
30
|
this._isPropertyOwner = false;
|
|
32
31
|
}
|
|
33
|
-
|
|
34
|
-
super.connectedCallback();
|
|
35
|
-
this.addEventListener("validate-form", this._validateForm);
|
|
36
|
-
}
|
|
37
|
-
disconnectedCallback() {
|
|
38
|
-
super.disconnectedCallback();
|
|
39
|
-
this.removeEventListener(
|
|
40
|
-
"validate-form",
|
|
41
|
-
this._validateForm
|
|
42
|
-
);
|
|
43
|
-
}
|
|
32
|
+
// TODO: Remove if pd-collapse-group kann handle dynamic added collapse boxes
|
|
44
33
|
firstUpdated() {
|
|
45
34
|
this.addEventListener("toggle-accordion", (e) => {
|
|
46
35
|
var _a;
|
|
@@ -66,6 +55,8 @@ let PdOrderContacts = class extends LitElement {
|
|
|
66
55
|
}
|
|
67
56
|
_renderEditContacts() {
|
|
68
57
|
return html`
|
|
58
|
+
<!-- <pd-collapse-group> -->
|
|
59
|
+
|
|
69
60
|
<pd-collapse id="orderContactCollapseId" active>
|
|
70
61
|
<div slot="header">
|
|
71
62
|
${this.contactTitle.orderInputContact ?? msg("Adresse", { id: "pd.order.contacts.orderContact.inputHeader" })}
|
|
@@ -120,8 +111,8 @@ let PdOrderContacts = class extends LitElement {
|
|
|
120
111
|
<div class="property-owner-box">
|
|
121
112
|
<pd-checkbox
|
|
122
113
|
id="isPropertyOwnerId"
|
|
123
|
-
.
|
|
124
|
-
@
|
|
114
|
+
.initValue=${this._isPropertyOwner}
|
|
115
|
+
@pd-form-element-change=${(e) => this._isPropertyOwner = e.detail.value === "true"}
|
|
125
116
|
>
|
|
126
117
|
${msg("Ist der Kunde Vermieter?", {
|
|
127
118
|
id: "pd.order.contacts.propertyContact.checkBox"
|
|
@@ -193,6 +184,7 @@ let PdOrderContacts = class extends LitElement {
|
|
|
193
184
|
` : nothing}
|
|
194
185
|
</div>
|
|
195
186
|
` : nothing}
|
|
187
|
+
<!-- </pd-collapse-group> -->
|
|
196
188
|
`;
|
|
197
189
|
}
|
|
198
190
|
_renderSummary() {
|
|
@@ -229,11 +221,28 @@ let PdOrderContacts = class extends LitElement {
|
|
|
229
221
|
</div>
|
|
230
222
|
`;
|
|
231
223
|
}
|
|
232
|
-
|
|
233
|
-
var _a, _b
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
224
|
+
get valid() {
|
|
225
|
+
var _a, _b;
|
|
226
|
+
let isValid = false;
|
|
227
|
+
for (const { id, collapse, condition = true } of this._getCollapseMap()) {
|
|
228
|
+
if (!condition) continue;
|
|
229
|
+
isValid += (_b = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById(id)) == null ? void 0 : _b.triggerValidate().valid;
|
|
230
|
+
}
|
|
231
|
+
return isValid;
|
|
232
|
+
}
|
|
233
|
+
async triggerValidate() {
|
|
234
|
+
var _a, _b;
|
|
235
|
+
const promises = [];
|
|
236
|
+
for (const { id, collapse, condition = true } of this._getCollapseMap()) {
|
|
237
|
+
if (!condition) continue;
|
|
238
|
+
promises.push(
|
|
239
|
+
(_b = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById(id)) == null ? void 0 : _b.triggerValidate()
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
return Promise.all(promises).then((resArr) => !resArr.some((result) => !result)).catch((e) => false);
|
|
243
|
+
}
|
|
244
|
+
_getCollapseMap() {
|
|
245
|
+
return [
|
|
237
246
|
{ id: "orderContactId", collapse: "orderContactCollapseId" },
|
|
238
247
|
{
|
|
239
248
|
id: "billingContactId",
|
|
@@ -251,13 +260,6 @@ let PdOrderContacts = class extends LitElement {
|
|
|
251
260
|
condition: this._isPropertyOwner && this._ownAdminContact
|
|
252
261
|
}
|
|
253
262
|
];
|
|
254
|
-
for (const { id, collapse, condition = true } of collapseMap) {
|
|
255
|
-
if (!condition) continue;
|
|
256
|
-
(_b = (_a = this.shadowRoot) == null ? void 0 : _a.getElementById(id)) == null ? void 0 : _b.dispatchEvent(new CustomEvent("validate-form", { detail }));
|
|
257
|
-
if (((_c = detail.errorMap) == null ? void 0 : _c.size) > 0) {
|
|
258
|
-
(_e = (_d = this.shadowRoot) == null ? void 0 : _d.getElementById(collapse)) == null ? void 0 : _e.open();
|
|
259
|
-
}
|
|
260
|
-
}
|
|
261
263
|
}
|
|
262
264
|
};
|
|
263
265
|
PdOrderContacts.styles = [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@progressive-development/pd-order",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.4",
|
|
4
4
|
"description": "Progressive Development Order Component",
|
|
5
5
|
"author": "PD Progressive Development",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@lit/localize": "^0.12.2",
|
|
43
|
-
"@progressive-development/pd-calendar": "^0.6.
|
|
44
|
-
"@progressive-development/pd-contact": "^0.6.
|
|
45
|
-
"@progressive-development/pd-content": "^0.6.
|
|
46
|
-
"@progressive-development/pd-dialog": "^0.6.
|
|
47
|
-
"@progressive-development/pd-forms": "^0.6.
|
|
48
|
-
"@progressive-development/pd-price": "^0.6.
|
|
49
|
-
"@progressive-development/pd-shared-styles": "^0.2.
|
|
43
|
+
"@progressive-development/pd-calendar": "^0.6.6",
|
|
44
|
+
"@progressive-development/pd-contact": "^0.6.6",
|
|
45
|
+
"@progressive-development/pd-content": "^0.6.10",
|
|
46
|
+
"@progressive-development/pd-dialog": "^0.6.5",
|
|
47
|
+
"@progressive-development/pd-forms": "^0.6.14",
|
|
48
|
+
"@progressive-development/pd-price": "^0.6.2",
|
|
49
|
+
"@progressive-development/pd-shared-styles": "^0.2.4",
|
|
50
50
|
"fecha": "^4.2.3",
|
|
51
51
|
"lit": "^3.3.0"
|
|
52
52
|
},
|