@jescon-technologies/react-native-ui-kit 0.0.4 → 0.0.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/index.d.ts +66 -0
- package/index.js +3 -7
- package/package.json +3 -2
- package/src/Alerts/AAlert.js +4 -4
- package/src/Alerts/AAlertIOS.js +3 -3
- package/src/{common → Common}/NetworkServiceCall.js +1 -1
- package/src/CommonStyle/CommonTheme.js +11 -0
- package/src/CommonStyle/ComponentFunctions.js +632 -0
- package/src/CommonStyle/PopupStyle.js +146 -0
- package/src/CommonStyle/commonStyle.js +93 -0
- package/src/CommonStyle/componentStyle.js +545 -0
- package/src/CommonStyle/optionListStyles.js +175 -0
- package/src/Components/ByProductPage.js +200 -0
- package/src/Components/CDropDownListNew.js +153 -0
- package/src/Components/CSupplierList.js +88 -0
- package/src/Components/CVerificationCard.js +2822 -0
- package/src/Components/CustomButton.js +67 -0
- package/src/Components/CustomCard.js +127 -0
- package/src/Components/CustomTextInput.js +47 -0
- package/src/Components/EquipmentPage.js +313 -0
- package/src/Components/FilterInput.Copy.js +723 -0
- package/src/Components/FilterInput.js +569 -0
- package/src/Components/HSubHeading.js +68 -0
- package/src/Components/HeaderCard.js +40 -0
- package/src/Components/MoreOptionsScreen.js +251 -0
- package/src/Components/NonSwipableProductCard.js +226 -0
- package/src/Components/NonSwipableSupplierCard.js +348 -0
- package/src/Components/ProductCard.js +1336 -0
- package/src/Components/QualityProductCard.js +1059 -0
- package/src/Components/RateProductCard.js +1452 -0
- package/src/Components/RawMaterial.js +261 -0
- package/src/Components/SDropDownEdited.js +549 -0
- package/src/Components/SDropDownNew.js +529 -0
- package/src/Components/SHelpDescription.js +147 -0
- package/src/Components/STextInputNew.js +510 -0
- package/src/Components/SearchProductCard.js +470 -0
- package/src/Components/StageByProduct.js +199 -0
- package/src/Components/SupplierCard.js +243 -0
- package/src/Components/SupplierInvoiceCard.js +405 -0
- package/src/Components/SwipableSupplierCard.js +136 -0
- package/src/Components/TagTemplate.js +74 -0
- package/src/Components/WrappedComponent.js +25 -0
- package/src/Custom/CBooking.js +944 -0
- package/src/Custom/CBookingPostpone.js +1822 -0
- package/src/Custom/CCalendar.js +560 -0
- package/src/Custom/CCard.js +880 -0
- package/src/Custom/CDetailCard.js +205 -0
- package/src/Custom/CHelpImage.js +52 -0
- package/src/Custom/CReport.js +569 -0
- package/src/Custom/CScrollView.js +73 -0
- package/src/Custom/CSignature.js +112 -0
- package/src/Custom/CSliderMenu.js +339 -0
- package/src/Custom/CSupplierCard.js +99 -0
- package/src/Custom/CTemplateCard.js +438 -0
- package/src/Custom/CTokenAllocation.js +1402 -0
- package/src/Custom/CTokenListOverlay.js +122 -0
- package/src/Custom/CWardStatus.js +444 -0
- package/src/Custom/Charts/CBarChart.js +218 -0
- package/src/Custom/Charts/CDashBoardList.js +133 -0
- package/src/Custom/Charts/CDashBoardTable.js +172 -0
- package/src/Custom/Charts/CLineChart.js +193 -0
- package/src/Custom/Charts/CPieChart.js +186 -0
- package/src/Custom/Loader.js +182 -0
- package/src/Custom/OUserView.js +1121 -0
- package/src/Custom/PreviewDosage.js +115 -0
- package/src/Custom/SearchLoader.js +32 -0
- package/src/Custom/TableComponent/CActivityTable.js +707 -0
- package/src/Custom/TableComponent/CMoreButtonTable.js +197 -0
- package/src/Custom/TableComponent/CTable.js +185 -0
- package/src/Custom/TableComponent/CTextBody.js +40 -0
- package/src/Custom/TableComponent/CTextHeader.js +17 -0
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +1011 -0
- package/src/Custom/TableComponent/SDropdownTable.js +491 -0
- package/src/Custom/TableComponent/TagTable.js +1200 -0
- package/src/CustomComponents/CAddColumn.js +140 -0
- package/src/CustomComponents/CAssessmentDelete.js +307 -0
- package/src/CustomComponents/CAwesomeButton.js +83 -0
- package/src/CustomComponents/CAwesomeMoreButton.js +54 -0
- package/src/CustomComponents/CBackHandler.js +273 -0
- package/src/CustomComponents/CCalendar.js +243 -0
- package/src/CustomComponents/CCommentOverlay.js +202 -0
- package/src/CustomComponents/CComments.js +162 -0
- package/src/CustomComponents/CContainerView.js +24 -0
- package/src/CustomComponents/CCustomTextInput.js +336 -0
- package/src/CustomComponents/CDetailView.js +40 -0
- package/src/CustomComponents/CDropDownList.js +153 -0
- package/src/CustomComponents/CDropdownSelect.js +555 -0
- package/src/CustomComponents/CFooterView.js +42 -0
- package/src/CustomComponents/CImagePickerSave.js +316 -0
- package/src/CustomComponents/CModalOverlay.js +91 -0
- package/src/CustomComponents/CNetworkStatus.js +327 -0
- package/src/CustomComponents/CNotesInstructions.js +1000 -0
- package/src/CustomComponents/COverlay.js +81 -0
- package/src/CustomComponents/CRemarks.js +176 -0
- package/src/CustomComponents/CRowAdd.js +143 -0
- package/src/CustomComponents/CSummaryDropDown.js +327 -0
- package/src/CustomComponents/CText.js +9 -0
- package/src/CustomComponents/CVectorIcon.js +34 -0
- package/src/CustomComponents/HtmlContentViewer.js +65 -0
- package/src/CustomComponents/PdfContentViewer.js +90 -0
- package/src/CustomComponents/SDropDownDosage.js +1087 -0
- package/src/CustomComponents/SwipableProductCard.js +246 -0
- package/src/CustomComponents/SwipableProductImageCard.js +254 -0
- package/src/CustomComponents/WorkOrderDetails.js +1216 -0
- package/src/CustomComponents/WorkOrderDetailsPage.js +1213 -0
- package/src/HOC/ConfirmOverlay.js +2 -2
- package/src/HOC/HMoreButton.js +1 -1
- package/src/HOC/HNatureHeading.js +1 -1
- package/src/HOC/HShadowButton.js +1 -1
- package/src/HOC/HShadowCountButton.js +1 -1
- package/src/Json/Chart.json +818 -0
- package/src/Json/Consultation.json +622 -0
- package/src/Json/CreditBill.json +490 -0
- package/src/Json/Dropdown.json +216 -0
- package/src/Json/DropdownConsultation.json +228 -0
- package/src/Json/DynamicReports.json +623 -0
- package/src/Json/Footer.json +79 -0
- package/src/Media/AudioScreen.js +2 -7
- package/src/Media/CCaptureImageWithoutEdit.js +1 -1
- package/src/Media/CImageGallery.js +2 -2
- package/src/Media/CSingleImage.js +2 -2
- package/src/Media/CVideoPlay.js +1 -1
- package/src/Media/DocumentScreen.js +2 -7
- package/src/Media/DrawingScreen.js +2 -6
- package/src/Media/ImageScreen.js +2 -6
- package/src/Media/RecordAudio.js +1 -1
- package/src/Media/VideoScreen.js +2 -7
- package/src/Navigation/PageNavigation.js +224 -0
- package/src/Navigation/useFocusEffect.js +2 -0
- package/src/Navigation/useFocusEffect.native.js +1 -0
- package/src/Navigation/useFocusEffect.web.js +1 -0
- package/src/Navigation/useIsFocused.js +1 -0
- package/src/Navigation/useIsFocused.native.js +1 -0
- package/src/Navigation/useIsFocused.web.js +1 -0
- package/src/Navigation/useNavigation.js +2 -0
- package/src/Navigation/useNavigation.native.js +1 -0
- package/src/Navigation/useNavigation.web.js +1 -0
- package/src/Screens/CMedications.js +528 -0
- package/src/Screens/CWebViewGallery.js +203 -0
- package/src/Screens/ChartScan.js +279 -0
- package/src/Screens/ChartScreenNew.js +1579 -0
- package/src/Screens/Consultation.js +1500 -0
- package/src/Screens/Dashboard.js +778 -0
- package/src/Screens/FileExplorer.js +288 -0
- package/src/Screens/Footer.js +340 -0
- package/src/Screens/ForgotPassword.js +288 -0
- package/src/Screens/HeaderBlock.js +353 -0
- package/src/Screens/Login.js +328 -0
- package/src/Screens/Notification.js +149 -0
- package/src/Screens/OcrScreen.js +20 -0
- package/src/Screens/PdfPreview.js +507 -0
- package/src/Screens/RegistrationDetails.js +467 -0
- package/src/Screens/SearchScreen.js +582 -0
- package/src/Screens/Splash.js +788 -0
- package/src/Screens/SwipeLeftView.js +1867 -0
- package/src/StaticComponents/SDatePickerLabel.js +1 -1
- package/src/StaticComponents/SDatePickerNew.js +1 -1
- package/src/StaticComponents/SDateTimePickerNew.js +2 -2
- package/src/StaticComponents/SDropDownGenerate.js +3 -3
- package/src/StaticComponents/SDropDownHoc.js +4 -4
- package/src/StaticComponents/SDropDownIcon.js +1 -1
- package/src/StaticComponents/SMenuBox.js +2 -2
- package/src/StaticComponents/SSearch.js +2 -2
- package/src/StaticComponents/STextInput.js +1 -1
- package/src/StaticComponents/STimePicker.js +1 -1
- package/src/StaticComponents/STimingDropDownNew.js +2 -6
- package/src/StaticComponents/STimingSwitch.js +1 -1
- package/src/layout/CContainerView.js +1 -1
- package/src/layout/CDetailView.js +3 -3
- package/src/layout/HeaderBlock.js +5 -5
- package/src/layout/INVLoginLayout.js +3 -4
- package/src/layout/Loader.js +2 -2
- package/src/HOC/HAbsolute.js +0 -56
- package/src/HOC/HDiscontinue.js +0 -105
- package/src/HOC/HOverlay.js +0 -99
- package/src/layout/FooterBlock.js +0 -821
- /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
- /package/src/{common → Common}/Icons.js +0 -0
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Dimensions,
|
|
5
|
+
Text,
|
|
6
|
+
TouchableOpacity,
|
|
7
|
+
StyleSheet,
|
|
8
|
+
TextInput,
|
|
9
|
+
Platform,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
12
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
13
|
+
import Svg, { Rect, Defs, LinearGradient, Stop } from 'react-native-svg';
|
|
14
|
+
import HOCIcons from '../HOC/HOCIcons';
|
|
15
|
+
import CModalOverlay from './CModalOverlay';
|
|
16
|
+
|
|
17
|
+
export default function CBackHandler(props) {
|
|
18
|
+
const [overlay, setOverlay] = useState(true);
|
|
19
|
+
const [text, onChangeText] = useState('');
|
|
20
|
+
const [data] = useState(props.data);
|
|
21
|
+
|
|
22
|
+
const getPopupContainerStyle = () =>
|
|
23
|
+
Platform.OS === 'ios'
|
|
24
|
+
? { ...styles.overlayStyle, top: normalize(60) }
|
|
25
|
+
: { ...styles.overlayStyle, bottom: 0 };
|
|
26
|
+
|
|
27
|
+
const getTextKey = key => {
|
|
28
|
+
switch (key) {
|
|
29
|
+
case 1:
|
|
30
|
+
return 'Please enter installation key to continue.';
|
|
31
|
+
case 2:
|
|
32
|
+
return 'Please make sure data saved before verify, Are you sure you want to verify ?';
|
|
33
|
+
case 3:
|
|
34
|
+
return 'Do you want share consent form?';
|
|
35
|
+
case 4:
|
|
36
|
+
return 'Do you want to delete?';
|
|
37
|
+
case 5:
|
|
38
|
+
return 'Hold On, Are you sure you want to exit without save ?';
|
|
39
|
+
case 6:
|
|
40
|
+
return 'Hold on, Are you sure you want to log out ?';
|
|
41
|
+
case 7:
|
|
42
|
+
case 8:
|
|
43
|
+
return props.displaytext;
|
|
44
|
+
default:
|
|
45
|
+
return 'Do you want to exit ?';
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const getObject = key => {
|
|
50
|
+
switch (key) {
|
|
51
|
+
case 1:
|
|
52
|
+
return {
|
|
53
|
+
iconname: 'lock',
|
|
54
|
+
button1: 'CANCEL',
|
|
55
|
+
button2: 'CONFIRM',
|
|
56
|
+
heading: 'INSTALLATION KEY',
|
|
57
|
+
};
|
|
58
|
+
case 2:
|
|
59
|
+
return {
|
|
60
|
+
iconname: 'save',
|
|
61
|
+
button1: 'No',
|
|
62
|
+
button2: 'VERIFY',
|
|
63
|
+
heading: 'VERIFICATION',
|
|
64
|
+
};
|
|
65
|
+
case 3:
|
|
66
|
+
return {
|
|
67
|
+
iconname: 'file-invoice',
|
|
68
|
+
button1: 'No',
|
|
69
|
+
button2: 'Yes',
|
|
70
|
+
heading: 'DELETION',
|
|
71
|
+
};
|
|
72
|
+
case 4:
|
|
73
|
+
return {
|
|
74
|
+
iconname: 'trash',
|
|
75
|
+
button1: 'No',
|
|
76
|
+
button2: 'Yes',
|
|
77
|
+
heading: 'DELETION',
|
|
78
|
+
};
|
|
79
|
+
case 5:
|
|
80
|
+
return {
|
|
81
|
+
iconname: 'exclamation-triangle',
|
|
82
|
+
button1: 'No',
|
|
83
|
+
button2: 'Yes',
|
|
84
|
+
heading: 'EXIT WITHOUT SAVE ?',
|
|
85
|
+
};
|
|
86
|
+
case 6:
|
|
87
|
+
return {
|
|
88
|
+
iconname: 'exclamation-triangle',
|
|
89
|
+
button1: 'No',
|
|
90
|
+
button2: 'Yes',
|
|
91
|
+
heading: 'LOG OUT',
|
|
92
|
+
};
|
|
93
|
+
case 7:
|
|
94
|
+
return {
|
|
95
|
+
iconname: 'exclamation-triangle',
|
|
96
|
+
button1: 'No',
|
|
97
|
+
button2: 'Yes',
|
|
98
|
+
heading: 'SWITCH SCREEN WITHOUT SAVE ?',
|
|
99
|
+
};
|
|
100
|
+
case 8:
|
|
101
|
+
return (
|
|
102
|
+
props.displaybuttons || {
|
|
103
|
+
iconname: 'exclamation-triangle',
|
|
104
|
+
button1: 'No',
|
|
105
|
+
button2: 'Yes',
|
|
106
|
+
heading: 'CONFIRMATION',
|
|
107
|
+
}
|
|
108
|
+
);
|
|
109
|
+
default:
|
|
110
|
+
return {
|
|
111
|
+
iconname: 'exclamation-triangle',
|
|
112
|
+
button1: 'No',
|
|
113
|
+
button2: 'Yes',
|
|
114
|
+
heading: 'CONFIRMATION',
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const getClose = () => {
|
|
120
|
+
setOverlay(false);
|
|
121
|
+
props.close?.(false);
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const config = getObject(props.type);
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
<CModalOverlay
|
|
128
|
+
visible={overlay}
|
|
129
|
+
onClose={getClose}
|
|
130
|
+
closeOnTouchOutside
|
|
131
|
+
containerStyle={styles.container}
|
|
132
|
+
childrenWrapperStyle={getPopupContainerStyle()}>
|
|
133
|
+
<View style={styles.wrapper}>
|
|
134
|
+
{/* Icon + Message */}
|
|
135
|
+
<View style={styles.content}>
|
|
136
|
+
<HOCIcons.Icons
|
|
137
|
+
icongroup={props.type === 6 ? 8 : 5}
|
|
138
|
+
name={props.type === 6 ? 'log-out-outline' : config.iconname}
|
|
139
|
+
size={normalize(70)}
|
|
140
|
+
color="#7575ed"
|
|
141
|
+
style={styles.icon}
|
|
142
|
+
/>
|
|
143
|
+
<Text numberOfLines={3} style={styles.message}>
|
|
144
|
+
{getTextKey(props.type)}
|
|
145
|
+
</Text>
|
|
146
|
+
</View>
|
|
147
|
+
|
|
148
|
+
{/* Input (only for type 1) */}
|
|
149
|
+
{props.type === 1 && (
|
|
150
|
+
<TextInput
|
|
151
|
+
style={styles.input}
|
|
152
|
+
placeholder="Enter key"
|
|
153
|
+
keyboardType="default"
|
|
154
|
+
onChangeText={onChangeText}
|
|
155
|
+
value={text}
|
|
156
|
+
/>
|
|
157
|
+
)}
|
|
158
|
+
|
|
159
|
+
{/* Buttons */}
|
|
160
|
+
<View style={styles.buttonRow}>
|
|
161
|
+
<TouchableOpacity onPress={getClose} style={styles.cancelButton}>
|
|
162
|
+
<Text style={styles.cancelButtonText}>{config.button1}</Text>
|
|
163
|
+
</TouchableOpacity>
|
|
164
|
+
|
|
165
|
+
<TouchableOpacity
|
|
166
|
+
onPress={() => props.callBack(text)}
|
|
167
|
+
style={styles.confirmButton}>
|
|
168
|
+
<Svg>
|
|
169
|
+
<Defs>
|
|
170
|
+
<LinearGradient id="grad" x1="0" y1="0" x2="1" y2="0">
|
|
171
|
+
<Stop offset="0" stopColor="#2f3ec1" stopOpacity="1" />
|
|
172
|
+
<Stop
|
|
173
|
+
offset="1"
|
|
174
|
+
stopColor={Global.AppTheme.primary_color}
|
|
175
|
+
stopOpacity="1"
|
|
176
|
+
/>
|
|
177
|
+
</LinearGradient>
|
|
178
|
+
</Defs>
|
|
179
|
+
<Rect
|
|
180
|
+
x="0"
|
|
181
|
+
y="0"
|
|
182
|
+
width="100%"
|
|
183
|
+
height={normalize(35)}
|
|
184
|
+
fill="url(#grad)"
|
|
185
|
+
rx="5"
|
|
186
|
+
/>
|
|
187
|
+
</Svg>
|
|
188
|
+
<Text style={styles.confirmButtonText}>{config.button2}</Text>
|
|
189
|
+
</TouchableOpacity>
|
|
190
|
+
</View>
|
|
191
|
+
</View>
|
|
192
|
+
</CModalOverlay>
|
|
193
|
+
);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
const styles = StyleSheet.create({
|
|
197
|
+
container: {
|
|
198
|
+
width: '100%',
|
|
199
|
+
backgroundColor: 'rgba(97, 97, 97, 0)',
|
|
200
|
+
},
|
|
201
|
+
overlayStyle: {
|
|
202
|
+
position: 'absolute',
|
|
203
|
+
width: Dimensions.get('window').width,
|
|
204
|
+
height: Dimensions.get('window').height * 0.3,
|
|
205
|
+
borderTopLeftRadius: 15,
|
|
206
|
+
borderTopRightRadius: 15,
|
|
207
|
+
borderWidth: 2,
|
|
208
|
+
borderColor: 'darkblue',
|
|
209
|
+
},
|
|
210
|
+
wrapper: {
|
|
211
|
+
marginTop: normalize(-10),
|
|
212
|
+
width: Dimensions.get('window').width - 10,
|
|
213
|
+
flex: 1,
|
|
214
|
+
borderRadius: normalize(17),
|
|
215
|
+
},
|
|
216
|
+
content: {
|
|
217
|
+
alignItems: 'center',
|
|
218
|
+
flex: 1,
|
|
219
|
+
},
|
|
220
|
+
icon: {
|
|
221
|
+
textAlign: 'center',
|
|
222
|
+
marginVertical: normalize(10),
|
|
223
|
+
opacity: 0.6,
|
|
224
|
+
},
|
|
225
|
+
message: {
|
|
226
|
+
color: 'black',
|
|
227
|
+
fontSize: normalize(14),
|
|
228
|
+
fontWeight: '400',
|
|
229
|
+
textAlign: 'center',
|
|
230
|
+
},
|
|
231
|
+
input: {
|
|
232
|
+
height: normalize(30),
|
|
233
|
+
padding: 5,
|
|
234
|
+
fontWeight: 'bold',
|
|
235
|
+
width: normalize(190),
|
|
236
|
+
alignSelf: 'center',
|
|
237
|
+
textAlign: 'center',
|
|
238
|
+
borderBottomColor: Global.AppTheme.primary_color,
|
|
239
|
+
borderBottomWidth: 3,
|
|
240
|
+
fontSize: normalize(14),
|
|
241
|
+
color: 'black',
|
|
242
|
+
},
|
|
243
|
+
buttonRow: {
|
|
244
|
+
flexDirection: 'row',
|
|
245
|
+
width: '100%',
|
|
246
|
+
justifyContent: 'space-evenly',
|
|
247
|
+
},
|
|
248
|
+
cancelButton: {
|
|
249
|
+
backgroundColor: '#d2d2d2',
|
|
250
|
+
borderRadius: 5,
|
|
251
|
+
width: '47%',
|
|
252
|
+
justifyContent: 'center',
|
|
253
|
+
alignItems: 'center',
|
|
254
|
+
height: normalize(35),
|
|
255
|
+
marginVertical: normalize(10),
|
|
256
|
+
},
|
|
257
|
+
cancelButtonText: {
|
|
258
|
+
fontSize: normalize(12),
|
|
259
|
+
color: 'black',
|
|
260
|
+
},
|
|
261
|
+
confirmButton: {
|
|
262
|
+
width: '47%',
|
|
263
|
+
justifyContent: 'center',
|
|
264
|
+
alignItems: 'center',
|
|
265
|
+
height: normalize(35),
|
|
266
|
+
marginVertical: normalize(10),
|
|
267
|
+
},
|
|
268
|
+
confirmButtonText: {
|
|
269
|
+
fontSize: normalize(12),
|
|
270
|
+
color: '#fff',
|
|
271
|
+
position: 'absolute',
|
|
272
|
+
},
|
|
273
|
+
});
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { Text, View, FlatList, TouchableOpacity, Dimensions, ActivityIndicator } from 'react-native';
|
|
3
|
+
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
|
|
4
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
5
|
+
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
6
|
+
import { notifyMessage } from '../CommonStyle/ComponentFunctions';
|
|
7
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
8
|
+
import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
|
|
9
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
10
|
+
|
|
11
|
+
const CCalendar = () => {
|
|
12
|
+
const { width, height } = Dimensions.get('screen');
|
|
13
|
+
const flatlistRef = useRef();
|
|
14
|
+
const dividedWidth = width / 7;
|
|
15
|
+
const [data, setData] = useState();
|
|
16
|
+
const [refresh, setRefresh] = useState(0);
|
|
17
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
18
|
+
const [showTable, setShowTable] = useState(false);
|
|
19
|
+
const [PichartVisibility, setPiechartVisibility] = useState(false);
|
|
20
|
+
const [footerData, setFooterData] = useState();
|
|
21
|
+
const formatedPieChart = [];
|
|
22
|
+
const formatedPieDisplayText = [];
|
|
23
|
+
const formatedPieColor = [];
|
|
24
|
+
|
|
25
|
+
const SumwithoutFS = [];
|
|
26
|
+
var PiechartSecondWOFV = []; //totalsum - firstvisitsum
|
|
27
|
+
var monthlysumResult = []; //totalsum - monthly
|
|
28
|
+
var monthlyColorCode = [];
|
|
29
|
+
|
|
30
|
+
const [monthTotal, setmonthTotal] = useState();
|
|
31
|
+
const [totalMonthChart, settotalMonthChart] = useState([]);
|
|
32
|
+
const [ColorCode, setColorCode] = useState([]);
|
|
33
|
+
const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
34
|
+
const d = new Date();
|
|
35
|
+
const [monthinno, setMonthInNo] = useState(d.getMonth());
|
|
36
|
+
let monthName = months[monthinno];
|
|
37
|
+
const [year, setYear] = useState(d.getFullYear());
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
// getConsultation(Global.userData.hosuconsultant, year, monthinno)
|
|
41
|
+
getConsultation(1096, year, monthinno);
|
|
42
|
+
}, []);
|
|
43
|
+
|
|
44
|
+
function getConsultation(consultant, year, month) {
|
|
45
|
+
var monthReal = month + 1;
|
|
46
|
+
let buttonapi = APIURL + 'emr/emrcommonget/rnhococonsultationhistoryemr ' + consultant + ',' + year + ',' + monthReal;
|
|
47
|
+
|
|
48
|
+
setIsLoading(true);
|
|
49
|
+
NetworkServiceCall('get', buttonapi, '')
|
|
50
|
+
.then(function (response) {
|
|
51
|
+
if (response.httpstatus == 200 && response.data != null && response.data != undefined) {
|
|
52
|
+
setIsLoading(false);
|
|
53
|
+
setData(response.data.bookingdata);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
setIsLoading(false);
|
|
57
|
+
notifyMessage('Consultation not available,Please try again later',4);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function getApiPatientData(data) {
|
|
63
|
+
setIsLoading(true);
|
|
64
|
+
let buttonapi = APIURL + 'emr/emrcommonget/rnhococonsultationhistorypatient ' + Global.userData.hosuconsultant + ',' + JSON.stringify(data.date);
|
|
65
|
+
NetworkServiceCall('get', buttonapi, '')
|
|
66
|
+
.then(function (response) {
|
|
67
|
+
if (response.httpstatus == 200) {
|
|
68
|
+
data.patientdetails = response.data.patientdata;
|
|
69
|
+
flatlistRef.current.scrollToEnd({ animating: true });
|
|
70
|
+
setIsLoading(false);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
setIsLoading(false);
|
|
74
|
+
notifyMessage('Patient data not available',4);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function onPressPieChart() {
|
|
80
|
+
setPiechartVisibility(!PichartVisibility);
|
|
81
|
+
// flatlistRef.current.scrollToEnd({ animating: true });
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function IncrementMonth() {
|
|
85
|
+
setFooterData(null);
|
|
86
|
+
if (monthinno != 11) {
|
|
87
|
+
if (monthinno != d.getMonth()) {
|
|
88
|
+
if (monthinno < 11) {
|
|
89
|
+
setMonthInNo(monthinno + 1);
|
|
90
|
+
} else {
|
|
91
|
+
setYear(year + 1);
|
|
92
|
+
setMonthInNo(0);
|
|
93
|
+
}
|
|
94
|
+
getConsultation(Global.userData.hosuconsultant, year, monthinno + 1);
|
|
95
|
+
}
|
|
96
|
+
} else {
|
|
97
|
+
setMonthInNo(0);
|
|
98
|
+
setYear(year + 1);
|
|
99
|
+
getConsultation(Global.userData.hosuconsultant, year + 1, 0);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function DAYNAME(year, month) {
|
|
104
|
+
var date = new Date(year, month, 1);
|
|
105
|
+
var days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
|
|
106
|
+
return days[date.getDay()];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function DecrementMonth() {
|
|
110
|
+
if (monthinno != 0) {
|
|
111
|
+
setFooterData(null);
|
|
112
|
+
if (monthinno > 0) {
|
|
113
|
+
setMonthInNo(monthinno - 1);
|
|
114
|
+
} else {
|
|
115
|
+
setYear(year - 1);
|
|
116
|
+
setMonthInNo(11);
|
|
117
|
+
}
|
|
118
|
+
getConsultation(Global.userData.hosuconsultant, year, monthinno - 1);
|
|
119
|
+
} else {
|
|
120
|
+
setYear(year - 1);
|
|
121
|
+
setMonthInNo(11);
|
|
122
|
+
getConsultation(Global.userData.hosuconsultant, year - 1, 11);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
return (
|
|
127
|
+
<View style={{}}>
|
|
128
|
+
{isLoading ?
|
|
129
|
+
<ActivityIndicator size={normalize(30)} style={{ marginTop: normalize(10) }} color="#d808c3" /> : null}
|
|
130
|
+
<View style={{ backgroundColor: 'transparent' }}>
|
|
131
|
+
<View style={{ flexDirection: 'row', alignSelf: 'center', alignItems: 'center', justifyContent: 'space-between', width: '50%' }}>
|
|
132
|
+
<FontAwesome5 name="arrow-left" color="black" size={normalize(20)} onPress={() => DecrementMonth()} />
|
|
133
|
+
<Text style={{ fontSize: normalize(16), color: 'black', paddingHorizontal: 10 }}>{monthName} {year}</Text>
|
|
134
|
+
<FontAwesome5 name="arrow-right" color="black" size={normalize(20)} onPress={() => IncrementMonth()} />
|
|
135
|
+
</View>
|
|
136
|
+
</View>
|
|
137
|
+
<View style={{ flexDirection: 'row', height: normalize(20), alignItems: 'center', justifyContent: 'center' }}>
|
|
138
|
+
{['Sun', 'Mon', 'Tue', 'Wed', 'Thr', 'Fri', 'Sat'].map((week, i) => {
|
|
139
|
+
return (
|
|
140
|
+
<View key={i} style={{ width: dividedWidth, alignItems: 'center', borderWidth: 0.5 }}>
|
|
141
|
+
<Text style={{ fontSize: normalize(12), fontWeight: 'bold', color: i == 0 ? 'red' : 'black' }}>{week}</Text>
|
|
142
|
+
</View>);
|
|
143
|
+
})}
|
|
144
|
+
</View >
|
|
145
|
+
<FlatList
|
|
146
|
+
ref={flatlistRef}
|
|
147
|
+
data={data}
|
|
148
|
+
style={{ width: '100%', marginBottom: normalize(85) }}
|
|
149
|
+
renderItem={renderItem}
|
|
150
|
+
keyExtractor={(item) => item.displaytext}
|
|
151
|
+
numColumns={7}
|
|
152
|
+
ListFooterComponent={footerComponent}
|
|
153
|
+
ListFooterComponentStyle={{ width: width }}
|
|
154
|
+
/>
|
|
155
|
+
</View>
|
|
156
|
+
);
|
|
157
|
+
|
|
158
|
+
function footerComponent() {
|
|
159
|
+
return (
|
|
160
|
+
<View style={{ marginBottom: 10 }}>
|
|
161
|
+
{footerData != undefined && footerData.data != undefined ?
|
|
162
|
+
<View
|
|
163
|
+
style={{ backgroundColor: '#fff', height: normalize(35), alignItems: 'center', justifyContent: 'space-evenly', flexDirection: 'row' }}>
|
|
164
|
+
<View style={{ flexDirection: 'row', alignItems: 'center', width: '50%', justifyContent: 'center' }}>
|
|
165
|
+
<Icons.FontAwesome5 name={'calendar-day'} color={'black'} size={normalize(20)} />
|
|
166
|
+
<Text style={{ fontWeight: 'bold', fontSize: normalize(15), color: 'black', paddingLeft: normalize(10) }}>
|
|
167
|
+
{footerData.displaytext + '/' + monthName + '/' + year}
|
|
168
|
+
</Text>
|
|
169
|
+
</View>
|
|
170
|
+
</View> : null}
|
|
171
|
+
|
|
172
|
+
{footerData != undefined && footerData.data != undefined ?
|
|
173
|
+
<FlatList
|
|
174
|
+
nestedScrollEnabled={true}
|
|
175
|
+
data={footerData.data}
|
|
176
|
+
style={{ width: width }}
|
|
177
|
+
renderItem={renderFooterView}
|
|
178
|
+
keyExtractor={(item, index) => 'key' + index}
|
|
179
|
+
listKey={(item, index) => 'key' + index} /> : null}
|
|
180
|
+
</View>
|
|
181
|
+
);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
function renderFooterView({ item }) {
|
|
186
|
+
return (
|
|
187
|
+
<View style={{}}>
|
|
188
|
+
<TouchableOpacity onPress={() => { item.expand = !item.expand, setRefresh(refresh + 1); }}
|
|
189
|
+
style={{ flexDirection: 'row', backgroundColor: '#fff', alignItems: 'center', justifyContent: 'space-between', marginTop: 2, paddingHorizontal: 10 }}>
|
|
190
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
191
|
+
<Icons.FontAwesome5 name={item.iconname != undefined ? item.iconname : 'file-alt'} color={'#164d8e'} size={normalize(13)} style={{ paddingRight: 10 }} />
|
|
192
|
+
<Text style={{ fontSize: normalize(14), fontWeight: 'bold', color: '#164d8e', paddingVertical: normalize(3) }}>{item.bookingname}</Text>
|
|
193
|
+
</View>
|
|
194
|
+
<View style={{ flexDirection: 'row', alignItems: 'center' }}>
|
|
195
|
+
<Icons.FontAwesome5 name={'rupee-sign'} color={'#164d8e'} size={normalize(15)} />
|
|
196
|
+
<Text style={{ color: '#164d8e', fontWeight: 'bold', fontSize: normalize(18), paddingLeft: 10 }}>{item.amount != undefined ? item.amount : item.tokenarray != undefined && item.tokenarray.length > 0 ? item.tokenarray[0].amount : ''}</Text>
|
|
197
|
+
</View>
|
|
198
|
+
</TouchableOpacity>
|
|
199
|
+
<View>
|
|
200
|
+
<FlatList
|
|
201
|
+
data={item.tokenarray}
|
|
202
|
+
renderItem={(data) => renderTokens(data, footerData)}
|
|
203
|
+
numColumns={4}
|
|
204
|
+
style={{ width: '100%', paddingHorizontal: 20 }}
|
|
205
|
+
contentContainerStyle={{ alignSelf: 'center' }}
|
|
206
|
+
listKey={(item, index) => 'key' + index}
|
|
207
|
+
keyExtractor={(item, index) => 'key' + index}
|
|
208
|
+
initialNumToRender={10}
|
|
209
|
+
/>
|
|
210
|
+
</View>
|
|
211
|
+
</View>
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
|
|
216
|
+
function renderItem({ item }) {
|
|
217
|
+
return (
|
|
218
|
+
<TouchableOpacity style={{
|
|
219
|
+
width: dividedWidth, alignItems: 'center', paddingTop: 5,
|
|
220
|
+
borderWidth: 0.5, backgroundColor: item.data != undefined && item.data.length > 0 ? '#f4fcf7' : '#fff',
|
|
221
|
+
}}
|
|
222
|
+
disabled={true}
|
|
223
|
+
onPress={() => item.data != undefined && item.data.length > 0 ? getDateTokens(item) : (getDateTokens(item), notifyMessage('Sorry , No Tokens Found'))}
|
|
224
|
+
>
|
|
225
|
+
<View style={{
|
|
226
|
+
alignItems: 'center', justifyContent: 'center',
|
|
227
|
+
}}>
|
|
228
|
+
<Text style={{
|
|
229
|
+
color: item.data != undefined && item.data.length > 0 ? 'green' : '#b6b5b7', fontSize: normalize(20), fontWeight: 'bold', textShadowColor: '#b6b5b7',
|
|
230
|
+
textShadowOffset: { width: -1, height: 1 },
|
|
231
|
+
textShadowRadius: 3,
|
|
232
|
+
}}>{item.displaytext == 0 ? '' : item.displaytext}</Text>
|
|
233
|
+
</View>
|
|
234
|
+
<View style={{
|
|
235
|
+
flexDirection: 'row', width: '100%', flex: 1, alignItems: 'center',
|
|
236
|
+
justifyContent: 'space-between', flexWrap: 'wrap', paddingHorizontal: 0,
|
|
237
|
+
paddingTop: normalize(5), paddingBottom: normalize(5),
|
|
238
|
+
}} />
|
|
239
|
+
</TouchableOpacity>
|
|
240
|
+
);
|
|
241
|
+
}
|
|
242
|
+
};
|
|
243
|
+
export default CCalendar;
|