medos-sdk 1.1.6 → 1.1.8
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/dist/components/AppointmentCalender.js +13 -2
- package/dist/components/AppointmentConfirmationStep.d.ts +24 -0
- package/dist/components/AppointmentConfirmationStep.js +110 -0
- package/dist/components/Icons/SuccessIcon.d.ts +8 -0
- package/dist/components/Icons/SuccessIcon.js +14 -0
- package/dist/components/SuccessStep.js +1 -1
- package/dist/services/EnquiryService.d.ts +1 -1
- package/dist/services/EnquiryService.js +5 -8
- package/dist/services/WorkspaceService.d.ts +9 -0
- package/dist/services/WorkspaceService.js +17 -0
- package/dist/vanilla/AppointmentCalendarWidget.d.ts +12 -0
- package/dist/vanilla/AppointmentCalendarWidget.js +573 -167
- package/dist/vanilla/EnquiryFormWidget.d.ts +3 -0
- package/dist/vanilla/EnquiryFormWidget.js +229 -120
- package/dist/vanilla/components/AppointmentConfirmationStep.d.ts +24 -0
- package/dist/vanilla/components/Icons/SuccessIcon.d.ts +8 -0
- package/dist/vanilla/components/VanillaCalendar.d.ts +32 -0
- package/dist/vanilla/components/VanillaCalendar.js +366 -0
- package/dist/vanilla/components/VanillaIcons.d.ts +17 -0
- package/dist/vanilla/components/VanillaIcons.js +268 -0
- package/dist/vanilla/components/VanillaSelect.d.ts +46 -0
- package/dist/vanilla/components/VanillaSelect.js +523 -0
- package/dist/vanilla/components/index.d.ts +3 -0
- package/dist/vanilla/components/index.js +3 -0
- package/dist/vanilla/components/theme-injector.d.ts +1 -0
- package/dist/vanilla/components/theme-injector.js +447 -0
- package/dist/vanilla/enquiry-widget.js +1445 -128
- package/dist/vanilla/services/EnquiryService.d.ts +1 -1
- package/dist/vanilla/services/WorkspaceService.d.ts +9 -0
- package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +12 -0
- package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +3 -0
- package/dist/vanilla/vanilla/components/VanillaCalendar.d.ts +32 -0
- package/dist/vanilla/vanilla/components/VanillaIcons.d.ts +17 -0
- package/dist/vanilla/vanilla/components/VanillaSelect.d.ts +46 -0
- package/dist/vanilla/vanilla/components/index.d.ts +3 -0
- package/dist/vanilla/vanilla/components/theme-injector.d.ts +1 -0
- package/dist/vanilla/vanilla/widget.d.ts +2 -0
- package/dist/vanilla/widget.d.ts +2 -0
- package/dist/vanilla/widget.js +2402 -294
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ declare class EnquiryFormWidget {
|
|
|
12
12
|
private options;
|
|
13
13
|
private mounted;
|
|
14
14
|
private state;
|
|
15
|
+
private countryCodeSelect;
|
|
15
16
|
constructor(container: HTMLElement | string, options: EnquiryFormWidgetOptions);
|
|
16
17
|
private init;
|
|
17
18
|
private validateContactStep;
|
|
@@ -22,11 +23,13 @@ declare class EnquiryFormWidget {
|
|
|
22
23
|
private resetForm;
|
|
23
24
|
private setState;
|
|
24
25
|
private render;
|
|
26
|
+
private initializeCustomComponents;
|
|
25
27
|
private renderStep;
|
|
26
28
|
private renderStep0;
|
|
27
29
|
private renderStep1;
|
|
28
30
|
private renderStep2;
|
|
29
31
|
private renderStep3;
|
|
32
|
+
private renderSuccessIcon;
|
|
30
33
|
private attachEventListeners;
|
|
31
34
|
private escapeHtml;
|
|
32
35
|
destroy(): void;
|
|
@@ -1,9 +1,21 @@
|
|
|
1
1
|
import { EnquiryService } from "../services/EnquiryService";
|
|
2
2
|
import { MedosClient } from "../client/MedosClient";
|
|
3
3
|
import { validateName, validateEmail, validatePhoneNumber, validateSubject, validateMessage, validateCountryCode, } from "../enquiry-form/validation";
|
|
4
|
+
import { VanillaIcons } from "./components/VanillaIcons";
|
|
5
|
+
import { VanillaSelect } from "./components/VanillaSelect";
|
|
6
|
+
import { injectThemedStyles } from "./components/theme-injector";
|
|
7
|
+
const COUNTRY_CODES_ENQUIRY = [
|
|
8
|
+
{ value: "+91", label: "🇮🇳 +91" },
|
|
9
|
+
{ value: "+1", label: "🇺🇸 +1" },
|
|
10
|
+
{ value: "+44", label: "🇬🇧 +44" },
|
|
11
|
+
{ value: "+86", label: "🇨🇳 +86" },
|
|
12
|
+
{ value: "+81", label: "🇯🇵 +81" },
|
|
13
|
+
];
|
|
4
14
|
class EnquiryFormWidget {
|
|
5
15
|
constructor(container, options) {
|
|
6
16
|
this.mounted = true;
|
|
17
|
+
this.countryCodeSelect = null;
|
|
18
|
+
injectThemedStyles();
|
|
7
19
|
if (typeof container === "string") {
|
|
8
20
|
const el = document.getElementById(container);
|
|
9
21
|
if (!el) {
|
|
@@ -125,6 +137,9 @@ class EnquiryFormWidget {
|
|
|
125
137
|
await EnquiryService.submitEnquiry(payload);
|
|
126
138
|
this.state.step = 3;
|
|
127
139
|
this.options.onSuccess?.(payload);
|
|
140
|
+
setTimeout(() => {
|
|
141
|
+
this.resetForm();
|
|
142
|
+
}, 5000);
|
|
128
143
|
}
|
|
129
144
|
catch (e) {
|
|
130
145
|
const msg = e.message || "Failed to submit enquiry";
|
|
@@ -161,16 +176,20 @@ class EnquiryFormWidget {
|
|
|
161
176
|
this.container.innerHTML = `
|
|
162
177
|
<div class="medos-enquiry-container">
|
|
163
178
|
<div class="medos-enquiry-card">
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
<
|
|
167
|
-
|
|
179
|
+
${this.state.step !== 3
|
|
180
|
+
? `
|
|
181
|
+
<div class="medos-enquiry-header">
|
|
182
|
+
<h2 class="medos-enquiry-title">Submit Inquiry</h2>
|
|
183
|
+
<p class="medos-enquiry-step-indicator">Step ${this.state.step + 1} of 4</p>
|
|
184
|
+
</div>
|
|
168
185
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
186
|
+
${this.state.loading
|
|
187
|
+
? '<div class="medos-enquiry-loading">Loading...</div>'
|
|
188
|
+
: ""}
|
|
189
|
+
${this.state.error
|
|
190
|
+
? `<div class="medos-enquiry-error">${this.escapeHtml(this.state.error)}</div>`
|
|
191
|
+
: ""}
|
|
192
|
+
`
|
|
174
193
|
: ""}
|
|
175
194
|
|
|
176
195
|
${this.renderStep()}
|
|
@@ -178,6 +197,23 @@ class EnquiryFormWidget {
|
|
|
178
197
|
</div>
|
|
179
198
|
`;
|
|
180
199
|
this.attachEventListeners();
|
|
200
|
+
this.initializeCustomComponents();
|
|
201
|
+
}
|
|
202
|
+
initializeCustomComponents() {
|
|
203
|
+
if (this.state.step === 0) {
|
|
204
|
+
const countryCodeContainer = this.container.querySelector("#medos-enquiry-country-code-container");
|
|
205
|
+
if (countryCodeContainer) {
|
|
206
|
+
this.countryCodeSelect = new VanillaSelect(countryCodeContainer, COUNTRY_CODES_ENQUIRY, {
|
|
207
|
+
placeholder: "Country",
|
|
208
|
+
onValueChange: (value) => {
|
|
209
|
+
this.state.countryCode = value;
|
|
210
|
+
},
|
|
211
|
+
});
|
|
212
|
+
if (this.state.countryCode) {
|
|
213
|
+
this.countryCodeSelect.setValue(this.state.countryCode);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
181
217
|
}
|
|
182
218
|
renderStep() {
|
|
183
219
|
switch (this.state.step) {
|
|
@@ -195,137 +231,214 @@ class EnquiryFormWidget {
|
|
|
195
231
|
}
|
|
196
232
|
renderStep0() {
|
|
197
233
|
return `
|
|
198
|
-
<div class="medos-
|
|
199
|
-
<
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
class="medos-enquiry-input"
|
|
203
|
-
id="medos-enquiry-name"
|
|
204
|
-
placeholder="Enter your full name"
|
|
205
|
-
value="${this.escapeHtml(this.state.patientName)}"
|
|
206
|
-
/>
|
|
207
|
-
|
|
208
|
-
<label class="medos-enquiry-label" style="margin-top: 12px">Email Address *</label>
|
|
209
|
-
<input
|
|
210
|
-
type="email"
|
|
211
|
-
class="medos-enquiry-input"
|
|
212
|
-
id="medos-enquiry-email"
|
|
213
|
-
placeholder="your.email@example.com"
|
|
214
|
-
value="${this.escapeHtml(this.state.patientEmail)}"
|
|
215
|
-
/>
|
|
216
|
-
|
|
217
|
-
<label class="medos-enquiry-label" style="margin-top: 12px">Country Code *</label>
|
|
218
|
-
<input
|
|
219
|
-
type="text"
|
|
220
|
-
class="medos-enquiry-input"
|
|
221
|
-
id="medos-enquiry-country-code"
|
|
222
|
-
placeholder="+91"
|
|
223
|
-
value="${this.escapeHtml(this.state.countryCode)}"
|
|
224
|
-
/>
|
|
225
|
-
|
|
226
|
-
<label class="medos-enquiry-label" style="margin-top: 12px">Phone Number *</label>
|
|
227
|
-
<input
|
|
228
|
-
type="tel"
|
|
229
|
-
class="medos-enquiry-input"
|
|
230
|
-
id="medos-enquiry-phone"
|
|
231
|
-
placeholder="9876543210"
|
|
232
|
-
value="${this.escapeHtml(this.state.patientPhone)}"
|
|
233
|
-
maxlength="15"
|
|
234
|
-
/>
|
|
235
|
-
|
|
236
|
-
<div class="medos-enquiry-actions">
|
|
237
|
-
<button class="medos-enquiry-btn medos-enquiry-btn-secondary" id="medos-enquiry-btn-cancel">Cancel</button>
|
|
238
|
-
<button class="medos-enquiry-btn medos-enquiry-btn-primary" id="medos-enquiry-btn-next">Next</button>
|
|
234
|
+
<div class="medos-section-card">
|
|
235
|
+
<div class="medos-section-header">
|
|
236
|
+
${VanillaIcons.user(14)}
|
|
237
|
+
<span class="medos-section-title">Contact Information</span>
|
|
239
238
|
</div>
|
|
239
|
+
<div class="medos-section-body">
|
|
240
|
+
<div class="medos-form-group">
|
|
241
|
+
<label class="medos-label">Full Name <span class="medos-required">*</span></label>
|
|
242
|
+
<input
|
|
243
|
+
type="text"
|
|
244
|
+
class="medos-input"
|
|
245
|
+
id="medos-enquiry-name"
|
|
246
|
+
placeholder="Enter your full name"
|
|
247
|
+
value="${this.escapeHtml(this.state.patientName)}"
|
|
248
|
+
/>
|
|
249
|
+
</div>
|
|
250
|
+
|
|
251
|
+
<div class="medos-form-group">
|
|
252
|
+
<label class="medos-label">Email Address <span class="medos-required">*</span></label>
|
|
253
|
+
<input
|
|
254
|
+
type="email"
|
|
255
|
+
class="medos-input"
|
|
256
|
+
id="medos-enquiry-email"
|
|
257
|
+
placeholder="your.email@example.com"
|
|
258
|
+
value="${this.escapeHtml(this.state.patientEmail)}"
|
|
259
|
+
/>
|
|
260
|
+
</div>
|
|
261
|
+
|
|
262
|
+
<div class="medos-form-group">
|
|
263
|
+
<label class="medos-label">Phone Number <span class="medos-required">*</span></label>
|
|
264
|
+
<div class="medos-phone-input-row">
|
|
265
|
+
<div class="medos-country-code-wrapper">
|
|
266
|
+
<div id="medos-enquiry-country-code-container"></div>
|
|
267
|
+
</div>
|
|
268
|
+
<div class="medos-phone-wrapper">
|
|
269
|
+
<input
|
|
270
|
+
type="tel"
|
|
271
|
+
class="medos-input"
|
|
272
|
+
id="medos-enquiry-phone"
|
|
273
|
+
placeholder="Enter phone number"
|
|
274
|
+
value="${this.escapeHtml(this.state.patientPhone)}"
|
|
275
|
+
maxlength="15"
|
|
276
|
+
/>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
</div>
|
|
281
|
+
</div>
|
|
282
|
+
|
|
283
|
+
<div class="medos-actions">
|
|
284
|
+
<button class="medos-btn medos-btn-secondary" id="medos-enquiry-btn-cancel">Cancel</button>
|
|
285
|
+
<button class="medos-btn medos-btn-primary" id="medos-enquiry-btn-next">Next</button>
|
|
240
286
|
</div>
|
|
241
287
|
`;
|
|
242
288
|
}
|
|
243
289
|
renderStep1() {
|
|
244
290
|
return `
|
|
245
|
-
<div class="medos-
|
|
246
|
-
<
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
291
|
+
<div class="medos-section-card">
|
|
292
|
+
<div class="medos-section-header">
|
|
293
|
+
${VanillaIcons.mail(14)}
|
|
294
|
+
<span class="medos-section-title">Inquiry Details</span>
|
|
295
|
+
</div>
|
|
296
|
+
<div class="medos-section-body">
|
|
297
|
+
<div class="medos-form-group">
|
|
298
|
+
<label class="medos-label">Subject <span class="medos-required">*</span></label>
|
|
299
|
+
<input
|
|
300
|
+
type="text"
|
|
301
|
+
class="medos-input"
|
|
302
|
+
id="medos-enquiry-subject"
|
|
303
|
+
placeholder="What is your inquiry about?"
|
|
304
|
+
value="${this.escapeHtml(this.state.inquirySubject)}"
|
|
305
|
+
/>
|
|
306
|
+
</div>
|
|
307
|
+
|
|
308
|
+
<div class="medos-form-group">
|
|
309
|
+
<label class="medos-label">Message <span class="medos-required">*</span></label>
|
|
310
|
+
<textarea
|
|
311
|
+
class="medos-textarea"
|
|
312
|
+
id="medos-enquiry-message"
|
|
313
|
+
placeholder="Please describe your inquiry in detail (max 1000 characters)"
|
|
314
|
+
maxlength="1000"
|
|
315
|
+
>${this.escapeHtml(this.state.inquiryMessage)}</textarea>
|
|
316
|
+
<div class="medos-char-count">${this.state.inquiryMessage.length}/1000</div>
|
|
317
|
+
</div>
|
|
267
318
|
</div>
|
|
268
319
|
</div>
|
|
320
|
+
|
|
321
|
+
<div class="medos-actions">
|
|
322
|
+
<button class="medos-btn medos-btn-secondary" id="medos-enquiry-btn-back">Back</button>
|
|
323
|
+
<button class="medos-btn medos-btn-primary" id="medos-enquiry-btn-next">Next</button>
|
|
324
|
+
</div>
|
|
269
325
|
`;
|
|
270
326
|
}
|
|
271
327
|
renderStep2() {
|
|
272
328
|
return `
|
|
273
|
-
<div class="medos-
|
|
274
|
-
<
|
|
275
|
-
|
|
276
|
-
<
|
|
277
|
-
<input
|
|
278
|
-
type="radio"
|
|
279
|
-
name="contact-method"
|
|
280
|
-
value="PHONE"
|
|
281
|
-
${this.state.preferredContactMethod === "PHONE" ? "checked" : ""}
|
|
282
|
-
id="medos-enquiry-contact-phone"
|
|
283
|
-
/>
|
|
284
|
-
<span>Phone</span>
|
|
285
|
-
</label>
|
|
286
|
-
<label class="medos-enquiry-radio-label">
|
|
287
|
-
<input
|
|
288
|
-
type="radio"
|
|
289
|
-
name="contact-method"
|
|
290
|
-
value="EMAIL"
|
|
291
|
-
${this.state.preferredContactMethod === "EMAIL" ? "checked" : ""}
|
|
292
|
-
id="medos-enquiry-contact-email"
|
|
293
|
-
/>
|
|
294
|
-
<span>Email</span>
|
|
295
|
-
</label>
|
|
296
|
-
<label class="medos-enquiry-radio-label">
|
|
297
|
-
<input
|
|
298
|
-
type="radio"
|
|
299
|
-
name="contact-method"
|
|
300
|
-
value="BOTH"
|
|
301
|
-
${this.state.preferredContactMethod === "BOTH" ? "checked" : ""}
|
|
302
|
-
id="medos-enquiry-contact-both"
|
|
303
|
-
/>
|
|
304
|
-
<span>Both</span>
|
|
305
|
-
</label>
|
|
329
|
+
<div class="medos-section-card">
|
|
330
|
+
<div class="medos-section-header">
|
|
331
|
+
${VanillaIcons.phone(14)}
|
|
332
|
+
<span class="medos-section-title">Contact Preference</span>
|
|
306
333
|
</div>
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
<
|
|
310
|
-
|
|
334
|
+
<div class="medos-section-body">
|
|
335
|
+
<p class="medos-section-description">How would you prefer to be contacted?</p>
|
|
336
|
+
<div class="medos-contact-options">
|
|
337
|
+
<label class="medos-radio-option ${this.state.preferredContactMethod === "PHONE" ? "selected" : ""}">
|
|
338
|
+
<input
|
|
339
|
+
type="radio"
|
|
340
|
+
name="contact-method"
|
|
341
|
+
value="PHONE"
|
|
342
|
+
${this.state.preferredContactMethod === "PHONE" ? "checked" : ""}
|
|
343
|
+
class="medos-radio-input"
|
|
344
|
+
/>
|
|
345
|
+
<span class="medos-radio-label">Phone</span>
|
|
346
|
+
</label>
|
|
347
|
+
<label class="medos-radio-option ${this.state.preferredContactMethod === "EMAIL" ? "selected" : ""}">
|
|
348
|
+
<input
|
|
349
|
+
type="radio"
|
|
350
|
+
name="contact-method"
|
|
351
|
+
value="EMAIL"
|
|
352
|
+
${this.state.preferredContactMethod === "EMAIL" ? "checked" : ""}
|
|
353
|
+
class="medos-radio-input"
|
|
354
|
+
/>
|
|
355
|
+
<span class="medos-radio-label">Email</span>
|
|
356
|
+
</label>
|
|
357
|
+
<label class="medos-radio-option ${this.state.preferredContactMethod === "BOTH" ? "selected" : ""}">
|
|
358
|
+
<input
|
|
359
|
+
type="radio"
|
|
360
|
+
name="contact-method"
|
|
361
|
+
value="BOTH"
|
|
362
|
+
${this.state.preferredContactMethod === "BOTH" ? "checked" : ""}
|
|
363
|
+
class="medos-radio-input"
|
|
364
|
+
/>
|
|
365
|
+
<span class="medos-radio-label">Both</span>
|
|
366
|
+
</label>
|
|
367
|
+
</div>
|
|
311
368
|
</div>
|
|
312
369
|
</div>
|
|
370
|
+
|
|
371
|
+
<div class="medos-actions">
|
|
372
|
+
<button class="medos-btn medos-btn-secondary" id="medos-enquiry-btn-back">Back</button>
|
|
373
|
+
<button class="medos-btn medos-btn-primary" id="medos-enquiry-btn-submit" ${this.state.loading ? "disabled" : ""} style="opacity: ${this.state.loading ? 0.6 : 1}">${this.state.loading ? "Submitting..." : "Submit Inquiry"}</button>
|
|
374
|
+
</div>
|
|
313
375
|
`;
|
|
314
376
|
}
|
|
315
377
|
renderStep3() {
|
|
316
378
|
return `
|
|
317
|
-
<div
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
<div class="medos-enquiry-success-message">Thank you, ${this.escapeHtml(this.state.patientName || "Patient")}. We have received your inquiry and will get back to you soon.</div>
|
|
379
|
+
<div style="display: flex; flex-direction: column; padding: 0; font-family: Arial, sans-serif; background: #f8f9fa; min-height: 500px;">
|
|
380
|
+
<!-- Header with border -->
|
|
381
|
+
<div style="padding: 20px 24px; font-size: 24px; font-weight: bold; color: #1a365d; border-bottom: 2px solid #e2e8f0; background: white;">
|
|
382
|
+
Inquiry Confirmed
|
|
322
383
|
</div>
|
|
323
|
-
|
|
324
|
-
|
|
384
|
+
|
|
385
|
+
<!-- Main content with border -->
|
|
386
|
+
<div style="flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; border: 2px solid #e2e8f0; border-top: none; background: white; text-align: center;">
|
|
387
|
+
<!-- Success Title -->
|
|
388
|
+
<h2 style="font-size: 20px; font-weight: 600; color: #006E0F; margin: 0 0 24px 0;">
|
|
389
|
+
Inquiry Submitted Successfully
|
|
390
|
+
</h2>
|
|
391
|
+
|
|
392
|
+
<!-- Success Icon -->
|
|
393
|
+
<div style="margin-bottom: 32px;">
|
|
394
|
+
${this.renderSuccessIcon()}
|
|
395
|
+
</div>
|
|
396
|
+
|
|
397
|
+
<!-- Inquiry Details -->
|
|
398
|
+
<div style="width: 100%; max-width: 500px; margin-bottom: 32px;">
|
|
399
|
+
<h3 style="font-size: 18px; font-weight: 600; color: #006E0F; margin-bottom: 24px;">
|
|
400
|
+
Inquiry Details
|
|
401
|
+
</h3>
|
|
402
|
+
|
|
403
|
+
<div style="display: flex; flex-direction: column; gap: 12px; font-size: 16px; line-height: 1.6; color: #4a5568;">
|
|
404
|
+
<div><strong style="color: #006E0F;">Name:</strong> ${this.escapeHtml(this.state.patientName || "Patient")}</div>
|
|
405
|
+
<div><strong style="color: #006E0F;">Email:</strong> ${this.escapeHtml(this.state.patientEmail)}</div>
|
|
406
|
+
<div><strong style="color: #006E0F;">Phone:</strong> ${this.escapeHtml(this.state.countryCode)} ${this.escapeHtml(this.state.patientPhone)}</div>
|
|
407
|
+
<div><strong style="color: #006E0F;">Subject:</strong> ${this.escapeHtml(this.state.inquirySubject)}</div>
|
|
408
|
+
<div><strong style="color: #006E0F;">Preferred Contact:</strong> ${this.state.preferredContactMethod === "PHONE"
|
|
409
|
+
? "Phone"
|
|
410
|
+
: this.state.preferredContactMethod === "EMAIL"
|
|
411
|
+
? "Email"
|
|
412
|
+
: "Both"}</div>
|
|
413
|
+
</div>
|
|
414
|
+
</div>
|
|
415
|
+
|
|
416
|
+
<!-- Confirmation Message -->
|
|
417
|
+
<div style="font-size: 16px; font-style: italic; color: #718096; text-align: center; max-width: 600px; line-height: 1.5;">
|
|
418
|
+
Thank you for your inquiry. We have received your message and will get back to you soon via your preferred contact method.
|
|
419
|
+
</div>
|
|
325
420
|
</div>
|
|
326
421
|
</div>
|
|
327
422
|
`;
|
|
328
423
|
}
|
|
424
|
+
renderSuccessIcon() {
|
|
425
|
+
return `
|
|
426
|
+
<div style="position: relative; display: inline-block;">
|
|
427
|
+
<svg width="64" height="64" viewBox="0 0 41 41" fill="none">
|
|
428
|
+
<path
|
|
429
|
+
d="M31.1309 4.90254C32.388 4.98797 33.0166 5.03069 33.5247 5.25288C34.2598 5.57438 34.8467 6.16126 35.1682 6.8964C35.3904 7.40445 35.4331 8.03302 35.5185 9.29016L35.7135 12.159C35.748 12.6674 35.7653 12.9217 35.8206 13.1645C35.9004 13.5154 36.0391 13.8503 36.2308 14.1549C36.3634 14.3657 36.531 14.5576 36.8661 14.9416L38.7568 17.108C39.5853 18.0574 39.9996 18.532 40.2017 19.0484C40.4942 19.7955 40.4942 20.6255 40.2017 21.3727C39.9996 21.889 39.5853 22.3637 38.7568 23.313L36.8661 25.4795C36.531 25.8634 36.3634 26.0554 36.2308 26.2662C36.0391 26.5708 35.9004 26.9056 35.8206 27.2566C35.7653 27.4994 35.748 27.7536 35.7135 28.2621L35.5185 31.1309C35.4331 32.388 35.3904 33.0166 35.1682 33.5247C34.8467 34.2598 34.2598 34.8467 33.5247 35.1682C33.0166 35.3904 32.388 35.4331 31.1309 35.5185L28.2621 35.7135C27.7536 35.748 27.4994 35.7653 27.2566 35.8206C26.9056 35.9004 26.5708 36.0391 26.2662 36.2308C26.0554 36.3634 25.8634 36.531 25.4795 36.8661L23.313 38.7568C22.3637 39.5853 21.889 39.9996 21.3727 40.2017C20.6255 40.4942 19.7955 40.4942 19.0484 40.2017C18.532 39.9996 18.0574 39.5853 17.108 38.7568L14.9416 36.8661C14.5576 36.531 14.3657 36.3634 14.1549 36.2308C13.8503 36.0391 13.5154 35.9004 13.1645 35.8206C12.9217 35.7653 12.6674 35.748 12.159 35.7135L9.29016 35.5185C8.03302 35.4331 7.40445 35.3904 6.8964 35.1682C6.16126 34.8467 5.57438 34.2598 5.25288 33.5247C5.03069 33.0166 4.98797 32.388 4.90254 31.1309L4.70759 28.2621C4.67304 27.7536 4.65576 27.4994 4.60049 27.2566C4.52063 26.9056 4.38193 26.5708 4.19028 26.2662C4.05764 26.0554 3.89009 25.8634 3.555 25.4795L1.66428 23.313C0.83576 22.3637 0.421499 21.889 0.219363 21.3727C-0.073121 20.6255 -0.0731209 19.7955 0.219363 19.0484C0.421499 18.532 0.83576 18.0574 1.66428 17.108L3.555 14.9416C3.89009 14.5576 4.05764 14.3657 4.19027 14.1549C4.38193 13.8503 4.52063 13.5154 4.60049 13.1645C4.65576 12.9217 4.67304 12.6674 4.70759 12.159L4.90254 9.29016C4.98797 8.03302 5.03069 7.40445 5.25288 6.8964C5.57438 6.16126 6.16126 5.57438 6.8964 5.25288C7.40445 5.03069 8.03302 4.98797 9.29016 4.90254L12.159 4.70759C12.6674 4.67304 12.9217 4.65577 13.1645 4.6005C13.5154 4.52063 13.8503 4.38193 14.1549 4.19028C14.3657 4.05764 14.5576 3.89009 14.9416 3.555L17.108 1.66428C18.0574 0.83576 18.532 0.421499 19.0484 0.219363C19.7955 -0.073121 20.6255 -0.073121 21.3727 0.219363C21.889 0.421499 22.3637 0.83576 23.313 1.66428L25.4795 3.555C25.8634 3.89009 26.0554 4.05764 26.2662 4.19028C26.5708 4.38193 26.9056 4.52063 27.2566 4.6005C27.4994 4.65577 27.7536 4.67304 28.2621 4.70759L31.1309 4.90254Z"
|
|
430
|
+
fill="#006E0F"
|
|
431
|
+
/>
|
|
432
|
+
</svg>
|
|
433
|
+
<svg width="16" height="12" viewBox="0 0 16 12" fill="none" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);">
|
|
434
|
+
<path
|
|
435
|
+
d="M5.472 11.544L0 6.072L1.368 4.704L5.472 8.808L14.28 0L15.648 1.368L5.472 11.544Z"
|
|
436
|
+
fill="white"
|
|
437
|
+
/>
|
|
438
|
+
</svg>
|
|
439
|
+
</div>
|
|
440
|
+
`;
|
|
441
|
+
}
|
|
329
442
|
attachEventListeners() {
|
|
330
443
|
const nameInput = this.container.querySelector("#medos-enquiry-name");
|
|
331
444
|
if (nameInput) {
|
|
@@ -400,10 +513,6 @@ class EnquiryFormWidget {
|
|
|
400
513
|
if (cancelBtn) {
|
|
401
514
|
cancelBtn.addEventListener("click", () => this.resetForm());
|
|
402
515
|
}
|
|
403
|
-
const submitAnotherBtn = this.container.querySelector("#medos-enquiry-btn-submit-another");
|
|
404
|
-
if (submitAnotherBtn) {
|
|
405
|
-
submitAnotherBtn.addEventListener("click", () => this.resetForm());
|
|
406
|
-
}
|
|
407
516
|
}
|
|
408
517
|
escapeHtml(text) {
|
|
409
518
|
const div = document.createElement("div");
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
interface AppointmentDetails {
|
|
3
|
+
patientName?: string;
|
|
4
|
+
visitationType?: string;
|
|
5
|
+
appointmentDate?: string;
|
|
6
|
+
fromTime?: string;
|
|
7
|
+
toTime?: string;
|
|
8
|
+
duration?: number;
|
|
9
|
+
location?: string;
|
|
10
|
+
mode?: string;
|
|
11
|
+
paymentMode?: string;
|
|
12
|
+
}
|
|
13
|
+
interface AppointmentConfirmationStepProps {
|
|
14
|
+
appointment: AppointmentDetails;
|
|
15
|
+
patient: {
|
|
16
|
+
firstName?: string;
|
|
17
|
+
middleName?: string;
|
|
18
|
+
lastName?: string;
|
|
19
|
+
patientName?: string;
|
|
20
|
+
};
|
|
21
|
+
onClose: () => void;
|
|
22
|
+
}
|
|
23
|
+
declare const AppointmentConfirmationStep: React.FC<AppointmentConfirmationStepProps>;
|
|
24
|
+
export default AppointmentConfirmationStep;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface VanillaCalendarOptions {
|
|
2
|
+
pastDisabled?: boolean;
|
|
3
|
+
onSelect?: (date: Date) => void;
|
|
4
|
+
selectedDate?: Date;
|
|
5
|
+
}
|
|
6
|
+
export declare class VanillaCalendar {
|
|
7
|
+
private container;
|
|
8
|
+
private config;
|
|
9
|
+
private currentMonth;
|
|
10
|
+
private currentYear;
|
|
11
|
+
private selectedDate;
|
|
12
|
+
private today;
|
|
13
|
+
private static readonly DAYS_OF_WEEK;
|
|
14
|
+
private static readonly MONTHS;
|
|
15
|
+
constructor(container: HTMLElement | string, config?: VanillaCalendarOptions);
|
|
16
|
+
private getDaysInMonth;
|
|
17
|
+
private getFirstDayOfMonth;
|
|
18
|
+
private isSameDate;
|
|
19
|
+
private isBeforeToday;
|
|
20
|
+
private render;
|
|
21
|
+
private attachEventListeners;
|
|
22
|
+
private prevMonth;
|
|
23
|
+
private nextMonth;
|
|
24
|
+
private selectDate;
|
|
25
|
+
setSelectedDate(date: Date | null): void;
|
|
26
|
+
getSelectedDate(): Date | null;
|
|
27
|
+
goToDate(date: Date): void;
|
|
28
|
+
goToToday(): void;
|
|
29
|
+
setPastDisabled(disabled: boolean): void;
|
|
30
|
+
destroy(): void;
|
|
31
|
+
}
|
|
32
|
+
export default VanillaCalendar;
|