@progressive-development/pd-contact 0.1.59 → 0.1.60
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/package.json +1 -1
- package/src/PdContact.js +24 -17
package/package.json
CHANGED
package/src/PdContact.js
CHANGED
|
@@ -81,17 +81,24 @@
|
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
84
|
+
constructor() {
|
|
85
|
+
super();
|
|
86
|
+
this.addressTitle = 'Adres';
|
|
87
|
+
this.requiredFields = [];
|
|
88
|
+
this.summary = false;
|
|
89
|
+
this.business = false;
|
|
90
|
+
this.match = {};
|
|
91
|
+
this._errorMap = new Map();
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
update(changedProperties) {
|
|
95
|
+
if (changedProperties.has("contact") && this.contact) {
|
|
96
|
+
this.business = this.contact.business;
|
|
97
|
+
}
|
|
98
|
+
super.update(changedProperties);
|
|
99
|
+
}
|
|
93
100
|
|
|
94
|
-
|
|
101
|
+
connectedCallback() {
|
|
95
102
|
super.connectedCallback();
|
|
96
103
|
// add validation event listener
|
|
97
104
|
this.addEventListener('validate-form', this._validateForm);
|
|
@@ -103,13 +110,13 @@
|
|
|
103
110
|
this.removeEventListener('validate-form', this._validateForm);
|
|
104
111
|
}
|
|
105
112
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
113
|
+
firstUpdated() {
|
|
114
|
+
this.addEventListener('key-pressed', e => {
|
|
115
|
+
this._errorMap.set(e.detail.name, '');
|
|
116
|
+
super.requestUpdate();
|
|
117
|
+
});
|
|
111
118
|
|
|
112
|
-
|
|
119
|
+
// first validation if form is already filled (edit)
|
|
113
120
|
if (this.contact) {
|
|
114
121
|
const detail = {
|
|
115
122
|
errorMap: new Map()
|
|
@@ -118,7 +125,7 @@
|
|
|
118
125
|
new CustomEvent("validate-form", {detail})
|
|
119
126
|
);
|
|
120
127
|
}
|
|
121
|
-
|
|
128
|
+
}
|
|
122
129
|
|
|
123
130
|
render() {
|
|
124
131
|
return html`
|