medos-sdk 1.1.8 → 1.1.10
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 +44 -27
- package/dist/components/AppointmentConfirmationStep.d.ts +3 -0
- package/dist/components/AppointmentConfirmationStep.js +26 -20
- package/dist/components/AppointmentDateTimeModal.d.ts +3 -0
- package/dist/components/AppointmentDateTimeModal.js +24 -6
- package/dist/components/ContactInformationStep.js +6 -5
- package/dist/components/ContactPreferenceStep.js +6 -5
- package/dist/components/DoctorSelectModal.d.ts +5 -0
- package/dist/components/DoctorSelectModal.js +65 -16
- package/dist/components/EnquiryForm.js +4 -4
- package/dist/components/InquiryDetailsStep.js +7 -6
- package/dist/components/appointment-booking/AppointmentCalender.d.ts +5 -0
- package/dist/components/appointment-booking/AppointmentCalender.js +107 -0
- package/dist/components/appointment-booking/hooks/index.d.ts +3 -0
- package/dist/components/appointment-booking/hooks/index.js +3 -0
- package/dist/components/appointment-booking/hooks/useAppointmentFlow.d.ts +9 -0
- package/dist/components/appointment-booking/hooks/useAppointmentFlow.js +233 -0
- package/dist/components/appointment-booking/hooks/useAppointmentState.d.ts +9 -0
- package/dist/components/appointment-booking/hooks/useAppointmentState.js +93 -0
- package/dist/components/appointment-booking/hooks/useInitializeAddresses.d.ts +1 -0
- package/dist/components/appointment-booking/hooks/useInitializeAddresses.js +56 -0
- package/dist/components/appointment-booking/index.d.ts +5 -0
- package/dist/components/appointment-booking/index.js +3 -0
- package/dist/components/appointment-booking/types.d.ts +128 -0
- package/dist/components/appointment-booking/types.js +33 -0
- package/dist/components/types.d.ts +10 -139
- package/dist/components/types.js +1 -33
- package/dist/components/uiComponents/SelectDropdown.d.ts +1 -1
- package/dist/components/uiComponents/SelectDropdown.js +24 -24
- package/dist/enquiry-form/validation.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +1 -1
- package/dist/vanilla/AppointmentCalendarWidget.js +20 -13
- package/dist/vanilla/components/AppointmentConfirmationStep.d.ts +3 -0
- package/dist/vanilla/components/AppointmentDateTimeModal.d.ts +3 -0
- package/dist/vanilla/components/DoctorSelectModal.d.ts +5 -0
- package/dist/vanilla/components/appointment-booking/AppointmentCalender.d.ts +5 -0
- package/dist/vanilla/components/appointment-booking/hooks/index.d.ts +3 -0
- package/dist/vanilla/components/appointment-booking/hooks/useAppointmentFlow.d.ts +9 -0
- package/dist/vanilla/components/appointment-booking/hooks/useAppointmentState.d.ts +9 -0
- package/dist/vanilla/components/appointment-booking/hooks/useInitializeAddresses.d.ts +1 -0
- package/dist/vanilla/components/appointment-booking/index.d.ts +5 -0
- package/dist/vanilla/components/appointment-booking/types.d.ts +128 -0
- package/dist/vanilla/components/types.d.ts +10 -139
- package/dist/vanilla/components/uiComponents/SelectDropdown.d.ts +1 -1
- package/dist/vanilla/enquiry-widget.js +1 -1
- package/dist/vanilla/index.d.ts +1 -1
- package/dist/vanilla/react/index.d.ts +2 -1
- package/dist/vanilla/widget.js +44 -36
- package/package.json +1 -1
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
onError?: (err: Error) => void;
|
|
4
|
-
};
|
|
1
|
+
export type { AppointmentState, AppointmentAction, } from "./appointment-booking/types";
|
|
2
|
+
export { INITIAL_STATE } from "./appointment-booking/types";
|
|
5
3
|
export type PhoneVerificationStepProps = {
|
|
6
|
-
state:
|
|
7
|
-
dispatch: React.Dispatch<
|
|
4
|
+
state: any;
|
|
5
|
+
dispatch: React.Dispatch<any>;
|
|
8
6
|
onSendOtp: () => Promise<void>;
|
|
9
7
|
onVerifyOtp: () => Promise<void>;
|
|
10
8
|
onBack: () => void;
|
|
11
9
|
onContinue: () => void;
|
|
12
10
|
};
|
|
13
11
|
export type PatientDetailsStepProps = {
|
|
14
|
-
state:
|
|
15
|
-
dispatch: React.Dispatch<
|
|
12
|
+
state: any;
|
|
13
|
+
dispatch: React.Dispatch<any>;
|
|
16
14
|
onBack: () => void;
|
|
17
15
|
onSubmit: () => Promise<void>;
|
|
18
16
|
};
|
|
@@ -33,138 +31,12 @@ export type OtpInputSectionProps = {
|
|
|
33
31
|
onOtpChange: (code: string) => void;
|
|
34
32
|
};
|
|
35
33
|
export type PatientInfoSectionProps = {
|
|
36
|
-
state:
|
|
37
|
-
dispatch: React.Dispatch<
|
|
34
|
+
state: any;
|
|
35
|
+
dispatch: React.Dispatch<any>;
|
|
38
36
|
};
|
|
39
37
|
export type AddressInfoSectionProps = {
|
|
40
|
-
state:
|
|
41
|
-
dispatch: React.Dispatch<
|
|
42
|
-
};
|
|
43
|
-
export interface AppointmentState {
|
|
44
|
-
step: number;
|
|
45
|
-
loading: boolean;
|
|
46
|
-
error: string | null;
|
|
47
|
-
workspaceId: number | null;
|
|
48
|
-
addresses: AddressItem[];
|
|
49
|
-
addressDoctorsMap: Record<number, Doctor[]>;
|
|
50
|
-
selectedAddress: number | null;
|
|
51
|
-
selectedDoctor: number | null;
|
|
52
|
-
selectedDate: Date;
|
|
53
|
-
slots: Slot[];
|
|
54
|
-
selectedSlot: Slot | null;
|
|
55
|
-
consultationMode: "ONLINE" | "OFFLINE";
|
|
56
|
-
consultationCharge: string;
|
|
57
|
-
patientName: string;
|
|
58
|
-
patientAge: string;
|
|
59
|
-
patientEmail: string;
|
|
60
|
-
patientGender: string;
|
|
61
|
-
bloodGroup: string;
|
|
62
|
-
patientAddress: string;
|
|
63
|
-
patientCity: string;
|
|
64
|
-
patientState: string;
|
|
65
|
-
patientCountry: string;
|
|
66
|
-
patientZipcode: string;
|
|
67
|
-
patientLandmark: string;
|
|
68
|
-
countryCode: string;
|
|
69
|
-
patientPhone: string;
|
|
70
|
-
otpCode: string;
|
|
71
|
-
otpSent: boolean;
|
|
72
|
-
otpVerified: boolean;
|
|
73
|
-
otpSending: boolean;
|
|
74
|
-
otpVerifying: boolean;
|
|
75
|
-
}
|
|
76
|
-
export type AppointmentAction = {
|
|
77
|
-
type: "SET_STEP";
|
|
78
|
-
payload: number;
|
|
79
|
-
} | {
|
|
80
|
-
type: "SET_LOADING";
|
|
81
|
-
payload: boolean;
|
|
82
|
-
} | {
|
|
83
|
-
type: "SET_ERROR";
|
|
84
|
-
payload: string | null;
|
|
85
|
-
} | {
|
|
86
|
-
type: "SET_WORKSPACE";
|
|
87
|
-
payload: {
|
|
88
|
-
id: number;
|
|
89
|
-
addresses: AddressItem[];
|
|
90
|
-
};
|
|
91
|
-
} | {
|
|
92
|
-
type: "SET_SELECTED_ADDRESS";
|
|
93
|
-
payload: number | null;
|
|
94
|
-
} | {
|
|
95
|
-
type: "SET_SELECTED_DOCTOR";
|
|
96
|
-
payload: number | null;
|
|
97
|
-
} | {
|
|
98
|
-
type: "SET_SELECTED_DATE";
|
|
99
|
-
payload: Date;
|
|
100
|
-
} | {
|
|
101
|
-
type: "SET_SLOTS";
|
|
102
|
-
payload: Slot[];
|
|
103
|
-
} | {
|
|
104
|
-
type: "SET_SELECTED_SLOT";
|
|
105
|
-
payload: Slot | null;
|
|
106
|
-
} | {
|
|
107
|
-
type: "SET_CONSULTATION_MODE";
|
|
108
|
-
payload: "ONLINE" | "OFFLINE";
|
|
109
|
-
} | {
|
|
110
|
-
type: "SET_CONSULTATION_CHARGE";
|
|
111
|
-
payload: string;
|
|
112
|
-
} | {
|
|
113
|
-
type: "SET_PATIENT_NAME";
|
|
114
|
-
payload: string;
|
|
115
|
-
} | {
|
|
116
|
-
type: "SET_PATIENT_AGE";
|
|
117
|
-
payload: string;
|
|
118
|
-
} | {
|
|
119
|
-
type: "SET_PATIENT_EMAIL";
|
|
120
|
-
payload: string;
|
|
121
|
-
} | {
|
|
122
|
-
type: "SET_PATIENT_GENDER";
|
|
123
|
-
payload: string;
|
|
124
|
-
} | {
|
|
125
|
-
type: "SET_BLOOD_GROUP";
|
|
126
|
-
payload: string;
|
|
127
|
-
} | {
|
|
128
|
-
type: "SET_PATIENT_ADDRESS";
|
|
129
|
-
payload: string;
|
|
130
|
-
} | {
|
|
131
|
-
type: "SET_PATIENT_CITY";
|
|
132
|
-
payload: string;
|
|
133
|
-
} | {
|
|
134
|
-
type: "SET_PATIENT_STATE";
|
|
135
|
-
payload: string;
|
|
136
|
-
} | {
|
|
137
|
-
type: "SET_PATIENT_COUNTRY";
|
|
138
|
-
payload: string;
|
|
139
|
-
} | {
|
|
140
|
-
type: "SET_PATIENT_ZIPCODE";
|
|
141
|
-
payload: string;
|
|
142
|
-
} | {
|
|
143
|
-
type: "SET_PATIENT_LANDMARK";
|
|
144
|
-
payload: string;
|
|
145
|
-
} | {
|
|
146
|
-
type: "SET_COUNTRY_CODE";
|
|
147
|
-
payload: string;
|
|
148
|
-
} | {
|
|
149
|
-
type: "SET_PATIENT_PHONE";
|
|
150
|
-
payload: string;
|
|
151
|
-
} | {
|
|
152
|
-
type: "SET_OTP_CODE";
|
|
153
|
-
payload: string;
|
|
154
|
-
} | {
|
|
155
|
-
type: "SET_OTP_SENT";
|
|
156
|
-
payload: boolean;
|
|
157
|
-
} | {
|
|
158
|
-
type: "SET_OTP_VERIFIED";
|
|
159
|
-
payload: boolean;
|
|
160
|
-
} | {
|
|
161
|
-
type: "SET_OTP_SENDING";
|
|
162
|
-
payload: boolean;
|
|
163
|
-
} | {
|
|
164
|
-
type: "SET_OTP_VERIFYING";
|
|
165
|
-
payload: boolean;
|
|
166
|
-
} | {
|
|
167
|
-
type: "RESET_FORM";
|
|
38
|
+
state: any;
|
|
39
|
+
dispatch: React.Dispatch<any>;
|
|
168
40
|
};
|
|
169
41
|
export declare const COUNTRY_CODES: {
|
|
170
42
|
code: string;
|
|
@@ -178,4 +50,3 @@ export declare const BLOOD_GROUP_OPTIONS: {
|
|
|
178
50
|
value: string;
|
|
179
51
|
label: string;
|
|
180
52
|
}[];
|
|
181
|
-
export declare const INITIAL_STATE: AppointmentState;
|
|
@@ -4218,7 +4218,7 @@
|
|
|
4218
4218
|
};
|
|
4219
4219
|
const validateMessage = (message) => {
|
|
4220
4220
|
const trimmed = message.trim();
|
|
4221
|
-
return trimmed.length > 0
|
|
4221
|
+
return trimmed.length > 0;
|
|
4222
4222
|
};
|
|
4223
4223
|
const validateCountryCode = (code) => {
|
|
4224
4224
|
return /^\+[1-9]\d{0,3}$/.test(code);
|
package/dist/vanilla/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { MedosThemeProvider } from "./react/ThemeProvider";
|
|
|
4
4
|
export type { MedosThemeProviderProps } from "./react/ThemeProvider";
|
|
5
5
|
export { defaultTheme, modernTheme } from "./core/theme/themes";
|
|
6
6
|
export { useTheme, useThemeContext, useCssVar } from "./react/hooks/useTheme";
|
|
7
|
-
export { AppointmentCalender } from "./components/
|
|
7
|
+
export { AppointmentCalender } from "./components/appointment-booking";
|
|
8
8
|
export { EnquiryForm } from "./components/EnquiryForm";
|
|
9
9
|
export type { EnquiryFormProps } from "./components/EnquiryForm";
|
|
10
10
|
export * from "./appointments/provider";
|
|
@@ -2,6 +2,7 @@ export * from "../core";
|
|
|
2
2
|
export { MedosThemeProvider } from "./ThemeProvider";
|
|
3
3
|
export type { MedosThemeProviderProps } from "./ThemeProvider";
|
|
4
4
|
export { useTheme, useThemeContext, useCssVar } from "./hooks/useTheme";
|
|
5
|
-
export { AppointmentCalender } from "../components/
|
|
5
|
+
export { AppointmentCalender } from "../components/appointment-booking";
|
|
6
|
+
export type { AppointmentCalenderProps } from "../components/appointment-booking";
|
|
6
7
|
export { EnquiryForm } from "../components/EnquiryForm";
|
|
7
8
|
export type { EnquiryFormProps } from "../components/EnquiryForm";
|
package/dist/vanilla/widget.js
CHANGED
|
@@ -4173,28 +4173,6 @@
|
|
|
4173
4173
|
},
|
|
4174
4174
|
};
|
|
4175
4175
|
|
|
4176
|
-
const COUNTRY_CODES = [
|
|
4177
|
-
{ code: "+91", label: "🇮🇳 +91" },
|
|
4178
|
-
{ code: "+1", label: "🇺🇸 +1" },
|
|
4179
|
-
{ code: "+44", label: "🇬🇧 +44" },
|
|
4180
|
-
{ code: "+86", label: "🇨🇳 +86" },
|
|
4181
|
-
{ code: "+81", label: "🇯🇵 +81" },
|
|
4182
|
-
];
|
|
4183
|
-
const GENDER_OPTIONS = [
|
|
4184
|
-
{ value: "MALE", label: "Male" },
|
|
4185
|
-
{ value: "FEMALE", label: "Female" },
|
|
4186
|
-
{ value: "OTHER", label: "Other" },
|
|
4187
|
-
];
|
|
4188
|
-
const BLOOD_GROUP_OPTIONS = [
|
|
4189
|
-
{ value: "A+", label: "A+" },
|
|
4190
|
-
{ value: "A-", label: "A-" },
|
|
4191
|
-
{ value: "B+", label: "B+" },
|
|
4192
|
-
{ value: "B-", label: "B-" },
|
|
4193
|
-
{ value: "AB+", label: "AB+" },
|
|
4194
|
-
{ value: "AB-", label: "AB-" },
|
|
4195
|
-
{ value: "O+", label: "O+" },
|
|
4196
|
-
{ value: "O-", label: "O-" },
|
|
4197
|
-
];
|
|
4198
4176
|
const INITIAL_STATE = {
|
|
4199
4177
|
step: 0,
|
|
4200
4178
|
loading: false,
|
|
@@ -4229,6 +4207,29 @@
|
|
|
4229
4207
|
otpVerifying: false,
|
|
4230
4208
|
};
|
|
4231
4209
|
|
|
4210
|
+
const COUNTRY_CODES = [
|
|
4211
|
+
{ code: "+91", label: "🇮🇳 +91" },
|
|
4212
|
+
{ code: "+1", label: "🇺🇸 +1" },
|
|
4213
|
+
{ code: "+44", label: "🇬🇧 +44" },
|
|
4214
|
+
{ code: "+86", label: "🇨🇳 +86" },
|
|
4215
|
+
{ code: "+81", label: "🇯🇵 +81" },
|
|
4216
|
+
];
|
|
4217
|
+
const GENDER_OPTIONS = [
|
|
4218
|
+
{ value: "MALE", label: "Male" },
|
|
4219
|
+
{ value: "FEMALE", label: "Female" },
|
|
4220
|
+
{ value: "OTHER", label: "Other" },
|
|
4221
|
+
];
|
|
4222
|
+
const BLOOD_GROUP_OPTIONS = [
|
|
4223
|
+
{ value: "A+", label: "A+" },
|
|
4224
|
+
{ value: "A-", label: "A-" },
|
|
4225
|
+
{ value: "B+", label: "B+" },
|
|
4226
|
+
{ value: "B-", label: "B-" },
|
|
4227
|
+
{ value: "AB+", label: "AB+" },
|
|
4228
|
+
{ value: "AB-", label: "AB-" },
|
|
4229
|
+
{ value: "O+", label: "O+" },
|
|
4230
|
+
{ value: "O-", label: "O-" },
|
|
4231
|
+
];
|
|
4232
|
+
|
|
4232
4233
|
const validatePhoneNumber$1 = (phone) => {
|
|
4233
4234
|
const cleaned = phone.replace(/\D/g, "");
|
|
4234
4235
|
return cleaned.length >= 7 && cleaned.length <= 15;
|
|
@@ -6417,23 +6418,30 @@
|
|
|
6417
6418
|
renderStep0() {
|
|
6418
6419
|
const canProceed = this.canProceedFromMergedStep();
|
|
6419
6420
|
return `
|
|
6420
|
-
<div
|
|
6421
|
-
<div
|
|
6422
|
-
${VanillaIcons.mapPin(
|
|
6423
|
-
<
|
|
6421
|
+
<div style="border:1px solid #e5e7eb;border-radius:12px;margin-bottom:24px;background:#fff;">
|
|
6422
|
+
<div style="background:#F9FAFB;padding:16px 20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid #E5E7EB;">
|
|
6423
|
+
${VanillaIcons.mapPin(18)}
|
|
6424
|
+
<h3 style="font-size:18px;font-weight:600;margin:0;">Location & Doctor</h3>
|
|
6424
6425
|
</div>
|
|
6425
|
-
<div
|
|
6426
|
-
<div
|
|
6427
|
-
<label
|
|
6426
|
+
<div style="padding:24px;">
|
|
6427
|
+
<div style="margin-bottom:20px;">
|
|
6428
|
+
<label style="display:block;font-size:13px;margin-bottom:6px;color:#374151;">
|
|
6429
|
+
Preferred Location <span style="color:#EF4444">*</span>
|
|
6430
|
+
</label>
|
|
6428
6431
|
<div id="medos-address-select-container"></div>
|
|
6429
6432
|
</div>
|
|
6430
|
-
<div
|
|
6431
|
-
<label
|
|
6433
|
+
<div style="margin-bottom:20px;">
|
|
6434
|
+
<label style="display:block;font-size:13px;margin-bottom:6px;color:#374151;">
|
|
6435
|
+
Preferred Doctor <span style="color:#EF4444">*</span>
|
|
6436
|
+
</label>
|
|
6432
6437
|
<div id="medos-doctor-select-container"></div>
|
|
6433
6438
|
</div>
|
|
6434
|
-
<div
|
|
6435
|
-
<label
|
|
6439
|
+
<div style="margin-bottom:20px;">
|
|
6440
|
+
<label style="display:block;font-size:13px;margin-bottom:6px;color:#374151;">
|
|
6441
|
+
Chief Complaint <span style="color:#6B7280">(optional)</span>
|
|
6442
|
+
</label>
|
|
6436
6443
|
<textarea
|
|
6444
|
+
style="width:100%;padding:10px 12px;border-radius:8px;border:1px solid #e6e9ef;font-size:14px;box-sizing:border-box;"
|
|
6437
6445
|
class="medos-textarea"
|
|
6438
6446
|
id="medos-chief-complaint"
|
|
6439
6447
|
placeholder="Enter Chief Complaint or Appointment Notes"
|
|
@@ -6441,8 +6449,8 @@
|
|
|
6441
6449
|
</div>
|
|
6442
6450
|
</div>
|
|
6443
6451
|
</div>
|
|
6444
|
-
<div
|
|
6445
|
-
<button
|
|
6452
|
+
<div style="display:flex;gap:8px;margin-top:16px;justify-content:flex-end;">
|
|
6453
|
+
<button style="background:#218838;color:#fff;border:none;padding:10px 14px;border-radius:8px;cursor:pointer;font-weight:600;${!canProceed ? "opacity:0.6;" : ""}" id="medos-btn-next" ${!canProceed ? "disabled" : ""}>Next</button>
|
|
6446
6454
|
</div>
|
|
6447
6455
|
`;
|
|
6448
6456
|
}
|
|
@@ -7119,7 +7127,7 @@
|
|
|
7119
7127
|
};
|
|
7120
7128
|
const validateMessage = (message) => {
|
|
7121
7129
|
const trimmed = message.trim();
|
|
7122
|
-
return trimmed.length > 0
|
|
7130
|
+
return trimmed.length > 0;
|
|
7123
7131
|
};
|
|
7124
7132
|
const validateCountryCode = (code) => {
|
|
7125
7133
|
return /^\+[1-9]\d{0,3}$/.test(code);
|
package/package.json
CHANGED