@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.
Files changed (178) hide show
  1. package/index.d.ts +66 -0
  2. package/index.js +3 -7
  3. package/package.json +3 -2
  4. package/src/Alerts/AAlert.js +4 -4
  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/RecordAudio.js +1 -1
  127. package/src/Media/VideoScreen.js +2 -7
  128. package/src/Navigation/PageNavigation.js +224 -0
  129. package/src/Navigation/useFocusEffect.js +2 -0
  130. package/src/Navigation/useFocusEffect.native.js +1 -0
  131. package/src/Navigation/useFocusEffect.web.js +1 -0
  132. package/src/Navigation/useIsFocused.js +1 -0
  133. package/src/Navigation/useIsFocused.native.js +1 -0
  134. package/src/Navigation/useIsFocused.web.js +1 -0
  135. package/src/Navigation/useNavigation.js +2 -0
  136. package/src/Navigation/useNavigation.native.js +1 -0
  137. package/src/Navigation/useNavigation.web.js +1 -0
  138. package/src/Screens/CMedications.js +528 -0
  139. package/src/Screens/CWebViewGallery.js +203 -0
  140. package/src/Screens/ChartScan.js +279 -0
  141. package/src/Screens/ChartScreenNew.js +1579 -0
  142. package/src/Screens/Consultation.js +1500 -0
  143. package/src/Screens/Dashboard.js +778 -0
  144. package/src/Screens/FileExplorer.js +288 -0
  145. package/src/Screens/Footer.js +340 -0
  146. package/src/Screens/ForgotPassword.js +288 -0
  147. package/src/Screens/HeaderBlock.js +353 -0
  148. package/src/Screens/Login.js +328 -0
  149. package/src/Screens/Notification.js +149 -0
  150. package/src/Screens/OcrScreen.js +20 -0
  151. package/src/Screens/PdfPreview.js +507 -0
  152. package/src/Screens/RegistrationDetails.js +467 -0
  153. package/src/Screens/SearchScreen.js +582 -0
  154. package/src/Screens/Splash.js +788 -0
  155. package/src/Screens/SwipeLeftView.js +1867 -0
  156. package/src/StaticComponents/SDatePickerLabel.js +1 -1
  157. package/src/StaticComponents/SDatePickerNew.js +1 -1
  158. package/src/StaticComponents/SDateTimePickerNew.js +2 -2
  159. package/src/StaticComponents/SDropDownGenerate.js +3 -3
  160. package/src/StaticComponents/SDropDownHoc.js +4 -4
  161. package/src/StaticComponents/SDropDownIcon.js +1 -1
  162. package/src/StaticComponents/SMenuBox.js +2 -2
  163. package/src/StaticComponents/SSearch.js +2 -2
  164. package/src/StaticComponents/STextInput.js +1 -1
  165. package/src/StaticComponents/STimePicker.js +1 -1
  166. package/src/StaticComponents/STimingDropDownNew.js +2 -6
  167. package/src/StaticComponents/STimingSwitch.js +1 -1
  168. package/src/layout/CContainerView.js +1 -1
  169. package/src/layout/CDetailView.js +3 -3
  170. package/src/layout/HeaderBlock.js +5 -5
  171. package/src/layout/INVLoginLayout.js +3 -4
  172. package/src/layout/Loader.js +2 -2
  173. package/src/HOC/HAbsolute.js +0 -56
  174. package/src/HOC/HDiscontinue.js +0 -105
  175. package/src/HOC/HOverlay.js +0 -99
  176. package/src/layout/FooterBlock.js +0 -821
  177. /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
  178. /package/src/{common → Common}/Icons.js +0 -0
@@ -0,0 +1,327 @@
1
+ import React, { useState, useContext, useEffect } from 'react';
2
+ import { View, Text, TouchableOpacity, TextInput, FlatList, Dimensions, ScrollView } from 'react-native';
3
+ import { Icons } from '@jescon-technologies/react-native-ui-kit';;
4
+ import { normalize } from '../CommonStyle/componentStyle';
5
+ import CFooterView from '../CustomComponents/CFooterView';
6
+ import EmrResponseComponentContext from '../Handlers/emrResponseComponentContext';
7
+ import { getLoading, isNU, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
8
+ import CAwesomeButton from '../CustomComponents/CAwesomeButton';
9
+ import SSearchBar from '../StaticComponents/SSearchBar';
10
+ import SAlphabet from '../StaticComponents/SAlphabet';
11
+ import { getListviewItem, getListviewItemText } from '../CommonStyle/PopupStyle';
12
+ import { Global } from '../../../../../src/Common/Global';
13
+ import { APIURL } from '../../../../../src/Common/apiConstants';
14
+ import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
15
+ import { useNavigation } from '../Navigation/useNavigation';
16
+
17
+
18
+ import Loader from '../Custom/Loader';
19
+
20
+
21
+ var DropDownALL = [];
22
+ export default function CSummaryDropDown(props) {
23
+
24
+ const { responseJSON, setResponseJSON } = useContext(EmrResponseComponentContext);
25
+ const hosumrclassificationnature = responseJSON.consultation[responseJSON.natureindex].hosumrclassificationnature;
26
+ const navigation = useNavigation();
27
+ const [data, setData] = useState();
28
+ const [routine, setRoutine] = useState();
29
+ const [searchData, setSearchData] = useState('');
30
+ const [parameterName, setParameterName] = useState('');
31
+ const [refresh, setRefresh] = useState(0);
32
+ const [stage, setStage] = useState(1);
33
+ const [selected, setSelected] = useState(0);
34
+ const [isLoading, setIsLoading] = useState(true);
35
+ const [alphaFilter, setAlphaFilter] = useState(false);
36
+ const [filterPurpose, setFilterPurpose] = useState([]);
37
+ const [tempString, settempString] = useState([]);
38
+ const [displayData, setDisplayData] = useState([]);
39
+ const [selectedValue, setSelectedValue] = useState(props.value);
40
+ const [edituser, setEditUser] = useState();
41
+
42
+
43
+ useEffect(() => {
44
+ setAlphaFilter(false);
45
+ });
46
+
47
+ useEffect(() => {
48
+ FetchDropdownList();
49
+ }, []);
50
+
51
+ function FetchDropdownList() {
52
+ setSearchData('');
53
+ setIsLoading(true);
54
+ let buttonapi = APIURL + 'emr/emrcommonget/rnsummarydropdown ' + Global.userData.hosuconsultant + ',' + hosumrclassificationnature;
55
+ console.log('JJJJJJJMMMMMMMMMHHHHHHHHHHHHHHHHH3', buttonapi);
56
+ NetworkServiceCall('get', buttonapi, '')
57
+ .then(function (response) {
58
+ if (response.data.data != null && response.data.data != undefined) {
59
+ DropDownALL = response.data.data;
60
+ setDisplayData(response.data.data);
61
+ setIsLoading(false);
62
+ }
63
+ else {
64
+ setDisplayData([]);
65
+ setIsLoading(false);
66
+ }
67
+ });
68
+ }
69
+
70
+ function getNavigateToSummary() {
71
+ navigation.navigate('SummaryTemplate', { type: 1 });
72
+ props.visibility(false);
73
+ }
74
+
75
+ function getAllTabFunctions(key) {
76
+ switch (key) {
77
+ case 'ALL01': getRetrival(1);
78
+ break;
79
+ case 'ALL02': getRetrival(2);
80
+ break;
81
+ default: break;
82
+ }
83
+ }
84
+
85
+ function getRetrival(type) {
86
+
87
+ var x = tempString.toString();
88
+ var procedurename = 'rnhomrsummarytemplate '; // rnlatemplatesummaryretrival_01112024 rnlatemplatesummaryretrival
89
+ setIsLoading(true);
90
+ let buttonapi = APIURL + 'emr/emrcommonget/' + procedurename + type + ',' + Global.PatientDetails.hopapatient + ',' + Global.userData.hosuconsultant + ',' + hosumrclassificationnature + ',' + x + ',' + Global.ParameterInfo.homrpatientchart;
91
+ console.log('getRetrival buttonapi', buttonapi);
92
+
93
+ NetworkServiceCall('get', buttonapi, '')
94
+ .then(function (response) {
95
+ if (response.data.NewData != null && response.data.NewData != undefined && responseJSON.consultationEdit.NewData != undefined) {
96
+ if (type == 1) {
97
+
98
+ // console.log('response.data.NewData', JSON.stringify([response.data.NewData[0]]));
99
+
100
+ const updatedResponseJSON = {
101
+ ...responseJSON,
102
+ editStatus: true,
103
+ consultation: [...responseJSON.consultation],
104
+ };
105
+ const natureindex = updatedResponseJSON.natureindex ?? 0;
106
+ updatedResponseJSON.consultation[natureindex] = {
107
+ ...updatedResponseJSON.consultation[natureindex],
108
+ editStatus: true,
109
+ NewData: [...updatedResponseJSON.consultation[natureindex].NewData],
110
+ };
111
+ updatedResponseJSON.consultation[natureindex].NewData = [response.data.NewData[0]];
112
+ setResponseJSON(updatedResponseJSON);
113
+
114
+ navigation.navigate('ConsultationEdit', { data: updatedResponseJSON.consultation[updatedResponseJSON.natureindex].NewData[0].editArray, parent: updatedResponseJSON.consultation[updatedResponseJSON.natureindex] });
115
+
116
+ setIsLoading(false);
117
+ props.visibility(false);
118
+
119
+ // responseJSON.consultationEdit.NewData = [];
120
+ // responseJSON.consultationEdit.editStatus = true;
121
+ // setTimeout(() => {
122
+ // responseJSON.consultationEdit.NewData.push(response.data.NewData[0]);
123
+ // navigation.navigate('ConsultationEdit', { data: responseJSON.consultationEdit.NewData[0].editArray, parent: responseJSON.consultationEdit });
124
+ // setResponseJSON({
125
+ // ...responseJSON,
126
+ // "consultationEdit": responseJSON.consultationEdit
127
+ // });
128
+ // setIsLoading(false);
129
+ // props.visibility(false);
130
+ // });
131
+
132
+ } else {
133
+ navigation.navigate('SummaryTemplate', { type: 2, data: response.data.NewData });
134
+ setIsLoading(false);
135
+ props.visibility(false);
136
+ }
137
+ }
138
+ else {
139
+ setIsLoading(false);
140
+ props.visibility(false);
141
+ }
142
+ });
143
+ getLoading(v => setIsLoading(false));
144
+ }
145
+
146
+ function renderItem(data) {
147
+
148
+ return (
149
+ data.item.displayvalue != undefined && data.item.displayvalue != '' ?
150
+ <TouchableOpacity
151
+ style={[getListviewItem(data.item.selected), { flexDirection: 'row', alignItems: 'center' }]}
152
+ onPress={() => onSelectItem(data.item, false)}
153
+ activeOpacity={0.5}
154
+ >
155
+ <Icons.FontAwesome name="dot-circle-o" color={Global.AppTheme.primary_color} size={normalize(10)}
156
+ style={{ paddingHorizontal: normalize(2), paddingLeft: normalize(4) }} />
157
+ <Text style={selectedValue != null && selectedValue != undefined ? selectedValue == item.datavalue ? getListviewItemText(true) : getListviewItemText(false) : getListviewItemText(false)}>
158
+ {data.item.displayvalue.toUpperCase()}
159
+ </Text>
160
+ </TouchableOpacity>
161
+ : null
162
+ );
163
+ }
164
+
165
+ function onSelectItem(datavalue, multiselect) {
166
+ if (multiselect == true) {
167
+ if (tempString.includes(datavalue.datavalue)) {
168
+ datavalue.selected = !datavalue.selected;
169
+ setSelected(selected + 1);
170
+ var index = tempString.indexOf(datavalue.datavalue);
171
+ if (index > -1) {
172
+ tempString.splice(index, 1);
173
+ }
174
+ } else {
175
+ datavalue.selected = !datavalue.selected;
176
+ setSelected(selected + 1);
177
+ tempString.push(datavalue.datavalue);
178
+ }
179
+ } else {
180
+ displayData.map((sub) => sub.selected = false);
181
+ datavalue.selected = true;
182
+ tempString.splice(0, tempString.length);
183
+ tempString.push(datavalue.datavalue);
184
+ setEditUser(datavalue);
185
+ setSelected(selected + 1);
186
+ }
187
+ }
188
+
189
+ function getAlphabetData(alpha, index) {
190
+ var filter = displayData.filter(value => (value.displayvalue != undefined ? value.displayvalue : '').charAt(0) == alpha);
191
+ setFilterPurpose(filter);
192
+ index == 0 ? setSearchData('') : setSearchData(alpha);
193
+ index == 0 ? setAlphaFilter(false) : setAlphaFilter(true);
194
+ }
195
+
196
+ function GetDropdown(data) {
197
+ const newDropDownData = data.filter(function (item) {
198
+ const dataItem = item.displayvalue ? item.displayvalue.toUpperCase() : ''.toUpperCase();
199
+ const textData = searchData.toUpperCase();
200
+ return dataItem.indexOf(textData) > -1;
201
+ });
202
+ return (
203
+ <View style={{ flexDirection: 'row' }}>
204
+ <FlatList
205
+ data={newDropDownData}
206
+ renderItem={renderItem}
207
+ initialNumToRender={10}
208
+ maxToRenderPerBatch={20}
209
+ keyExtractor={(item, index) => 'key' + index}
210
+ />
211
+
212
+ <SAlphabet
213
+ callBack={val =>
214
+ val == undefined ? null : getAlphabetData(val.alpha, val.index)
215
+ } />
216
+ </View>
217
+ );
218
+ }
219
+
220
+ return (
221
+ <View style={{ marginTop: normalize(-5) }}>
222
+ {isLoading ?
223
+ <Loader displaytext={true} />
224
+ : null}
225
+ <Text style={{ alignSelf: 'center', fontSize: normalize(12), fontWeight: 'bold', marginBottom: normalize(2), color: Global.AppTheme.primary_color }}>{ValueCheck(responseJSON) && ValueCheck(responseJSON.consultationEdit) && ValueCheck(responseJSON.consultationEdit.heading) ? responseJSON.consultationEdit.heading : 'SUMMARY'}</Text>
226
+
227
+ <View style={{
228
+ flexDirection: 'row', backgroundColor: '#fff', width: '100%', borderRadius: 6,
229
+ justifyContent: 'space-evenly', height: normalize(45), alignItems: 'center', marginRight: normalize(8),
230
+ }}>
231
+ {[{ 'iconname': 'archive', 'displayvalue': 'ALL', 'color': Global.AppTheme.primary_color, 'shadowcolor': '#fff', 'stage': 1 },
232
+ { 'iconname': 'add-to-list', 'displayvalue': 'CREATE', 'color': Global.AppTheme.primary_color, 'shadowcolor': '#fff', 'stage': 2 }].map((buttons, i) => {
233
+ return (
234
+ <TouchableOpacity
235
+ key={i}
236
+ onPress={() => buttons.stage == 1 ? setStage(buttons.stage) : getNavigateToSummary()}
237
+ style={{
238
+ borderRadius: 7,
239
+ borderWidth: 1,
240
+ height: normalize(35),
241
+ width: normalize(50),
242
+ backgroundColor: stage == buttons.stage ? '#eaf2ff' : '#fff',
243
+ borderColor: stage == buttons.stage ? '#eaf2ff' : Global.AppTheme.primary_color,
244
+ alignItems: 'center',
245
+ justifyContent: 'center',
246
+ padding: 0,
247
+ elevation: 1,
248
+ shadowColor: '#000',
249
+ shadowOffset: { width: 0, height: 1 },
250
+ shadowOpacity: 0.2,
251
+ shadowRadius: 1,
252
+ }}
253
+ >
254
+ <View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
255
+ <Icons.Entypo name={buttons.iconname} style={{ paddingRight: 0 }}
256
+ color={Global.AppTheme.primary_color} size={normalize(17)} />
257
+ <Text style={{
258
+ color: Global.AppTheme.primary_color,
259
+ fontSize: normalize(10),
260
+ fontWeight: stage == buttons.stage ? 'bold' : 'normal',
261
+ }}>{buttons.displayvalue}</Text>
262
+ </View>
263
+ </TouchableOpacity>
264
+ );
265
+ })}
266
+ </View>
267
+
268
+ {stage == 1 ?
269
+ <View style={{ flex: 1 }}>
270
+ <View style={{ flexDirection: 'row', marginTop: normalize(5) }}>
271
+ <SSearchBar
272
+ onChangeText={val => setSearchData(val)}
273
+ />
274
+ </View>
275
+
276
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1 }}>
277
+ <View style={{ flex: 1 }}>
278
+ {GetDropdown(alphaFilter ? filterPurpose : displayData)}
279
+ </View>
280
+ </View>
281
+ </View>
282
+ : null}
283
+
284
+ {stage == 1 ?
285
+ <CFooterView style={{ borderRadius: normalize(10), backgroundColor: '#fff' }}>
286
+ <View style={{ flexDirection: 'row' }}>
287
+ {[{
288
+ 'displaytext': 'Select',
289
+ 'fontcolor': Global.AppTheme.primary_color,
290
+ 'shadowcolor': '#f1f3f6',
291
+ 'size': 10,
292
+ 'iconname': 'file-medical',
293
+ 'iconcolor': Global.AppTheme.primary_color,
294
+ 'selected': false,
295
+ 'visibility': true,
296
+ 'iconsize': 20,
297
+ 'functionid': 'ALL01',
298
+ },
299
+ {
300
+ 'displaytext': 'Edit',
301
+ 'fontcolor': Global.AppTheme.primary_color,
302
+ 'shadowcolor': '#f1f3f6',
303
+ 'size': 10,
304
+ 'iconname': 'edit',
305
+ 'iconcolor': Global.AppTheme.primary_color,
306
+ 'selected': false,
307
+ 'visibility': isNU(edituser) ? true : false, // isNU(edituser) && edituser.editstatus ? true : false,
308
+ 'iconsize': 20,
309
+ 'functionid': 'ALL02',
310
+ }].map((item, i) => {
311
+ return (
312
+ item.visibility ?
313
+ <View key={i} style={{ borderRadius: normalize(10), paddingLeft: normalize(10) }}>
314
+ <CAwesomeButton
315
+ data={item}
316
+ callBack={val => val == undefined ? null : getAllTabFunctions(item.functionid)}
317
+ />
318
+ </View>
319
+ : null
320
+ );
321
+ })}
322
+ </View>
323
+ </CFooterView> : null}
324
+
325
+ </View>
326
+ );
327
+ }
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import { Text } from 'react-native';
3
+
4
+ const CText = (props) => {
5
+ return (
6
+ <Text adjustsFontSizeToFit {...props} />
7
+ );
8
+ };
9
+ export default CText;
@@ -0,0 +1,34 @@
1
+ import React, { useState } from 'react';
2
+ import { Text, TouchableOpacity } from 'react-native';
3
+ import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
4
+ import { Icons } from '@jescon-technologies/react-native-ui-kit';;
5
+ import { notifyMessage } from '../CommonStyle/ComponentFunctions';
6
+ import { normalize } from '../CommonStyle/componentStyle';
7
+
8
+ export default function CVectorIcon(props) {
9
+ const [data, setData] = useState(props.data);
10
+ return (
11
+ <TouchableOpacity
12
+ disabled={data.disabled != undefined ? data.disabled : false}
13
+ style={{ alignItems: 'center', width: data.width != undefined ? normalize(70) : normalize(50) }}
14
+ onPress={() => data.functionid != undefined ? getCallBack(data) : notifyMessage('Incorporate soon',3)}>
15
+ <Icons.FontAwesome5 name={data.iconname != undefined ? data.iconname : 'file'}
16
+ color={data.iconcolor != undefined ? data.iconcolor : 'white'}
17
+ size={data.iconsize != undefined ? normalize(data.iconsize) : normalize(20)} />
18
+ <Text
19
+ numberOfLines={1}
20
+ style={{
21
+ // flex:1,
22
+ width:normalize(50),
23
+ color: data.fontcolor != undefined ? data.fontcolor : '#fff',
24
+ textAlign: data.textAlign != undefined ? data.textAlign : 'center',
25
+ fontSize: data.size != undefined ? normalize(data.size) : normalize(10),
26
+ fontWeight: data.fontWeight != undefined ? data.fontWeight : 'normal',
27
+ }}>{data.displaytext != undefined ? data.displaytext : ''}</Text>
28
+ </TouchableOpacity>
29
+ );
30
+
31
+ function getCallBack(item) {
32
+ props.callBack(item);
33
+ }
34
+ }
@@ -0,0 +1,65 @@
1
+ import React, { useEffect, useRef } from 'react';
2
+ import { Platform } from 'react-native';
3
+ import { WebView } from 'react-native-webview';
4
+
5
+
6
+ const HtmlContentViewer = ({
7
+ htmlContent,
8
+ uri,
9
+ width = '100%',
10
+ height = 500,
11
+ iframeRef: externalIframeRef,
12
+ onLoad,
13
+ onMessage,
14
+ }) => {
15
+ const internalIframeRef = useRef(null);
16
+ const iframeRef = externalIframeRef || internalIframeRef;
17
+
18
+ // ✅ Hook is ALWAYS called
19
+ useEffect(() => {
20
+ if (Platform.OS === 'web' && iframeRef.current) {
21
+ const iframe = iframeRef.current;
22
+ const doc =
23
+ iframe.contentDocument || iframe.contentWindow?.document;
24
+
25
+ if (doc) {
26
+ doc.open();
27
+ doc.write(htmlContent);
28
+ doc.close();
29
+ }
30
+ }
31
+ }, [htmlContent]);
32
+
33
+ // 🌐 Web / Electron
34
+ if (Platform.OS === 'web') {
35
+ return htmlContent ? (
36
+ <iframe
37
+ ref={iframeRef}
38
+ title="html-content"
39
+ style={{ width, height, border: 'none' }}
40
+ />
41
+ ) : (
42
+ <iframe
43
+ src={uri}
44
+ title="uri-content"
45
+ style={{ width, height, border: 'none' }}
46
+ />
47
+ );
48
+ }
49
+
50
+ // 📱 Android / iOS
51
+ return (
52
+ <WebView
53
+ androidHardwareAccelerationDisabled
54
+ scalesPageToFit
55
+ mixedContentMode="compatibility"
56
+ originWhitelist={['*']}
57
+ source={htmlContent ? { html: htmlContent } : { uri }}
58
+ onLoad={onLoad}
59
+ onMessage={onMessage}
60
+ style={{ width, height }}
61
+ />
62
+ );
63
+ };
64
+
65
+ export default HtmlContentViewer;
@@ -0,0 +1,90 @@
1
+ import React, { useEffect, useState } from 'react';
2
+ import { Platform, View, ActivityIndicator, StyleSheet } from 'react-native';
3
+ import Pdf from 'react-native-pdf';
4
+
5
+ const PdfContentViewer = ({
6
+ link,
7
+ style,
8
+ onLoadComplete,
9
+ onError,
10
+ }) => {
11
+ const [isLoading, setIsLoading] = useState(true);
12
+ const [localPdfUrl, setLocalPdfUrl] = useState(null);
13
+
14
+ useEffect(() => {
15
+ async function preparePdf() {
16
+ if (!link) {return;}
17
+ console.log('Preparing PDF from link:', link);
18
+ setIsLoading(true);
19
+ try {
20
+ if (Platform.OS === 'web') {
21
+ const localPath = await window.electronAPI.openPdfPreview(link);
22
+ setLocalPdfUrl(localPath);
23
+ } else {
24
+ setLocalPdfUrl(link);
25
+ }
26
+ } catch (err) {
27
+ console.error('PDF prepare error', err);
28
+ onError?.(err);
29
+ } finally {
30
+ setIsLoading(false);
31
+ }
32
+ }
33
+
34
+ preparePdf();
35
+ return () => (mounted = false);
36
+ }, [link]);
37
+
38
+ if (!localPdfUrl) {return null;}
39
+
40
+ return (
41
+ <View style={[styles.container, style]}>
42
+ {isLoading && (
43
+ <View style={styles.loader}>
44
+ <ActivityIndicator size="large" />
45
+ </View>
46
+ )}
47
+ {Platform.OS === 'web' ? (
48
+ <iframe
49
+ src={localPdfUrl}
50
+ style={styles.pdfView}
51
+ title="PDF Viewer"
52
+ onLoad={() => onLoadComplete?.(localPdfUrl)}
53
+ onError={(e) => onError?.(e)}
54
+ />
55
+ ) : (
56
+ <Pdf
57
+ onLoadProgress={n => { }}
58
+ trustAllCerts={false}
59
+ onPressLink={uri => { }}
60
+ onPageChanged={(page, numberOfPages) => { }}
61
+ source={{ uri: localPdfUrl }}
62
+ style={styles.pdfView}
63
+ onLoadComplete={(pages, path) =>
64
+ onLoadComplete?.(path, pages)
65
+ }
66
+ onError={onError}
67
+ />
68
+ )}
69
+ </View>
70
+ );
71
+ };
72
+
73
+ export default PdfContentViewer;
74
+
75
+ const styles = StyleSheet.create({
76
+ container: { flex: 1 },
77
+ pdfView: {
78
+ flex: 1,
79
+ width: '100%',
80
+ height: '100%',
81
+ borderWidth: 0,
82
+ },
83
+ loader: {
84
+ ...StyleSheet.absoluteFillObject,
85
+ justifyContent: 'center',
86
+ alignItems: 'center',
87
+ zIndex: 10,
88
+ backgroundColor: 'rgba(255,255,255,0.6)',
89
+ },
90
+ });