pr360-questionnaire 2.1.4 → 2.1.6
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/build/questionnaire-test.js +30 -19
- package/css/components/_tables.scss +3 -0
- package/dist/index.js +30 -19
- package/js/questionnaire.ts +38 -19
- package/package.json +1 -1
|
@@ -17311,14 +17311,6 @@ meter::-webkit-meter-optimum-value {
|
|
|
17311
17311
|
this.visitedNodes = [];
|
|
17312
17312
|
this.hubspotId = "40834387";
|
|
17313
17313
|
}
|
|
17314
|
-
get providers() {
|
|
17315
|
-
return this.getAttribute("providers")?.split(",") || [];
|
|
17316
|
-
}
|
|
17317
|
-
set providers(value) {
|
|
17318
|
-
if (value !== null && value !== void 0) {
|
|
17319
|
-
this.setAttribute("providers", value.join(","));
|
|
17320
|
-
}
|
|
17321
|
-
}
|
|
17322
17314
|
get topic() {
|
|
17323
17315
|
return `questionnaires:${this.siteId}`;
|
|
17324
17316
|
}
|
|
@@ -17390,15 +17382,21 @@ meter::-webkit-meter-optimum-value {
|
|
|
17390
17382
|
</div>
|
|
17391
17383
|
<div>
|
|
17392
17384
|
<label for="email">Email</label>
|
|
17393
|
-
<input type="email" id="email" name="email" required
|
|
17385
|
+
<input type="email" id="email" name="email" required
|
|
17386
|
+
pattern="^[^@\s]+@[^@\s]+\\.[^@\s]+$"
|
|
17387
|
+
title="Please enter a valid email address (e.g. user@example.com)"/>
|
|
17394
17388
|
</div>
|
|
17395
17389
|
<div>
|
|
17396
17390
|
<label for="phone">Phone</label>
|
|
17397
|
-
<input type="tel" id="phone" name="phone" required
|
|
17391
|
+
<input type="tel" id="phone" name="phone" required
|
|
17392
|
+
pattern="^[0-9]{6,11}$"
|
|
17393
|
+
title="Please enter a valid phone number (6-11 digits)"/>
|
|
17398
17394
|
</div>
|
|
17399
17395
|
<div>
|
|
17400
17396
|
<label for="zip_code">Zip Code</label>
|
|
17401
|
-
<input type="text" id="zip_code" name="zip_code" required
|
|
17397
|
+
<input type="text" id="zip_code" name="zip_code" required
|
|
17398
|
+
pattern="^[0-9]{5,6}$"
|
|
17399
|
+
title="Please enter a valid US zip code (5 or 6 digits)"/>
|
|
17402
17400
|
</div>
|
|
17403
17401
|
<div>
|
|
17404
17402
|
<label for="insurance_provider">Insurance Provider</label>
|
|
@@ -17486,6 +17484,23 @@ meter::-webkit-meter-optimum-value {
|
|
|
17486
17484
|
event.preventDefault();
|
|
17487
17485
|
if (this.contactInfoForm?.checkValidity()) {
|
|
17488
17486
|
const email = this.emailInput?.value;
|
|
17487
|
+
const phone = this.phoneInput?.value;
|
|
17488
|
+
const zipCode = this.zipCodeInput?.value;
|
|
17489
|
+
const emailRegex = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
|
17490
|
+
if (!emailRegex.test(email)) {
|
|
17491
|
+
alert("Please enter a valid email address");
|
|
17492
|
+
return;
|
|
17493
|
+
}
|
|
17494
|
+
const phoneRegex = /^\d{6,}$/;
|
|
17495
|
+
if (!phoneRegex.test(phone)) {
|
|
17496
|
+
alert("Phone number must contain only numbers and be at least 6 digits long");
|
|
17497
|
+
return;
|
|
17498
|
+
}
|
|
17499
|
+
const zipCodeRegex = /^\d{5,6}$/;
|
|
17500
|
+
if (!zipCodeRegex.test(zipCode)) {
|
|
17501
|
+
alert("Zip code must be 5 or 6 digits");
|
|
17502
|
+
return;
|
|
17503
|
+
}
|
|
17489
17504
|
const hsq = window["_hsq"] = window["_hsq"] || [];
|
|
17490
17505
|
hsq.push(["identify", { email }]);
|
|
17491
17506
|
hsq.push(["setPath", "/submit-contact-info"]);
|
|
@@ -17496,8 +17511,8 @@ meter::-webkit-meter-optimum-value {
|
|
|
17496
17511
|
first_name: this.firstNameInput.value,
|
|
17497
17512
|
last_name: this.lastNameInput.value,
|
|
17498
17513
|
email,
|
|
17499
|
-
zip_code:
|
|
17500
|
-
phone_number:
|
|
17514
|
+
zip_code: zipCode,
|
|
17515
|
+
phone_number: phone,
|
|
17501
17516
|
insurance_provider: this.insuranceProviderSelect.value
|
|
17502
17517
|
}
|
|
17503
17518
|
}));
|
|
@@ -17535,7 +17550,7 @@ meter::-webkit-meter-optimum-value {
|
|
|
17535
17550
|
], QuestionnaireElement.prototype, "phoneNumber", 2);
|
|
17536
17551
|
__decorateClass([
|
|
17537
17552
|
t3()
|
|
17538
|
-
], QuestionnaireElement.prototype, "
|
|
17553
|
+
], QuestionnaireElement.prototype, "providers", 2);
|
|
17539
17554
|
__decorateClass([
|
|
17540
17555
|
n5(),
|
|
17541
17556
|
liveStateConfig("url")
|
|
@@ -17549,10 +17564,6 @@ meter::-webkit-meter-optimum-value {
|
|
|
17549
17564
|
__decorateClass([
|
|
17550
17565
|
n5({ type: Boolean })
|
|
17551
17566
|
], QuestionnaireElement.prototype, "open", 2);
|
|
17552
|
-
__decorateClass([
|
|
17553
|
-
n5({ type: Array }),
|
|
17554
|
-
liveStateConfig("providers")
|
|
17555
|
-
], QuestionnaireElement.prototype, "providers", 1);
|
|
17556
17567
|
__decorateClass([
|
|
17557
17568
|
i4("#question-modal")
|
|
17558
17569
|
], QuestionnaireElement.prototype, "modal", 2);
|
|
@@ -17583,7 +17594,7 @@ meter::-webkit-meter-optimum-value {
|
|
|
17583
17594
|
QuestionnaireElement = __decorateClass([
|
|
17584
17595
|
e4("pr360-questionnaire"),
|
|
17585
17596
|
liveStateDecorator_default({
|
|
17586
|
-
properties: ["currentStep", "visitedNodes", "phoneNumber", "links", "accountActive", "questionnaireDepth"],
|
|
17597
|
+
properties: ["currentStep", "visitedNodes", "phoneNumber", "links", "accountActive", "questionnaireDepth", "providers"],
|
|
17587
17598
|
events: {
|
|
17588
17599
|
send: ["answerQuestion", "submitContactInfo", "goBack"]
|
|
17589
17600
|
},
|
package/dist/index.js
CHANGED
|
@@ -7500,14 +7500,6 @@ meter::-webkit-meter-optimum-value {
|
|
|
7500
7500
|
this.visitedNodes = [];
|
|
7501
7501
|
this.hubspotId = "40834387";
|
|
7502
7502
|
}
|
|
7503
|
-
get providers() {
|
|
7504
|
-
return this.getAttribute("providers")?.split(",") || [];
|
|
7505
|
-
}
|
|
7506
|
-
set providers(value) {
|
|
7507
|
-
if (value !== null && value !== void 0) {
|
|
7508
|
-
this.setAttribute("providers", value.join(","));
|
|
7509
|
-
}
|
|
7510
|
-
}
|
|
7511
7503
|
get topic() {
|
|
7512
7504
|
return `questionnaires:${this.siteId}`;
|
|
7513
7505
|
}
|
|
@@ -7579,15 +7571,21 @@ meter::-webkit-meter-optimum-value {
|
|
|
7579
7571
|
</div>
|
|
7580
7572
|
<div>
|
|
7581
7573
|
<label for="email">Email</label>
|
|
7582
|
-
<input type="email" id="email" name="email" required
|
|
7574
|
+
<input type="email" id="email" name="email" required
|
|
7575
|
+
pattern="^[^@\s]+@[^@\s]+\\.[^@\s]+$"
|
|
7576
|
+
title="Please enter a valid email address (e.g. user@example.com)"/>
|
|
7583
7577
|
</div>
|
|
7584
7578
|
<div>
|
|
7585
7579
|
<label for="phone">Phone</label>
|
|
7586
|
-
<input type="tel" id="phone" name="phone" required
|
|
7580
|
+
<input type="tel" id="phone" name="phone" required
|
|
7581
|
+
pattern="^[0-9]{6,11}$"
|
|
7582
|
+
title="Please enter a valid phone number (6-11 digits)"/>
|
|
7587
7583
|
</div>
|
|
7588
7584
|
<div>
|
|
7589
7585
|
<label for="zip_code">Zip Code</label>
|
|
7590
|
-
<input type="text" id="zip_code" name="zip_code" required
|
|
7586
|
+
<input type="text" id="zip_code" name="zip_code" required
|
|
7587
|
+
pattern="^[0-9]{5,6}$"
|
|
7588
|
+
title="Please enter a valid US zip code (5 or 6 digits)"/>
|
|
7591
7589
|
</div>
|
|
7592
7590
|
<div>
|
|
7593
7591
|
<label for="insurance_provider">Insurance Provider</label>
|
|
@@ -7675,6 +7673,23 @@ meter::-webkit-meter-optimum-value {
|
|
|
7675
7673
|
event.preventDefault();
|
|
7676
7674
|
if (this.contactInfoForm?.checkValidity()) {
|
|
7677
7675
|
const email = this.emailInput?.value;
|
|
7676
|
+
const phone = this.phoneInput?.value;
|
|
7677
|
+
const zipCode = this.zipCodeInput?.value;
|
|
7678
|
+
const emailRegex = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
|
7679
|
+
if (!emailRegex.test(email)) {
|
|
7680
|
+
alert("Please enter a valid email address");
|
|
7681
|
+
return;
|
|
7682
|
+
}
|
|
7683
|
+
const phoneRegex = /^\d{6,}$/;
|
|
7684
|
+
if (!phoneRegex.test(phone)) {
|
|
7685
|
+
alert("Phone number must contain only numbers and be at least 6 digits long");
|
|
7686
|
+
return;
|
|
7687
|
+
}
|
|
7688
|
+
const zipCodeRegex = /^\d{5,6}$/;
|
|
7689
|
+
if (!zipCodeRegex.test(zipCode)) {
|
|
7690
|
+
alert("Zip code must be 5 or 6 digits");
|
|
7691
|
+
return;
|
|
7692
|
+
}
|
|
7678
7693
|
const hsq = window["_hsq"] = window["_hsq"] || [];
|
|
7679
7694
|
hsq.push(["identify", { email }]);
|
|
7680
7695
|
hsq.push(["setPath", "/submit-contact-info"]);
|
|
@@ -7685,8 +7700,8 @@ meter::-webkit-meter-optimum-value {
|
|
|
7685
7700
|
first_name: this.firstNameInput.value,
|
|
7686
7701
|
last_name: this.lastNameInput.value,
|
|
7687
7702
|
email,
|
|
7688
|
-
zip_code:
|
|
7689
|
-
phone_number:
|
|
7703
|
+
zip_code: zipCode,
|
|
7704
|
+
phone_number: phone,
|
|
7690
7705
|
insurance_provider: this.insuranceProviderSelect.value
|
|
7691
7706
|
}
|
|
7692
7707
|
}));
|
|
@@ -7724,7 +7739,7 @@ meter::-webkit-meter-optimum-value {
|
|
|
7724
7739
|
], QuestionnaireElement.prototype, "phoneNumber", 2);
|
|
7725
7740
|
__decorateClass([
|
|
7726
7741
|
t3()
|
|
7727
|
-
], QuestionnaireElement.prototype, "
|
|
7742
|
+
], QuestionnaireElement.prototype, "providers", 2);
|
|
7728
7743
|
__decorateClass([
|
|
7729
7744
|
n5(),
|
|
7730
7745
|
liveStateConfig("url")
|
|
@@ -7738,10 +7753,6 @@ meter::-webkit-meter-optimum-value {
|
|
|
7738
7753
|
__decorateClass([
|
|
7739
7754
|
n5({ type: Boolean })
|
|
7740
7755
|
], QuestionnaireElement.prototype, "open", 2);
|
|
7741
|
-
__decorateClass([
|
|
7742
|
-
n5({ type: Array }),
|
|
7743
|
-
liveStateConfig("providers")
|
|
7744
|
-
], QuestionnaireElement.prototype, "providers", 1);
|
|
7745
7756
|
__decorateClass([
|
|
7746
7757
|
i4("#question-modal")
|
|
7747
7758
|
], QuestionnaireElement.prototype, "modal", 2);
|
|
@@ -7772,7 +7783,7 @@ meter::-webkit-meter-optimum-value {
|
|
|
7772
7783
|
QuestionnaireElement = __decorateClass([
|
|
7773
7784
|
e4("pr360-questionnaire"),
|
|
7774
7785
|
liveStateDecorator_default({
|
|
7775
|
-
properties: ["currentStep", "visitedNodes", "phoneNumber", "links", "accountActive", "questionnaireDepth"],
|
|
7786
|
+
properties: ["currentStep", "visitedNodes", "phoneNumber", "links", "accountActive", "questionnaireDepth", "providers"],
|
|
7776
7787
|
events: {
|
|
7777
7788
|
send: ["answerQuestion", "submitContactInfo", "goBack"]
|
|
7778
7789
|
},
|
package/js/questionnaire.ts
CHANGED
|
@@ -36,7 +36,7 @@ export type Answer = {
|
|
|
36
36
|
|
|
37
37
|
@customElement('pr360-questionnaire')
|
|
38
38
|
@liveState({
|
|
39
|
-
properties: ['currentStep', 'visitedNodes', 'phoneNumber', 'links', 'accountActive', 'questionnaireDepth'],
|
|
39
|
+
properties: ['currentStep', 'visitedNodes', 'phoneNumber', 'links', 'accountActive', 'questionnaireDepth', 'providers'],
|
|
40
40
|
events: {
|
|
41
41
|
send: ['answerQuestion', 'submitContactInfo', 'goBack']
|
|
42
42
|
},
|
|
@@ -66,7 +66,7 @@ export class QuestionnaireElement extends LitElement {
|
|
|
66
66
|
phoneNumber: string;
|
|
67
67
|
|
|
68
68
|
@state()
|
|
69
|
-
|
|
69
|
+
providers: string[];
|
|
70
70
|
|
|
71
71
|
@property()
|
|
72
72
|
@liveStateConfig('url')
|
|
@@ -81,18 +81,6 @@ export class QuestionnaireElement extends LitElement {
|
|
|
81
81
|
@property({ type: Boolean })
|
|
82
82
|
open: boolean;
|
|
83
83
|
|
|
84
|
-
@property({ type: Array })
|
|
85
|
-
@liveStateConfig('providers')
|
|
86
|
-
get providers(): string[] {
|
|
87
|
-
return this.getAttribute('providers')?.split(',') || [];
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
set providers(value: string[]) {
|
|
91
|
-
if (value !== null && value !== undefined) {
|
|
92
|
-
this.setAttribute('providers', value.join(','));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
84
|
@query('#question-modal')
|
|
97
85
|
modal: HTMLDialogElement | undefined;
|
|
98
86
|
|
|
@@ -190,15 +178,21 @@ export class QuestionnaireElement extends LitElement {
|
|
|
190
178
|
</div>
|
|
191
179
|
<div>
|
|
192
180
|
<label for="email">Email</label>
|
|
193
|
-
<input type="email" id="email" name="email" required
|
|
181
|
+
<input type="email" id="email" name="email" required
|
|
182
|
+
pattern="^[^@\s]+@[^@\s]+\\.[^@\s]+$"
|
|
183
|
+
title="Please enter a valid email address (e.g. user@example.com)"/>
|
|
194
184
|
</div>
|
|
195
185
|
<div>
|
|
196
186
|
<label for="phone">Phone</label>
|
|
197
|
-
<input type="tel" id="phone" name="phone" required
|
|
187
|
+
<input type="tel" id="phone" name="phone" required
|
|
188
|
+
pattern="^[0-9]{6,11}$"
|
|
189
|
+
title="Please enter a valid phone number (6-11 digits)"/>
|
|
198
190
|
</div>
|
|
199
191
|
<div>
|
|
200
192
|
<label for="zip_code">Zip Code</label>
|
|
201
|
-
<input type="text" id="zip_code" name="zip_code" required
|
|
193
|
+
<input type="text" id="zip_code" name="zip_code" required
|
|
194
|
+
pattern="^[0-9]{5,6}$"
|
|
195
|
+
title="Please enter a valid US zip code (5 or 6 digits)"/>
|
|
202
196
|
</div>
|
|
203
197
|
<div>
|
|
204
198
|
<label for="insurance_provider">Insurance Provider</label>
|
|
@@ -293,8 +287,33 @@ export class QuestionnaireElement extends LitElement {
|
|
|
293
287
|
submitContactInfo(event: Event) {
|
|
294
288
|
event.stopPropagation();
|
|
295
289
|
event.preventDefault();
|
|
290
|
+
|
|
296
291
|
if (this.contactInfoForm?.checkValidity()) {
|
|
297
292
|
const email = this.emailInput?.value;
|
|
293
|
+
const phone = this.phoneInput?.value;
|
|
294
|
+
const zipCode = this.zipCodeInput?.value;
|
|
295
|
+
|
|
296
|
+
// Email validation
|
|
297
|
+
const emailRegex = /^[^@\s]+@[^@\s]+\.[^@\s]+$/;
|
|
298
|
+
if (!emailRegex.test(email)) {
|
|
299
|
+
alert('Please enter a valid email address');
|
|
300
|
+
return;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// Phone validation
|
|
304
|
+
const phoneRegex = /^\d{6,}$/;
|
|
305
|
+
if (!phoneRegex.test(phone)) {
|
|
306
|
+
alert('Phone number must contain only numbers and be at least 6 digits long');
|
|
307
|
+
return;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
// Zip code validation
|
|
311
|
+
const zipCodeRegex = /^\d{5,6}$/;
|
|
312
|
+
if (!zipCodeRegex.test(zipCode)) {
|
|
313
|
+
alert('Zip code must be 5 or 6 digits');
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
|
|
298
317
|
const hsq = window['_hsq'] = window['_hsq'] || [];
|
|
299
318
|
hsq.push(['identify', { email: email }]);
|
|
300
319
|
hsq.push(['setPath', '/submit-contact-info']);
|
|
@@ -306,8 +325,8 @@ export class QuestionnaireElement extends LitElement {
|
|
|
306
325
|
first_name: this.firstNameInput.value,
|
|
307
326
|
last_name: this.lastNameInput.value,
|
|
308
327
|
email: email,
|
|
309
|
-
zip_code:
|
|
310
|
-
phone_number:
|
|
328
|
+
zip_code: zipCode,
|
|
329
|
+
phone_number: phone,
|
|
311
330
|
insurance_provider: this.insuranceProviderSelect.value
|
|
312
331
|
}
|
|
313
332
|
}));
|