@jescon-technologies/react-native-ui-kit 0.0.1 → 0.0.2

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 (59) hide show
  1. package/index.js +70 -0
  2. package/package.json +26 -3
  3. package/src/Alerts/AAlert.js +1 -1
  4. package/src/HOC/ConfirmOverlay.js +192 -0
  5. package/src/HOC/HAbsolute.js +56 -0
  6. package/src/HOC/HDiscontinue.js +105 -0
  7. package/src/HOC/HHeading.js +70 -0
  8. package/src/HOC/HMoreButton.js +88 -0
  9. package/src/HOC/HNatureHeading.js +402 -0
  10. package/src/HOC/HOCIcons.js +80 -0
  11. package/src/HOC/HOverlay.js +99 -0
  12. package/src/HOC/HOverlayCentered.js +140 -0
  13. package/src/HOC/HShadowButton.js +45 -0
  14. package/src/HOC/HShadowCountButton.js +82 -0
  15. package/src/HOC/OptionOverlay.js +48 -0
  16. package/src/Media/AudioScreen.js +347 -0
  17. package/src/Media/BarcodeScan.js +145 -0
  18. package/src/Media/CAudioPlay.js +228 -0
  19. package/src/Media/CCaptureImageWithoutEdit.js +330 -0
  20. package/src/Media/CImageGallery.js +289 -0
  21. package/src/Media/CImageZoom.js +82 -0
  22. package/src/Media/CSingleImage.js +391 -0
  23. package/src/Media/CSketchCanvas.js +76 -0
  24. package/src/Media/CVideoPlay.js +31 -0
  25. package/src/Media/DocumentScreen.js +367 -0
  26. package/src/Media/DrawingScreen.js +582 -0
  27. package/src/Media/ImageScreen.js +313 -0
  28. package/src/Media/RecordAudio.js +250 -0
  29. package/src/Media/RecordVideo.js +223 -0
  30. package/src/Media/VideoScreen.js +383 -0
  31. package/src/StaticComponents/SAlphabet.js +47 -0
  32. package/src/StaticComponents/SCheckBox.js +42 -0
  33. package/src/StaticComponents/SDatePicker.js +208 -0
  34. package/src/StaticComponents/SDatePickerLabel.js +253 -0
  35. package/src/StaticComponents/SDatePickerNew.js +258 -0
  36. package/src/StaticComponents/SDateTimePickerNew.js +381 -0
  37. package/src/StaticComponents/SDropDownGenerate.js +450 -0
  38. package/src/StaticComponents/SDropDownHoc.js +636 -0
  39. package/src/StaticComponents/SDropDownIcon.js +500 -0
  40. package/src/StaticComponents/SMenuBox.js +131 -0
  41. package/src/StaticComponents/SOverlay.js +177 -0
  42. package/src/StaticComponents/SOverlayTextInput.js +109 -0
  43. package/src/StaticComponents/SSearch.js +438 -0
  44. package/src/StaticComponents/SSearchBar.js +53 -0
  45. package/src/StaticComponents/SSpeedDial.js +303 -0
  46. package/src/StaticComponents/STextInput.js +289 -0
  47. package/src/StaticComponents/STextInputProps.js +36 -0
  48. package/src/StaticComponents/STimePicker.js +171 -0
  49. package/src/StaticComponents/STimingDropDownNew.js +1589 -0
  50. package/src/StaticComponents/STimingSwitch.js +34 -0
  51. package/src/layout/CContainerView.js +21 -0
  52. package/src/layout/CDetailView.js +81 -0
  53. package/src/layout/FooterBlock.js +0 -3
  54. package/src/layout/HeaderBlock.js +353 -0
  55. package/src/index.js +0 -15
  56. package/src/screens/ForgotPassword.js +0 -346
  57. package/src/screens/Login.js +0 -328
  58. package/src/screens/Splash.js +0 -788
  59. /package/src/{components → layout}/Loader.js +0 -0
@@ -0,0 +1,636 @@
1
+ import React, { useState, useEffect } from 'react';
2
+ import { TouchableOpacity, StyleSheet, View, Text, Image, TextInput, FlatList, ActivityIndicator, Dimensions, Platform } from 'react-native';
3
+ import { notifyMessage, normalize, Loader, isBNU, isBNUL, dlog, ValueCheck } from '../CommonStyle/ComponentFunctions';
4
+ import NetworkServiceCall from '../Common/NetworkServiceCall';
5
+ import ComponentStyles, { height } from '../CommonStyle/componentStyle';
6
+ import Overlay from 'react-native-modal-overlay';
7
+ import Icons from '../Common/Icons';
8
+ import { FlashList } from '@shopify/flash-list';
9
+ import CFooterView from '../CustomComponents/CFooterView';
10
+ import HOCIcons from '../HOC/HOCIcons';
11
+ import CAwesomeButton from '../CustomComponents/CAwesomeButtonLab';
12
+ import themes from '../Common/CommonTheme';
13
+ import HView from '../HOC/HView';
14
+ import { Global } from '../Common/Global';
15
+ var searchResult = [];
16
+
17
+ const SDropDownHoc = props => {
18
+
19
+ useEffect(() => { isBNU(props.overlay) && props.overlay == true ? FetchDropdownList() : null; }, []);
20
+
21
+ const [dataold, setData] = useState(props.data ? props.data : null);
22
+ const data = props.data ? props.data : null;
23
+ const [overlay, setOverlay] = useState(false);
24
+ const [searchData, setSearchData] = useState('');
25
+ const [loading, setLoading] = useState(false);
26
+ const [alphaFilter, setAlphaFilter] = useState(false);
27
+ const [displayData, setDisplayData] = useState([]);
28
+ const [filterPurpose, setFilterPurpose] = useState([]);
29
+ const [alphaindex, setAlphaIndex] = useState(0);
30
+ const [refresh, setRefresh] = useState(0);
31
+ const [editmode, setEditMode] = useState(false);
32
+ const [stage, setStage] = useState(1);
33
+ const buttonarray = [
34
+ { 'code': 2, 'name': 'Select', 'icon': 'select1', 'icongroup': 1, 'color': 'white', 'visible': !props.disableselectbutton && fnButton() ? true : false },
35
+ { 'code': 5, 'name': 'Sort', 'icon': 'sort-alphabetical-ascending', 'icongroup': 3, 'color': 'white', 'visible': props.sortbutton ? true : false },
36
+ { 'code': 4, 'name': 'Edit', 'icon': 'edit', 'icongroup': 5, 'color': 'white', 'visible': props.editbutton && fnButton() ? true : false },
37
+ ];
38
+ const selectarray = props.stage ? props.selectarray : [];
39
+ const PropStyles = {
40
+ 'overlayheight': ValueCheck(props.height) ? props.height : 0.17,
41
+ 'overlayborderRadius': ValueCheck(props.height) ? 0 : 20,
42
+ };
43
+
44
+
45
+ function onPressFunction(i) {
46
+ switch (i) {
47
+ case 1:
48
+ (setOverlay(false), props.setoverlay(false));
49
+ break;
50
+ case 2:
51
+ (props.multiselect == true ? getMultiSelect() : getSingleSelect());
52
+ break;
53
+ case 3:
54
+ getClearAll();
55
+ break;
56
+ case 4:
57
+ setEditMode(true);
58
+ setStage(2);
59
+ break;
60
+ case 5:
61
+ break;
62
+ default:
63
+ break;
64
+ }
65
+ }
66
+
67
+ function FetchDropdownList() {
68
+
69
+ setDisplayData([]);
70
+ setAlphaFilter(false);
71
+ setFilterPurpose([]);
72
+ setAlphaIndex(0);
73
+ setSearchData('');
74
+ setLoading(true);
75
+ setOverlay(true);
76
+ isBNU(props.dropdownapi) ? (
77
+ dlog('props.dropdownapi ' + props.dropdownapi),
78
+ NetworkServiceCall('get', props.dropdownapi, '').then(
79
+ function (response) {
80
+ if (isBNU(response.httpstatus) && response.httpstatus == 200) {
81
+ searchResult = response;
82
+ setDisplayData(response.data.data);
83
+ setLoading(false);
84
+ } else {
85
+ notifyMessage('Data Not Found', 2);
86
+ setLoading(false);
87
+ }
88
+ })
89
+ ) : isBNU(props.dropdownarray) ? (
90
+ searchResult = props.dropdownarray,
91
+ setDisplayData(props.dropdownarray.data.data),
92
+ setLoading(false)
93
+ ) : null;
94
+ }
95
+
96
+ function fnButton() {
97
+ let marray = isBNUL(displayData) ? displayData.filter((i) => i.selected == true) : null;
98
+ let item = isBNUL(marray) ? true : false;
99
+ return item;
100
+ }
101
+
102
+ function fnstring(i) {
103
+ return isBNUL(i) ? i.toString() : null;
104
+ }
105
+
106
+ function fnarray(i) {
107
+ let array = [];
108
+ isBNUL(i) ? i.map(data => { array.push(data.displayvalue); }) : null;
109
+ return array;
110
+ }
111
+
112
+ function MapSelection(i) {
113
+ displayData && displayData != null && displayData != undefined && displayData.length > 0 ?
114
+ displayData.filter((val, k) => {
115
+ val.selected != null && val.selected != undefined && i != k ? val.selected = false : null;
116
+ }) : null;
117
+ }
118
+
119
+ function singleselection(item) {
120
+
121
+ MapSelection(item.index);
122
+ item.item.selected = !item.item.selected;
123
+ setRefresh(refresh + 1);
124
+ }
125
+
126
+ function fastsingleselection(item) {
127
+
128
+ setData(item.item.displayvalue);
129
+ (props.arraycallback ? props.arraycallback(item.item) : props.callback(item.item.displayvalue));
130
+ setOverlay(false);
131
+ props.setoverlay(false);
132
+ }
133
+
134
+ function getSingleSelect() {
135
+ let marray = isBNUL(displayData) ? displayData.filter((i) => i.selected == true) : null;
136
+ let mstring = fnstring(fnarray(marray));
137
+ setData(mstring);
138
+ (props.arraycallback ? props.arraycallback(marray[0]) : props.callback(mstring));
139
+ setOverlay(false);
140
+ props.setoverlay(false);
141
+ }
142
+
143
+ function multiselection(item) {
144
+ item.selected = !item.selected;
145
+ setRefresh(refresh + 1);
146
+ }
147
+
148
+ function getMultiSelect() {
149
+
150
+ let marray = isBNUL(displayData) ? displayData.filter((i) => i.selected == true) : null;
151
+ let mstring = fnstring(fnarray(marray));
152
+ setData(mstring);
153
+ (props.arraycallback ? props.arraycallback(marray) : props.callback(mstring));
154
+ setOverlay(false);
155
+ props.setoverlay(false);
156
+ }
157
+
158
+ function getClearAll() {
159
+
160
+ isBNUL(displayData) ?
161
+ displayData.filter((val) => {
162
+ val.selected != null && val.selected != undefined ? val.selected = false : null;
163
+ }) : null;
164
+ setRefresh(refresh + 1);
165
+ }
166
+
167
+ function DropdownLayout() {
168
+ return (
169
+ <View style={{ width: '100%', flex: 1, borderWidth: 0 }}>
170
+ <View style={{ flexDirection: 'row', marginHorizontal: 10, marginVertical: normalize(5) }}>
171
+ <View
172
+ style={{
173
+ flexDirection: 'row',
174
+ borderWidth: 0,
175
+ borderColor: 'grey',
176
+ justifyContent: 'flex-start',
177
+ alignItems: 'center',
178
+ borderRadius: 5,
179
+ marginBottom: Dimensions.get('window').height * 0.003,
180
+ height: 35,
181
+ backgroundColor: '#f0f0f0',
182
+ marginTop: 0,
183
+ width: '100%',
184
+ }}>
185
+ <HOCIcons.Icons
186
+ component={5}
187
+ name={'filter'}
188
+ color={Global.AppTheme.primary_color}
189
+ size={normalize(13)}
190
+ style={{ marginHorizontal: normalize(5) }}
191
+ />
192
+ <View style={{ flex: 1, paddingLeft: '1%' }}>
193
+ <TextInput
194
+ style={{
195
+ color: '#000000',
196
+ width: '100%', marginLeft: '1%', marginRight: '1%',
197
+ fontSize: normalize(16),
198
+ textAlign: 'justify',
199
+ // backgroundColor:'#f0f0f0',
200
+ fontWeight: 'bold',
201
+ padding: 0, height: '100%', marginBottom: -(Dimensions.get('window').height * 0.003),
202
+ }}
203
+ autoCapitalize={'characters'}
204
+ value={searchData}
205
+ onChangeText={text => setSearchData(text)}
206
+ secureTextEntry={false}
207
+ keyboardType={'default'}
208
+ placeholder="Search"
209
+ />
210
+ </View>
211
+ {isBNUL(searchData) ?
212
+ <TouchableOpacity onPress={() => { setSearchData(''), setAlphaFilter(false), setAlphaIndex(0); }} >
213
+ <HOCIcons.MaterialCommunityIcons
214
+ name={'close-circle'}
215
+ color={Global.AppTheme.primary_color}
216
+ size={normalize(20)}
217
+ style={{ marginHorizontal: normalize(5) }}
218
+ />
219
+ </TouchableOpacity>
220
+ : null}
221
+ </View>
222
+ </View>
223
+ <View style={{ borderWidth: 0, flex: 1 }}>
224
+ {GetDropdown(alphaFilter ? filterPurpose : displayData)}
225
+ </View>
226
+ </View>
227
+ );
228
+ }
229
+
230
+ function getListviewItem(selected) {
231
+ return ({ backgroundColor: selected ? '#766fff42' : '#ffffffc7' });
232
+ }
233
+
234
+ function getListviewItemText(selected) {
235
+ return (
236
+ {
237
+ alignContent: 'center',
238
+ margin: Dimensions.get('window').height * 0.004,
239
+ alignItems: 'center',
240
+ textAlign: 'left',
241
+ fontSize: normalize(14),
242
+ fontWeight: selected ? 'bold' : 'normal',
243
+ color: selected ? Global.AppTheme.primary_color : 'black',
244
+ }
245
+ );
246
+ }
247
+
248
+ function GetDropdown(data) {
249
+
250
+ const newDropDownData = data != undefined ? data.filter(function (item) {
251
+ const dataItem = item.displayvalue ? item.displayvalue.toUpperCase() : ''.toUpperCase();
252
+ const textData = searchData.toUpperCase();
253
+ return dataItem.indexOf(textData) > -1;
254
+ }) : null;
255
+
256
+ return (
257
+ <View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1 }}>
258
+ <View style={{ borderWidth: 0, width: '90%', flex: 1 }}>
259
+ <FlashList
260
+ data={newDropDownData}
261
+ keyboardShouldPersistTaps={'handled'}
262
+ renderItem={renderItem}
263
+ estimatedItemSize={normalize(25)}
264
+ />
265
+ </View>
266
+ <View style={{ height: Dimensions.get('window').height * 0.75, marginBottom: Dimensions.get('window').height * 0.01 }}>
267
+ <FlatList
268
+ data={['#', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']}
269
+ keyboardShouldPersistTaps={'handled'}
270
+ renderItem={renderAlphabet}
271
+ style={{ paddingBottom: 0 }}
272
+ contentContainerStyle={{ alignItems: 'center' }}
273
+ keyExtractor={item => item}
274
+ />
275
+ </View>
276
+ </View>
277
+ );
278
+ }
279
+
280
+ function renderAlphabet({ index, item }) {
281
+
282
+ return (
283
+ <TouchableOpacity
284
+ style={{
285
+ width: normalize(30),
286
+ alignItems: 'center',
287
+ borderRadius: normalize(40) / 2,
288
+ backgroundColor: index == alphaindex ? '#8162fc' : 'transparent',
289
+ }}
290
+ onPress={() => getAlphabetData(item, index)}>
291
+ <Text style={{
292
+ fontSize: normalize(12),
293
+ color: index == alphaindex ? 'white' : 'black',
294
+ fontWeight: index == alphaindex ? 'bold' : 'normal',
295
+ }}>
296
+ {item}
297
+ </Text>
298
+ </TouchableOpacity>
299
+ );
300
+ }
301
+
302
+ function getAlphabetData(alpha, index) {
303
+
304
+ var filter = displayData.filter(value => value.displayvalue != null && value.displayvalue != undefined && value.displayvalue.length > 0 ? value.displayvalue.charAt(0) == alpha : undefined);
305
+ setAlphaIndex(index);
306
+ setFilterPurpose(filter);
307
+ index == 0 ? setSearchData('') : setSearchData(alpha);
308
+ index == 0 ? setAlphaFilter(false) : setAlphaFilter(true);
309
+ }
310
+
311
+ function renderItem(b) {
312
+
313
+ return (
314
+ <TouchableOpacity
315
+ style={[b.item.selected == true ? getListviewItem(true) : getListviewItem(false),
316
+ {
317
+ borderWidth: 1,
318
+ width: '100%',
319
+ borderRadius: 7,
320
+ borderColor: 'lightgrey',
321
+ },
322
+ ]}
323
+ onPress={() => props.multiselect == true ? multiselection(b.item) : props.fastselection ? fastsingleselection(b) : singleselection(b)}
324
+ activeOpacity={0.5}
325
+ >
326
+ <View style={{
327
+ flexDirection: 'row',
328
+ alignItems: 'center',
329
+ }}>
330
+ <HOCIcons.Icons
331
+ icongroup={b.item.selected == true ? 3 : 4}
332
+ name={b.item.selected == true ? 'radiobox-marked' : 'dot-circle-o'}
333
+ color={'darkblue'}
334
+ size={normalize(13)}
335
+ style={{ marginHorizontal: normalize(3) }}
336
+ />
337
+ <Text style={b.item.selected == true ? getListviewItemText(true) : getListviewItemText(false)}>
338
+ {b.item.displayvalue}
339
+ </Text>
340
+ </View>
341
+ {(isBNU(b.item.dropdownremarks) || isBNU(b.item.finalresultvaluenature) || isBNU(b.item.pathologyclonename)) ?
342
+ <View style={{ borderWidth: 0, flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center' }}>
343
+ {isBNU(b.item.finalresultvaluenature) ?
344
+ <Text style={{ color: Global.AppTheme.primary_color, fontSize: normalize(8), fontWeight: 'bold' }}>
345
+ {b.item.finalresultvaluenature}
346
+ </Text>
347
+ : null}
348
+ {isBNU(b.item.pathologyclonename) ?
349
+ <Text style={{ color: Global.AppTheme.primary_color, fontSize: normalize(8), fontWeight: 'bold' }}>
350
+ {b.item.pathologyclonename}
351
+ </Text>
352
+ : null}
353
+ {isBNU(b.item.dropdownremarks) ?
354
+ <Text style={{ color: 'grey', fontSize: normalize(7) }}>
355
+ {b.item.dropdownremarks}
356
+ </Text>
357
+ : null}
358
+ </View>
359
+ : null}
360
+ </TouchableOpacity>
361
+ );
362
+ }
363
+
364
+ return (
365
+ <TouchableOpacity
366
+ disabled={props.disabled != null && props.disabled != undefined && props.disabled == true ? true : false}
367
+ style={props.buttonstyle}
368
+ onPress={() => { FetchDropdownList(); }}
369
+ >
370
+ {props.icon ?
371
+ <HOCIcons.Icons
372
+ icongroup={props.icon.icongroup != null && props.icon.icongroup != undefined ? props.icon.icongroup : 5}
373
+ name={props.icon.name}
374
+ size={props.icon.size}
375
+ style={props.iconstyle}
376
+ />
377
+ : null}
378
+ {props.textview && props.textview != null && props.textview != undefined ?
379
+ <Text adjustsFontSizeToFit style={props.textstyle}>
380
+ {isBNU(data) ? data : null}
381
+ </Text>
382
+ : null}
383
+ {props.iconclose && isBNU(data) ?
384
+ <TouchableOpacity
385
+ disabled={props.disabled != null && props.disabled != undefined && props.disabled == true ? true : false}
386
+ onPress={() => {
387
+ setData(''),
388
+ props.iconclosecallback(true);
389
+ }}
390
+ >
391
+ <HOCIcons.Icons
392
+ icongroup={props.iconclose.icongroup != null && props.iconclose.icongroup != undefined ? props.iconclose.icongroup : 5}
393
+ name={props.iconclose.name}
394
+ color={props.iconclose.color}
395
+ size={props.iconclose.size}
396
+ style={props.iconclosestyle}
397
+ />
398
+ </TouchableOpacity>
399
+ : null}
400
+ {overlay ? (
401
+ <Overlay
402
+ visible={overlay}
403
+ onClose={() => { setStage(1), setOverlay(false), props.setoverlay(false); }}
404
+ closeOnTouchOutside
405
+ animationType="fadeInUp"
406
+ // animationType="zoomIn"
407
+ containerStyle={{ backgroundColor: 'transparent' }}
408
+ childrenWrapperStyle={{
409
+ position: 'absolute',
410
+ bottom: 0,
411
+ // top: Platform.OS === 'ios' ? normalize(50) : 0,
412
+ top: Dimensions.get('screen').height * (PropStyles.overlayheight),
413
+ borderTopLeftRadius: 10,
414
+ borderTopRightRadius: 10,
415
+ borderColor: '#4497ea',
416
+ alignItems: 'center',
417
+ alignSelf: 'center',
418
+ justifyContent: 'flex-start',
419
+ width: Dimensions.get('window').width,
420
+ // height: Dimensions.get('window').height * 0.8,
421
+ padding: 0,
422
+ }}
423
+ animationDuration={500}
424
+ >
425
+
426
+ <View style={{ flex: 1 }}>
427
+
428
+ <View
429
+ style={{
430
+ flexDirection: 'row',
431
+ justifyContent: 'space-between',
432
+ alignItems: 'center',
433
+ width: Dimensions.get('screen').width,
434
+ borderTopLeftRadius: 10,
435
+ paddingVertical: normalize(2),
436
+ borderTopRightRadius: 10,
437
+ borderWidth: 0,
438
+ }}>
439
+ <View style={{ width: '20%', borderWidth: 0 }}>
440
+ <Text>{' '}</Text>
441
+ </View>
442
+ <View style={{
443
+ flex: 1,
444
+ width: '60%',
445
+ borderWidth: 0,
446
+ justifyContent: 'center',
447
+ alignItems: 'center',
448
+ }}>
449
+ <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'center' }}>
450
+ {props.overlayicon != null && props.overlayicon != undefined ?
451
+ <Icons.FontAwesome5
452
+ name={props.overlayicon != null && props.overlayicon != undefined ? props.overlayicon : 'file'}
453
+ color={'#000000'}
454
+ size={normalize(11)}
455
+ style={{ marginHorizontal: normalize(5) }}
456
+ />
457
+ : null}
458
+ <Text style={{ color: Global.AppTheme.primary_color, fontSize: normalize(11), fontWeight: 'bold', textAlign: 'center' }}>{props.overlayheading != null && props.overlayheading != undefined ? props.overlayheading : 'SELECT OPTION'}</Text>
459
+ </View>
460
+ </View>
461
+ <View style={{ width: '20%', borderWidth: 0, justifyContent: 'flex-end', alignItems: 'flex-end' }}>
462
+ <TouchableOpacity style={{}}
463
+ onPress={() => { setStage(1), setOverlay(false), props.setoverlay(false); }}
464
+ >
465
+ <HOCIcons.FontAwesome5
466
+ name={'angle-double-down'}
467
+ color={Global.AppTheme.primary_color}
468
+ size={normalize(20)}
469
+ style={{
470
+ marginHorizontal: normalize(5),
471
+ }}
472
+ />
473
+ </TouchableOpacity>
474
+ </View>
475
+ </View>
476
+ {props.stage ?
477
+ <View style={{
478
+ flexDirection: 'row', width: '100%', borderRadius: 6,
479
+ justifyContent: 'space-evenly', alignItems: 'center',
480
+ }}>
481
+ {isBNUL(selectarray) ? selectarray.map((buttons, i) => {
482
+ return (
483
+ buttons.visibility == true ?
484
+ <CAwesomeButton
485
+ callback={(val) => {
486
+ setStage(buttons.stage),
487
+ (buttons.stage == 1 ? (setEditMode(false), FetchDropdownList()) : buttons.stage == 2 ?
488
+ null
489
+ : null),
490
+ setRefresh(refresh + 1);
491
+ }}
492
+ buttonstyle={{
493
+ 'borderRadius': 10,
494
+ 'borderWidth': 1,
495
+ 'height': normalize(30),
496
+ 'width': normalize(100),
497
+ 'backgroundColor': stage == buttons.stage ? '#f7efef' : '#eff6f7',
498
+ 'paddingHorizontal': 0,
499
+ 'raiseLevel': 1,
500
+ 'paddingBottom': 0,
501
+ 'borderColor': stage == buttons.stage ? 'lightblue' : '#ddfbff',
502
+ 'paddingTop': 0,
503
+ }}
504
+ viewstyle={{
505
+ borderWidth: 0,
506
+ borderRadius: 0,
507
+ justifyContent: 'center',
508
+ alignItems: 'center',
509
+ flexDirection: 'row',
510
+ }}
511
+ icon={{
512
+ 'icongroup': buttons.icongroup,
513
+ 'name': buttons.iconname,
514
+ 'color': Global.AppTheme.primary_color,
515
+ 'size': normalize(15),
516
+ 'style': {
517
+ textAlign: 'center',
518
+ marginHorizontal: normalize(5),
519
+ },
520
+ }}
521
+ text={{
522
+ fontSize: normalize(10),
523
+ fontWeight: 'bold',
524
+ color: Global.AppTheme.primary_color,
525
+ textAlign: 'center',
526
+ }}
527
+ displaytext={buttons.displayvalue}
528
+ />
529
+ // <TouchableOpacity
530
+ // onPress={() => {
531
+ // console.log('selectarray')
532
+ // }}
533
+ // >
534
+ // <Text>{"SELECT"}</Text>
535
+ // </TouchableOpacity>
536
+ : null
537
+ );
538
+ }) : null}
539
+ </View>
540
+
541
+ : null}
542
+
543
+ {stage == 1 ?
544
+ <View style={{ flex: 1 }}>
545
+ <View style={{ flex: 1, borderWidth: 0 }}>
546
+ {!loading ? (searchResult.httpstatus == 200 ? (
547
+ DropdownLayout()
548
+ ) : (
549
+ <View style={{ flex: 1, alignSelf: 'center' }}>
550
+ <Text style={[ComponentStyles.no_data_found_text]}>
551
+ No Result Found
552
+ </Text>
553
+ </View>
554
+ )) : (
555
+ <View
556
+ style={{
557
+ flex: 1,
558
+ width: '100%',
559
+ justifyContent: 'flex-start',
560
+ }}>
561
+ <Loader />
562
+ </View>
563
+ )}
564
+ </View>
565
+ <CFooterView color={'white'}>
566
+ <View style={{ flexDirection: 'row', alignItems: 'center', justifyContent: 'flex-start' }}>
567
+ {buttonarray.map((val) => {
568
+ return (val.visible ?
569
+ <CAwesomeButton
570
+ callback={(k) => { onPressFunction(val.code); }}
571
+ buttonstyle={{
572
+ 'borderRadius': 10,
573
+ 'borderWidth': 0.5,
574
+ 'height': Dimensions.get('screen').height * 0.06,
575
+ 'width': Dimensions.get('screen').height * 0.06,
576
+ 'backgroundColor': '#f2f3ff',
577
+ 'paddingHorizontal': 0,
578
+ 'raiseLevel': 4,
579
+ 'paddingBottom': 0,
580
+ 'borderColor': 'white',
581
+ 'paddingTop': 0,
582
+ 'style': {
583
+ padding: 0,
584
+ marginHorizontal: 2,
585
+ },
586
+ }}
587
+ viewstyle={{
588
+ borderWidth: 0,
589
+ borderRadius: 0,
590
+ justifyContent: 'center',
591
+ alignItems: 'center',
592
+ }}
593
+ icon={{
594
+ 'icongroup': val.icongroup,
595
+ 'name': val.icon,
596
+ 'color': Global.AppTheme.primary_color,
597
+ 'size': normalize(25),
598
+ 'style': {
599
+ textAlign: 'center',
600
+ },
601
+ }}
602
+ text={{
603
+ fontSize: normalize(7),
604
+ fontWeight: 'bold',
605
+ color: Global.AppTheme.primary_color,
606
+ textAlign: 'center',
607
+ }}
608
+ displaytext={val.name}
609
+ />
610
+ : null);
611
+ })}
612
+ </View>
613
+ </CFooterView>
614
+ </View>
615
+ : stage == 2 ?
616
+ <View style={{ flex: 1 }}>
617
+ {isBNU(props.hoccomponent) ?
618
+ <HView
619
+ editmode={editmode}
620
+ displaydata={displayData}
621
+ component={props.hoccomponent}
622
+ hocdata={props.hocdata}
623
+ savecallback={(val) => { setStage(1), FetchDropdownList(), setRefresh(refresh + 1); }}
624
+ natureoption={props.natureoption ? true : false}
625
+ pathologycloneoption={props.pathologycloneoption ? true : false}
626
+ />
627
+ : null}
628
+ </View>
629
+ : null}
630
+ </View>
631
+ </Overlay>
632
+ ) : null}
633
+ </TouchableOpacity>
634
+ );
635
+ };
636
+ export default SDropDownHoc;