@jescon-technologies/react-native-ui-kit 0.0.6 → 0.0.7
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/dist/Common/ErrorBoundary.d.ts +15 -0
- package/dist/Common/ErrorBoundary.d.ts.map +1 -0
- package/dist/Common/ErrorBoundary.js +64 -0
- package/dist/Common/ErrorBoundary.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/src/Common/ErrorBoundary.d.ts +15 -0
- package/dist/src/Common/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/Common/ErrorBoundary.js +64 -0
- package/dist/src/Common/ErrorBoundary.js.map +1 -0
- package/package.json +17 -5
- package/.gitattributes +0 -2
- package/index.d.ts +0 -66
- package/index.js +0 -66
- package/src/Alerts/AAlert.js +0 -137
- package/src/Alerts/AAlertIOS.js +0 -97
- package/src/Alerts/ABlink.js +0 -40
- package/src/Common/ErrorBoundary.tsx +0 -73
- package/src/Common/Icons.js +0 -49
- package/src/Common/NetworkServiceCall.js +0 -265
- package/src/CommonStyle/CommonTheme.js +0 -11
- package/src/CommonStyle/ComponentFunctions.js +0 -632
- package/src/CommonStyle/PopupStyle.js +0 -146
- package/src/CommonStyle/commonStyle.js +0 -93
- package/src/CommonStyle/componentStyle.js +0 -545
- package/src/CommonStyle/optionListStyles.js +0 -175
- package/src/Components/ByProductPage.js +0 -200
- package/src/Components/CDropDownListNew.js +0 -153
- package/src/Components/CSupplierList.js +0 -88
- package/src/Components/CVerificationCard.js +0 -2822
- package/src/Components/CustomButton.js +0 -67
- package/src/Components/CustomCard.js +0 -127
- package/src/Components/CustomTextInput.js +0 -47
- package/src/Components/EquipmentPage.js +0 -313
- package/src/Components/FilterInput.Copy.js +0 -723
- package/src/Components/FilterInput.js +0 -569
- package/src/Components/HSubHeading.js +0 -68
- package/src/Components/HeaderCard.js +0 -40
- package/src/Components/MoreOptionsScreen.js +0 -251
- package/src/Components/NonSwipableProductCard.js +0 -226
- package/src/Components/NonSwipableSupplierCard.js +0 -348
- package/src/Components/ProductCard.js +0 -1336
- package/src/Components/QualityProductCard.js +0 -1059
- package/src/Components/RateProductCard.js +0 -1452
- package/src/Components/RawMaterial.js +0 -261
- package/src/Components/SDropDownEdited.js +0 -549
- package/src/Components/SDropDownNew.js +0 -529
- package/src/Components/SHelpDescription.js +0 -147
- package/src/Components/STextInputNew.js +0 -510
- package/src/Components/SearchProductCard.js +0 -470
- package/src/Components/StageByProduct.js +0 -199
- package/src/Components/SupplierCard.js +0 -243
- package/src/Components/SupplierInvoiceCard.js +0 -405
- package/src/Components/SwipableSupplierCard.js +0 -136
- package/src/Components/TagTemplate.js +0 -74
- package/src/Components/WrappedComponent.js +0 -25
- package/src/Custom/CBooking.js +0 -944
- package/src/Custom/CBookingPostpone.js +0 -1822
- package/src/Custom/CCalendar.js +0 -560
- package/src/Custom/CCard.js +0 -880
- package/src/Custom/CDetailCard.js +0 -205
- package/src/Custom/CHelpImage.js +0 -52
- package/src/Custom/CReport.js +0 -569
- package/src/Custom/CScrollView.js +0 -73
- package/src/Custom/CSignature.js +0 -112
- package/src/Custom/CSliderMenu.js +0 -339
- package/src/Custom/CSupplierCard.js +0 -99
- package/src/Custom/CTemplateCard.js +0 -438
- package/src/Custom/CTokenAllocation.js +0 -1402
- package/src/Custom/CTokenListOverlay.js +0 -122
- package/src/Custom/CWardStatus.js +0 -444
- package/src/Custom/Charts/CBarChart.js +0 -218
- package/src/Custom/Charts/CDashBoardList.js +0 -133
- package/src/Custom/Charts/CDashBoardTable.js +0 -172
- package/src/Custom/Charts/CLineChart.js +0 -193
- package/src/Custom/Charts/CPieChart.js +0 -186
- package/src/Custom/Loader.js +0 -182
- package/src/Custom/OUserView.js +0 -1121
- package/src/Custom/PreviewDosage.js +0 -115
- package/src/Custom/SearchLoader.js +0 -32
- package/src/Custom/TableComponent/CActivityTable.js +0 -707
- package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
- package/src/Custom/TableComponent/CTable.js +0 -185
- package/src/Custom/TableComponent/CTextBody.js +0 -40
- package/src/Custom/TableComponent/CTextHeader.js +0 -17
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
- package/src/Custom/TableComponent/SDropdownTable.js +0 -491
- package/src/Custom/TableComponent/TagTable.js +0 -1200
- package/src/CustomComponents/CAddColumn.js +0 -140
- package/src/CustomComponents/CAssessmentDelete.js +0 -307
- package/src/CustomComponents/CAwesomeButton.js +0 -83
- package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
- package/src/CustomComponents/CBackHandler.js +0 -273
- package/src/CustomComponents/CCalendar.js +0 -243
- package/src/CustomComponents/CCommentOverlay.js +0 -202
- package/src/CustomComponents/CComments.js +0 -162
- package/src/CustomComponents/CContainerView.js +0 -24
- package/src/CustomComponents/CCustomTextInput.js +0 -336
- package/src/CustomComponents/CDetailView.js +0 -40
- package/src/CustomComponents/CDropDownList.js +0 -153
- package/src/CustomComponents/CDropdownSelect.js +0 -555
- package/src/CustomComponents/CFooterView.js +0 -42
- package/src/CustomComponents/CImagePickerSave.js +0 -316
- package/src/CustomComponents/CModalOverlay.js +0 -91
- package/src/CustomComponents/CNetworkStatus.js +0 -327
- package/src/CustomComponents/CNotesInstructions.js +0 -1000
- package/src/CustomComponents/COverlay.js +0 -81
- package/src/CustomComponents/CRemarks.js +0 -176
- package/src/CustomComponents/CRowAdd.js +0 -143
- package/src/CustomComponents/CSummaryDropDown.js +0 -327
- package/src/CustomComponents/CText.js +0 -9
- package/src/CustomComponents/CVectorIcon.js +0 -34
- package/src/CustomComponents/HtmlContentViewer.js +0 -65
- package/src/CustomComponents/PdfContentViewer.js +0 -90
- package/src/CustomComponents/SDropDownDosage.js +0 -1087
- package/src/CustomComponents/SwipableProductCard.js +0 -246
- package/src/CustomComponents/SwipableProductImageCard.js +0 -254
- package/src/CustomComponents/WorkOrderDetails.js +0 -1216
- package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
- package/src/HOC/ConfirmOverlay.js +0 -192
- package/src/HOC/HHeading.js +0 -70
- package/src/HOC/HMoreButton.js +0 -88
- package/src/HOC/HNatureHeading.js +0 -402
- package/src/HOC/HOCIcons.js +0 -80
- package/src/HOC/HOverlayCentered.js +0 -140
- package/src/HOC/HShadowButton.js +0 -45
- package/src/HOC/HShadowCountButton.js +0 -82
- package/src/HOC/OptionOverlay.js +0 -48
- package/src/Json/Chart.json +0 -818
- package/src/Json/Consultation.json +0 -622
- package/src/Json/CreditBill.json +0 -490
- package/src/Json/Dropdown.json +0 -216
- package/src/Json/DropdownConsultation.json +0 -228
- package/src/Json/DynamicReports.json +0 -623
- package/src/Json/Footer.json +0 -79
- package/src/Media/AudioScreen.js +0 -342
- package/src/Media/BarcodeScan.js +0 -145
- package/src/Media/CAudioPlay.js +0 -228
- package/src/Media/CCaptureImageWithoutEdit.js +0 -330
- package/src/Media/CImageGallery.js +0 -289
- package/src/Media/CImageZoom.js +0 -82
- package/src/Media/CSingleImage.js +0 -391
- package/src/Media/CSketchCanvas.js +0 -76
- package/src/Media/CVideoPlay.js +0 -31
- package/src/Media/DocumentScreen.js +0 -362
- package/src/Media/DrawingScreen.js +0 -578
- package/src/Media/ImageScreen.js +0 -309
- package/src/Media/RecordAudio.js +0 -250
- package/src/Media/RecordVideo.js +0 -223
- package/src/Media/VideoScreen.js +0 -378
- package/src/Navigation/PageNavigation.js +0 -224
- package/src/Navigation/useFocusEffect.js +0 -2
- package/src/Navigation/useFocusEffect.native.js +0 -1
- package/src/Navigation/useFocusEffect.web.js +0 -1
- package/src/Navigation/useIsFocused.js +0 -1
- package/src/Navigation/useIsFocused.native.js +0 -1
- package/src/Navigation/useIsFocused.web.js +0 -1
- package/src/Navigation/useNavigation.js +0 -2
- package/src/Navigation/useNavigation.native.js +0 -1
- package/src/Navigation/useNavigation.web.js +0 -1
- package/src/Screens/CMedications.js +0 -528
- package/src/Screens/CWebViewGallery.js +0 -203
- package/src/Screens/ChartScan.js +0 -279
- package/src/Screens/ChartScreenNew.js +0 -1579
- package/src/Screens/Consultation.js +0 -1500
- package/src/Screens/Dashboard.js +0 -778
- package/src/Screens/FileExplorer.js +0 -288
- package/src/Screens/Footer.js +0 -340
- package/src/Screens/ForgotPassword.js +0 -288
- package/src/Screens/HeaderBlock.js +0 -353
- package/src/Screens/Login.js +0 -328
- package/src/Screens/Notification.js +0 -149
- package/src/Screens/OcrScreen.js +0 -20
- package/src/Screens/PdfPreview.js +0 -507
- package/src/Screens/RegistrationDetails.js +0 -467
- package/src/Screens/SearchScreen.js +0 -582
- package/src/Screens/Splash.js +0 -788
- package/src/Screens/SwipeLeftView.js +0 -1867
- package/src/StaticComponents/SAlphabet.js +0 -47
- package/src/StaticComponents/SCheckBox.js +0 -42
- package/src/StaticComponents/SDatePicker.js +0 -208
- package/src/StaticComponents/SDatePickerLabel.js +0 -253
- package/src/StaticComponents/SDatePickerNew.js +0 -258
- package/src/StaticComponents/SDateTimePickerNew.js +0 -381
- package/src/StaticComponents/SDropDownGenerate.js +0 -450
- package/src/StaticComponents/SDropDownHoc.js +0 -636
- package/src/StaticComponents/SDropDownIcon.js +0 -500
- package/src/StaticComponents/SMenuBox.js +0 -131
- package/src/StaticComponents/SOverlay.js +0 -177
- package/src/StaticComponents/SOverlayTextInput.js +0 -109
- package/src/StaticComponents/SSearch.js +0 -438
- package/src/StaticComponents/SSearchBar.js +0 -53
- package/src/StaticComponents/SSpeedDial.js +0 -303
- package/src/StaticComponents/STextInput.js +0 -289
- package/src/StaticComponents/STextInputProps.js +0 -36
- package/src/StaticComponents/STimePicker.js +0 -171
- package/src/StaticComponents/STimingDropDownNew.js +0 -1585
- package/src/StaticComponents/STimingSwitch.js +0 -34
- package/src/layout/CContainerView.js +0 -21
- package/src/layout/CDetailView.js +0 -81
- package/src/layout/HeaderBlock.js +0 -353
- package/src/layout/INVLoginLayout.js +0 -657
- package/src/layout/Loader.js +0 -176
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { TouchableOpacity, View, Text } from 'react-native';
|
|
3
|
-
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
4
|
-
import { notifyMessage } from '../CommonStyle/ComponentFunctions';
|
|
5
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
6
|
-
|
|
7
|
-
export default function CustomButton({ data, callBack }) {
|
|
8
|
-
return (
|
|
9
|
-
<TouchableOpacity
|
|
10
|
-
style={{
|
|
11
|
-
borderRadius: data.borderRadius != undefined ? data.borderRadius : 10,
|
|
12
|
-
borderWidth: data.borderWidth != undefined ? data.borderWidth : 1,
|
|
13
|
-
height: normalize(data.height != undefined ? data.height : 40),
|
|
14
|
-
width: normalize(data.width != undefined ? data.width : 58),
|
|
15
|
-
backgroundColor: data.shadowcolor != undefined ? data.shadowcolor : '#f7efef',
|
|
16
|
-
borderColor: data.bordercolor != undefined ? data.bordercolor : 'lightblue',
|
|
17
|
-
alignItems: 'center',
|
|
18
|
-
justifyContent: 'center',
|
|
19
|
-
padding: data.padding != undefined ? data.padding : 5,
|
|
20
|
-
shadowColor: '#000',
|
|
21
|
-
shadowOpacity: 0.2,
|
|
22
|
-
shadowRadius: 2,
|
|
23
|
-
shadowOffset: { width: 0, height: 2 },
|
|
24
|
-
}}
|
|
25
|
-
onPress={() =>
|
|
26
|
-
data.functionid != undefined ? callBack(data) : notifyMessage('Incorporate soon')
|
|
27
|
-
}
|
|
28
|
-
disabled={data.disabled != undefined ? data.disabled : false}
|
|
29
|
-
>
|
|
30
|
-
<View style={{ alignItems: 'center', justifyContent: 'center' }}>
|
|
31
|
-
{data.count ? <View style={{
|
|
32
|
-
position: 'absolute', right: normalize(10), top: normalize(-5), backgroundColor: 'white',
|
|
33
|
-
alignItems: 'center', borderRadius: 20, width: normalize(15), borderWidth: 0.5, zIndex: 10,
|
|
34
|
-
}}>
|
|
35
|
-
|
|
36
|
-
<Text style={{ color: 'black', fontSize: normalize(11), fontWeight: 'bold' }}>{data.countValue || 0}</Text>
|
|
37
|
-
</View> : null}
|
|
38
|
-
{data.iconname ? (
|
|
39
|
-
<Icons.FontAwesome5
|
|
40
|
-
name={data.iconname != undefined ? data.iconname : 'file'}
|
|
41
|
-
color={data.iconcolor != undefined ? data.iconcolor : 'white'}
|
|
42
|
-
size={data.iconsize != undefined ? normalize(data.iconsize) : normalize(20)}
|
|
43
|
-
/>
|
|
44
|
-
) : (
|
|
45
|
-
<Icons.MaterialIcons
|
|
46
|
-
name={data.icon != undefined ? data.icon : 'file'}
|
|
47
|
-
color={data.iconcolor != undefined ? data.iconcolor : 'white'}
|
|
48
|
-
size={data.iconsize != undefined ? normalize(data.iconsize) : normalize(20)}
|
|
49
|
-
/>
|
|
50
|
-
)}
|
|
51
|
-
<Text
|
|
52
|
-
numberOfLines={1}
|
|
53
|
-
style={{
|
|
54
|
-
width: normalize(50),
|
|
55
|
-
color: data.fontcolor != undefined ? data.fontcolor : '#fff',
|
|
56
|
-
textAlign: data.textAlign != undefined ? data.textAlign : 'center',
|
|
57
|
-
fontSize: data.size != undefined ? normalize(data.size) : normalize(10),
|
|
58
|
-
fontWeight: data.fontWeight != undefined ? data.fontWeight : 'normal',
|
|
59
|
-
marginTop: 5,
|
|
60
|
-
}}
|
|
61
|
-
>
|
|
62
|
-
{data.displaytext != undefined ? data.displaytext : ''}
|
|
63
|
-
</Text>
|
|
64
|
-
</View>
|
|
65
|
-
</TouchableOpacity>
|
|
66
|
-
);
|
|
67
|
-
}
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import { View, Text, StyleSheet, Image, TouchableOpacity, ScrollView } from 'react-native';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
5
|
-
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
6
|
-
|
|
7
|
-
const CustomCard = ({ item, onCardPress }) => {
|
|
8
|
-
// console.log('////////////////////////////////////////#############', item)
|
|
9
|
-
const [expanded, setExpanded] = useState(false);
|
|
10
|
-
return (
|
|
11
|
-
// <View style={{ backgroundColor: item?.backgroundColor != undefined ? item.backgroundColor : '#e1e3e1', borderRadius: 12, position: 'relative', padding: 10 }}>
|
|
12
|
-
<View>
|
|
13
|
-
{/* <TouchableOpacity style={{ backgroundColor: '#e1e3e1', borderRadius: 12, position: 'relative', padding: 10 }} onPress={() => { */}
|
|
14
|
-
<TouchableOpacity style={{ backgroundColor: item?.backgroundColor != undefined ? item.backgroundColor : '#e1e3e1', borderRadius: 12, position: 'relative', padding: 10 }} onPress={() => {
|
|
15
|
-
onCardPress(item);
|
|
16
|
-
}}>
|
|
17
|
-
<View style={{ flexDirection: 'row', justifyContent: 'space-between', paddingBottom: 3 }}>
|
|
18
|
-
<View style={{ flexDirection: 'row' }}>
|
|
19
|
-
{/* Image container */}
|
|
20
|
-
<View style={styles.imageContainer}>
|
|
21
|
-
<Image
|
|
22
|
-
source={
|
|
23
|
-
item.imageUrl
|
|
24
|
-
? { uri: item.imageUrl }
|
|
25
|
-
: item.description === 'M'
|
|
26
|
-
? {uri: `${APIURL}file/getCommonFile/image/Male(2).png`} : {uri: `${APIURL}file/getCommonFile/image/FemaleI(1).png`}
|
|
27
|
-
}
|
|
28
|
-
style={styles.image}
|
|
29
|
-
/>
|
|
30
|
-
|
|
31
|
-
</View>
|
|
32
|
-
<View>
|
|
33
|
-
<Text style={{ color: item?.fontcolor != undefined ? item.fontcolor : '#094485', fontWeight: item?.fonttype != undefined ? item.fonttype : 'bold', fontSize: 15 }}>{item.name}</Text>
|
|
34
|
-
<View style={{ flexDirection: 'row', justifyContent: 'space-between', width: 90 }}>
|
|
35
|
-
<Text style={{ fontWeight: '500', fontSize: 13, color: '#000' }}>{item.description}</Text>
|
|
36
|
-
<Text style={{ fontWeight: '500', fontSize: 13, color: '#000' }}>{item.detail}</Text>
|
|
37
|
-
</View>
|
|
38
|
-
</View>
|
|
39
|
-
</View>
|
|
40
|
-
<View>
|
|
41
|
-
<Text style={{ color: item?.fontcolor != undefined ? item.fontcolor : '#094485', fontWeight: item?.fonttype != undefined ? item.fonttype : 'bold', fontSize: 15 }}>{item.id}</Text>
|
|
42
|
-
<View style={{ position: 'absolute', bottom: 5, right: 5 }}>
|
|
43
|
-
<TouchableOpacity
|
|
44
|
-
style={{
|
|
45
|
-
height: 30, width: 30, justifyContent: 'center', alignItems: 'center',
|
|
46
|
-
borderRadius: 15, backgroundColor: 'lightgrey',
|
|
47
|
-
}}
|
|
48
|
-
onPress={() => setExpanded(!expanded)}
|
|
49
|
-
>
|
|
50
|
-
<Icons.FontAwesome5
|
|
51
|
-
name={expanded ? 'chevron-up' : 'chevron-down'}
|
|
52
|
-
size={14}
|
|
53
|
-
color="darkblue"
|
|
54
|
-
/>
|
|
55
|
-
</TouchableOpacity>
|
|
56
|
-
</View>
|
|
57
|
-
</View>
|
|
58
|
-
</View>
|
|
59
|
-
</TouchableOpacity>
|
|
60
|
-
{
|
|
61
|
-
expanded && <View style={{ height: 180 }}>
|
|
62
|
-
<ScrollView style={{ paddingHorizontal: 10 }} nestedScrollEnabled={true}>
|
|
63
|
-
{
|
|
64
|
-
item.expandedcontent.map((exp, i) => (
|
|
65
|
-
// <View key={i + 1} style={{ flexDirection: 'row', padding: 5 }}>
|
|
66
|
-
// <Text style={{ color: 'gray' }}>{exp.expandlabel} : </Text>
|
|
67
|
-
// <Text style={{ fontWeight: '500', fontSize: 15, color: '#000' }}>{exp.expanddata}</Text>
|
|
68
|
-
// </View>
|
|
69
|
-
<View
|
|
70
|
-
key={i + 1}
|
|
71
|
-
style={{
|
|
72
|
-
backgroundColor: '#ffffff',
|
|
73
|
-
borderRadius: 5,
|
|
74
|
-
paddingVertical: 5,
|
|
75
|
-
paddingHorizontal: 12,
|
|
76
|
-
marginVertical: 2,
|
|
77
|
-
borderWidth: 1,
|
|
78
|
-
borderColor: '#ddd',
|
|
79
|
-
flexDirection: 'row',
|
|
80
|
-
alignItems: 'center',
|
|
81
|
-
justifyContent: 'space-between',
|
|
82
|
-
}}
|
|
83
|
-
>
|
|
84
|
-
<Text
|
|
85
|
-
style={{
|
|
86
|
-
color: 'gray',
|
|
87
|
-
fontSize: 14,
|
|
88
|
-
marginRight: 5,
|
|
89
|
-
}}
|
|
90
|
-
>
|
|
91
|
-
{exp.expandlabel} :
|
|
92
|
-
</Text>
|
|
93
|
-
<Text
|
|
94
|
-
style={{
|
|
95
|
-
fontWeight: '500',
|
|
96
|
-
fontSize: 15,
|
|
97
|
-
color: '#000',
|
|
98
|
-
}}
|
|
99
|
-
>
|
|
100
|
-
{exp.expanddata}
|
|
101
|
-
</Text>
|
|
102
|
-
</View>
|
|
103
|
-
))
|
|
104
|
-
}
|
|
105
|
-
</ScrollView>
|
|
106
|
-
</View>
|
|
107
|
-
}
|
|
108
|
-
</View>
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const styles = StyleSheet.create({
|
|
113
|
-
imageContainer: {
|
|
114
|
-
marginRight: 10,
|
|
115
|
-
borderRadius: 50,
|
|
116
|
-
overflow: 'hidden',
|
|
117
|
-
},
|
|
118
|
-
image: {
|
|
119
|
-
width: 60,
|
|
120
|
-
height: 60,
|
|
121
|
-
borderRadius: 50,
|
|
122
|
-
borderWidth: 1,
|
|
123
|
-
resizeMode: 'contain',
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
export default CustomCard;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { TextInput, StyleSheet } from 'react-native';
|
|
3
|
-
|
|
4
|
-
const CustomTextInput = ({
|
|
5
|
-
inputRef,
|
|
6
|
-
style,
|
|
7
|
-
placeholder,
|
|
8
|
-
placeholderTextColor = 'gray',
|
|
9
|
-
value,
|
|
10
|
-
onChangeText,
|
|
11
|
-
onSubmitEditing,
|
|
12
|
-
keyboardType = 'default',
|
|
13
|
-
}) => {
|
|
14
|
-
const [localValue, setLocalValue] = useState(value);
|
|
15
|
-
|
|
16
|
-
const handleChangeText = (text) => {
|
|
17
|
-
setLocalValue(text);
|
|
18
|
-
if (onChangeText) {
|
|
19
|
-
onChangeText(text);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
return (
|
|
24
|
-
<TextInput
|
|
25
|
-
ref={inputRef}
|
|
26
|
-
style={[styles.input, style]}
|
|
27
|
-
placeholder={placeholder}
|
|
28
|
-
placeholderTextColor={placeholderTextColor || 'gray'}
|
|
29
|
-
value={localValue}
|
|
30
|
-
onChangeText={handleChangeText}
|
|
31
|
-
onSubmitEditing={onSubmitEditing}
|
|
32
|
-
keyboardType={keyboardType}
|
|
33
|
-
/>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
const styles = StyleSheet.create({
|
|
38
|
-
input: {
|
|
39
|
-
padding: 10,
|
|
40
|
-
borderColor: '#ccc',
|
|
41
|
-
borderWidth: 1,
|
|
42
|
-
borderRadius: 5,
|
|
43
|
-
color: 'black',
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
export default CustomTextInput;
|
|
@@ -1,313 +0,0 @@
|
|
|
1
|
-
import {View, Text, Dimensions, ScrollView} from 'react-native';
|
|
2
|
-
import React, {useContext, useEffect, useState} from 'react';
|
|
3
|
-
import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
|
|
4
|
-
import {notifyMessage} from '../CommonStyle/ComponentFunctions';
|
|
5
|
-
import ContextBio from '../ContextAPI/ContextBio';
|
|
6
|
-
import {normalize} from '../CommonStyle/componentStyle';
|
|
7
|
-
import Loader from '../Custom/Loader';
|
|
8
|
-
import SDropDownNew from '../Components/SDropDownNew';
|
|
9
|
-
|
|
10
|
-
import CTextHeader from '../Custom/TableComponent/CTextHeader';
|
|
11
|
-
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
12
|
-
|
|
13
|
-
const EquipmentPage = props => {
|
|
14
|
-
const {argument} = props;
|
|
15
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
16
|
-
const {invoiceData, setInvoiceData} = useContext(ContextBio);
|
|
17
|
-
|
|
18
|
-
// const data =
|
|
19
|
-
// invoiceData.workOrder[argument.workOrderIndex].details[
|
|
20
|
-
// argument.detailIndex
|
|
21
|
-
// ];
|
|
22
|
-
|
|
23
|
-
const data = invoiceData?.workOrder[argument.workOrderIndex]?.details[argument.detailIndex]?.workorderequipment;
|
|
24
|
-
|
|
25
|
-
console.log('dataaaaaaaaaaaaaa',data);
|
|
26
|
-
|
|
27
|
-
// useEffect for API call
|
|
28
|
-
// useEffect(() => {
|
|
29
|
-
// getData();
|
|
30
|
-
// }, []);
|
|
31
|
-
|
|
32
|
-
// Function for fetch data from API
|
|
33
|
-
function getData() {
|
|
34
|
-
setIsLoading(true);
|
|
35
|
-
let buttonapi = `${APIURL}invget/invcommonget/rnintrworkorderequipment ${argument.argument}`;
|
|
36
|
-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', buttonapi);
|
|
37
|
-
NetworkServiceCall('get', buttonapi).then(function (response) {
|
|
38
|
-
if (response.httpstatus == 200) {
|
|
39
|
-
// setData(response.data.data);
|
|
40
|
-
if (invoiceData.EquipmentUpdate != true) {
|
|
41
|
-
setInvoiceData(prevData => {
|
|
42
|
-
const updatedWorkOrder = prevData.workOrder.map((item, index) => {
|
|
43
|
-
if (index === argument.workOrderIndex) {
|
|
44
|
-
const updatedDetails = item.details.map(
|
|
45
|
-
(detail, detailIndex) => {
|
|
46
|
-
if (detailIndex === argument.detailIndex) {
|
|
47
|
-
return {...detail, equipment: response.data.data};
|
|
48
|
-
}
|
|
49
|
-
return detail;
|
|
50
|
-
},
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
return {...item, details: updatedDetails};
|
|
54
|
-
}
|
|
55
|
-
return item;
|
|
56
|
-
});
|
|
57
|
-
|
|
58
|
-
return {
|
|
59
|
-
...prevData,
|
|
60
|
-
workOrder: updatedWorkOrder,
|
|
61
|
-
EditStatus: true,
|
|
62
|
-
EquipmentUpdate: true,
|
|
63
|
-
};
|
|
64
|
-
});
|
|
65
|
-
}
|
|
66
|
-
setIsLoading(false);
|
|
67
|
-
console.log(
|
|
68
|
-
'RESPONSEEEEEEEEEEE FROM CONSULTATTION22222222',
|
|
69
|
-
JSON.stringify(response.data.data),
|
|
70
|
-
);
|
|
71
|
-
} else {
|
|
72
|
-
notifyMessage('Data Not Found.....');
|
|
73
|
-
setIsLoading(false);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
// getLoading(v => setIsLoading(false));
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
function handleEquipmentDropdownChange(
|
|
80
|
-
workOrderIndex,
|
|
81
|
-
detailIndex,
|
|
82
|
-
equipmentIndex,
|
|
83
|
-
value,
|
|
84
|
-
datavalue,
|
|
85
|
-
displayvalue,
|
|
86
|
-
) {
|
|
87
|
-
// Clone the workOrder data to ensure immutability
|
|
88
|
-
const updatedWorkOrders = [...invoiceData.workOrder];
|
|
89
|
-
|
|
90
|
-
// Clone the details array for the specific workOrder at workOrderIndex
|
|
91
|
-
const updatedDetails = [...updatedWorkOrders[workOrderIndex].details];
|
|
92
|
-
|
|
93
|
-
// Clone the equipment array inside the specific detail at detailIndex
|
|
94
|
-
const updatedEquipment = [...updatedDetails[detailIndex].workorderequipment];
|
|
95
|
-
|
|
96
|
-
// Update the specific equipment inside the equipment array at equipmentIndex
|
|
97
|
-
updatedEquipment[equipmentIndex] = {
|
|
98
|
-
...updatedEquipment[equipmentIndex],
|
|
99
|
-
[datavalue]: value.datavalue,
|
|
100
|
-
[displayvalue]: value.displayvalue,
|
|
101
|
-
};
|
|
102
|
-
|
|
103
|
-
// Update the details with the modified equipment array
|
|
104
|
-
updatedDetails[detailIndex] = {
|
|
105
|
-
...updatedDetails[detailIndex],
|
|
106
|
-
workorderequipment: updatedEquipment,
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
// Update the workOrder with the modified details array
|
|
110
|
-
updatedWorkOrders[workOrderIndex] = {
|
|
111
|
-
...updatedWorkOrders[workOrderIndex],
|
|
112
|
-
details: updatedDetails,
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
// Update the state with the modified workOrder data
|
|
116
|
-
setInvoiceData(prevState => ({
|
|
117
|
-
...prevState,
|
|
118
|
-
workOrder: updatedWorkOrders,
|
|
119
|
-
EditStatus: true,
|
|
120
|
-
}));
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
useEffect(() => {
|
|
124
|
-
console.log('invoicedata', JSON.stringify(invoiceData));
|
|
125
|
-
}, [invoiceData]);
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<View style={{width: Dimensions.get('screen').width * 0.95}}>
|
|
129
|
-
{/* Container for the page title */}
|
|
130
|
-
<View
|
|
131
|
-
style={{
|
|
132
|
-
borderWidth: 0,
|
|
133
|
-
justifyContent: 'center',
|
|
134
|
-
alignItems: 'center',
|
|
135
|
-
marginTop: normalize(5),
|
|
136
|
-
marginVertical: normalize(5),
|
|
137
|
-
alignSelf: 'center',
|
|
138
|
-
}}>
|
|
139
|
-
<Text
|
|
140
|
-
style={{
|
|
141
|
-
fontSize: normalize(14),
|
|
142
|
-
fontWeight: 'bold',
|
|
143
|
-
color: '#094485',
|
|
144
|
-
}}>
|
|
145
|
-
Equipment
|
|
146
|
-
</Text>
|
|
147
|
-
</View>
|
|
148
|
-
{
|
|
149
|
-
isLoading ? (
|
|
150
|
-
<View
|
|
151
|
-
style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
|
|
152
|
-
<Loader />
|
|
153
|
-
</View>
|
|
154
|
-
) : (
|
|
155
|
-
<ScrollView horizontal={true} style={{marginVertical: normalize(3)}}>
|
|
156
|
-
<View>
|
|
157
|
-
{
|
|
158
|
-
// Table header section
|
|
159
|
-
data != undefined && data != null ? (
|
|
160
|
-
<View style={{flexDirection: 'row'}}>
|
|
161
|
-
<CTextHeader
|
|
162
|
-
text={'Classification Nature'}
|
|
163
|
-
fontSize={10}
|
|
164
|
-
widthArr={Dimensions.get('screen').width * 0.45}
|
|
165
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
166
|
-
color={'#094485'}
|
|
167
|
-
borderColor={'lightgrey'}
|
|
168
|
-
marginHorizontal={normalize(2)}
|
|
169
|
-
borderRadius={5}
|
|
170
|
-
elevation={0}
|
|
171
|
-
/>
|
|
172
|
-
<CTextHeader
|
|
173
|
-
text={'Product'}
|
|
174
|
-
fontSize={10}
|
|
175
|
-
widthArr={Dimensions.get('screen').width * 0.49}
|
|
176
|
-
bgColor={'rgba(184, 184, 191,0.3)'}
|
|
177
|
-
color={'#094485'}
|
|
178
|
-
borderColor={'lightgrey'}
|
|
179
|
-
marginHorizontal={normalize(2)}
|
|
180
|
-
borderRadius={5}
|
|
181
|
-
elevation={0}
|
|
182
|
-
/>
|
|
183
|
-
</View>
|
|
184
|
-
) : null
|
|
185
|
-
}
|
|
186
|
-
{data != undefined && data != null
|
|
187
|
-
? data.map((item, i) => (
|
|
188
|
-
<View
|
|
189
|
-
key={i}
|
|
190
|
-
style={{
|
|
191
|
-
flexDirection: 'row',
|
|
192
|
-
}}>
|
|
193
|
-
{/* Classification nature */}
|
|
194
|
-
<View
|
|
195
|
-
style={{
|
|
196
|
-
borderWidth: 1,
|
|
197
|
-
borderColor: 'lightgrey',
|
|
198
|
-
elevation: 0,
|
|
199
|
-
borderRadius: 5,
|
|
200
|
-
width: Dimensions.get('screen').width * 0.455,
|
|
201
|
-
paddingTop: 5,
|
|
202
|
-
paddingBottom: 5,
|
|
203
|
-
height: Dimensions.get('screen').height * 0.056,
|
|
204
|
-
alignItems: 'flex-start',
|
|
205
|
-
justifyContent: 'center',
|
|
206
|
-
paddingHorizontal: normalize(10),
|
|
207
|
-
}}>
|
|
208
|
-
<Text
|
|
209
|
-
style={{
|
|
210
|
-
fontWeight: 'bold',
|
|
211
|
-
color: 'black',
|
|
212
|
-
fontSize: normalize(10),
|
|
213
|
-
}}>
|
|
214
|
-
{item.classificationnaturename}
|
|
215
|
-
</Text>
|
|
216
|
-
</View>
|
|
217
|
-
{/* Dropdown */}
|
|
218
|
-
<SDropDownNew
|
|
219
|
-
// iconName={"boxes"}
|
|
220
|
-
widthArr={Dimensions.get('screen').width * 0.49}
|
|
221
|
-
heightArr={Dimensions.get('screen').height * 0.056}
|
|
222
|
-
fontSize={normalize(10)}
|
|
223
|
-
fontWeight={'bold'}
|
|
224
|
-
dropdowndata={item.productname || ''}
|
|
225
|
-
dropdownapi={`invget/invcommonget/rnddinsuproductarg ${item.insuclassificationnature}`}
|
|
226
|
-
dropdownPort={false}
|
|
227
|
-
// multiselect={true}
|
|
228
|
-
onChangeData={val => {
|
|
229
|
-
handleEquipmentDropdownChange(
|
|
230
|
-
argument.workOrderIndex,
|
|
231
|
-
argument.detailIndex,
|
|
232
|
-
i,
|
|
233
|
-
val,
|
|
234
|
-
'insuproduct',
|
|
235
|
-
'productname',
|
|
236
|
-
);
|
|
237
|
-
}}
|
|
238
|
-
editable={true}
|
|
239
|
-
// dropdownarray={Dropdown.packing}
|
|
240
|
-
refreshCount={
|
|
241
|
-
val => console.log(val)
|
|
242
|
-
// val == undefined ? setRefresh(refresh + 1) : null
|
|
243
|
-
}
|
|
244
|
-
/>
|
|
245
|
-
</View>
|
|
246
|
-
))
|
|
247
|
-
: null}
|
|
248
|
-
</View>
|
|
249
|
-
</ScrollView>
|
|
250
|
-
)
|
|
251
|
-
// data.equipment != undefined && data.equipment != null ? (
|
|
252
|
-
// data.equipment.map((item, i) => (
|
|
253
|
-
// <View
|
|
254
|
-
// key={i}
|
|
255
|
-
// style={{
|
|
256
|
-
// backgroundColor: '#fff',
|
|
257
|
-
// padding: 15,
|
|
258
|
-
// marginBottom: 10,
|
|
259
|
-
// borderRadius: 8,
|
|
260
|
-
// borderWidth: 1,
|
|
261
|
-
// borderColor: '#ddd',
|
|
262
|
-
// shadowColor: '#000',
|
|
263
|
-
// shadowOffset: {width: 0, height: 2},
|
|
264
|
-
// shadowOpacity: 0.1,
|
|
265
|
-
// shadowRadius: 5,
|
|
266
|
-
// elevation: 3,
|
|
267
|
-
// flexDirection: 'row',
|
|
268
|
-
// justifyContent: 'space-between',
|
|
269
|
-
// alignItems: 'center',
|
|
270
|
-
// width: Dimensions.get('screen').width * 0.89,
|
|
271
|
-
// }}>
|
|
272
|
-
// <Text style={{fontSize: 14, color: '#333', marginBottom: 5}}>
|
|
273
|
-
// {/* <Text style={{fontWeight: 'bold'}}>Classification Nature: </Text> */}
|
|
274
|
-
// {item.classificationnaturename}
|
|
275
|
-
// </Text>
|
|
276
|
-
// <SDropDownNew
|
|
277
|
-
// // iconName={"boxes"}
|
|
278
|
-
// widthArr={Dimensions.get('screen').width * 0.4}
|
|
279
|
-
// heightArr={Dimensions.get('screen').height * 0.05}
|
|
280
|
-
// dropdowndata={''}
|
|
281
|
-
// dropdownapi={`invget/invcommonget/rnddinsuproductarg ${item.insuclassificationnature}`}
|
|
282
|
-
// dropdownPort={true}
|
|
283
|
-
// // multiselect={true}
|
|
284
|
-
// onChangeData={val => {
|
|
285
|
-
// handleEquipmentDropdownChange(
|
|
286
|
-
// argument.workOrderIndex,
|
|
287
|
-
// argument.detailIndex,
|
|
288
|
-
// i,
|
|
289
|
-
// val,
|
|
290
|
-
// 'insuproduct',
|
|
291
|
-
// 'productname',
|
|
292
|
-
// )
|
|
293
|
-
// }}
|
|
294
|
-
// editable={true}
|
|
295
|
-
// // dropdownarray={Dropdown.packing}
|
|
296
|
-
// refreshCount={
|
|
297
|
-
// val => console.log(val)
|
|
298
|
-
// // val == undefined ? setRefresh(refresh + 1) : null
|
|
299
|
-
// }
|
|
300
|
-
// />
|
|
301
|
-
// {/* <Text style={{fontSize: 14, color: '#333', marginBottom: 5}}>
|
|
302
|
-
// <Text style={{fontWeight: 'bold'}}>Product: </Text>
|
|
303
|
-
// {item.productname || 'Product name'}
|
|
304
|
-
// </Text> */}
|
|
305
|
-
// </View>
|
|
306
|
-
// ))
|
|
307
|
-
// ) : null
|
|
308
|
-
}
|
|
309
|
-
</View>
|
|
310
|
-
);
|
|
311
|
-
};
|
|
312
|
-
|
|
313
|
-
export default EquipmentPage;
|