@jescon-technologies/react-native-ui-kit 0.0.3 → 0.0.5

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 (177) hide show
  1. package/index.d.ts +66 -0
  2. package/index.js +0 -4
  3. package/package.json +3 -34
  4. package/src/Alerts/AAlert.js +3 -3
  5. package/src/Alerts/AAlertIOS.js +3 -3
  6. package/src/{common → Common}/NetworkServiceCall.js +1 -1
  7. package/src/CommonStyle/CommonTheme.js +11 -0
  8. package/src/CommonStyle/ComponentFunctions.js +632 -0
  9. package/src/CommonStyle/PopupStyle.js +146 -0
  10. package/src/CommonStyle/commonStyle.js +93 -0
  11. package/src/CommonStyle/componentStyle.js +545 -0
  12. package/src/CommonStyle/optionListStyles.js +175 -0
  13. package/src/Components/ByProductPage.js +200 -0
  14. package/src/Components/CDropDownListNew.js +153 -0
  15. package/src/Components/CSupplierList.js +88 -0
  16. package/src/Components/CVerificationCard.js +2822 -0
  17. package/src/Components/CustomButton.js +67 -0
  18. package/src/Components/CustomCard.js +127 -0
  19. package/src/Components/CustomTextInput.js +47 -0
  20. package/src/Components/EquipmentPage.js +313 -0
  21. package/src/Components/FilterInput.Copy.js +723 -0
  22. package/src/Components/FilterInput.js +569 -0
  23. package/src/Components/HSubHeading.js +68 -0
  24. package/src/Components/HeaderCard.js +40 -0
  25. package/src/Components/MoreOptionsScreen.js +251 -0
  26. package/src/Components/NonSwipableProductCard.js +226 -0
  27. package/src/Components/NonSwipableSupplierCard.js +348 -0
  28. package/src/Components/ProductCard.js +1336 -0
  29. package/src/Components/QualityProductCard.js +1059 -0
  30. package/src/Components/RateProductCard.js +1452 -0
  31. package/src/Components/RawMaterial.js +261 -0
  32. package/src/Components/SDropDownEdited.js +549 -0
  33. package/src/Components/SDropDownNew.js +529 -0
  34. package/src/Components/SHelpDescription.js +147 -0
  35. package/src/Components/STextInputNew.js +510 -0
  36. package/src/Components/SearchProductCard.js +470 -0
  37. package/src/Components/StageByProduct.js +199 -0
  38. package/src/Components/SupplierCard.js +243 -0
  39. package/src/Components/SupplierInvoiceCard.js +405 -0
  40. package/src/Components/SwipableSupplierCard.js +136 -0
  41. package/src/Components/TagTemplate.js +74 -0
  42. package/src/Components/WrappedComponent.js +25 -0
  43. package/src/Custom/CBooking.js +944 -0
  44. package/src/Custom/CBookingPostpone.js +1822 -0
  45. package/src/Custom/CCalendar.js +560 -0
  46. package/src/Custom/CCard.js +880 -0
  47. package/src/Custom/CDetailCard.js +205 -0
  48. package/src/Custom/CHelpImage.js +52 -0
  49. package/src/Custom/CReport.js +569 -0
  50. package/src/Custom/CScrollView.js +73 -0
  51. package/src/Custom/CSignature.js +112 -0
  52. package/src/Custom/CSliderMenu.js +339 -0
  53. package/src/Custom/CSupplierCard.js +99 -0
  54. package/src/Custom/CTemplateCard.js +438 -0
  55. package/src/Custom/CTokenAllocation.js +1402 -0
  56. package/src/Custom/CTokenListOverlay.js +122 -0
  57. package/src/Custom/CWardStatus.js +444 -0
  58. package/src/Custom/Charts/CBarChart.js +218 -0
  59. package/src/Custom/Charts/CDashBoardList.js +133 -0
  60. package/src/Custom/Charts/CDashBoardTable.js +172 -0
  61. package/src/Custom/Charts/CLineChart.js +193 -0
  62. package/src/Custom/Charts/CPieChart.js +186 -0
  63. package/src/Custom/Loader.js +182 -0
  64. package/src/Custom/OUserView.js +1121 -0
  65. package/src/Custom/PreviewDosage.js +115 -0
  66. package/src/Custom/SearchLoader.js +32 -0
  67. package/src/Custom/TableComponent/CActivityTable.js +707 -0
  68. package/src/Custom/TableComponent/CMoreButtonTable.js +197 -0
  69. package/src/Custom/TableComponent/CTable.js +185 -0
  70. package/src/Custom/TableComponent/CTextBody.js +40 -0
  71. package/src/Custom/TableComponent/CTextHeader.js +17 -0
  72. package/src/Custom/TableComponent/PreviewPrescriptionNew.js +1011 -0
  73. package/src/Custom/TableComponent/SDropdownTable.js +491 -0
  74. package/src/Custom/TableComponent/TagTable.js +1200 -0
  75. package/src/CustomComponents/CAddColumn.js +140 -0
  76. package/src/CustomComponents/CAssessmentDelete.js +307 -0
  77. package/src/CustomComponents/CAwesomeButton.js +83 -0
  78. package/src/CustomComponents/CAwesomeMoreButton.js +54 -0
  79. package/src/CustomComponents/CBackHandler.js +273 -0
  80. package/src/CustomComponents/CCalendar.js +243 -0
  81. package/src/CustomComponents/CCommentOverlay.js +202 -0
  82. package/src/CustomComponents/CComments.js +162 -0
  83. package/src/CustomComponents/CContainerView.js +24 -0
  84. package/src/CustomComponents/CCustomTextInput.js +336 -0
  85. package/src/CustomComponents/CDetailView.js +40 -0
  86. package/src/CustomComponents/CDropDownList.js +153 -0
  87. package/src/CustomComponents/CDropdownSelect.js +555 -0
  88. package/src/CustomComponents/CFooterView.js +42 -0
  89. package/src/CustomComponents/CImagePickerSave.js +316 -0
  90. package/src/CustomComponents/CModalOverlay.js +91 -0
  91. package/src/CustomComponents/CNetworkStatus.js +327 -0
  92. package/src/CustomComponents/CNotesInstructions.js +1000 -0
  93. package/src/CustomComponents/COverlay.js +81 -0
  94. package/src/CustomComponents/CRemarks.js +176 -0
  95. package/src/CustomComponents/CRowAdd.js +143 -0
  96. package/src/CustomComponents/CSummaryDropDown.js +327 -0
  97. package/src/CustomComponents/CText.js +9 -0
  98. package/src/CustomComponents/CVectorIcon.js +34 -0
  99. package/src/CustomComponents/HtmlContentViewer.js +65 -0
  100. package/src/CustomComponents/PdfContentViewer.js +90 -0
  101. package/src/CustomComponents/SDropDownDosage.js +1087 -0
  102. package/src/CustomComponents/SwipableProductCard.js +246 -0
  103. package/src/CustomComponents/SwipableProductImageCard.js +254 -0
  104. package/src/CustomComponents/WorkOrderDetails.js +1216 -0
  105. package/src/CustomComponents/WorkOrderDetailsPage.js +1213 -0
  106. package/src/HOC/ConfirmOverlay.js +2 -2
  107. package/src/HOC/HMoreButton.js +1 -1
  108. package/src/HOC/HNatureHeading.js +1 -1
  109. package/src/HOC/HShadowButton.js +1 -1
  110. package/src/HOC/HShadowCountButton.js +1 -1
  111. package/src/Json/Chart.json +818 -0
  112. package/src/Json/Consultation.json +622 -0
  113. package/src/Json/CreditBill.json +490 -0
  114. package/src/Json/Dropdown.json +216 -0
  115. package/src/Json/DropdownConsultation.json +228 -0
  116. package/src/Json/DynamicReports.json +623 -0
  117. package/src/Json/Footer.json +79 -0
  118. package/src/Media/AudioScreen.js +2 -7
  119. package/src/Media/CCaptureImageWithoutEdit.js +1 -1
  120. package/src/Media/CImageGallery.js +2 -2
  121. package/src/Media/CSingleImage.js +2 -2
  122. package/src/Media/CVideoPlay.js +1 -1
  123. package/src/Media/DocumentScreen.js +2 -7
  124. package/src/Media/DrawingScreen.js +2 -6
  125. package/src/Media/ImageScreen.js +2 -6
  126. package/src/Media/VideoScreen.js +2 -7
  127. package/src/Navigation/PageNavigation.js +224 -0
  128. package/src/Navigation/useFocusEffect.js +2 -0
  129. package/src/Navigation/useFocusEffect.native.js +1 -0
  130. package/src/Navigation/useFocusEffect.web.js +1 -0
  131. package/src/Navigation/useIsFocused.js +1 -0
  132. package/src/Navigation/useIsFocused.native.js +1 -0
  133. package/src/Navigation/useIsFocused.web.js +1 -0
  134. package/src/Navigation/useNavigation.js +2 -0
  135. package/src/Navigation/useNavigation.native.js +1 -0
  136. package/src/Navigation/useNavigation.web.js +1 -0
  137. package/src/Screens/CMedications.js +528 -0
  138. package/src/Screens/CWebViewGallery.js +203 -0
  139. package/src/Screens/ChartScan.js +279 -0
  140. package/src/Screens/ChartScreenNew.js +1579 -0
  141. package/src/Screens/Consultation.js +1500 -0
  142. package/src/Screens/Dashboard.js +778 -0
  143. package/src/Screens/FileExplorer.js +288 -0
  144. package/src/Screens/Footer.js +340 -0
  145. package/src/Screens/ForgotPassword.js +288 -0
  146. package/src/Screens/HeaderBlock.js +353 -0
  147. package/src/Screens/Login.js +328 -0
  148. package/src/Screens/Notification.js +149 -0
  149. package/src/Screens/OcrScreen.js +20 -0
  150. package/src/Screens/PdfPreview.js +507 -0
  151. package/src/Screens/RegistrationDetails.js +467 -0
  152. package/src/Screens/SearchScreen.js +582 -0
  153. package/src/Screens/Splash.js +788 -0
  154. package/src/Screens/SwipeLeftView.js +1867 -0
  155. package/src/StaticComponents/SDatePickerLabel.js +1 -1
  156. package/src/StaticComponents/SDatePickerNew.js +1 -1
  157. package/src/StaticComponents/SDateTimePickerNew.js +2 -2
  158. package/src/StaticComponents/SDropDownGenerate.js +3 -3
  159. package/src/StaticComponents/SDropDownHoc.js +4 -4
  160. package/src/StaticComponents/SDropDownIcon.js +1 -1
  161. package/src/StaticComponents/SMenuBox.js +2 -2
  162. package/src/StaticComponents/SSearch.js +2 -2
  163. package/src/StaticComponents/STextInput.js +1 -1
  164. package/src/StaticComponents/STimePicker.js +1 -1
  165. package/src/StaticComponents/STimingDropDownNew.js +2 -6
  166. package/src/StaticComponents/STimingSwitch.js +1 -1
  167. package/src/layout/CContainerView.js +1 -1
  168. package/src/layout/CDetailView.js +3 -3
  169. package/src/layout/HeaderBlock.js +5 -5
  170. package/src/layout/INVLoginLayout.js +3 -4
  171. package/src/layout/Loader.js +2 -2
  172. package/src/HOC/HAbsolute.js +0 -56
  173. package/src/HOC/HDiscontinue.js +0 -105
  174. package/src/HOC/HOverlay.js +0 -99
  175. package/src/layout/FooterBlock.js +0 -821
  176. /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
  177. /package/src/{common → Common}/Icons.js +0 -0
@@ -0,0 +1,569 @@
1
+ import React, { useState, useEffect, useRef } from 'react';
2
+ import { Text, View, FlatList, TouchableOpacity, Dimensions, ActivityIndicator, ScrollView, Switch, TextInput, TouchableHighlight, Platform } 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 { ArrayCheck, getLoading, isPermitted, notifyMessage, ValueCheck } 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
+ import CTextHeader from './TableComponent/CTextHeader';
11
+ import CTextBody from './TableComponent/CTextBody';
12
+ import HHeading from '../HOC/HHeading';
13
+ import STimePicker from '../StaticComponents/STimePicker';
14
+ import Loader from './Loader';
15
+ import moment from 'moment';
16
+ import STextInput from '../StaticComponents/STextInput';
17
+ import AwesomeButton from 'react-native-really-awesome-button';
18
+ import SDropDownNew from '../Components/SDropDownNew';
19
+
20
+ import RNFetchBlob from 'rn-fetch-blob';
21
+ import RNHTMLtoPDF from 'react-native-html-to-pdf';
22
+ import RNPrint from 'react-native-print';
23
+ import HReportFormat from '../Html/HReportFormat';
24
+ import HReportHeader from '../Html/HReportHeader';
25
+ import HReportFooter from '../Html/HReportFooter';
26
+ import CFromToDate from '../CustomComponents/CFromToDate';
27
+ import CAwesomeButton from '../CustomComponents/CAwesomeButton';
28
+ // import { PDFDocument, PDFPage } from 'react-native-pdf-lib';
29
+
30
+
31
+ const CReport = (props) => {
32
+ const { width, height } = Dimensions.get('screen');
33
+ const [data, setData] = useState();
34
+ const [stage, setStage] = useState(1);
35
+ const [refresh, setRefresh] = useState(0);
36
+ const [tokenType, setTokenType] = useState('');
37
+ const [isLoading, setIsLoading] = useState(false);
38
+ const [date, setDate] = useState({
39
+ 'fromdate': moment().format('YYYY-MM-DD'),
40
+ 'todate': moment().format('YYYY-MM-DD'),
41
+ });
42
+ const [consultant, setConsultant] = useState();
43
+
44
+ var Report = {
45
+ 'title': 'Token Report',
46
+ 'fromdate': '',
47
+ 'todate': '',
48
+ 'tokentype': '',
49
+ 'tokentypename': '',
50
+ 'hosuconsultant': 0,
51
+ 'consultantname': 'DR.MATHEW K C',
52
+ 'dateWiseArr': [
53
+ {
54
+ 'date': '14 November 2023',
55
+ 'tokensArr': [
56
+ {
57
+ 'code': 1,
58
+ 'tokenno': 6,
59
+ 'morningoreveng': 'Morning',
60
+ 'consultationtime': '11:30 AM',
61
+ 'reportingtime': '11:00AM',
62
+ 'bookingtypename': 'PHONE',
63
+ 'totalamount': 0,
64
+ 'paymenttype': 'Pay Later',
65
+ 'bookedby': 'Harold Louis',
66
+ 'mobilenumber': '7338483582',
67
+ 'remarks': 'Remarks',
68
+ 'color': '#4f4d4d',
69
+ },
70
+ {
71
+ 'code': 2,
72
+ 'tokenno': 7,
73
+ 'morningoreveng': 'Morning',
74
+ 'consultationtime': '11:30 AM',
75
+ 'reportingtime': '11:00AM',
76
+ 'bookingtypename': 'PHONE',
77
+ 'totalamount': 0,
78
+ 'paymenttype': 'Pay Later',
79
+ 'bookedby': '',
80
+ 'mobilenumber': '',
81
+ 'remarks': 'Remarks',
82
+ 'color': '#4f4d4d',
83
+ },
84
+ ],
85
+ },
86
+ {
87
+ 'date': '15 November 2023',
88
+ 'tokensArr': [
89
+ {
90
+ 'code': 1,
91
+ 'tokenno': 6,
92
+ 'morningoreveng': 'Morning',
93
+ 'consultationtime': '11:30 AM',
94
+ 'reportingtime': '11:00AM',
95
+ 'bookingtypename': 'PHONE',
96
+ 'totalamount': 0,
97
+ 'paymenttype': 'Pay Later',
98
+ 'bookedby': 'Harold Louis',
99
+ 'mobilenumber': '7338483582',
100
+ 'remarks': 'Remarks',
101
+ 'color': '#4f4d4d',
102
+ },
103
+ {
104
+ 'code': 2,
105
+ 'tokenno': 7,
106
+ 'morningoreveng': 'Morning',
107
+ 'consultationtime': '11:30 AM',
108
+ 'reportingtime': '11:00AM',
109
+ 'bookingtypename': 'PHONE',
110
+ 'totalamount': 0,
111
+ 'paymenttype': 'Pay Later',
112
+ 'bookedby': '',
113
+ 'mobilenumber': '',
114
+ 'remarks': 'Remarks',
115
+ 'color': '#4f4d4d',
116
+ },
117
+ {
118
+ 'code': 1,
119
+ 'tokenno': 6,
120
+ 'morningoreveng': 'Morning',
121
+ 'consultationtime': '11:30 AM',
122
+ 'reportingtime': '11:00AM',
123
+ 'bookingtypename': 'PHONE',
124
+ 'totalamount': 0,
125
+ 'paymenttype': 'Pay Later',
126
+ 'bookedby': 'Harold Louis',
127
+ 'mobilenumber': '7338483582',
128
+ 'remarks': 'Remarks',
129
+ 'color': '#4f4d4d',
130
+ },
131
+ {
132
+ 'code': 2,
133
+ 'tokenno': 7,
134
+ 'morningoreveng': 'Morning',
135
+ 'consultationtime': '11:30 AM',
136
+ 'reportingtime': '11:00AM',
137
+ 'bookingtypename': 'PHONE',
138
+ 'totalamount': 0,
139
+ 'paymenttype': 'Pay Later',
140
+ 'bookedby': '',
141
+ 'mobilenumber': '',
142
+ 'remarks': 'Remarks',
143
+ 'color': '#4f4d4d',
144
+ },
145
+ ],
146
+ },
147
+ ],
148
+ };
149
+
150
+ function getReportAPI(fromtodate, tokentype) {
151
+ var consultantCode = ValueCheck(consultant) ? consultant.datavalue : Global.userData.hosuconsultant;
152
+ var tokentypevar = ValueCheck(tokentype) ? tokentype : tokenType;
153
+ setDate(fromtodate);
154
+ var from = moment(fromtodate.fromdate).format('YYYY-MM-DD');
155
+ var to = moment(fromtodate.todate).format('YYYY-MM-DD');
156
+ // let buttonapi = APIURL + 'emr/emrcommonget/rnhococonsultationtokenorderweekday ' + 7
157
+ var buttonapi = APIURL + 'emr/emrcommonget/rnhosuconsultantbookingreport ' + consultantCode + ',' + "'" + from + "'" + ',' + "'" + to + "'" + ',' + "'" + tokentypevar + "'"
158
+ + ',' + stage;
159
+ console.log('Button api.....................CReport.....................', JSON.stringify(buttonapi));
160
+ setIsLoading(true);
161
+ NetworkServiceCall('get', buttonapi, '')
162
+ .then(function (response) {
163
+ if (response.httpstatus == 200 && response.data != null
164
+ && response.data != undefined) {
165
+ setData(response.data);
166
+ getReport(response.data);
167
+ }
168
+ else {
169
+ setIsLoading(false);
170
+ notifyMessage('Data not available,Please try again later', 4);
171
+ }
172
+ });
173
+
174
+ getLoading(v => setIsLoading(false));
175
+ }
176
+
177
+ function contentdata(data) {
178
+ return (`
179
+ <style type="text/css">
180
+ .studentInfo {
181
+ width: 100%;
182
+ border-collapse: collapse;
183
+ border: 0px solid grey;
184
+
185
+ }
186
+
187
+ .studentInfo td {
188
+
189
+ border: 0.5px solid lightgrey;
190
+ }
191
+
192
+ .headerTable td {
193
+ background: aliceblue;font-size:8px;
194
+ border: 0.5px solid lightgrey;
195
+ }
196
+ .DetailData td {
197
+ font-size:14px;text-align: center;
198
+ border: 0.5px solid lightgrey;
199
+ }
200
+ .header {
201
+ text-align: left;
202
+ font-wight:'bold';
203
+ font-size:14px;
204
+ }
205
+ #rcorners1{
206
+ text-align:center;
207
+ align-items:center;
208
+ justify-content: center;
209
+ border-radius: 1500px;
210
+ background: red;
211
+ padding: 2px;
212
+ width: 25px;
213
+ }
214
+
215
+ </style>
216
+
217
+ <div>
218
+ ${`<div style="border: 1px solid #000000; margin-top: 0px;padding:0px;">
219
+ <span style="
220
+ display: inline;
221
+ background: #fff;
222
+ margin-left:0px;
223
+ padding: 0px 2px;
224
+ position: relative;
225
+ top: -0.6em;
226
+ font-size:10px;
227
+ font-weight:normal;"
228
+ >
229
+ Consultant Details
230
+ </span>
231
+
232
+ <div style="display:flex;flex-direction:column;margin:5px;margin-top:0px;">
233
+
234
+ <div style="display:flex;flex-direction:row;">
235
+ <div style="display:flex;flex-direction:row;align-items:flex-end;width:50%;">
236
+ <div style="width:30%;font-size:8px;">
237
+ Consultant :
238
+ </div>
239
+ <div style="width:50%;font-weight:bold;font-size:10px;">
240
+ :&nbsp;${ValueCheck(consultant) ? consultant.displayvalue : Global.userData.username}
241
+ </div>
242
+ </div>
243
+ <div style="display:flex;flex-direction:row;align-items:flex-end;width:50%;">
244
+ <div style="width:30%;font-size:8px;">
245
+ Token Type :
246
+ </div>
247
+ <div style="width:50%;font-weight:bold;font-size:10px;">
248
+ :&nbsp;${ValueCheck(data) ? data.tokentypename : ''}
249
+ </div>
250
+ </div>
251
+ </div>
252
+ ${stage != 1 ?
253
+ `<div style="display:flex;flex-direction:row;">
254
+ <div style="display:flex;flex-direction:row;align-items:flex-end;width:60%;">
255
+ <div style="width:30%;font-size:8px;">
256
+ From Date :
257
+ </div>
258
+ <div style="width:50%;font-weight:bold;font-size:10px;">
259
+ :&nbsp;${ValueCheck(data) ? data.fromdate : ''}
260
+ </div>
261
+ </div>
262
+ <div style="display:flex;flex-direction:row;align-items:flex-end;width:60%;">
263
+ <div style="width:30%;font-size:8px;">
264
+ To Date :
265
+ </div>
266
+ <div style="width:50%;font-weight:bold;font-size:10px;">
267
+ :&nbsp;${ValueCheck(data) ? data.todate : ''}
268
+ </div>
269
+ </div>
270
+ </div>` : ''}
271
+
272
+ </div>
273
+ </div>
274
+ </div>
275
+ `}
276
+
277
+ <div>
278
+ <div style="font-size:10px;text-align: center;padding-top:5px">
279
+ Tokens Chart
280
+ </div>
281
+
282
+ ${ValueCheck(data) && ArrayCheck(data.dateWiseArr) ? data.dateWiseArr.map((subArr, i) => {
283
+ return (
284
+ `<div style="margin-top:0px">
285
+ <table class="studentInfo">
286
+ <tbody>
287
+
288
+ ${ValueCheck(subArr.tokensArr) && ArrayCheck(subArr.tokensArr) ?
289
+ `<tr>
290
+ <td class="header" colspan="9"> ${subArr.date} </td>
291
+ </tr>` : ''}
292
+
293
+ ${i == 0 ?
294
+ `<tr class="headerTable">
295
+ <td>Token No</td>
296
+ <td>Type</td>
297
+ <td>Reporting Time</td>
298
+ <td>Consultation Time</td>
299
+ <td>Nature</td>
300
+ <td>Disabled</td>
301
+ <td>Mrng/Evng</td>
302
+ ${stage != 1 ?
303
+ `<td>Patient Name</td>
304
+ <td>Mobile No</td>` : ''}
305
+ </tr>` : ''}
306
+ ${ValueCheck(subArr.tokensArr) && ArrayCheck(subArr.tokensArr) ? subArr.tokensArr.map((subArray) => {
307
+ return (
308
+ `<tr class="DetailData">
309
+ <td style="width:5%;font-size:16px;font-weight:bold;color: ${ValueCheck(subArray.disabledtoken) ? 'red' : ValueCheck(subArray.bookedstatus) ? 'green' : 'black'};">${subArray.tokenno}</td>
310
+ <td style="width:7%;">${subArray.bookingtypename}</td>
311
+ <td style="width:8%;">${subArray.reportingtime}</td>
312
+ <td style="width:8%;">${subArray.consultationtime}</td>
313
+ <td style="width:8%;">${ValueCheck(subArray.onlinetoken) ? subArray.onlinetoken : ''}</td>
314
+ <td style="width:8%;">${ValueCheck(subArray.disabledtoken) ? 'YES' : 'NO'}</td>
315
+ <td style="width:8%;">${ValueCheck(subArray.morningoreveng) ? subArray.morningoreveng : ''}</td>
316
+ ${stage != 1 ?
317
+ `<td style="width:8%;">${subArray.bookedby}</td>
318
+ <td style="width:8%;">${subArray.mobilenumber}</td>` : ''}
319
+ </tr>`
320
+ );
321
+ }).join('') : ''}
322
+
323
+ </tbody>
324
+ </table>
325
+ </div>`
326
+ );
327
+ }).join('') : ''}
328
+
329
+
330
+
331
+ </div>
332
+ </div>
333
+ `);
334
+ }
335
+
336
+ const getReport = async (data) => {
337
+ if (Platform.OS === 'web') {
338
+ window.electronAPI.savePDF(data);
339
+ return;
340
+ }
341
+ if (await isPermitted()) {
342
+ const htmlresult = await RNHTMLtoPDF.convert({
343
+ html: HReportFormat(contentdata(data), HReportHeader(), HReportFooter(), '110px', '80px'),
344
+ fileName: 'pdf',
345
+ base64: true,
346
+ });
347
+ setIsLoading(false);
348
+ RNPrint.print({ filePath: htmlresult.filePath });
349
+
350
+ // var x = []
351
+ // for (let i = 0; i < 30; i++) {
352
+ // var y = PDFPage
353
+ // .modify(0)
354
+ // .drawText(`Page ${i + 1}`, {
355
+ // x: 400,
356
+ // color: '#F62727',
357
+ // })
358
+ // y.page.pageIndex = i
359
+ // x.push(y)
360
+ // }
361
+ // var z = x.map((item) => { return JSON.stringify(item) }).toString(',')
362
+ // // console.log("..............................", z)
363
+ // PDFDocument
364
+ // .modify(htmlresult.filePath)
365
+ // .modifyPages({"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 1"}],"pageIndex":0}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 2"}],"pageIndex":1}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 3"}],"pageIndex":2}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 4"}],"pageIndex":3}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 5"}],"pageIndex":4}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 6"}],"pageIndex":5}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 7"}],"pageIndex":6}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 8"}],"pageIndex":7}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 9"}],"pageIndex":8}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 10"}],"pageIndex":9}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 11"}],"pageIndex":10}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 12"}],"pageIndex":11}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 13"}],"pageIndex":12}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 14"}],"pageIndex":13}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 15"}],"pageIndex":14}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 16"}],"pageIndex":15}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 17"}],"pageIndex":16}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 18"}],"pageIndex":17}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 19"}],"pageIndex":18}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 20"}],"pageIndex":19}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 21"}],"pageIndex":20}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 22"}],"pageIndex":21}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 23"}],"pageIndex":22}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 24"}],"pageIndex":23}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 25"}],"pageIndex":24}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 26"}],"pageIndex":25}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 27"}],"pageIndex":26}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 28"}],"pageIndex":27}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 29"}],"pageIndex":28}},{"page":{"actions":[{"x":400,"y":0,"color":"#F62727","fontSize":12,"fontName":"Times New Roman","type":"text","value":"Page 30"}],"pageIndex":29}})
366
+ // .write()
367
+ // .then(path => {
368
+ // RNPrint.print({ filePath: path });
369
+ // });
370
+ }
371
+ };
372
+
373
+ function getObj(params) {
374
+ params.map((item) => { return item; });
375
+ }
376
+
377
+ return (
378
+ <View style={{ flex: 1, marginTop: normalize(-2) }}>
379
+
380
+ <HHeading
381
+ styles={{
382
+ 'iconname': 'file-pdf',
383
+ 'bgcolor': '#f2efef',
384
+ 'iconsize': 16,
385
+ 'iconcolor': Global.AppTheme.primary_color,
386
+ 'displaytext': 'REPORTS',
387
+ 'textsize': 14,
388
+ 'textcolor': Global.AppTheme.primary_color,
389
+ }}
390
+ callBack={val => (val == undefined ? null : console.log(val))} />
391
+
392
+
393
+
394
+ {isLoading ?
395
+ <Loader displaytext={true} /> : null}
396
+
397
+ <View style={{ flex: 1 }}>
398
+ <View style={{ flexDirection: 'row', backgroundColor: '#fff', height: normalize(35), justifyContent: 'space-evenly', alignItems: 'center' }}>
399
+ {[{
400
+ stage: 1,
401
+ iconname: 'stack-overflow',
402
+ display: 'WEEKDAY',
403
+ },
404
+ {
405
+ stage: 2,
406
+ iconname: 'user-md',
407
+ display: 'BOOKING',
408
+ }].map((subItem, i) => {
409
+ return (
410
+ <TouchableOpacity key={i} style={{
411
+ height: '100%', borderBottomWidth: stage == subItem.stage ? 4 : 0, borderBottomColor: Global.AppTheme.primary_color,
412
+ backgroundColor: stage == subItem.stage ? '#eaedf9' : '#fff',
413
+ alignItems: 'center', justifyContent: 'center', width: Dimensions.get('screen').width * 0.5, marginBottom: normalize(5),
414
+ }}
415
+ onPress={() => setStage(subItem.stage)}>
416
+ <Icons.FontAwesome name={subItem.iconname} color={stage == subItem.stage ? Global.AppTheme.primary_color : 'black'} size={normalize(15)} />
417
+ <View style={{ alignItems: 'center' }}>
418
+ <Text style={{ color: stage == subItem.stage ? Global.AppTheme.primary_color : 'black', fontSize: normalize(10) }}>{subItem.display}</Text>
419
+ </View>
420
+ </TouchableOpacity>
421
+ );
422
+ })}
423
+
424
+ </View>
425
+
426
+ {Global.userData.hosuconsultant == 0 ?
427
+ <View style={{ paddingHorizontal: normalize(8), marginBottom: normalize(4) }}>
428
+ <Text style={{ fontSize: normalize(8), paddingHorizontal: 5 }}>Consultant :</Text>
429
+ <SDropDownNew
430
+ dropdownapi={'emr/emrcommonget/exec rndddwdropdownselect 1'}
431
+ dropdowndata={ValueCheck(Global.userData.hosuconsultant) &&
432
+ Global.userData.hosuconsultant > 0 ? Global.userData.username : ''}
433
+ onChangeData={val =>
434
+ val == undefined ? null : setConsultant(val)}
435
+ editable={true}
436
+ widthArr={Dimensions.get('screen').width * 0.96}
437
+ iconName={'user-md'}
438
+ refreshCount={val =>
439
+ val == undefined ? null : console.log('Refresh')
440
+ }
441
+ />
442
+ </View> : null}
443
+
444
+ <View style={{ paddingHorizontal: normalize(8) }}>
445
+ <Text style={{ fontSize: normalize(8), paddingHorizontal: 5 }}>Token Type :</Text>
446
+ <SDropDownNew
447
+ dropdownapi={'emr/emrcommonget/rnladropdowntokentype'}
448
+ dropdowndata={'ALL'}
449
+ onChangeData={val =>
450
+ val == undefined ? null : setTokenType(val.datavalue)}
451
+ editable={true}
452
+ widthArr={Dimensions.get('screen').width * 0.96}
453
+ iconName={'coins'}
454
+ refreshCount={val =>
455
+ val == undefined ? null : console.log()
456
+ }
457
+ />
458
+ </View>
459
+
460
+ {stage == 2 ?
461
+ <CFromToDate
462
+ callBack={val =>
463
+ val == undefined
464
+ ? null
465
+ : setDate(val)
466
+ } /> : null}
467
+ </View>
468
+
469
+ <View style={{
470
+ position: 'absolute', flexDirection: 'row', borderTopColor: '#c9c7c7', borderTopWidth: 2,
471
+ alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: 0,
472
+ bottom: 0, paddingVertical: 5, width: '100%', backgroundColor: '#fff',
473
+ }}>
474
+ {[
475
+ {
476
+ 'icongroup': 4,
477
+ 'displaytext': 'Print', 'size': 10, 'iconname': 'print', 'iconcolor': Global.AppTheme.primary_color, 'fontcolor': Global.AppTheme.primary_color,
478
+ 'shadowcolor': '#fff', 'selected': false, 'visibility': true, 'iconsize': 20, 'functionid': 'CB01', 'iconsize': 20, 'functionid': 'CB01', 'componentname': 'SetUpVitalSign',
479
+ },
480
+ {
481
+ 'icongroup': 4,
482
+ 'displaytext': 'Monthly',
483
+ 'iconname': 'calendar-check-o',
484
+ 'stage': 1,
485
+ 'visibility': true,
486
+ 'functionid': 'CB04',
487
+ },
488
+ {
489
+ 'icongroup': 4,
490
+ 'key': 3,
491
+ 'iconname': 'stack-overflow',
492
+ 'displaytext': 'Tokens',
493
+ 'visibility': true,
494
+ 'functionid': 'CB05',
495
+ },
496
+ {
497
+ 'icongroup': 4,
498
+ 'iconname': 'user-md',
499
+ 'displaytext': 'Booking',
500
+ 'stage': 1,
501
+ 'visibility': true,
502
+ 'functionid': 'CB03',
503
+ },
504
+ {
505
+ 'icongroup': 4,
506
+ 'iconname': 'exchange',
507
+ 'displaytext': 'Postpone',
508
+ 'stage': 5,
509
+ 'visibility': true,
510
+ 'selected': true,
511
+ 'functionid': 'CB06',
512
+ },
513
+ // {
514
+ // "icongroup": 4,
515
+ // "displaytext": "Report", "size": 10, "iconname": "file-pdf-o", "iconcolor": Global.AppTheme.primary_color,
516
+ // "fontcolor": Global.AppTheme.primary_color, "shadowcolor": '#fff', "selected": false, "visibility": true, "iconsize": 20, "functionid": "CB02",
517
+ // }
518
+ ].map((item, i) => {
519
+ return (
520
+ item.visibility ?
521
+
522
+
523
+ // <TouchableOpacity key={i} style={{ alignItems: 'center', justifyContent: 'center' }}
524
+ // onPress={() => getFooterIconsFunctions(item)}>
525
+ // <Icons.FontAwesome name={item.iconname} color={item.displaytext == "Report" ? "#db04ac" : item.displaytext == "Save" ? "red" : "black"} size={normalize(20)} />
526
+ // <Text style={{ color: item.displaytext == "Report" ? "#db04ac" : item.displaytext == "Save" ? "red" : "black", fontSize: normalize(10) }}>{item.displaytext}</Text>
527
+ // </TouchableOpacity>
528
+
529
+ <View>
530
+ <CAwesomeButton
531
+ key={i}
532
+ data={{
533
+ ...item,
534
+ 'width': normalize(45),
535
+ 'shadowcolor': '#fff',
536
+ 'iconcolor': item.displaytext == 'Report' ? '#db04ac' : item.displaytext == 'Save' ? 'red' : Global.AppTheme.primary_color,
537
+ 'fontcolor': item.displaytext == 'Report' ? '#db04ac' : item.displaytext == 'Save' ? 'red' : Global.AppTheme.primary_color,
538
+ }}
539
+ callBack={val => val == undefined ? null : getFooterIconsFunctions(item)}
540
+ />
541
+ </View>
542
+
543
+ : null
544
+ );
545
+ })}
546
+ </View>
547
+ </View>
548
+ );
549
+
550
+ function getFooterIconsFunctions(val) {
551
+ switch (val.functionid) {
552
+ case 'CB01': ValueCheck(date) ? getReportAPI(date, tokenType) : notifyMessage('Data Not Found', 3);
553
+ break;
554
+ case 'CB02': props.callBack(4);
555
+ break;
556
+ case 'CB03': props.callBack(1);
557
+ break;
558
+ case 'CB04': props.callBack(0);
559
+ break;
560
+ case 'CB05': props.callBack(2);
561
+ break;
562
+ case 'CB06': props.callBack(5);
563
+ break;
564
+ default: console.log('Deault');
565
+ break;
566
+ }
567
+ }
568
+ };
569
+ export default CReport;
@@ -0,0 +1,73 @@
1
+ import React, { useRef, useState } from 'react';
2
+ import { Animated, Dimensions, View, ScrollView, StyleSheet, TouchableOpacity, Image, Text } from 'react-native';
3
+ import { normalize } from '../CommonStyle/componentStyle';
4
+ import FontAwesome from 'react-native-vector-icons/FontAwesome';
5
+ import { useNavigation } from '../Navigation/useNavigation';
6
+
7
+
8
+ import { videoURL } from '../../../../../src/Common/apiConstants';
9
+ const { width } = Dimensions.get('window');
10
+ const itemWidth = (width / 3) * 2;
11
+ const padding = (width - itemWidth) / 2;
12
+ const offset = itemWidth;
13
+ export default function CScrollView(props) {
14
+ const [data, setData] = useState(props.data);
15
+ const scrollX = useRef(new Animated.Value(0)).current;
16
+ return (
17
+ <ScrollView
18
+ horizontal
19
+ pagingEnabled
20
+ decelerationRate="fast"
21
+ contentContainerStyle={styles.scrollView}
22
+ showsHorizontalScrollIndicator={false}
23
+ snapToInterval={offset}
24
+ onScroll={Animated.event(
25
+ [{ nativeEvent: { contentOffset: { x: scrollX } } }],
26
+ { useNativeDriver: false }
27
+ )}
28
+ >
29
+
30
+ {data.map((item, i) => (
31
+ <Item key={i} i={i} scrollX={scrollX} item={item} />
32
+ ))}
33
+
34
+ </ScrollView>
35
+ );
36
+ }
37
+ function Item({ i, scrollX, item }) {
38
+ const navigation = useNavigation();
39
+ const scale = scrollX.interpolate({
40
+ inputRange: [-offset + i * offset, i * offset, offset + i * offset],
41
+ outputRange: [0.75, 1, 0.75],
42
+ });
43
+ return (
44
+ <TouchableOpacity onPress={() => navigation.navigate('CVideoPlay',
45
+ { video: item.videolink })}>
46
+ <Animated.View style={[styles.item, { transform: [{ scale }] }]}>
47
+ <Image
48
+ source={{ uri: item.thumbnail }}
49
+ style={{
50
+ flex: 1, borderRadius: 10,
51
+ }}
52
+ resizeMode={'cover'}
53
+ />
54
+ <View style={{ position: 'absolute', bottom: '40%', left: '37%' }}>
55
+ <FontAwesome name={'play-circle-o'} size={normalize(60)} color={'#4f4e4e'} />
56
+ </View>
57
+ <View style={{ position: 'absolute', paddingHorizontal: 10, bottom: normalize(10), left: normalize(10), backgroundColor: 'black', borderRadius: 5 }}>
58
+ <Text style={{ fontSize: normalize(10), fontWeight: 'bold', color: '#fff' }}>{item.displaytext}</Text>
59
+ </View>
60
+ </Animated.View>
61
+ </TouchableOpacity>
62
+ );
63
+ }
64
+ const styles = StyleSheet.create({
65
+ scrollView: { paddingHorizontal: padding, alignItems: 'flex-start', paddingTop: normalize(40) },
66
+ item: {
67
+ height: itemWidth,
68
+ width: itemWidth,
69
+ backgroundColor: 'darkblue',
70
+ borderRadius: 10,
71
+ elevation: 5,
72
+ },
73
+ });