@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,529 @@
1
+ //dddddddddddddddddddddddddddddddddddddddddddddddd
2
+ import React, { useState, useEffect, useRef } from 'react';
3
+ import { TouchableOpacity, StyleSheet, View, Dimensions, Text, Image, TextInput, FlatList, ScrollView } from 'react-native';
4
+ import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
5
+ import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
6
+ import {
7
+ getListviewItem,
8
+ getListviewItemText,
9
+ } from '../CommonStyle/PopupStyle';
10
+ import { APIURL } from '../../../../../src/Common/apiConstants';
11
+ import AntDesign from 'react-native-vector-icons/AntDesign';
12
+ import Icons, { MaterialCommunityIcons } from '../Common/Icons';
13
+ import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
14
+ import SearchLoader from '../Custom/SearchLoader';
15
+ import { isBNU, isBNUL, isNU, isNUL } from '../CommonStyle/ComponentFunctions';
16
+ import { Global } from '../../../../../src/Common/Global';
17
+ import { Menu, MenuOptions, MenuTrigger } from 'react-native-popup-menu';
18
+ import HOCIcons from '../HOC/HOCIcons';
19
+ import SHelpDescription from './SHelpDescription';
20
+ import CModalOverlay from '../CustomComponents/CModalOverlay';
21
+
22
+ var searchResult = [];
23
+ var tempvalue = [];
24
+ var ValueString = null;
25
+ const SDropDownNew = (props) => {
26
+ const [isdropdownshow, setDropdownShow] = useState(false);
27
+ const [searchData, setSearchData] = useState('');
28
+ const [isLoading, setIsLoading] = useState(true);
29
+ const [selectedValue, setSelectedValue] = useState(props.value);
30
+ const [displayData, setDisplayData] = useState([]);
31
+ const [stage, setStage] = useState(false);
32
+ const [refresh, setRefresh] = useState(0);
33
+ const [filterPurpose, setFilterPurpose] = useState([]);
34
+ const [alphaFilter, setAlphaFilter] = useState(false);
35
+ const [dropdowndata, setDropDownData] = useState(props.dropdowndata);
36
+ const dynamicMenuRef = useRef(null);
37
+ const [data, setData] = useState(props.data ? props.data : null);
38
+
39
+ useEffect(() => {
40
+ setDropDownData(props.dropdowndata);
41
+ }, [props.dropdowndata]);
42
+
43
+ useEffect(() => {
44
+ setData(props.data ? props.data : null);
45
+ }, [props.data]);
46
+
47
+ useEffect(() => {
48
+ isBNU(props.overlay) && props.overlay == true ? FetchDropdownList() : null;
49
+ }, [props.overlay]);
50
+
51
+ function getOverlayScreenContainer() {
52
+ return ({
53
+ flexDirection: 'row',
54
+ margin: 10,
55
+ });
56
+ }
57
+
58
+ useEffect(() => {
59
+ setAlphaFilter(false);
60
+ });
61
+
62
+ function FetchDropdownList(key) {
63
+ const updatedApiUrl = props.dropdownPort ? '' : APIURL;
64
+ setSearchData('');
65
+ setIsLoading(true);
66
+ setDropdownShow(true);
67
+ // console.log("SDROPDOWNLINK___________________", "get", APIURL + props.dropdownapi, "")
68
+ NetworkServiceCall('get', updatedApiUrl + props.dropdownapi, '')
69
+ .then(function (response) {
70
+ console.log('updatedUrl', updatedApiUrl + props.dropdownapi);
71
+ // console.log('Responseeeeeeeeeeeeeeeeeeeeeeeeee', JSON.stringify(response.data.data))
72
+ // console.log("SDROPDOWN_________________DATA___________", response)
73
+ searchResult = response;
74
+ if (response.data.data != null && response.data.data != undefined) {
75
+
76
+ // console.log('arrayyyyyyyyyyyyyyy', JSON.stringify(props.multidropdownarray))
77
+ if (props.iconOnly && props.multiselect) {
78
+ if (isBNUL(props.multidropdownarray) && isBNUL(response.data.data)) {
79
+
80
+ var results = response.data.data.map((item) => {
81
+ // Find the matching `xxx` object from `props.multidropdownarray`
82
+ const matchingXxx = props.multidropdownarray.find((xxx) => item.datavalue === xxx.datavalue);
83
+
84
+ // If a match is found, update `item` with all properties from `matchingXxx`
85
+ if (matchingXxx) {
86
+ return { ...item, ...matchingXxx }; // Merge properties of `item` and `matchingXxx`
87
+ }
88
+
89
+ // If no match is found, return the original `item`
90
+ return item;
91
+ });
92
+
93
+ }
94
+ else {
95
+ var results = response.data.data;
96
+ }
97
+
98
+
99
+
100
+ console.log('response.data.data #################', JSON.stringify(results));
101
+ setDisplayData(results);
102
+ setIsLoading(false);
103
+
104
+
105
+
106
+ }
107
+ else {
108
+ if (props.selectedval != undefined && props.selectedval != null && props.selectedval.length > 0) {
109
+
110
+
111
+ var results = response.data.data.map((item) => {
112
+
113
+
114
+
115
+ props.selectedval.map((xxx) => {
116
+ if (item.datavalue == xxx) {
117
+ item.selected = true;
118
+ }
119
+ });
120
+ });
121
+ }
122
+
123
+ console.log('response.data.data #################', JSON.stringify(results));
124
+ setDisplayData(response.data.data);
125
+ setIsLoading(false);
126
+
127
+
128
+ }
129
+
130
+
131
+
132
+
133
+
134
+ }
135
+ else {
136
+ searchResult = [];
137
+ setDisplayData([]);
138
+ setIsLoading(false);
139
+ }
140
+ });
141
+ }
142
+
143
+ function FetchList() {
144
+ setSearchData('');
145
+ setIsLoading(true);
146
+ setDropdownShow(true);
147
+ searchResult = { 'httpstatus': 200 };
148
+ setDisplayData(props.dropdownarray);
149
+ setIsLoading(false);
150
+ }
151
+
152
+ function selection(item, changevalue, keycode) {
153
+ console.log('DROP DOWN DETAILCODE-----------------------', item);
154
+ let dataset = {
155
+ ...item,
156
+ // "datavalue": item.datavalue,
157
+ // "displayvalue": item.displayvalue,
158
+ // "detailcode": item.detailcode,
159
+ // "color": item.color,
160
+ // "searchparam": item.searchparam,
161
+ // "jasperfilename":item.jasperfilename,
162
+ // "reporttype":item.reporttype,
163
+ // "key": keycode,
164
+ // "item": item
165
+ };
166
+ setDropDownData(item.displayvalue);
167
+ props.onChangeData(dataset);
168
+ props.refreshCount(1);
169
+ // props.editStatus(1)
170
+ setDropdownShow(false);
171
+ if (props.setOverlay) {
172
+ props.setOverlay(false);
173
+ }
174
+ }
175
+
176
+ function DropdownLayout() {
177
+ return (
178
+ <View style={layoutstyles.overlay_screen_container}>
179
+ <View style={{ alignItems: 'center' }}>
180
+ <Text style={{ fontSize: normalize(12), fontWeight: 'bold', color: 'darkblue' }}>{isNU(data) && data.displaytext != undefined ? data.displaytext.toUpperCase() : ' SELECT OPTION '}</Text>
181
+ </View>
182
+ <View style={getOverlayScreenChildcontainer()}>
183
+ {GetDropdown(alphaFilter ? filterPurpose : displayData)}
184
+ </View>
185
+
186
+ {props.multiselect != undefined && props.multiselect
187
+ ?
188
+ <View style={{ justifyContent: 'center', alignItems: 'center', flexDirection: 'row', gap: normalize(5) }}>
189
+ <TouchableOpacity style={{ justifyContent: 'center', borderRadius: 10, alignItems: 'center', paddingHorizontal: normalize(0) }}
190
+ onPress={() => getMultiSelect(false)}
191
+ >
192
+ <View style={{
193
+ flexDirection: 'column',
194
+ backgroundColor: '#f7f4f4', borderRadius: 10,
195
+ paddingHorizontal: normalize(15),
196
+ paddingVertical: normalize(5),
197
+ alignItems: 'center',
198
+ }}>
199
+ <AntDesign name="select1"
200
+ color={'#094485'} size={normalize(20)} />
201
+
202
+ <Text
203
+ style={{
204
+ fontSize: normalize(11),
205
+ color: '#094485',
206
+ fontWeight: 'bold',
207
+ }}>
208
+ {' '}
209
+ Select
210
+ </Text>
211
+ </View>
212
+ </TouchableOpacity>
213
+ <TouchableOpacity style={{ justifyContent: 'center', borderRadius: 10, alignItems: 'center', paddingHorizontal: normalize(0) }}
214
+ onPress={() => getMultiSelect(true)}
215
+ >
216
+ <View style={{
217
+ flexDirection: 'column',
218
+ backgroundColor: '#f7f4f4', borderRadius: 10,
219
+ paddingHorizontal: normalize(15),
220
+ paddingVertical: normalize(5),
221
+ alignItems: 'center',
222
+ }}>
223
+ <AntDesign name="sync"
224
+ color={'#094485'} size={normalize(20)} />
225
+
226
+ <Text
227
+ style={{
228
+ fontSize: normalize(11),
229
+ color: '#094485',
230
+ fontWeight: 'bold',
231
+ }}>
232
+ {' '}
233
+ Reset
234
+ </Text>
235
+ </View>
236
+ </TouchableOpacity>
237
+ </View> : null}
238
+ </View>
239
+ );
240
+ }
241
+
242
+ function getMultiSelect(reset) {
243
+ let filterArray;
244
+ let display;
245
+ // console.log('DISPLAYDATA @@@@@@@@@@@@@@@@', displayData)
246
+ if (reset == false) {
247
+ filterArray = displayData.filter((element) => element.selected == true);
248
+ display = filterArray != undefined &&
249
+ filterArray.length > 0 ? filterArray.map((item) => item.displayvalue) : null;
250
+ setDropDownData(display?.join());
251
+ } else {
252
+ filterArray = [];
253
+ }
254
+
255
+ props.onChangeData(filterArray);
256
+ setDropdownShow(false);
257
+ if (props.setOverlay) {
258
+ props.setOverlay(false);
259
+ }
260
+ }
261
+
262
+ function getOverlayChildrenWrapperStyle() {
263
+ return ({
264
+ position: 'absolute',
265
+ bottom: 0,
266
+ top: Dimensions.get('screen').height * 0.17,
267
+ width: Dimensions.get('screen').width,
268
+ borderRadius: 20,
269
+ borderWidth: 2,
270
+ borderColor: '#e0e0e0',
271
+ paddingHorizontal: normalize(5),
272
+ });
273
+ }
274
+
275
+ return (
276
+ <View style={{ width: props.widthArr ? props.widthArr : '100%', borderWidth: 0 ,marginVertical: normalize(5)}}>
277
+ {isNU(data) && data.displaytext != undefined && props.iconOnly == undefined ?
278
+ <Text style={{ fontSize: normalize(11), color: 'black', paddingHorizontal: normalize(5), height: normalize(15) }}>
279
+ {data.required == true ?
280
+ <Text style={{ color: 'red', fontSize: normalize(13), fontWeight: 'bold' }}>* </Text> : null}
281
+ {data.displaytext}
282
+ </Text> : null}
283
+ {/* <Text>DDDDDDDDDDDDDD</Text> */}
284
+
285
+ <TouchableOpacity
286
+ onPress={() => (Global.HelpId = props.columnid, props.editable ? FetchDropdownList() : FetchList())}
287
+ disabled={props.disabled ? props.disabled : false}
288
+ // onLongPress={() => props.LongPress ? setStage(true) : null}
289
+ style={{
290
+ borderWidth: props.borderWidth ? 0 : 1, borderColor: 'lightgrey'
291
+ , paddingLeft: 2, alignItems: 'center', paddingRight: 15, elevation: 0,
292
+ backgroundColor: props.backgroundColor != undefined ? props.backgroundColor : '#fff',
293
+ height: props.heightArr ? props.heightArr : Dimensions.get('screen').height * 0.040,
294
+ flexDirection: 'row', borderRadius: props.borderRadiusArr ? props.borderRadiusArr : 5,
295
+ borderColor: props.borderArr ? props.borderArr : 'lightgrey',
296
+ }}
297
+
298
+ >
299
+
300
+
301
+ {props.iconOnly == undefined && props.iconName != undefined || props.icon != undefined ?
302
+
303
+ <Menu ref={dynamicMenuRef}>
304
+ <MenuTrigger
305
+ disabled={false}
306
+ customStyles={{ triggerWrapper: { borderWidth: 0, borderRadius: 10, elevation: 0 } }}
307
+ >
308
+ <TouchableOpacity disabled={true} style={{ width: normalize(22), paddingLeft: normalize(3) }}>
309
+ {props.iconName != undefined ? <FontAwesome5 name={props.iconName} color=
310
+ {props.flagData == 1 ? 'darkblue' : '#094485'}
311
+ size={props.iconSize != undefined ? normalize(props.iconSize) : normalize(15)} /> : null}
312
+ {props.icon != undefined ?
313
+ <MaterialCommunityIcons name={props.icon} color=
314
+ {props.flagData == 1 ? 'darkblue' : '#094485'}
315
+ size={normalize(20)} /> : null}
316
+
317
+ </TouchableOpacity>
318
+ </MenuTrigger>
319
+ <MenuOptions optionsContainerStyle={{ marginTop: normalize(25), marginLeft: 0, width: props.widthArr }}>
320
+ {props.columnid != undefined ? <SHelpDescription column={props.columnid != undefined ? props.columnid : 0} /> : null}
321
+ </MenuOptions>
322
+ </Menu>
323
+ : null}
324
+ {props.iconOnly != true ?
325
+ <View style={{ position: 'absolute', bottom: 0, right: 3 }}>
326
+ <Text adjustsFontSizeToFit numberOfLines={3}
327
+ style={{ fontSize: props.fontSize ? props.fontSize : normalize(11), alignSelf: 'flex-start', fontWeight: 'bold', width: parseFloat(props.widthArr) - normalize(10) + '%' }} >
328
+ {props.cornerKey != null && props.cornerKey != undefined && typeof props.cornerKey === 'string' ? props.cornerKey : ''}</Text>
329
+ </View>
330
+ : null}
331
+ {props.iconOnly != true ?
332
+ <View style={{ alignItems: 'center', paddingRight: normalize(5.2), width: props.iconclose ? '88%' : '100%' }}>
333
+ <Text adjustsFontSizeToFit numberOfLines={3} style={{ fontSize: props.fontSize ? props.fontSize : normalize(11), alignSelf: 'flex-start', fontWeight: 'bold', marginHorizontal: normalize(4), color: props.fontcolor ? props.fontcolor : 'black', width: '95%', borderWidth: 0 }} >
334
+ {dropdowndata != null && dropdowndata != undefined ? dropdowndata : props.value}
335
+ {/* {getDropDownData(dropdowndata)} */}
336
+ </Text>
337
+ </View>
338
+ : null}
339
+ {isBNU(dropdowndata) && props.iconclose ?
340
+ <TouchableOpacity
341
+ disabled={props.disabled != null && props.disabled != undefined && props.disabled == true ? true : false}
342
+ onPress={() => {
343
+ setDropDownData(''),
344
+ props.iconclosecallback(true);
345
+ }}
346
+ >
347
+ <HOCIcons.Icons
348
+ icongroup={3}
349
+ name={'close-circle'}
350
+ size={normalize(25)}
351
+ color={'darkblue'}
352
+ style={{ color: 'darkblue' }}
353
+ />
354
+ </TouchableOpacity>
355
+ : null}
356
+ {props.iconName != undefined && props.iconOnly == true ?
357
+ <FontAwesome5 name={props.iconName} color=
358
+ {props.flagData == 1 ? 'darkblue' : '#094485'}
359
+ size={props.iconsize} /> : null}
360
+ {props.icon != undefined && props.iconOnly == true ?
361
+ <MaterialCommunityIcons name={props.icon} color=
362
+ {props.flagData == 1 ? 'darkblue' : '#094485'}
363
+ size={props.iconsize} /> : null}
364
+
365
+ {isdropdownshow ?
366
+ <CModalOverlay visible={true}
367
+ onClose={() => {
368
+ setDropdownShow(false);
369
+ if (props.setOverlay) {
370
+ props.setOverlay(false);
371
+ }
372
+ }}
373
+ closeOnTouchOutside
374
+ animationType="zoomIn"
375
+ containerStyle={{ backgroundColor: 'transparent' }}
376
+ childrenWrapperStyle={getOverlayChildrenWrapperStyle()}
377
+ animationDuration={500}
378
+ >
379
+
380
+ <TouchableOpacity style={{ position: 'absolute', right: 0, zIndex: 1, marginTop: normalize(5) }}
381
+ onPress={() => {
382
+ setDropdownShow(false);
383
+ if (props.setOverlay) {
384
+ props.setOverlay(false);
385
+ }
386
+ }}
387
+ >
388
+ <FontAwesome5 name={'angle-double-down'}
389
+ color={'#094485'} size={normalize(20)} />
390
+ </TouchableOpacity>
391
+
392
+ <View style={getOverlayScreenContainer()}>
393
+ <View style={[ComponentStyles.searchTextbox_View, layoutstyles.overlay_searchTextbox_View]}>
394
+ <View style={layoutstyles.textinput_view}>
395
+ <TextInput
396
+ style={[ComponentStyles.searchTextbox]}
397
+ editable={true}
398
+ autoCapitalize={'characters'}
399
+ value={searchData}
400
+ onChangeText={text => setSearchData(text)}
401
+ secureTextEntry={false}
402
+ keyboardType={'default'}
403
+ placeholder="Search"
404
+ />
405
+
406
+ </View>
407
+ <Image style={[ComponentStyles.searchIcon]}
408
+ source={{ uri: 'https://i.ibb.co/j8ywYpJ/search.png' }}
409
+ />
410
+
411
+ </View>
412
+ </View>
413
+ {!isLoading ?
414
+ searchResult.httpstatus == 200 ?
415
+ DropdownLayout()
416
+ :
417
+ <View>
418
+ <Text style={[ComponentStyles.no_data_found_text]}>No Result Found</Text>
419
+ </View>
420
+ :
421
+ <View style={{
422
+ flex: 1, width: '100%', justifyContent: 'center',
423
+ backgroundColor: 'transparent', borderRadius: 10,
424
+ }}>
425
+ <SearchLoader />
426
+ </View>}
427
+ </CModalOverlay>
428
+ : null}
429
+
430
+ {stage ?
431
+ <OverlayHOCComponent
432
+ visibility={val => (val == undefined ? null : setStage(val))}
433
+ xyz={val => (val == undefined ? null : setDropDownData(val.displayvalue, setStage(false)))}
434
+ value={props.cornerKey}
435
+ // onselect={val => (val == undefined ? null : onSelect(val))}
436
+ // data={searchResult != null && searchResult != undefined && searchResult.length > 0 ? searchResult : null}
437
+ /> : null}
438
+
439
+ </TouchableOpacity>
440
+ </View>
441
+
442
+ );
443
+
444
+ function GetDropdown(data) {
445
+
446
+ const newDropDownData = data != null && data != undefined ? data.filter(function (item) {
447
+ const dataItem = item.displayvalue ? item.displayvalue.toUpperCase() : ''.toUpperCase();
448
+ const textData = searchData.toUpperCase();
449
+ return dataItem.indexOf(textData) > -1;
450
+ }) : null;
451
+
452
+ return (
453
+ <View style={{ flexDirection: 'row', flex: 1, width: '100%' }}>
454
+ <FlatList
455
+ data={newDropDownData}
456
+ renderItem={renderItem}
457
+ initialNumToRender={150}
458
+ maxToRenderPerBatch={200}
459
+ keyExtractor={(item, index) => 'key' + index}
460
+ style={{ flex: 1, width: '85%' }}
461
+ contentContainerStyle={{ flexGrow: 1 }}
462
+ scrollEnabled={true}
463
+ nestedScrollEnabled={true}
464
+ />
465
+ </View>
466
+ );
467
+ }
468
+
469
+ function multiselect(item, keycode) {
470
+ item.selected = !item.selected;
471
+ setRefresh(refresh + 1);
472
+ }
473
+ function renderItem(data) {
474
+ // console.log("________________________________________",data)
475
+ return (
476
+ <TouchableOpacity
477
+ style={[getListviewItem(data.item.selected), { flexDirection: 'row', alignItems: 'center' }]}
478
+ onPress={() => props.multiselect != undefined ? multiselect(data.item, props.keycode) : selection(data.item, data.item.selected, props.keycode)}
479
+ activeOpacity={0.5}
480
+ >
481
+ <Icons.FontAwesome name="dot-circle-o" color="darkblue" size={normalize(12)}
482
+ style={{ paddingHorizontal: normalize(2), paddingLeft: normalize(4) }} />
483
+ <Text style={selectedValue != null && selectedValue != undefined ? selectedValue == item.datavalue ? getListviewItemText(true) : getListviewItemText(false) : getListviewItemText(false)}>
484
+ {data.item.displayvalue}
485
+ </Text>
486
+ </TouchableOpacity>
487
+ );
488
+ }
489
+
490
+ function getOverlayScreenChildcontainer() {
491
+ return (
492
+ {
493
+ flex: 1,
494
+ minHeight: Dimensions.get('window').height * 0.5,
495
+ maxHeight: Dimensions.get('window').height * 0.75,
496
+ marginBottom: Dimensions.get('window').height * 0.01,
497
+ marginTop: Dimensions.get('window').height * 0.01,
498
+ }
499
+ );
500
+ }
501
+ };
502
+
503
+ const layoutstyles = StyleSheet.create({
504
+ lefticon_container: {
505
+ marginLeft: '2%',
506
+ },
507
+ textinput_view: {
508
+ flex: 1,
509
+ paddingLeft: '1%',
510
+ },
511
+ overlay_screen_listview_container: {
512
+ justifyContent: 'center',
513
+ marginBottom: 10,
514
+ },
515
+ overlay_searchTextbox_View: {
516
+ width: '96%',
517
+
518
+ },
519
+ overlay_screen_heading_text: {
520
+ ...ComponentStyles.popup_heading,
521
+ width: '100%',
522
+ },
523
+ overlay_screen_container: {
524
+ width: '100%',
525
+ flex: 1,
526
+ },
527
+ });
528
+
529
+ export default SDropDownNew;
@@ -0,0 +1,147 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { TouchableOpacity, View, Text, Dimensions } from 'react-native';
3
+ import { normalize } from '../CommonStyle/componentStyle';
4
+ import { getLoading, isNU, isNUL, isNUQ, notifyMessage } from '../CommonStyle/ComponentFunctions';
5
+ import { APIURL } from '../../../../../src/Common/apiConstants';
6
+ import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
7
+ import { Global } from '../../../../../src/Common/Global';
8
+
9
+ const SHelpDescription = (props) => {
10
+ const [data, setData] = useState();
11
+ const [isLoading, setIsLoading] = useState(false);
12
+ const [visibility, setVisibility] = useState(false);
13
+
14
+ console.log('kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk', props);
15
+ useEffect(() => {
16
+ getData(props.column != undefined ? props.column : 1);
17
+ }, []);
18
+
19
+ function getData(column) {
20
+ setVisibility(false);
21
+ setIsLoading(true);
22
+ // let buttonapi = APIURL + Global.PatientDetails.detailapi
23
+ let buttonapi = APIURL + 'commonhis/his/rnhrenhelpdescription ' + column;
24
+ // let buttonapi = APIURL + "commonhis/his/rnhrenbiodatasegregation_03112023" + " " + props.suoptiondetail + "," + code
25
+ console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', buttonapi);
26
+ NetworkServiceCall('get', buttonapi)
27
+ .then(function (response) {
28
+ if (response.httpstatus == 200) {
29
+ console.log('hhhhhhhhhhhhhhhhh',response.data.data);
30
+ // notifyMessage(isNUQ(response.data.data)&& isNUQ( response.data.data[0].helpfor)&&isNUQ(response.data.data[0].helpmessage ) ? response.data.data[0].helpfor + " :- "+ response.data.data[0].helpmessage : "Please select column for help")
31
+ setData(response.data.data[0]);
32
+ setTimeout(() => {
33
+ setVisibility(true);
34
+ });
35
+ Global.HelpId = 0;
36
+ // setResponseJSON(response.data.data[0])
37
+ // setData(response.data.bioarray)
38
+ setIsLoading(false);
39
+
40
+ } else {
41
+ notifyMessage('Please select valid column for help ', 4);
42
+ setIsLoading(false);
43
+ // console.log("RESPONSEEEEEEEEEEE FROM CONSULTATTION22222222", JSON.stringify(response.data.data[0]))
44
+
45
+ }
46
+ });
47
+ getLoading(v => setIsLoading(false));
48
+ }
49
+
50
+
51
+ return (
52
+ // <View style={{ marginHorizontal: normalize(3), marginVertical: normalize(2) }}>
53
+ // {/* <Menu style={{ borderRadius: 0, borderWidth: 0 }}>
54
+ // <MenuTrigger
55
+ // disabled={false}
56
+ // // customStyles={{ triggerWrapper: { borderWidth: 0, backgroundColor: '#ffffffff', borderRadius: 10, elevation: 0 } }}
57
+ // > */}
58
+ // <View>
59
+ // <TouchableOpacity
60
+ // onPress={()=> getData(1)}
61
+ // // disabled={true}
62
+ // style={{
63
+ // borderWidth: 1,
64
+ // borderColor: 'lightgrey',
65
+ // borderRadius: 10,
66
+ // alignItems: 'center',
67
+ // justifyContent: 'flex-start',
68
+ // height: normalize(25),
69
+ // flexDirection: 'row',
70
+ // backgroundColor: '#ffffff',
71
+ // // width: Dimensions.get('screen').width * 0.08,
72
+ // // minWidth: normalize(100),
73
+ // // maxWidth: Dimensions.get('screen').width * 0.278
74
+ // }}>
75
+ // <HOCIcons.Icons
76
+ // icongroup={11}
77
+ // name={'help-with-circle'}
78
+ // color={'darkblue'}
79
+ // size={normalize(18)}
80
+ // style={{ marginHorizontal: normalize(3), borderWidth: 0 }}
81
+ // />
82
+ // {/* <Text
83
+ // adjustsFontSizeToFit
84
+ // style={{
85
+ // borderWidth: 0,
86
+ // width: '80%',
87
+ // fontSize: normalize(8),
88
+ // fontWeight: 'bold',
89
+ // color: '#000000',
90
+ // alignItems: 'center',
91
+ // textAlign: 'center',
92
+ // justifyContent: 'center',
93
+ // }}>help</Text> */}
94
+ // </TouchableOpacity>
95
+ // </View>
96
+ // {/* </MenuTrigger>
97
+ // <MenuOptions
98
+ // optionsContainerStyle={{ marginTop: normalize(30) }}
99
+ // customStyles={{
100
+ // optionsContainer: {
101
+ // shadowColor: '#000000ff',
102
+ // shadowRadius: 10,
103
+ // borderRadius: 5,
104
+ // borderWidth: 0.5,
105
+ // borderColor: 'lightgrey',
106
+ // elevation: 3,
107
+ // width: Dimensions.get('screen').width * 0.28
108
+ // },
109
+ // optionText: {},
110
+ // }}>
111
+ // <Text>HELP</Text>
112
+ // </MenuOptions>
113
+ // </Menu> */}
114
+ // {/* <Text style={{ position: 'absolute', color: '#000000', fontSize: normalize(6), fontWeight: 'normal', top: normalize(-1), left: normalize(5), backgroundColor: 'white' }}>{params.displaytext}</Text> */}
115
+ // </View>
116
+ // <TouchableOpacity onPress={() => getData(Global.HelpId)}
117
+ // style={{ alignItems: 'center' }}
118
+ // >
119
+ // <HOCIcons.Icons
120
+ // icongroup={data.group != undefined ? data.group : 3}
121
+ // name={data.name ? data.name : 'help-circle'}
122
+ // color={data.color ? data.color : 'darkblue'}
123
+ // size={data.size ? data.size : normalize(25)}
124
+ // style={{ marginHorizontal: normalize(3), borderWidth: 0 }}
125
+ // />
126
+ // <Text
127
+ // adjustsFontSizeToFit
128
+ // style={{
129
+ // borderWidth: 0,
130
+ // width: '80%',
131
+ // fontSize: normalize(10),
132
+ // fontWeight: 'bold',
133
+ // color: '#000000',
134
+ // alignItems: 'center',
135
+ // textAlign: 'center',
136
+ // justifyContent: 'center',
137
+ // }}>help</Text>
138
+
139
+
140
+ // </TouchableOpacity>
141
+ <View style={{padding:normalize(5),borderWidth:0,borderColor:'lightblue',backgroundColor:'lightgrey',width:props.width ? props.width : '100%'}}>
142
+ {isNU(data) ? <Text style={{color:'black',fontStyle:'italic',fontSize:normalize(11),fontWeight:'bold'}}>{data.helpmessage != undefined ? data.helpmessage : 'help not setuped for current column'}</Text> : null}
143
+
144
+ </View>
145
+ );
146
+ };
147
+ export default SHelpDescription;