medos-sdk 1.1.9 → 1.1.11
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/client/MedosClient.d.ts +1 -0
- package/dist/client/MedosClient.js +7 -0
- package/dist/components/AppointmentCalender.js +22 -8
- package/dist/components/AppointmentConfirmationStep.d.ts +4 -0
- package/dist/components/AppointmentConfirmationStep.js +50 -52
- package/dist/components/AppointmentDateTimeModal.d.ts +4 -0
- package/dist/components/AppointmentDateTimeModal.js +216 -165
- package/dist/components/AppointmentSummaryStep.d.ts +12 -0
- package/dist/components/AppointmentSummaryStep.js +168 -0
- package/dist/components/BookingOptionStep.d.ts +14 -0
- package/dist/components/BookingOptionStep.js +346 -0
- package/dist/components/ContactInformationStep.js +13 -6
- package/dist/components/ContactPreferenceStep.js +16 -6
- package/dist/components/DoctorSelectModal.d.ts +5 -0
- package/dist/components/DoctorSelectModal.js +169 -74
- package/dist/components/EnquiryForm.js +84 -72
- package/dist/components/Icons/CloseIcon.d.ts +9 -0
- package/dist/components/Icons/CloseIcon.js +5 -0
- package/dist/components/InquiryDetailsStep.js +11 -6
- package/dist/components/PatientDetailsStep.js +17 -12
- package/dist/components/PatientSelectionStep.d.ts +12 -0
- package/dist/components/PatientSelectionStep.js +254 -0
- package/dist/components/PhoneVerificationStep.js +1 -1
- package/dist/components/SuccessStep.js +1 -1
- package/dist/components/appointment-booking/AppointmentCalender.d.ts +5 -0
- package/dist/components/appointment-booking/AppointmentCalender.js +247 -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 +8 -0
- package/dist/components/appointment-booking/hooks/useAppointmentFlow.js +318 -0
- package/dist/components/appointment-booking/hooks/useAppointmentState.d.ts +9 -0
- package/dist/components/appointment-booking/hooks/useAppointmentState.js +125 -0
- package/dist/components/appointment-booking/hooks/useInitializeAddresses.d.ts +1 -0
- package/dist/components/appointment-booking/hooks/useInitializeAddresses.js +55 -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 +291 -0
- package/dist/components/appointment-booking/types.js +49 -0
- package/dist/components/appointment-modal-styles.d.ts +259 -0
- package/dist/components/appointment-modal-styles.js +395 -0
- package/dist/components/constant.d.ts +2 -0
- package/dist/components/constant.js +15 -0
- package/dist/components/custom-calendar.js +20 -11
- package/dist/components/styles.js +93 -52
- package/dist/components/theme-styles.d.ts +5 -4
- package/dist/components/theme-styles.js +221 -125
- package/dist/components/types.d.ts +12 -139
- package/dist/components/types.js +15 -32
- package/dist/components/uiComponents/SelectDropdown.d.ts +1 -1
- package/dist/components/uiComponents/SelectDropdown.js +24 -24
- package/dist/components/utils.d.ts +3 -0
- package/dist/components/utils.js +59 -0
- package/dist/components/validation.d.ts +2 -0
- package/dist/components/validation.js +41 -0
- package/dist/core/theme/index.d.ts +1 -0
- package/dist/core/theme/index.js +1 -0
- package/dist/core/theme/responsive.d.ts +15 -0
- package/dist/core/theme/responsive.js +113 -0
- package/dist/core/theme/themes.js +16 -4
- package/dist/core/theme/types.d.ts +8 -0
- package/dist/enquiry-form/validation.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +2 -1
- package/dist/react/ThemeProvider.d.ts +2 -1
- package/dist/react/ThemeProvider.js +49 -10
- package/dist/react/index.d.ts +2 -1
- package/dist/react/index.js +1 -1
- package/dist/services/AppointmentService.d.ts +80 -2
- package/dist/services/AppointmentService.js +114 -5
- package/dist/services/WorkspaceService.d.ts +58 -3
- package/dist/services/WorkspaceService.js +10 -1
- package/dist/vanilla/AppointmentCalendarWidget.d.ts +9 -7
- package/dist/vanilla/AppointmentCalendarWidget.js +834 -384
- package/dist/vanilla/EnquiryFormWidget.d.ts +1 -0
- package/dist/vanilla/EnquiryFormWidget.js +25 -43
- package/dist/vanilla/client/MedosClient.d.ts +1 -0
- package/dist/vanilla/components/AppointmentConfirmationStep.d.ts +4 -0
- package/dist/vanilla/components/AppointmentDateTimeModal.d.ts +4 -0
- package/dist/vanilla/components/AppointmentSummaryStep.d.ts +12 -0
- package/dist/vanilla/components/BookingOptionStep.d.ts +14 -0
- package/dist/vanilla/components/DoctorSelectModal.d.ts +5 -0
- package/dist/vanilla/components/Icons/CloseIcon.d.ts +9 -0
- package/dist/vanilla/components/PatientSelectionStep.d.ts +12 -0
- package/dist/vanilla/components/VanillaCalendar.js +33 -18
- package/dist/vanilla/components/VanillaIcons.d.ts +5 -0
- package/dist/vanilla/components/VanillaIcons.js +92 -0
- package/dist/vanilla/components/VanillaSelect.d.ts +3 -0
- package/dist/vanilla/components/VanillaSelect.js +93 -5
- 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 +8 -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 +291 -0
- package/dist/vanilla/components/appointment-modal-styles.d.ts +259 -0
- package/dist/vanilla/components/constant.d.ts +2 -0
- package/dist/vanilla/components/theme-styles.d.ts +5 -4
- package/dist/vanilla/components/types.d.ts +12 -139
- package/dist/vanilla/components/uiComponents/SelectDropdown.d.ts +1 -1
- package/dist/vanilla/components/utils.d.ts +3 -0
- package/dist/vanilla/components/validation.d.ts +2 -0
- package/dist/vanilla/core/theme/index.d.ts +1 -0
- package/dist/vanilla/core/theme/responsive.d.ts +15 -0
- package/dist/vanilla/core/theme/types.d.ts +8 -0
- package/dist/vanilla/enquiry-widget.js +374 -53
- package/dist/vanilla/index.d.ts +3 -1
- package/dist/vanilla/react/ThemeProvider.d.ts +2 -1
- package/dist/vanilla/react/index.d.ts +2 -1
- package/dist/vanilla/services/AppointmentService.d.ts +80 -2
- package/dist/vanilla/services/WorkspaceService.d.ts +58 -3
- package/dist/vanilla/vanilla/AppointmentCalendarWidget.d.ts +9 -7
- package/dist/vanilla/vanilla/EnquiryFormWidget.d.ts +1 -0
- package/dist/vanilla/vanilla/components/VanillaIcons.d.ts +5 -0
- package/dist/vanilla/vanilla/components/VanillaSelect.d.ts +3 -0
- package/dist/vanilla/widget.css +833 -207
- package/dist/vanilla/widget.js +6463 -5687
- package/package.json +1 -1
|
@@ -10,8 +10,9 @@ export interface MedosThemeProviderProps {
|
|
|
10
10
|
children: React.ReactNode;
|
|
11
11
|
theme?: ThemeName | MedosTheme | PartialTheme;
|
|
12
12
|
cssVariablePrefix?: string;
|
|
13
|
+
onThemeError?: (error: Error) => void;
|
|
13
14
|
}
|
|
14
|
-
export declare function MedosThemeProvider({ children, theme, cssVariablePrefix, }: MedosThemeProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function MedosThemeProvider({ children, theme, cssVariablePrefix, onThemeError, }: Readonly<MedosThemeProviderProps>): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export declare function useThemeContext(): ThemeContextValue;
|
|
16
17
|
export declare function useTheme(): MedosTheme;
|
|
17
18
|
export declare function useCssVar(category: string, key: string, fallback?: string): string;
|
|
@@ -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";
|
|
@@ -11,6 +11,7 @@ export type Slot = {
|
|
|
11
11
|
[key: string]: any;
|
|
12
12
|
};
|
|
13
13
|
type PatientPayload = {
|
|
14
|
+
id?: number;
|
|
14
15
|
firstName: string;
|
|
15
16
|
lastName: string;
|
|
16
17
|
email?: string;
|
|
@@ -18,6 +19,8 @@ type PatientPayload = {
|
|
|
18
19
|
phoneNumber: string;
|
|
19
20
|
age?: number;
|
|
20
21
|
gender?: "MALE" | "FEMALE" | "OTHER";
|
|
22
|
+
dob?: string;
|
|
23
|
+
bloodGroup?: string;
|
|
21
24
|
};
|
|
22
25
|
type PatientAddressPayload = {
|
|
23
26
|
addressLine1: string;
|
|
@@ -26,6 +29,11 @@ type PatientAddressPayload = {
|
|
|
26
29
|
country: string;
|
|
27
30
|
zipcode: string;
|
|
28
31
|
landmark?: string;
|
|
32
|
+
addressLine2?: string;
|
|
33
|
+
completeAddress?: string;
|
|
34
|
+
countryCode?: string;
|
|
35
|
+
phoneNumber?: string;
|
|
36
|
+
patientId?: number;
|
|
29
37
|
};
|
|
30
38
|
type BookAppointmentPayload = {
|
|
31
39
|
workspaceId?: string | number;
|
|
@@ -35,13 +43,79 @@ type BookAppointmentPayload = {
|
|
|
35
43
|
appointmentDate: string;
|
|
36
44
|
fromDateTimeTs: string;
|
|
37
45
|
toDateTimeTs: string;
|
|
38
|
-
consultationCharge?: string;
|
|
46
|
+
consultationCharge?: string | number;
|
|
39
47
|
type?: "CONSULTATION" | string;
|
|
40
48
|
source?: string;
|
|
49
|
+
bookingType?: "PACKAGE_PURCHASE" | "ONE_TIME_APPOINTMENT" | "USE_ACTIVE_PACKAGE";
|
|
50
|
+
paymentMode?: "CASH" | "CARD" | string;
|
|
51
|
+
packageConfigId?: number;
|
|
52
|
+
patientPackageId?: number;
|
|
53
|
+
packageAmount?: number;
|
|
41
54
|
patientPayload: PatientPayload;
|
|
42
55
|
patientAddress: PatientAddressPayload;
|
|
43
56
|
attachments?: File[];
|
|
44
57
|
};
|
|
58
|
+
export type UnifiedBookAppointmentPayload = {
|
|
59
|
+
workspaceId: number;
|
|
60
|
+
workspaceAddressId: number;
|
|
61
|
+
doctorId: number;
|
|
62
|
+
mode: "ONLINE" | "OFFLINE";
|
|
63
|
+
appointmentDate: string;
|
|
64
|
+
fromDateTimeTs: string;
|
|
65
|
+
toDateTimeTs: string;
|
|
66
|
+
bookingType: "PACKAGE_PURCHASE" | "ONE_TIME_APPOINTMENT" | "USE_ACTIVE_PACKAGE";
|
|
67
|
+
consultationCharge: number;
|
|
68
|
+
packageConfigId?: number;
|
|
69
|
+
patientPackageId?: number;
|
|
70
|
+
packageAmount?: number;
|
|
71
|
+
paymentMode: "CASH" | "CARD" | string;
|
|
72
|
+
type: "CONSULTATION" | string;
|
|
73
|
+
source: string;
|
|
74
|
+
patientPayload: {
|
|
75
|
+
id?: number;
|
|
76
|
+
firstName: string;
|
|
77
|
+
lastName: string;
|
|
78
|
+
email: string;
|
|
79
|
+
countryCode: string;
|
|
80
|
+
phoneNumber: string;
|
|
81
|
+
dob: string;
|
|
82
|
+
age: number;
|
|
83
|
+
gender: "MALE" | "FEMALE" | "OTHER";
|
|
84
|
+
bloodGroup: string;
|
|
85
|
+
};
|
|
86
|
+
patientAddress: {
|
|
87
|
+
completeAddress: string;
|
|
88
|
+
addressLine1: string;
|
|
89
|
+
addressLine2?: string;
|
|
90
|
+
city: string;
|
|
91
|
+
state: string;
|
|
92
|
+
country: string;
|
|
93
|
+
zipcode: string;
|
|
94
|
+
landmark?: string;
|
|
95
|
+
countryCode: string;
|
|
96
|
+
phoneNumber: string;
|
|
97
|
+
patientId: number;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
export type AppointmentResponse = {
|
|
101
|
+
id: number;
|
|
102
|
+
patientName: string;
|
|
103
|
+
patientEmail: string;
|
|
104
|
+
patientPhone: string;
|
|
105
|
+
doctorId: number;
|
|
106
|
+
addressId: number;
|
|
107
|
+
appointmentDate: string;
|
|
108
|
+
startTime: string;
|
|
109
|
+
endTime: string;
|
|
110
|
+
status: string;
|
|
111
|
+
consultationCharge: number;
|
|
112
|
+
paymentMode: string;
|
|
113
|
+
type: string;
|
|
114
|
+
mode: string;
|
|
115
|
+
notes?: string;
|
|
116
|
+
createdAt: string;
|
|
117
|
+
[key: string]: any;
|
|
118
|
+
};
|
|
45
119
|
type AppointmentPayload = {
|
|
46
120
|
workspaceId?: string | number;
|
|
47
121
|
workspaceAddressId: string | number;
|
|
@@ -78,8 +152,12 @@ type AddressesResponse = {
|
|
|
78
152
|
addresses: AddressItem[];
|
|
79
153
|
};
|
|
80
154
|
declare const AppointmentService: {
|
|
155
|
+
arePackagesConfigured(): Promise<boolean>;
|
|
81
156
|
getAddresses(): Promise<AddressesResponse>;
|
|
82
157
|
fetchSlots(workspaceId: number, addressId: number, doctorId: number, appointmentDate: string): Promise<Slot[]>;
|
|
83
|
-
|
|
158
|
+
transformToUnifiedPayload(payload: BookAppointmentPayload): UnifiedBookAppointmentPayload;
|
|
159
|
+
createLegacyAppointment(payload: BookAppointmentPayload): Promise<AppointmentResponse>;
|
|
160
|
+
createAppointment(payload: BookAppointmentPayload): Promise<AppointmentResponse>;
|
|
161
|
+
createUnifiedAppointment(payload: BookAppointmentPayload): Promise<AppointmentResponse>;
|
|
84
162
|
};
|
|
85
163
|
export { AppointmentService, AppointmentPayload, BookAppointmentPayload, PatientPayload, PatientAddressPayload, AddressesResponse, AddressItem, };
|
|
@@ -1,9 +1,64 @@
|
|
|
1
|
-
|
|
1
|
+
import { ThemeName } from "../core/theme/themes";
|
|
2
|
+
interface Address {
|
|
3
|
+
id: number;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
deleted: boolean;
|
|
6
|
+
createdAtEpoch: number;
|
|
7
|
+
completeAddress: string;
|
|
8
|
+
addressLine1: string;
|
|
9
|
+
addressLine2: string;
|
|
10
|
+
city: string;
|
|
11
|
+
state: string;
|
|
12
|
+
country: string;
|
|
13
|
+
zipcode: string;
|
|
14
|
+
landmark: string;
|
|
15
|
+
phoneNumber: string;
|
|
16
|
+
latitude: number;
|
|
17
|
+
longitude: number;
|
|
18
|
+
userId: number;
|
|
19
|
+
}
|
|
20
|
+
interface ConsultationType {
|
|
21
|
+
fee: number;
|
|
22
|
+
currency: string;
|
|
23
|
+
type: string;
|
|
24
|
+
}
|
|
25
|
+
interface User {
|
|
2
26
|
id: number;
|
|
3
|
-
|
|
27
|
+
createdAt: string;
|
|
28
|
+
lastUpdatedAt: string;
|
|
29
|
+
deleted: boolean;
|
|
30
|
+
createdAtEpoch: number;
|
|
31
|
+
lastUpdatedAtEpoch: number;
|
|
32
|
+
firstName: string;
|
|
33
|
+
lastName: string;
|
|
34
|
+
email: string;
|
|
35
|
+
gender: string;
|
|
36
|
+
countryCode: string;
|
|
37
|
+
phoneNumber: string;
|
|
38
|
+
platform: string;
|
|
39
|
+
isKycCompleted: boolean;
|
|
40
|
+
}
|
|
41
|
+
interface Doctor {
|
|
42
|
+
consultationTypes: ConsultationType[];
|
|
43
|
+
user: User;
|
|
44
|
+
}
|
|
45
|
+
interface AddressDoctor {
|
|
46
|
+
address: Address;
|
|
47
|
+
doctors: Doctor[];
|
|
48
|
+
doctorCount: number;
|
|
49
|
+
}
|
|
50
|
+
interface WorkspaceResponse {
|
|
51
|
+
totalDoctors: number;
|
|
52
|
+
totalAddresses: number;
|
|
53
|
+
addressDoctors: AddressDoctor[];
|
|
54
|
+
workspaceId: number;
|
|
55
|
+
theme?: ThemeName;
|
|
56
|
+
arePackagesConfigured?: boolean;
|
|
4
57
|
[key: string]: any;
|
|
5
58
|
}
|
|
6
59
|
declare const WorkspaceService: {
|
|
7
60
|
fetchWorkspace(): Promise<WorkspaceResponse>;
|
|
61
|
+
fetchTheme(): Promise<ThemeName | undefined>;
|
|
8
62
|
};
|
|
9
|
-
export { WorkspaceService
|
|
63
|
+
export { WorkspaceService };
|
|
64
|
+
export type { WorkspaceResponse, Address, ConsultationType, User, Doctor, AddressDoctor, };
|
|
@@ -35,17 +35,19 @@ declare class AppointmentCalendarWidget {
|
|
|
35
35
|
private render;
|
|
36
36
|
private initializeCustomComponents;
|
|
37
37
|
private renderStep;
|
|
38
|
-
private
|
|
39
|
-
private
|
|
40
|
-
private
|
|
41
|
-
private
|
|
42
|
-
private
|
|
43
|
-
private
|
|
38
|
+
private renderPhoneVerificationStep;
|
|
39
|
+
private renderBookingOptionStep;
|
|
40
|
+
private renderPackageExplorerStep;
|
|
41
|
+
private renderLocationDoctorStep;
|
|
42
|
+
private renderNewAppointmentStep;
|
|
43
|
+
private renderPatientSelectionStep;
|
|
44
|
+
private renderAppointmentSummaryStep;
|
|
45
|
+
private renderSuccessStep;
|
|
44
46
|
private formatDate;
|
|
45
47
|
private formatTime;
|
|
46
48
|
private calculateDuration;
|
|
47
|
-
private renderStep5;
|
|
48
49
|
private attachEventListeners;
|
|
50
|
+
private getPlaceholderPatients;
|
|
49
51
|
private escapeHtml;
|
|
50
52
|
destroy(): void;
|
|
51
53
|
}
|
|
@@ -13,6 +13,7 @@ declare class EnquiryFormWidget {
|
|
|
13
13
|
private mounted;
|
|
14
14
|
private state;
|
|
15
15
|
private countryCodeSelect;
|
|
16
|
+
private contactMethodSelect;
|
|
16
17
|
constructor(container: HTMLElement | string, options: EnquiryFormWidgetOptions);
|
|
17
18
|
private init;
|
|
18
19
|
private validateContactStep;
|
|
@@ -12,6 +12,11 @@ export declare const VanillaIcons: {
|
|
|
12
12
|
phone: (size?: number) => string;
|
|
13
13
|
mail: (size?: number) => string;
|
|
14
14
|
clock: (size?: number) => string;
|
|
15
|
+
calendar: (size?: number) => string;
|
|
16
|
+
giftBox: (size?: number) => string;
|
|
17
|
+
arrowLeft: (size?: number) => string;
|
|
18
|
+
users: (size?: number) => string;
|
|
19
|
+
plus: (size?: number) => string;
|
|
15
20
|
medosLogo: (width?: number, height?: number) => string;
|
|
16
21
|
};
|
|
17
22
|
export default VanillaIcons;
|
|
@@ -33,6 +33,8 @@ export declare class VanillaSelect {
|
|
|
33
33
|
private attachPortalEvents;
|
|
34
34
|
private detachPortalEvents;
|
|
35
35
|
private focusNextItem;
|
|
36
|
+
private focusFirstItem;
|
|
37
|
+
private focusLastItem;
|
|
36
38
|
private selectValue;
|
|
37
39
|
setValue(value: string): void;
|
|
38
40
|
getValue(): string;
|
|
@@ -42,5 +44,6 @@ export declare class VanillaSelect {
|
|
|
42
44
|
destroy(): void;
|
|
43
45
|
private escapeHtml;
|
|
44
46
|
}
|
|
47
|
+
export declare function createContactMethodSelect(container: HTMLElement | string, currentValue?: "PHONE" | "EMAIL" | "BOTH", onValueChange?: (value: "PHONE" | "EMAIL" | "BOTH") => void): VanillaSelect;
|
|
45
48
|
export declare function upgradeNativeSelect(selectElement: HTMLSelectElement, config?: VanillaSelectOptions): VanillaSelect;
|
|
46
49
|
export default VanillaSelect;
|