@jescon-technologies/react-native-ui-kit 0.0.6 → 0.0.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.
Files changed (191) hide show
  1. package/index.d.ts +2 -66
  2. package/index.js +1 -66
  3. package/package.json +1 -1
  4. package/src/Alerts/AAlert.js +0 -137
  5. package/src/Alerts/AAlertIOS.js +0 -97
  6. package/src/Alerts/ABlink.js +0 -40
  7. package/src/Common/Icons.js +0 -49
  8. package/src/Common/NetworkServiceCall.js +0 -265
  9. package/src/CommonStyle/CommonTheme.js +0 -11
  10. package/src/CommonStyle/ComponentFunctions.js +0 -632
  11. package/src/CommonStyle/PopupStyle.js +0 -146
  12. package/src/CommonStyle/commonStyle.js +0 -93
  13. package/src/CommonStyle/componentStyle.js +0 -545
  14. package/src/CommonStyle/optionListStyles.js +0 -175
  15. package/src/Components/ByProductPage.js +0 -200
  16. package/src/Components/CDropDownListNew.js +0 -153
  17. package/src/Components/CSupplierList.js +0 -88
  18. package/src/Components/CVerificationCard.js +0 -2822
  19. package/src/Components/CustomButton.js +0 -67
  20. package/src/Components/CustomCard.js +0 -127
  21. package/src/Components/CustomTextInput.js +0 -47
  22. package/src/Components/EquipmentPage.js +0 -313
  23. package/src/Components/FilterInput.Copy.js +0 -723
  24. package/src/Components/FilterInput.js +0 -569
  25. package/src/Components/HSubHeading.js +0 -68
  26. package/src/Components/HeaderCard.js +0 -40
  27. package/src/Components/MoreOptionsScreen.js +0 -251
  28. package/src/Components/NonSwipableProductCard.js +0 -226
  29. package/src/Components/NonSwipableSupplierCard.js +0 -348
  30. package/src/Components/ProductCard.js +0 -1336
  31. package/src/Components/QualityProductCard.js +0 -1059
  32. package/src/Components/RateProductCard.js +0 -1452
  33. package/src/Components/RawMaterial.js +0 -261
  34. package/src/Components/SDropDownEdited.js +0 -549
  35. package/src/Components/SDropDownNew.js +0 -529
  36. package/src/Components/SHelpDescription.js +0 -147
  37. package/src/Components/STextInputNew.js +0 -510
  38. package/src/Components/SearchProductCard.js +0 -470
  39. package/src/Components/StageByProduct.js +0 -199
  40. package/src/Components/SupplierCard.js +0 -243
  41. package/src/Components/SupplierInvoiceCard.js +0 -405
  42. package/src/Components/SwipableSupplierCard.js +0 -136
  43. package/src/Components/TagTemplate.js +0 -74
  44. package/src/Components/WrappedComponent.js +0 -25
  45. package/src/Custom/CBooking.js +0 -944
  46. package/src/Custom/CBookingPostpone.js +0 -1822
  47. package/src/Custom/CCalendar.js +0 -560
  48. package/src/Custom/CCard.js +0 -880
  49. package/src/Custom/CDetailCard.js +0 -205
  50. package/src/Custom/CHelpImage.js +0 -52
  51. package/src/Custom/CReport.js +0 -569
  52. package/src/Custom/CScrollView.js +0 -73
  53. package/src/Custom/CSignature.js +0 -112
  54. package/src/Custom/CSliderMenu.js +0 -339
  55. package/src/Custom/CSupplierCard.js +0 -99
  56. package/src/Custom/CTemplateCard.js +0 -438
  57. package/src/Custom/CTokenAllocation.js +0 -1402
  58. package/src/Custom/CTokenListOverlay.js +0 -122
  59. package/src/Custom/CWardStatus.js +0 -444
  60. package/src/Custom/Charts/CBarChart.js +0 -218
  61. package/src/Custom/Charts/CDashBoardList.js +0 -133
  62. package/src/Custom/Charts/CDashBoardTable.js +0 -172
  63. package/src/Custom/Charts/CLineChart.js +0 -193
  64. package/src/Custom/Charts/CPieChart.js +0 -186
  65. package/src/Custom/Loader.js +0 -182
  66. package/src/Custom/OUserView.js +0 -1121
  67. package/src/Custom/PreviewDosage.js +0 -115
  68. package/src/Custom/SearchLoader.js +0 -32
  69. package/src/Custom/TableComponent/CActivityTable.js +0 -707
  70. package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
  71. package/src/Custom/TableComponent/CTable.js +0 -185
  72. package/src/Custom/TableComponent/CTextBody.js +0 -40
  73. package/src/Custom/TableComponent/CTextHeader.js +0 -17
  74. package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
  75. package/src/Custom/TableComponent/SDropdownTable.js +0 -491
  76. package/src/Custom/TableComponent/TagTable.js +0 -1200
  77. package/src/CustomComponents/CAddColumn.js +0 -140
  78. package/src/CustomComponents/CAssessmentDelete.js +0 -307
  79. package/src/CustomComponents/CAwesomeButton.js +0 -83
  80. package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
  81. package/src/CustomComponents/CBackHandler.js +0 -273
  82. package/src/CustomComponents/CCalendar.js +0 -243
  83. package/src/CustomComponents/CCommentOverlay.js +0 -202
  84. package/src/CustomComponents/CComments.js +0 -162
  85. package/src/CustomComponents/CContainerView.js +0 -24
  86. package/src/CustomComponents/CCustomTextInput.js +0 -336
  87. package/src/CustomComponents/CDetailView.js +0 -40
  88. package/src/CustomComponents/CDropDownList.js +0 -153
  89. package/src/CustomComponents/CDropdownSelect.js +0 -555
  90. package/src/CustomComponents/CFooterView.js +0 -42
  91. package/src/CustomComponents/CImagePickerSave.js +0 -316
  92. package/src/CustomComponents/CModalOverlay.js +0 -91
  93. package/src/CustomComponents/CNetworkStatus.js +0 -327
  94. package/src/CustomComponents/CNotesInstructions.js +0 -1000
  95. package/src/CustomComponents/COverlay.js +0 -81
  96. package/src/CustomComponents/CRemarks.js +0 -176
  97. package/src/CustomComponents/CRowAdd.js +0 -143
  98. package/src/CustomComponents/CSummaryDropDown.js +0 -327
  99. package/src/CustomComponents/CText.js +0 -9
  100. package/src/CustomComponents/CVectorIcon.js +0 -34
  101. package/src/CustomComponents/HtmlContentViewer.js +0 -65
  102. package/src/CustomComponents/PdfContentViewer.js +0 -90
  103. package/src/CustomComponents/SDropDownDosage.js +0 -1087
  104. package/src/CustomComponents/SwipableProductCard.js +0 -246
  105. package/src/CustomComponents/SwipableProductImageCard.js +0 -254
  106. package/src/CustomComponents/WorkOrderDetails.js +0 -1216
  107. package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
  108. package/src/HOC/ConfirmOverlay.js +0 -192
  109. package/src/HOC/HHeading.js +0 -70
  110. package/src/HOC/HMoreButton.js +0 -88
  111. package/src/HOC/HNatureHeading.js +0 -402
  112. package/src/HOC/HOCIcons.js +0 -80
  113. package/src/HOC/HOverlayCentered.js +0 -140
  114. package/src/HOC/HShadowButton.js +0 -45
  115. package/src/HOC/HShadowCountButton.js +0 -82
  116. package/src/HOC/OptionOverlay.js +0 -48
  117. package/src/Json/Chart.json +0 -818
  118. package/src/Json/Consultation.json +0 -622
  119. package/src/Json/CreditBill.json +0 -490
  120. package/src/Json/Dropdown.json +0 -216
  121. package/src/Json/DropdownConsultation.json +0 -228
  122. package/src/Json/DynamicReports.json +0 -623
  123. package/src/Json/Footer.json +0 -79
  124. package/src/Media/AudioScreen.js +0 -342
  125. package/src/Media/BarcodeScan.js +0 -145
  126. package/src/Media/CAudioPlay.js +0 -228
  127. package/src/Media/CCaptureImageWithoutEdit.js +0 -330
  128. package/src/Media/CImageGallery.js +0 -289
  129. package/src/Media/CImageZoom.js +0 -82
  130. package/src/Media/CSingleImage.js +0 -391
  131. package/src/Media/CSketchCanvas.js +0 -76
  132. package/src/Media/CVideoPlay.js +0 -31
  133. package/src/Media/DocumentScreen.js +0 -362
  134. package/src/Media/DrawingScreen.js +0 -578
  135. package/src/Media/ImageScreen.js +0 -309
  136. package/src/Media/RecordAudio.js +0 -250
  137. package/src/Media/RecordVideo.js +0 -223
  138. package/src/Media/VideoScreen.js +0 -378
  139. package/src/Navigation/PageNavigation.js +0 -224
  140. package/src/Navigation/useFocusEffect.js +0 -2
  141. package/src/Navigation/useFocusEffect.native.js +0 -1
  142. package/src/Navigation/useFocusEffect.web.js +0 -1
  143. package/src/Navigation/useIsFocused.js +0 -1
  144. package/src/Navigation/useIsFocused.native.js +0 -1
  145. package/src/Navigation/useIsFocused.web.js +0 -1
  146. package/src/Navigation/useNavigation.js +0 -2
  147. package/src/Navigation/useNavigation.native.js +0 -1
  148. package/src/Navigation/useNavigation.web.js +0 -1
  149. package/src/Screens/CMedications.js +0 -528
  150. package/src/Screens/CWebViewGallery.js +0 -203
  151. package/src/Screens/ChartScan.js +0 -279
  152. package/src/Screens/ChartScreenNew.js +0 -1579
  153. package/src/Screens/Consultation.js +0 -1500
  154. package/src/Screens/Dashboard.js +0 -778
  155. package/src/Screens/FileExplorer.js +0 -288
  156. package/src/Screens/Footer.js +0 -340
  157. package/src/Screens/ForgotPassword.js +0 -288
  158. package/src/Screens/HeaderBlock.js +0 -353
  159. package/src/Screens/Login.js +0 -328
  160. package/src/Screens/Notification.js +0 -149
  161. package/src/Screens/OcrScreen.js +0 -20
  162. package/src/Screens/PdfPreview.js +0 -507
  163. package/src/Screens/RegistrationDetails.js +0 -467
  164. package/src/Screens/SearchScreen.js +0 -582
  165. package/src/Screens/Splash.js +0 -788
  166. package/src/Screens/SwipeLeftView.js +0 -1867
  167. package/src/StaticComponents/SAlphabet.js +0 -47
  168. package/src/StaticComponents/SCheckBox.js +0 -42
  169. package/src/StaticComponents/SDatePicker.js +0 -208
  170. package/src/StaticComponents/SDatePickerLabel.js +0 -253
  171. package/src/StaticComponents/SDatePickerNew.js +0 -258
  172. package/src/StaticComponents/SDateTimePickerNew.js +0 -381
  173. package/src/StaticComponents/SDropDownGenerate.js +0 -450
  174. package/src/StaticComponents/SDropDownHoc.js +0 -636
  175. package/src/StaticComponents/SDropDownIcon.js +0 -500
  176. package/src/StaticComponents/SMenuBox.js +0 -131
  177. package/src/StaticComponents/SOverlay.js +0 -177
  178. package/src/StaticComponents/SOverlayTextInput.js +0 -109
  179. package/src/StaticComponents/SSearch.js +0 -438
  180. package/src/StaticComponents/SSearchBar.js +0 -53
  181. package/src/StaticComponents/SSpeedDial.js +0 -303
  182. package/src/StaticComponents/STextInput.js +0 -289
  183. package/src/StaticComponents/STextInputProps.js +0 -36
  184. package/src/StaticComponents/STimePicker.js +0 -171
  185. package/src/StaticComponents/STimingDropDownNew.js +0 -1585
  186. package/src/StaticComponents/STimingSwitch.js +0 -34
  187. package/src/layout/CContainerView.js +0 -21
  188. package/src/layout/CDetailView.js +0 -81
  189. package/src/layout/HeaderBlock.js +0 -353
  190. package/src/layout/INVLoginLayout.js +0 -657
  191. package/src/layout/Loader.js +0 -176
@@ -1,273 +0,0 @@
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
- });
@@ -1,243 +0,0 @@
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;