pr360-questionnaire 2.1.6 → 2.1.7

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.
@@ -17382,9 +17382,7 @@ meter::-webkit-meter-optimum-value {
17382
17382
  </div>
17383
17383
  <div>
17384
17384
  <label for="email">Email</label>
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)"/>
17385
+ <input type="email" id="email" name="email" required />
17388
17386
  </div>
17389
17387
  <div>
17390
17388
  <label for="phone">Phone</label>
@@ -17396,7 +17394,7 @@ meter::-webkit-meter-optimum-value {
17396
17394
  <label for="zip_code">Zip Code</label>
17397
17395
  <input type="text" id="zip_code" name="zip_code" required
17398
17396
  pattern="^[0-9]{5,6}$"
17399
- title="Please enter a valid US zip code (5 or 6 digits)"/>
17397
+ title="Please enter a valid zip code (5 or 6 digits)"/>
17400
17398
  </div>
17401
17399
  <div>
17402
17400
  <label for="insurance_provider">Insurance Provider</label>
@@ -17484,23 +17482,6 @@ meter::-webkit-meter-optimum-value {
17484
17482
  event.preventDefault();
17485
17483
  if (this.contactInfoForm?.checkValidity()) {
17486
17484
  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
- }
17504
17485
  const hsq = window["_hsq"] = window["_hsq"] || [];
17505
17486
  hsq.push(["identify", { email }]);
17506
17487
  hsq.push(["setPath", "/submit-contact-info"]);
@@ -17511,8 +17492,8 @@ meter::-webkit-meter-optimum-value {
17511
17492
  first_name: this.firstNameInput.value,
17512
17493
  last_name: this.lastNameInput.value,
17513
17494
  email,
17514
- zip_code: zipCode,
17515
- phone_number: phone,
17495
+ zip_code: this.zipCodeInput?.value,
17496
+ phone_number: this.phoneInput?.value,
17516
17497
  insurance_provider: this.insuranceProviderSelect.value
17517
17498
  }
17518
17499
  }));
package/css/app.scss CHANGED
@@ -16,6 +16,7 @@
16
16
  @import './components/forms';
17
17
  @import './components/grid';
18
18
  @import './components/questionnaire';
19
+ @import './components/site-rules';
19
20
 
20
21
  // Imported last to take precedence in the cascade
21
22
  @import './base/utilities';
@@ -25,6 +25,7 @@ $gray: hsl(46, 3%, 58%);
25
25
  $gray-dark: hsl(46, 3%, 35%);
26
26
  $gray-darkest: hsl(46, 3%, 25%);
27
27
  $black: #1d1d1d;
28
+ $danger: #f02e2e;
28
29
 
29
30
 
30
31
  // SPACING
@@ -0,0 +1,189 @@
1
+
2
+ #move-rules-modal {
3
+ .mr-4 {
4
+ margin-right: 16px ;
5
+ }
6
+ .mt-5 {
7
+ margin-top: 20px;
8
+ }
9
+
10
+ .mb-2 {
11
+ margin-bottom: 8px;
12
+ }
13
+ .text-5 {
14
+ font-size: 20px
15
+ }
16
+ .text-6 {
17
+ font-size: 24px
18
+ }
19
+
20
+ .title-alignment {
21
+ display: flex;
22
+ align-items: center;
23
+ }
24
+
25
+ .rules-header {
26
+ display: flex;
27
+ justify-content: space-between;
28
+ align-items: center;
29
+
30
+ h2 {
31
+ font-weight: bolder;
32
+ }
33
+ }
34
+
35
+ .rules-list {
36
+ max-height: 400px;
37
+ overflow-y: scroll;
38
+ margin-bottom: 8px;
39
+ border: 1px solid #bebebe;
40
+ border-radius: 5px;
41
+ padding: 12px 10px;
42
+ }
43
+
44
+ .modal-title {
45
+ margin-top: 20px;
46
+ margin-bottom: 8px;
47
+ font-weight: bolder;
48
+ }
49
+
50
+ .empty-list {
51
+ text-align: center;
52
+ margin-top: 24px;
53
+ font-weight: lighter;
54
+ }
55
+
56
+ .row-container:not(:last-child) {
57
+ margin-bottom: 12px;
58
+ padding-bottom: 6px;
59
+ border-bottom: 1px solid #d8d8d8;
60
+ }
61
+
62
+ .row-container {
63
+ display: flex;
64
+ justify-content: space-between;
65
+ align-items: center;
66
+ }
67
+
68
+ .row {
69
+ display: flex;
70
+ justify-content: space-between;
71
+ align-items: center;
72
+ font-size: 18px;
73
+ }
74
+
75
+ .drag-icon {
76
+ font-size: 20px;
77
+ font-weight: bold;
78
+ margin-right: 12px;
79
+ }
80
+
81
+ .position-text {
82
+ margin-right: 4px;
83
+ }
84
+
85
+ .text-container {
86
+ display: flex;
87
+ align-items: center;
88
+ gap: 6px
89
+ }
90
+
91
+ .quick-actions {
92
+ display: flex;
93
+ align-items: center;
94
+ gap: 16px;
95
+
96
+ }
97
+
98
+ .icon-btn {
99
+ background: transparent;
100
+ padding: 0;
101
+ cursor: pointer;
102
+
103
+ }
104
+
105
+ .site-pill {
106
+ font-size: 12px;
107
+ display: inline;
108
+ font-weight: bold;
109
+ border-radius: 10px;
110
+ background: gray;
111
+ padding: 4px 9px;
112
+ color: white;
113
+ }
114
+
115
+ .rule-form-row {
116
+ display: flex;
117
+ align-items: center;
118
+ gap: 6px;
119
+ padding-top: 10px;
120
+
121
+ textarea {
122
+ resize: both;
123
+ overflow: auto;
124
+ max-width: 786px;
125
+ max-height: 120px;
126
+ width: 100%;
127
+ height: 100%;
128
+ }
129
+ }
130
+
131
+ .rule-form-actions {
132
+ margin-top: 24px;
133
+ }
134
+
135
+ .zip-list-modal{
136
+ border: 1px solid #a3a3a3;
137
+ border-radius: 5px;
138
+ padding: 12px 10px;
139
+ }
140
+
141
+ .zip-list-box{
142
+ overflow-y: scroll;
143
+ border: 1px solid #e2dada;
144
+ border-radius: 5px;
145
+ padding: 6px 5px;
146
+ }
147
+
148
+ .close-btn{
149
+ margin-top: 5px;
150
+ }
151
+
152
+ .alert_error{
153
+ background-color: #ff2424;
154
+ padding: 10px 5px;
155
+ border: 1px solid #0c0909;
156
+ border-radius: 5px;
157
+ width: 786px;
158
+
159
+ h3 {
160
+ display: flex;
161
+ justify-content: space-between;
162
+ align-items: center;
163
+ color: #150f0f;
164
+ }
165
+ }
166
+
167
+
168
+
169
+
170
+ .modal--container{
171
+ background: $white;
172
+ width: 850px;
173
+ position: absolute;
174
+ top: 20%;
175
+ left: 43%;
176
+ margin-left: -330px;
177
+ padding: $space-md;
178
+ -webkit-box-shadow: 3px 3px 15px 3px #ACACAC;
179
+ box-shadow: 3px 3px 15px 3px #ACACAC;
180
+
181
+ @media screen and (max-width: $screen-tablet) {
182
+ left: 56%;
183
+ }
184
+ }
185
+
186
+ .rule-form-modal Select {
187
+ max-width: 150px;
188
+ }
189
+ }
package/dist/index.js CHANGED
@@ -7571,9 +7571,7 @@ meter::-webkit-meter-optimum-value {
7571
7571
  </div>
7572
7572
  <div>
7573
7573
  <label for="email">Email</label>
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)"/>
7574
+ <input type="email" id="email" name="email" required />
7577
7575
  </div>
7578
7576
  <div>
7579
7577
  <label for="phone">Phone</label>
@@ -7585,7 +7583,7 @@ meter::-webkit-meter-optimum-value {
7585
7583
  <label for="zip_code">Zip Code</label>
7586
7584
  <input type="text" id="zip_code" name="zip_code" required
7587
7585
  pattern="^[0-9]{5,6}$"
7588
- title="Please enter a valid US zip code (5 or 6 digits)"/>
7586
+ title="Please enter a valid zip code (5 or 6 digits)"/>
7589
7587
  </div>
7590
7588
  <div>
7591
7589
  <label for="insurance_provider">Insurance Provider</label>
@@ -7673,23 +7671,6 @@ meter::-webkit-meter-optimum-value {
7673
7671
  event.preventDefault();
7674
7672
  if (this.contactInfoForm?.checkValidity()) {
7675
7673
  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
- }
7693
7674
  const hsq = window["_hsq"] = window["_hsq"] || [];
7694
7675
  hsq.push(["identify", { email }]);
7695
7676
  hsq.push(["setPath", "/submit-contact-info"]);
@@ -7700,8 +7681,8 @@ meter::-webkit-meter-optimum-value {
7700
7681
  first_name: this.firstNameInput.value,
7701
7682
  last_name: this.lastNameInput.value,
7702
7683
  email,
7703
- zip_code: zipCode,
7704
- phone_number: phone,
7684
+ zip_code: this.zipCodeInput?.value,
7685
+ phone_number: this.phoneInput?.value,
7705
7686
  insurance_provider: this.insuranceProviderSelect.value
7706
7687
  }
7707
7688
  }));
package/js/app.js CHANGED
@@ -42,8 +42,16 @@ const SortableHook = {
42
42
  ghostClass: "drag-ghost",
43
43
  forceFallback: true,
44
44
  onEnd: e => {
45
- let params = {old: e.oldIndex, new: e.newIndex, ...e.item.dataset}
46
- this.pushEventTo(this.el, "reposition", params)
45
+ // Custom logic for rules list
46
+ if (this.el.id === "rules-sortable-list") {
47
+ // Collect the new order of rule positions (or ids)
48
+ const newOrder = Array.from(this.el.querySelectorAll(".row-container")).map(div => div.dataset.id);
49
+ this.pushEventTo(this.el, "reorder_rules", {order: newOrder});
50
+ } else {
51
+ // Default behavior for other sortable lists
52
+ let params = {old: e.oldIndex, new: e.newIndex, ...e.item.dataset}
53
+ this.pushEventTo(this.el, "reposition", params)
54
+ }
47
55
  }
48
56
  })
49
57
  }
@@ -66,4 +74,4 @@ liveSocket.connect()
66
74
  // >> liveSocket.disableLatencySim()
67
75
  window.liveSocket = liveSocket
68
76
 
69
- import './questionnaire.ts';
77
+ import './questionnaire.ts';
@@ -178,9 +178,7 @@ export class QuestionnaireElement extends LitElement {
178
178
  </div>
179
179
  <div>
180
180
  <label for="email">Email</label>
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)"/>
181
+ <input type="email" id="email" name="email" required />
184
182
  </div>
185
183
  <div>
186
184
  <label for="phone">Phone</label>
@@ -192,7 +190,7 @@ export class QuestionnaireElement extends LitElement {
192
190
  <label for="zip_code">Zip Code</label>
193
191
  <input type="text" id="zip_code" name="zip_code" required
194
192
  pattern="^[0-9]{5,6}$"
195
- title="Please enter a valid US zip code (5 or 6 digits)"/>
193
+ title="Please enter a valid zip code (5 or 6 digits)"/>
196
194
  </div>
197
195
  <div>
198
196
  <label for="insurance_provider">Insurance Provider</label>
@@ -290,29 +288,6 @@ export class QuestionnaireElement extends LitElement {
290
288
 
291
289
  if (this.contactInfoForm?.checkValidity()) {
292
290
  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
291
 
317
292
  const hsq = window['_hsq'] = window['_hsq'] || [];
318
293
  hsq.push(['identify', { email: email }]);
@@ -325,8 +300,8 @@ export class QuestionnaireElement extends LitElement {
325
300
  first_name: this.firstNameInput.value,
326
301
  last_name: this.lastNameInput.value,
327
302
  email: email,
328
- zip_code: zipCode,
329
- phone_number: phone,
303
+ zip_code: this.zipCodeInput?.value,
304
+ phone_number: this.phoneInput?.value,
330
305
  insurance_provider: this.insuranceProviderSelect.value
331
306
  }
332
307
  }));
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "pr360-questionnaire",
3
3
  "description": "An element to render a questionnaire for PatientReach 360.",
4
- "version": "2.1.6",
4
+ "version": "2.1.7",
5
5
  "main": "dist/index.js",
6
6
  "author": {
7
7
  "email": "chris@launchscout.com",