@jescon-technologies/react-native-ui-kit 0.0.4 → 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.
- package/index.d.ts +66 -0
- package/index.js +0 -4
- package/package.json +3 -2
- package/src/Alerts/AAlert.js +3 -3
- package/src/Alerts/AAlertIOS.js +3 -3
- package/src/{common → Common}/NetworkServiceCall.js +1 -1
- package/src/CommonStyle/CommonTheme.js +11 -0
- package/src/CommonStyle/ComponentFunctions.js +632 -0
- package/src/CommonStyle/PopupStyle.js +146 -0
- package/src/CommonStyle/commonStyle.js +93 -0
- package/src/CommonStyle/componentStyle.js +545 -0
- package/src/CommonStyle/optionListStyles.js +175 -0
- package/src/Components/ByProductPage.js +200 -0
- package/src/Components/CDropDownListNew.js +153 -0
- package/src/Components/CSupplierList.js +88 -0
- package/src/Components/CVerificationCard.js +2822 -0
- package/src/Components/CustomButton.js +67 -0
- package/src/Components/CustomCard.js +127 -0
- package/src/Components/CustomTextInput.js +47 -0
- package/src/Components/EquipmentPage.js +313 -0
- package/src/Components/FilterInput.Copy.js +723 -0
- package/src/Components/FilterInput.js +569 -0
- package/src/Components/HSubHeading.js +68 -0
- package/src/Components/HeaderCard.js +40 -0
- package/src/Components/MoreOptionsScreen.js +251 -0
- package/src/Components/NonSwipableProductCard.js +226 -0
- package/src/Components/NonSwipableSupplierCard.js +348 -0
- package/src/Components/ProductCard.js +1336 -0
- package/src/Components/QualityProductCard.js +1059 -0
- package/src/Components/RateProductCard.js +1452 -0
- package/src/Components/RawMaterial.js +261 -0
- package/src/Components/SDropDownEdited.js +549 -0
- package/src/Components/SDropDownNew.js +529 -0
- package/src/Components/SHelpDescription.js +147 -0
- package/src/Components/STextInputNew.js +510 -0
- package/src/Components/SearchProductCard.js +470 -0
- package/src/Components/StageByProduct.js +199 -0
- package/src/Components/SupplierCard.js +243 -0
- package/src/Components/SupplierInvoiceCard.js +405 -0
- package/src/Components/SwipableSupplierCard.js +136 -0
- package/src/Components/TagTemplate.js +74 -0
- package/src/Components/WrappedComponent.js +25 -0
- package/src/Custom/CBooking.js +944 -0
- package/src/Custom/CBookingPostpone.js +1822 -0
- package/src/Custom/CCalendar.js +560 -0
- package/src/Custom/CCard.js +880 -0
- package/src/Custom/CDetailCard.js +205 -0
- package/src/Custom/CHelpImage.js +52 -0
- package/src/Custom/CReport.js +569 -0
- package/src/Custom/CScrollView.js +73 -0
- package/src/Custom/CSignature.js +112 -0
- package/src/Custom/CSliderMenu.js +339 -0
- package/src/Custom/CSupplierCard.js +99 -0
- package/src/Custom/CTemplateCard.js +438 -0
- package/src/Custom/CTokenAllocation.js +1402 -0
- package/src/Custom/CTokenListOverlay.js +122 -0
- package/src/Custom/CWardStatus.js +444 -0
- package/src/Custom/Charts/CBarChart.js +218 -0
- package/src/Custom/Charts/CDashBoardList.js +133 -0
- package/src/Custom/Charts/CDashBoardTable.js +172 -0
- package/src/Custom/Charts/CLineChart.js +193 -0
- package/src/Custom/Charts/CPieChart.js +186 -0
- package/src/Custom/Loader.js +182 -0
- package/src/Custom/OUserView.js +1121 -0
- package/src/Custom/PreviewDosage.js +115 -0
- package/src/Custom/SearchLoader.js +32 -0
- package/src/Custom/TableComponent/CActivityTable.js +707 -0
- package/src/Custom/TableComponent/CMoreButtonTable.js +197 -0
- package/src/Custom/TableComponent/CTable.js +185 -0
- package/src/Custom/TableComponent/CTextBody.js +40 -0
- package/src/Custom/TableComponent/CTextHeader.js +17 -0
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +1011 -0
- package/src/Custom/TableComponent/SDropdownTable.js +491 -0
- package/src/Custom/TableComponent/TagTable.js +1200 -0
- package/src/CustomComponents/CAddColumn.js +140 -0
- package/src/CustomComponents/CAssessmentDelete.js +307 -0
- package/src/CustomComponents/CAwesomeButton.js +83 -0
- package/src/CustomComponents/CAwesomeMoreButton.js +54 -0
- package/src/CustomComponents/CBackHandler.js +273 -0
- package/src/CustomComponents/CCalendar.js +243 -0
- package/src/CustomComponents/CCommentOverlay.js +202 -0
- package/src/CustomComponents/CComments.js +162 -0
- package/src/CustomComponents/CContainerView.js +24 -0
- package/src/CustomComponents/CCustomTextInput.js +336 -0
- package/src/CustomComponents/CDetailView.js +40 -0
- package/src/CustomComponents/CDropDownList.js +153 -0
- package/src/CustomComponents/CDropdownSelect.js +555 -0
- package/src/CustomComponents/CFooterView.js +42 -0
- package/src/CustomComponents/CImagePickerSave.js +316 -0
- package/src/CustomComponents/CModalOverlay.js +91 -0
- package/src/CustomComponents/CNetworkStatus.js +327 -0
- package/src/CustomComponents/CNotesInstructions.js +1000 -0
- package/src/CustomComponents/COverlay.js +81 -0
- package/src/CustomComponents/CRemarks.js +176 -0
- package/src/CustomComponents/CRowAdd.js +143 -0
- package/src/CustomComponents/CSummaryDropDown.js +327 -0
- package/src/CustomComponents/CText.js +9 -0
- package/src/CustomComponents/CVectorIcon.js +34 -0
- package/src/CustomComponents/HtmlContentViewer.js +65 -0
- package/src/CustomComponents/PdfContentViewer.js +90 -0
- package/src/CustomComponents/SDropDownDosage.js +1087 -0
- package/src/CustomComponents/SwipableProductCard.js +246 -0
- package/src/CustomComponents/SwipableProductImageCard.js +254 -0
- package/src/CustomComponents/WorkOrderDetails.js +1216 -0
- package/src/CustomComponents/WorkOrderDetailsPage.js +1213 -0
- package/src/HOC/ConfirmOverlay.js +2 -2
- package/src/HOC/HMoreButton.js +1 -1
- package/src/HOC/HNatureHeading.js +1 -1
- package/src/HOC/HShadowButton.js +1 -1
- package/src/HOC/HShadowCountButton.js +1 -1
- package/src/Json/Chart.json +818 -0
- package/src/Json/Consultation.json +622 -0
- package/src/Json/CreditBill.json +490 -0
- package/src/Json/Dropdown.json +216 -0
- package/src/Json/DropdownConsultation.json +228 -0
- package/src/Json/DynamicReports.json +623 -0
- package/src/Json/Footer.json +79 -0
- package/src/Media/AudioScreen.js +2 -7
- package/src/Media/CCaptureImageWithoutEdit.js +1 -1
- package/src/Media/CImageGallery.js +2 -2
- package/src/Media/CSingleImage.js +2 -2
- package/src/Media/CVideoPlay.js +1 -1
- package/src/Media/DocumentScreen.js +2 -7
- package/src/Media/DrawingScreen.js +2 -6
- package/src/Media/ImageScreen.js +2 -6
- package/src/Media/VideoScreen.js +2 -7
- package/src/Navigation/PageNavigation.js +224 -0
- package/src/Navigation/useFocusEffect.js +2 -0
- package/src/Navigation/useFocusEffect.native.js +1 -0
- package/src/Navigation/useFocusEffect.web.js +1 -0
- package/src/Navigation/useIsFocused.js +1 -0
- package/src/Navigation/useIsFocused.native.js +1 -0
- package/src/Navigation/useIsFocused.web.js +1 -0
- package/src/Navigation/useNavigation.js +2 -0
- package/src/Navigation/useNavigation.native.js +1 -0
- package/src/Navigation/useNavigation.web.js +1 -0
- package/src/Screens/CMedications.js +528 -0
- package/src/Screens/CWebViewGallery.js +203 -0
- package/src/Screens/ChartScan.js +279 -0
- package/src/Screens/ChartScreenNew.js +1579 -0
- package/src/Screens/Consultation.js +1500 -0
- package/src/Screens/Dashboard.js +778 -0
- package/src/Screens/FileExplorer.js +288 -0
- package/src/Screens/Footer.js +340 -0
- package/src/Screens/ForgotPassword.js +288 -0
- package/src/Screens/HeaderBlock.js +353 -0
- package/src/Screens/Login.js +328 -0
- package/src/Screens/Notification.js +149 -0
- package/src/Screens/OcrScreen.js +20 -0
- package/src/Screens/PdfPreview.js +507 -0
- package/src/Screens/RegistrationDetails.js +467 -0
- package/src/Screens/SearchScreen.js +582 -0
- package/src/Screens/Splash.js +788 -0
- package/src/Screens/SwipeLeftView.js +1867 -0
- package/src/StaticComponents/SDatePickerLabel.js +1 -1
- package/src/StaticComponents/SDatePickerNew.js +1 -1
- package/src/StaticComponents/SDateTimePickerNew.js +2 -2
- package/src/StaticComponents/SDropDownGenerate.js +3 -3
- package/src/StaticComponents/SDropDownHoc.js +4 -4
- package/src/StaticComponents/SDropDownIcon.js +1 -1
- package/src/StaticComponents/SMenuBox.js +2 -2
- package/src/StaticComponents/SSearch.js +2 -2
- package/src/StaticComponents/STextInput.js +1 -1
- package/src/StaticComponents/STimePicker.js +1 -1
- package/src/StaticComponents/STimingDropDownNew.js +2 -6
- package/src/StaticComponents/STimingSwitch.js +1 -1
- package/src/layout/CContainerView.js +1 -1
- package/src/layout/CDetailView.js +3 -3
- package/src/layout/HeaderBlock.js +5 -5
- package/src/layout/INVLoginLayout.js +3 -4
- package/src/layout/Loader.js +2 -2
- package/src/HOC/HAbsolute.js +0 -56
- package/src/HOC/HDiscontinue.js +0 -105
- package/src/HOC/HOverlay.js +0 -99
- package/src/layout/FooterBlock.js +0 -821
- /package/src/{common → Common}/ErrorBoundary.tsx +0 -0
- /package/src/{common → Common}/Icons.js +0 -0
|
@@ -0,0 +1,549 @@
|
|
|
1
|
+
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { TouchableOpacity, StyleSheet, View, Dimensions, Text, Image, TextInput, ScrollView, FlatList } from 'react-native';
|
|
3
|
+
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
|
|
4
|
+
import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
|
|
5
|
+
import popupStyles, {
|
|
6
|
+
getListviewItem,
|
|
7
|
+
getListviewItemText,
|
|
8
|
+
} from '../CommonStyle/PopupStyle';
|
|
9
|
+
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
10
|
+
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
11
|
+
import SAlphabet from '../StaticComponents/SAlphabet';
|
|
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 CText from '../CustomComponents/CText';
|
|
20
|
+
import SHelpDescription from './SHelpDescription';
|
|
21
|
+
import CModalOverlay from '../CustomComponents/CModalOverlay';
|
|
22
|
+
|
|
23
|
+
var searchResult = [];
|
|
24
|
+
var tempvalue = [];
|
|
25
|
+
var ValueString = null;
|
|
26
|
+
const SDropDownEdited = (props) => {
|
|
27
|
+
const [isdropdownshow, setDropdownShow] = useState(false);
|
|
28
|
+
const [searchData, setSearchData] = useState('');
|
|
29
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
30
|
+
const [selectedValue, setSelectedValue] = useState(props.value);
|
|
31
|
+
const [displayData, setDisplayData] = useState([]);
|
|
32
|
+
const [stage, setStage] = useState(false);
|
|
33
|
+
const [refresh, setRefresh] = useState(0);
|
|
34
|
+
const [filterPurpose, setFilterPurpose] = useState([]);
|
|
35
|
+
const [alphaFilter, setAlphaFilter] = useState(false);
|
|
36
|
+
const [dropdowndata, setDropDownData] = useState(props.dropdowndata);
|
|
37
|
+
const dynamicMenuRef = useRef(null);
|
|
38
|
+
const [data, setData] = useState(props.data ? props.data : null);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
isBNU(props.overlay) && props.overlay == true ? FetchDropdownList() : null;
|
|
42
|
+
}, [props.overlay]);
|
|
43
|
+
|
|
44
|
+
function getOverlayScreenContainer() {
|
|
45
|
+
return ({
|
|
46
|
+
flexDirection: 'row',
|
|
47
|
+
margin: 10,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
setAlphaFilter(false);
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// console.log("DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD",dropdowndata)
|
|
57
|
+
function FetchDropdownList(key) {
|
|
58
|
+
const updatedApiUrl = props.dropdownPort ? '' : APIURL;
|
|
59
|
+
setSearchData('');
|
|
60
|
+
setIsLoading(true);
|
|
61
|
+
setDropdownShow(true);
|
|
62
|
+
// console.log("SDROPDOWNLINK___________________", "get", APIURL + props.dropdownapi, "")
|
|
63
|
+
NetworkServiceCall('get', updatedApiUrl + props.dropdownapi, '')
|
|
64
|
+
.then(function (response) {
|
|
65
|
+
console.log('updatedUrl', updatedApiUrl + props.dropdownapi);
|
|
66
|
+
// console.log('Responseeeeeeeeeeeeeeeeeeeeeeeeee', JSON.stringify(response.data.data))
|
|
67
|
+
// console.log("SDROPDOWN_________________DATA___________", response)
|
|
68
|
+
searchResult = response;
|
|
69
|
+
if (response.data.data != null && response.data.data != undefined) {
|
|
70
|
+
|
|
71
|
+
// console.log('arrayyyyyyyyyyyyyyy', JSON.stringify(props.multidropdownarray))
|
|
72
|
+
if (props.iconOnly && props.multiselect) {
|
|
73
|
+
if (isBNUL(props.multidropdownarray) && isBNUL(response.data.data)) {
|
|
74
|
+
|
|
75
|
+
var results = response.data.data.map((item) => {
|
|
76
|
+
// Find the matching `xxx` object from `props.multidropdownarray`
|
|
77
|
+
const matchingXxx = props.multidropdownarray.find((xxx) => item.sudynamiccriteriadatavalue === xxx.sudynamiccriteriadatavalue);
|
|
78
|
+
|
|
79
|
+
// If a match is found, update `item` with all properties from `matchingXxx`
|
|
80
|
+
if (matchingXxx) {
|
|
81
|
+
return { ...item, ...matchingXxx }; // Merge properties of `item` and `matchingXxx`
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// If no match is found, return the original `item`
|
|
85
|
+
return item;
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
// var results = response.data.data.map((item) => {
|
|
94
|
+
// props.multidropdownarray.map((xxx) => {
|
|
95
|
+
// if (item.sudynamiccriteriadatavalue == xxx.sudynamiccriteriadatavalue) {
|
|
96
|
+
|
|
97
|
+
// item.selected = xxx.selected,
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
// }
|
|
101
|
+
// })
|
|
102
|
+
// })
|
|
103
|
+
}
|
|
104
|
+
else {
|
|
105
|
+
var results = response.data.data;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
console.log('response.data.data #################', JSON.stringify(results));
|
|
111
|
+
setDisplayData(results);
|
|
112
|
+
setIsLoading(false);
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
if (props.selectedval != undefined && props.selectedval != null && props.selectedval.length > 0) {
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
var results = response.data.data.map((item) => {
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
props.selectedval.map((xxx) => {
|
|
126
|
+
if (item.sudynamiccriteriadatavalue == xxx) {
|
|
127
|
+
item.selected = true;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
console.log('response.data.data #################', JSON.stringify(results));
|
|
134
|
+
setDisplayData(response.data.data);
|
|
135
|
+
setIsLoading(false);
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
searchResult = [];
|
|
147
|
+
setDisplayData([]);
|
|
148
|
+
setIsLoading(false);
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
function FetchList() {
|
|
154
|
+
setSearchData('');
|
|
155
|
+
setIsLoading(true);
|
|
156
|
+
setDropdownShow(true);
|
|
157
|
+
searchResult = { 'httpstatus': 200 };
|
|
158
|
+
setDisplayData(props.dropdownarray);
|
|
159
|
+
setIsLoading(false);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function selection(item, changevalue, keycode) {
|
|
163
|
+
console.log('DROP DOWN DETAILCODE-----------------------', item);
|
|
164
|
+
let dataset = {
|
|
165
|
+
...item,
|
|
166
|
+
// "sudynamiccriteriadatavalue": item.sudynamiccriteriadatavalue,
|
|
167
|
+
// "columnname": item.columnname,
|
|
168
|
+
// "detailcode": item.detailcode,
|
|
169
|
+
// "color": item.color,
|
|
170
|
+
// "searchparam": item.searchparam,
|
|
171
|
+
// "jasperfilename":item.jasperfilename,
|
|
172
|
+
// "reporttype":item.reporttype,
|
|
173
|
+
// "key": keycode,
|
|
174
|
+
// "item": item
|
|
175
|
+
};
|
|
176
|
+
setDropDownData(item.columnname);
|
|
177
|
+
props.onChangeData(dataset);
|
|
178
|
+
props.refreshCount(1);
|
|
179
|
+
// props.editStatus(1)
|
|
180
|
+
setDropdownShow(false);
|
|
181
|
+
if (props.setOverlay) {
|
|
182
|
+
props.setOverlay(false);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function DropdownLayout() {
|
|
187
|
+
return (
|
|
188
|
+
<View style={layoutstyles.overlay_screen_container}>
|
|
189
|
+
<View style={{ alignItems: 'center' }}>
|
|
190
|
+
<Text style={{ fontSize: normalize(12), fontWeight: 'bold', color: 'darkblue' }}>{isNU(data) && data.displaytext != undefined ? data.displaytext.toUpperCase() : ' SELECT OPTION '}</Text>
|
|
191
|
+
</View>
|
|
192
|
+
|
|
193
|
+
<View style={getOverlayScreenContainer()}>
|
|
194
|
+
<View
|
|
195
|
+
style={[ComponentStyles.searchTextbox_View,
|
|
196
|
+
layoutstyles.overlay_searchTextbox_View,
|
|
197
|
+
]}
|
|
198
|
+
>
|
|
199
|
+
<View style={layoutstyles.textinput_view}>
|
|
200
|
+
<TextInput
|
|
201
|
+
style={[ComponentStyles.searchTextbox]}
|
|
202
|
+
editable={true}
|
|
203
|
+
autoCapitalize={'characters'}
|
|
204
|
+
value={searchData}
|
|
205
|
+
onChangeText={text => setSearchData(text)}
|
|
206
|
+
secureTextEntry={false}
|
|
207
|
+
keyboardType={'default'}
|
|
208
|
+
placeholder="Search"
|
|
209
|
+
/>
|
|
210
|
+
|
|
211
|
+
</View>
|
|
212
|
+
<Image style={[ComponentStyles.searchIcon]}
|
|
213
|
+
source={{ uri: 'https://i.ibb.co/j8ywYpJ/search.png' }}
|
|
214
|
+
/>
|
|
215
|
+
|
|
216
|
+
</View>
|
|
217
|
+
</View>
|
|
218
|
+
|
|
219
|
+
<View style={getOverlayScreenChildcontainer()}>
|
|
220
|
+
{GetDropdown(alphaFilter ? filterPurpose : displayData)}
|
|
221
|
+
</View>
|
|
222
|
+
|
|
223
|
+
{props.multiselect != undefined && props.multiselect
|
|
224
|
+
?
|
|
225
|
+
<TouchableOpacity style={{ justifyContent: 'center', borderRadius: 10, alignItems: 'center', paddingHorizontal: normalize(10) }}
|
|
226
|
+
onPress={() => getMultiSelect()}
|
|
227
|
+
>
|
|
228
|
+
<View style={{
|
|
229
|
+
flexDirection: 'column',
|
|
230
|
+
backgroundColor: '#f7f4f4', borderRadius: 10,
|
|
231
|
+
paddingHorizontal: normalize(15),
|
|
232
|
+
paddingVertical: normalize(5),
|
|
233
|
+
alignItems: 'center',
|
|
234
|
+
}}>
|
|
235
|
+
<AntDesign name="select1"
|
|
236
|
+
color={'#094485'} size={normalize(20)} />
|
|
237
|
+
|
|
238
|
+
<Text
|
|
239
|
+
style={{
|
|
240
|
+
fontSize: normalize(11),
|
|
241
|
+
color: '#094485',
|
|
242
|
+
fontWeight: 'bold',
|
|
243
|
+
}}>
|
|
244
|
+
{' '}
|
|
245
|
+
Select
|
|
246
|
+
</Text>
|
|
247
|
+
</View>
|
|
248
|
+
</TouchableOpacity> : null}
|
|
249
|
+
</View>
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function getMultiSelect(params) {
|
|
254
|
+
// console.log('DISPLAYDATA @@@@@@@@@@@@@@@@', displayData)
|
|
255
|
+
var filterArray = displayData.filter((element) => element.selected == true);
|
|
256
|
+
var display = filterArray != undefined &&
|
|
257
|
+
filterArray.length > 0 ? filterArray.map((item) => item.columnname) : null;
|
|
258
|
+
|
|
259
|
+
setDropDownData(display.join());
|
|
260
|
+
props.onChangeData(filterArray);
|
|
261
|
+
setDropdownShow(false);
|
|
262
|
+
if (props.setOverlay) {
|
|
263
|
+
props.setOverlay(false);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
function getOverlayChildrenWrapperStyle() {
|
|
268
|
+
return ({
|
|
269
|
+
position: 'absolute',
|
|
270
|
+
bottom: 0,
|
|
271
|
+
top: Dimensions.get('screen').height * 0.17,
|
|
272
|
+
width: Dimensions.get('screen').width,
|
|
273
|
+
borderRadius: 20,
|
|
274
|
+
borderWidth: 2,
|
|
275
|
+
borderColor: '#e0e0e0',
|
|
276
|
+
paddingHorizontal: normalize(5),
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
function getAlphabetData(alpha, index) {
|
|
282
|
+
var filter = isBNUL(displayData) ? displayData.filter(value => (value.columnname != undefined ? value.columnname : '').charAt(0) == alpha) : [];
|
|
283
|
+
setFilterPurpose(filter);
|
|
284
|
+
index == 0 ? setSearchData('') : setSearchData(alpha);
|
|
285
|
+
index == 0 ? setAlphaFilter(false) : setAlphaFilter(true);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
// console.log("TEXT-------------------------",data)
|
|
289
|
+
|
|
290
|
+
return (
|
|
291
|
+
<View style={{ width: props.widthArr ? props.widthArr : '100%', borderWidth: 0 }}>
|
|
292
|
+
{isNU(data) && data.displaytext != undefined && props.iconOnly == undefined ?
|
|
293
|
+
<Text style={{ fontSize: normalize(11), color: 'black', paddingHorizontal: normalize(5), height: normalize(15) }}>
|
|
294
|
+
{data.required == true ?
|
|
295
|
+
<Text style={{ color: 'red', fontSize: normalize(13), fontWeight: 'bold' }}>* </Text> : null}
|
|
296
|
+
{data.displaytext}
|
|
297
|
+
</Text> : null}
|
|
298
|
+
{/* <Text>DDDDDDDDDDDDDD</Text> */}
|
|
299
|
+
|
|
300
|
+
<TouchableOpacity
|
|
301
|
+
onPress={() => (Global.HelpId = props.columnid, props.editable ? FetchDropdownList() : FetchList())}
|
|
302
|
+
disabled={props.disabled ? props.disabled : false}
|
|
303
|
+
// onLongPress={() => props.LongPress ? setStage(true) : null}
|
|
304
|
+
style={{
|
|
305
|
+
borderWidth: props.borderWidth ? 0 : 1, borderColor: 'lightgrey'
|
|
306
|
+
, paddingLeft: 2, alignItems: 'center', paddingRight: 15, elevation: 0,
|
|
307
|
+
backgroundColor: props.backgroundColor != undefined ? props.backgroundColor : '#fff',
|
|
308
|
+
height: props.heightArr ? props.heightArr : Dimensions.get('screen').height * 0.040,
|
|
309
|
+
flexDirection: 'row', borderRadius: props.borderRadiusArr ? props.borderRadiusArr : 5,
|
|
310
|
+
borderColor: props.borderArr ? props.borderArr : 'lightgrey',
|
|
311
|
+
}}
|
|
312
|
+
|
|
313
|
+
>
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
{props.iconOnly == undefined && props.iconName != undefined || props.icon != undefined ?
|
|
317
|
+
|
|
318
|
+
<Menu ref={dynamicMenuRef}>
|
|
319
|
+
<MenuTrigger
|
|
320
|
+
disabled={false}
|
|
321
|
+
customStyles={{ triggerWrapper: { borderWidth: 0, borderRadius: 10, elevation: 0 } }}
|
|
322
|
+
>
|
|
323
|
+
<TouchableOpacity disabled={true} style={{ width: normalize(22), paddingLeft: normalize(3) }}>
|
|
324
|
+
{props.iconName != undefined ? <FontAwesome5 name={props.iconName} color=
|
|
325
|
+
{props.flagData == 1 ? 'darkblue' : '#094485'}
|
|
326
|
+
size={props.iconSize != undefined ? normalize(props.iconSize) : normalize(15)} /> : null}
|
|
327
|
+
{props.icon != undefined ?
|
|
328
|
+
<MaterialCommunityIcons name={props.icon} color=
|
|
329
|
+
{props.flagData == 1 ? 'darkblue' : '#094485'}
|
|
330
|
+
size={normalize(20)} /> : null}
|
|
331
|
+
|
|
332
|
+
</TouchableOpacity>
|
|
333
|
+
</MenuTrigger>
|
|
334
|
+
<MenuOptions optionsContainerStyle={{ marginTop: normalize(25), marginLeft: 0, width: props.widthArr }}>
|
|
335
|
+
{props.columnid != undefined ? <SHelpDescription column={props.columnid != undefined ? props.columnid : 0} /> : null}
|
|
336
|
+
</MenuOptions>
|
|
337
|
+
</Menu>
|
|
338
|
+
: null}
|
|
339
|
+
{props.iconOnly != true ?
|
|
340
|
+
<View style={{ position: 'absolute', bottom: 0, right: 3 }}>
|
|
341
|
+
<Text adjustsFontSizeToFit numberOfLines={3}
|
|
342
|
+
style={{ fontSize: props.fontSize ? props.fontSize : normalize(11), alignSelf: 'flex-start', fontWeight: 'bold', width: parseFloat(props.widthArr) - normalize(10) + '%' }} >
|
|
343
|
+
{props.cornerKey != null && props.cornerKey != undefined && typeof props.cornerKey === 'string' ? props.cornerKey : ''}</Text>
|
|
344
|
+
</View>
|
|
345
|
+
: null}
|
|
346
|
+
{props.iconOnly != true ?
|
|
347
|
+
<View style={{ alignItems: 'center', paddingRight: normalize(5.2), width: props.iconclose ? '88%' : '100%' }}>
|
|
348
|
+
<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 }} >
|
|
349
|
+
{dropdowndata != null && dropdowndata != undefined ? dropdowndata : props.value}
|
|
350
|
+
{/* {getDropDownData(dropdowndata)} */}
|
|
351
|
+
</Text>
|
|
352
|
+
</View>
|
|
353
|
+
: null}
|
|
354
|
+
{isBNU(dropdowndata) && props.iconclose ?
|
|
355
|
+
<TouchableOpacity
|
|
356
|
+
disabled={props.disabled != null && props.disabled != undefined && props.disabled == true ? true : false}
|
|
357
|
+
onPress={() => {
|
|
358
|
+
setDropDownData(''),
|
|
359
|
+
props.iconclosecallback(true);
|
|
360
|
+
}}
|
|
361
|
+
>
|
|
362
|
+
<HOCIcons.Icons
|
|
363
|
+
icongroup={3}
|
|
364
|
+
name={'close-circle'}
|
|
365
|
+
size={normalize(25)}
|
|
366
|
+
color={'darkblue'}
|
|
367
|
+
style={{ color: 'darkblue' }}
|
|
368
|
+
/>
|
|
369
|
+
</TouchableOpacity>
|
|
370
|
+
: null}
|
|
371
|
+
{props.iconName != undefined && props.iconOnly == true ?
|
|
372
|
+
<FontAwesome5 name={props.iconName} color=
|
|
373
|
+
{props.flagData == 1 ? 'darkblue' : '#094485'}
|
|
374
|
+
size={props.iconsize} /> : null}
|
|
375
|
+
{props.icon != undefined && props.iconOnly == true ?
|
|
376
|
+
<MaterialCommunityIcons name={props.icon} color=
|
|
377
|
+
{props.flagData == 1 ? 'darkblue' : '#094485'}
|
|
378
|
+
size={props.iconsize} /> : null}
|
|
379
|
+
|
|
380
|
+
{isdropdownshow ?
|
|
381
|
+
<CModalOverlay visible={true}
|
|
382
|
+
onClose={() => {
|
|
383
|
+
setDropdownShow(false);
|
|
384
|
+
if (props.setOverlay) {
|
|
385
|
+
props.setOverlay(false);
|
|
386
|
+
}
|
|
387
|
+
}}
|
|
388
|
+
closeOnTouchOutside
|
|
389
|
+
animationType="zoomIn"
|
|
390
|
+
containerStyle={{ backgroundColor: 'transparent' }}
|
|
391
|
+
childrenWrapperStyle={getOverlayChildrenWrapperStyle()}
|
|
392
|
+
animationDuration={500}
|
|
393
|
+
>
|
|
394
|
+
|
|
395
|
+
<TouchableOpacity style={{ position: 'absolute', right: 0, zIndex: 1, marginTop: normalize(5) }}
|
|
396
|
+
onPress={() => {
|
|
397
|
+
setDropdownShow(false);
|
|
398
|
+
if (props.setOverlay) {
|
|
399
|
+
props.setOverlay(false);
|
|
400
|
+
}
|
|
401
|
+
}}
|
|
402
|
+
>
|
|
403
|
+
<FontAwesome5 name={'angle-double-down'}
|
|
404
|
+
color={'#094485'} size={normalize(20)} />
|
|
405
|
+
</TouchableOpacity>
|
|
406
|
+
|
|
407
|
+
{!isLoading ?
|
|
408
|
+
searchResult.httpstatus == 200 ?
|
|
409
|
+
DropdownLayout()
|
|
410
|
+
:
|
|
411
|
+
<View>
|
|
412
|
+
<Text style={[ComponentStyles.no_data_found_text]}>No Result Found</Text>
|
|
413
|
+
</View>
|
|
414
|
+
:
|
|
415
|
+
<View style={{
|
|
416
|
+
flex: 1, width: '100%', justifyContent: 'center',
|
|
417
|
+
backgroundColor: 'transparent', borderRadius: 10,
|
|
418
|
+
}}>
|
|
419
|
+
<SearchLoader />
|
|
420
|
+
</View>}
|
|
421
|
+
</CModalOverlay>
|
|
422
|
+
: null}
|
|
423
|
+
|
|
424
|
+
{stage ?
|
|
425
|
+
<OverlayHOCComponent
|
|
426
|
+
visibility={val => (val == undefined ? null : setStage(val))}
|
|
427
|
+
xyz={val => (val == undefined ? null : setDropDownData(val.columnname, setStage(false)))}
|
|
428
|
+
value={props.cornerKey}
|
|
429
|
+
// onselect={val => (val == undefined ? null : onSelect(val))}
|
|
430
|
+
// data={searchResult != null && searchResult != undefined && searchResult.length > 0 ? searchResult : null}
|
|
431
|
+
/> : null}
|
|
432
|
+
|
|
433
|
+
</TouchableOpacity>
|
|
434
|
+
</View>
|
|
435
|
+
|
|
436
|
+
);
|
|
437
|
+
function getDropDownCode(details, droparry) {
|
|
438
|
+
console.log(details);
|
|
439
|
+
let dropdownvaluenew;
|
|
440
|
+
droparry != null
|
|
441
|
+
? droparry.map(val => {
|
|
442
|
+
if (val.sudynamiccriteriadatavalue == details) {
|
|
443
|
+
dropdownvaluenew = val.columnname;
|
|
444
|
+
}
|
|
445
|
+
})
|
|
446
|
+
: null;
|
|
447
|
+
|
|
448
|
+
console.log('DROP----------------------', dropdownvaluenew);
|
|
449
|
+
return dropdownvaluenew;
|
|
450
|
+
|
|
451
|
+
}
|
|
452
|
+
function GetDropdown(data) {
|
|
453
|
+
|
|
454
|
+
const newDropDownData = data != null && data != undefined ? data.filter(function (item) {
|
|
455
|
+
const dataItem = item.columnname ? item.columnname.toUpperCase() : ''.toUpperCase();
|
|
456
|
+
const textData = searchData.toUpperCase();
|
|
457
|
+
return dataItem.indexOf(textData) > -1;
|
|
458
|
+
}) : null;
|
|
459
|
+
|
|
460
|
+
return (
|
|
461
|
+
<View style={{ flexDirection: 'row' }}>
|
|
462
|
+
<FlatList
|
|
463
|
+
data={newDropDownData}
|
|
464
|
+
renderItem={renderItem}
|
|
465
|
+
initialNumToRender={10}
|
|
466
|
+
maxToRenderPerBatch={20}
|
|
467
|
+
keyExtractor={(item, index) => 'key' + index}
|
|
468
|
+
/>
|
|
469
|
+
|
|
470
|
+
<SAlphabet
|
|
471
|
+
callBack={val =>
|
|
472
|
+
val == undefined ? null : getAlphabetData(val.alpha, val.index)
|
|
473
|
+
} />
|
|
474
|
+
|
|
475
|
+
{/* <View style={{
|
|
476
|
+
height: Dimensions.get('window').height * 0.37,
|
|
477
|
+
marginBottom: Dimensions.get('window').height * 0.01,
|
|
478
|
+
}}>
|
|
479
|
+
<FlatList
|
|
480
|
+
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"]}
|
|
481
|
+
renderItem={renderAlphabet}
|
|
482
|
+
style={{ paddingBottom: 20 }}
|
|
483
|
+
contentContainerStyle={{ alignItems: 'center' }}
|
|
484
|
+
keyExtractor={(item, index) => 'key' + index}
|
|
485
|
+
/>
|
|
486
|
+
</View> */}
|
|
487
|
+
</View>
|
|
488
|
+
);
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
function multiselect(item, keycode) {
|
|
492
|
+
item.selected = !item.selected;
|
|
493
|
+
setRefresh(refresh + 1);
|
|
494
|
+
}
|
|
495
|
+
function renderItem(data) {
|
|
496
|
+
// console.log("________________________________________",data)
|
|
497
|
+
return (
|
|
498
|
+
<TouchableOpacity
|
|
499
|
+
style={[getListviewItem(data.item.selected), { flexDirection: 'row', alignItems: 'center' }]}
|
|
500
|
+
onPress={() => props.multiselect != undefined ? multiselect(data.item, props.keycode) : selection(data.item, data.item.selected, props.keycode)}
|
|
501
|
+
activeOpacity={0.5}
|
|
502
|
+
>
|
|
503
|
+
<Icons.FontAwesome name="dot-circle-o" color="darkblue" size={normalize(12)}
|
|
504
|
+
style={{ paddingHorizontal: normalize(2), paddingLeft: normalize(4) }} />
|
|
505
|
+
<Text style={selectedValue != null && selectedValue != undefined ? selectedValue == item.sudynamiccriteriadatavalue ? getListviewItemText(true) : getListviewItemText(false) : getListviewItemText(false)}>
|
|
506
|
+
{data.item.columnname}
|
|
507
|
+
</Text>
|
|
508
|
+
</TouchableOpacity>
|
|
509
|
+
);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
function getOverlayScreenChildcontainer() {
|
|
513
|
+
return (
|
|
514
|
+
{
|
|
515
|
+
flex: 1,
|
|
516
|
+
marginBottom: Dimensions.get('window').height * 0.01,
|
|
517
|
+
marginTop: Dimensions.get('window').height * 0.01,
|
|
518
|
+
}
|
|
519
|
+
);
|
|
520
|
+
}
|
|
521
|
+
};
|
|
522
|
+
|
|
523
|
+
const layoutstyles = StyleSheet.create({
|
|
524
|
+
lefticon_container: {
|
|
525
|
+
marginLeft: '2%',
|
|
526
|
+
},
|
|
527
|
+
textinput_view: {
|
|
528
|
+
flex: 1,
|
|
529
|
+
paddingLeft: '1%',
|
|
530
|
+
},
|
|
531
|
+
overlay_screen_listview_container: {
|
|
532
|
+
justifyContent: 'center',
|
|
533
|
+
marginBottom: 10,
|
|
534
|
+
},
|
|
535
|
+
overlay_searchTextbox_View: {
|
|
536
|
+
width: '96%',
|
|
537
|
+
|
|
538
|
+
},
|
|
539
|
+
overlay_screen_heading_text: {
|
|
540
|
+
...ComponentStyles.popup_heading,
|
|
541
|
+
width: '100%',
|
|
542
|
+
},
|
|
543
|
+
overlay_screen_container: {
|
|
544
|
+
width: '100%',
|
|
545
|
+
flex: 1,
|
|
546
|
+
},
|
|
547
|
+
});
|
|
548
|
+
|
|
549
|
+
export default SDropDownEdited;
|