@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.
- package/index.d.ts +66 -0
- package/index.js +0 -4
- package/package.json +3 -34
- 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,470 @@
|
|
|
1
|
+
import { View, Text, TouchableOpacity } from 'react-native';
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
4
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
5
|
+
import { CButtonShadow, isNUQ } from '../CommonStyle/ComponentFunctions';
|
|
6
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
7
|
+
import { useNavigation } from '../Navigation/useNavigation';
|
|
8
|
+
|
|
9
|
+
import HOCIcons from '../HOC/HOCIcons';
|
|
10
|
+
import { SwipeRow } from 'react-native-swipe-list-view';
|
|
11
|
+
|
|
12
|
+
const SearchProductCard = ({ item, callback }) => {
|
|
13
|
+
const [leftAction, setLeftAction] = useState(false);
|
|
14
|
+
const [secondAction, setSecondAction] = useState(false);
|
|
15
|
+
const [rightAction, setRightAction] = useState(false);
|
|
16
|
+
|
|
17
|
+
const navigation = useNavigation();
|
|
18
|
+
|
|
19
|
+
const renderLeftActions = () => (
|
|
20
|
+
<View style={{
|
|
21
|
+
// flex: 1,
|
|
22
|
+
// width: normalize(100),
|
|
23
|
+
// backgroundColor: '#4caf50',
|
|
24
|
+
justifyContent: 'flex-start',
|
|
25
|
+
alignItems: 'flex-start',
|
|
26
|
+
borderTopLeftRadius: 10,
|
|
27
|
+
borderBottomLeftRadius: 10,
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
paddingHorizontal: normalize(10),
|
|
30
|
+
}}>
|
|
31
|
+
{/* Info */}
|
|
32
|
+
<TouchableOpacity
|
|
33
|
+
style={{
|
|
34
|
+
// // flex: 1,
|
|
35
|
+
// width: normalize(100),
|
|
36
|
+
// // backgroundColor: '#4caf50',
|
|
37
|
+
// justifyContent: 'flex-start',
|
|
38
|
+
// alignItems: 'center',
|
|
39
|
+
// borderTopLeftRadius: 10,
|
|
40
|
+
// borderBottomLeftRadius: 10,
|
|
41
|
+
marginLeft: normalize(5),
|
|
42
|
+
}}
|
|
43
|
+
onPress={() => {
|
|
44
|
+
navigation.navigate('CPurchaseDetails', { productCode: item?.insuproduct });
|
|
45
|
+
}}
|
|
46
|
+
// onPress={() => setLeftAction(prev => !prev)}
|
|
47
|
+
>
|
|
48
|
+
{!leftAction && <View style={{
|
|
49
|
+
backgroundColor: '#f4f5ae',
|
|
50
|
+
justifyContent: 'center',
|
|
51
|
+
alignItems: 'center',
|
|
52
|
+
...CButtonShadow(),
|
|
53
|
+
borderRadius: normalize(5),
|
|
54
|
+
paddingHorizontal: normalize(3),
|
|
55
|
+
paddingVertical: normalize(5),
|
|
56
|
+
height: normalize(38),
|
|
57
|
+
width: normalize(38),
|
|
58
|
+
}}>
|
|
59
|
+
<HOCIcons.Entypo
|
|
60
|
+
name={'info-with-circle'}
|
|
61
|
+
size={normalize(20)}
|
|
62
|
+
color={Global.AppTheme.primary_color}
|
|
63
|
+
/>
|
|
64
|
+
<Text numberOfLines={1} style={{ fontSize: normalize(8), fontWeight: 'bold', color: Global.AppTheme.primary_color }}>Info</Text>
|
|
65
|
+
</View>
|
|
66
|
+
}
|
|
67
|
+
{leftAction &&
|
|
68
|
+
<View style={{
|
|
69
|
+
backgroundColor: '#f4f5ae',
|
|
70
|
+
justifyContent: 'center',
|
|
71
|
+
alignItems: 'center',
|
|
72
|
+
...CButtonShadow(),
|
|
73
|
+
borderRadius: normalize(5),
|
|
74
|
+
paddingHorizontal: normalize(3),
|
|
75
|
+
paddingVertical: normalize(5),
|
|
76
|
+
height: normalize(38),
|
|
77
|
+
width: normalize(38),
|
|
78
|
+
}}>
|
|
79
|
+
<Text style={{ fontSize: normalize(9), fontWeight: 'bold', color: Global.AppTheme.primary_color }}>Marketing Division</Text>
|
|
80
|
+
</View>
|
|
81
|
+
}
|
|
82
|
+
</TouchableOpacity>
|
|
83
|
+
{/* Tax name */}
|
|
84
|
+
<TouchableOpacity
|
|
85
|
+
style={{
|
|
86
|
+
// // flex: 1,
|
|
87
|
+
// width: normalize(100),
|
|
88
|
+
// // backgroundColor: '#4caf50',
|
|
89
|
+
// justifyContent: 'flex-start',
|
|
90
|
+
// alignItems: 'center',
|
|
91
|
+
// borderTopLeftRadius: 10,
|
|
92
|
+
// borderBottomLeftRadius: 10,
|
|
93
|
+
marginLeft: normalize(5),
|
|
94
|
+
}}
|
|
95
|
+
// onPress={() => setSecondAction(prev => !prev)}
|
|
96
|
+
>
|
|
97
|
+
{!secondAction && <View style={{
|
|
98
|
+
backgroundColor: '#f5bfae',
|
|
99
|
+
justifyContent: 'center',
|
|
100
|
+
alignItems: 'center',
|
|
101
|
+
...CButtonShadow(),
|
|
102
|
+
borderRadius: normalize(5),
|
|
103
|
+
paddingHorizontal: normalize(3),
|
|
104
|
+
paddingVertical: normalize(5),
|
|
105
|
+
height: normalize(38),
|
|
106
|
+
width: normalize(38),
|
|
107
|
+
}}>
|
|
108
|
+
<HOCIcons.MaterialCommunityIcons
|
|
109
|
+
name={'brightness-percent'}
|
|
110
|
+
size={normalize(20)}
|
|
111
|
+
color={Global.AppTheme.primary_color}
|
|
112
|
+
/>
|
|
113
|
+
<Text numberOfLines={1} style={{ fontSize: normalize(8), fontWeight: 'bold', color: Global.AppTheme.primary_color }}>Tax Name</Text>
|
|
114
|
+
</View>
|
|
115
|
+
}
|
|
116
|
+
{secondAction &&
|
|
117
|
+
<View style={{
|
|
118
|
+
backgroundColor: '#f5bfae',
|
|
119
|
+
justifyContent: 'center',
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
...CButtonShadow(),
|
|
122
|
+
borderRadius: normalize(5),
|
|
123
|
+
paddingHorizontal: normalize(3),
|
|
124
|
+
paddingVertical: normalize(5),
|
|
125
|
+
height: normalize(38),
|
|
126
|
+
width: normalize(38),
|
|
127
|
+
}}>
|
|
128
|
+
<Text style={{ fontSize: normalize(9), fontWeight: 'bold', color: Global.AppTheme.primary_color }}>Tax Name</Text>
|
|
129
|
+
</View>
|
|
130
|
+
}
|
|
131
|
+
</TouchableOpacity>
|
|
132
|
+
</View>
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
const renderRightActions = () => (
|
|
136
|
+
<View style={{
|
|
137
|
+
// flex: 1,
|
|
138
|
+
// width: normalize(100),
|
|
139
|
+
// backgroundColor: '#4caf50',
|
|
140
|
+
justifyContent: 'flex-start',
|
|
141
|
+
alignItems: 'flex-start',
|
|
142
|
+
borderTopLeftRadius: 10,
|
|
143
|
+
borderBottomLeftRadius: 10,
|
|
144
|
+
flexDirection: 'row',
|
|
145
|
+
paddingHorizontal: normalize(10),
|
|
146
|
+
}}>
|
|
147
|
+
{/* Supplier */}
|
|
148
|
+
<TouchableOpacity
|
|
149
|
+
style={{
|
|
150
|
+
// // flex: 1,
|
|
151
|
+
// width: normalize(100),
|
|
152
|
+
// // backgroundColor: '#4caf50',
|
|
153
|
+
// justifyContent: 'flex-start',
|
|
154
|
+
// alignItems: 'center',
|
|
155
|
+
// borderTopLeftRadius: 10,
|
|
156
|
+
// borderBottomLeftRadius: 10,
|
|
157
|
+
marginLeft: normalize(5),
|
|
158
|
+
}}
|
|
159
|
+
onPress={() => {
|
|
160
|
+
// console.log('itemmmmmmmmmmmmmmmmmm', item)
|
|
161
|
+
navigation.navigate('CSupplierList', { productCode: item?.insuproduct });
|
|
162
|
+
}}
|
|
163
|
+
>
|
|
164
|
+
{!rightAction && <View style={{
|
|
165
|
+
backgroundColor: '#aef5b4',
|
|
166
|
+
justifyContent: 'center',
|
|
167
|
+
alignItems: 'center',
|
|
168
|
+
...CButtonShadow(),
|
|
169
|
+
borderRadius: normalize(5),
|
|
170
|
+
paddingHorizontal: normalize(3),
|
|
171
|
+
paddingVertical: normalize(5),
|
|
172
|
+
height: normalize(38),
|
|
173
|
+
width: normalize(38),
|
|
174
|
+
}}>
|
|
175
|
+
<HOCIcons.MaterialCommunityIcons
|
|
176
|
+
name={'human-dolly'}
|
|
177
|
+
size={normalize(20)}
|
|
178
|
+
color={Global.AppTheme.primary_color}
|
|
179
|
+
/>
|
|
180
|
+
<Text numberOfLines={1} style={{ fontSize: normalize(8), fontWeight: 'bold', color: Global.AppTheme.primary_color }}>Supplier</Text>
|
|
181
|
+
</View>
|
|
182
|
+
}
|
|
183
|
+
{/* {rightAction &&
|
|
184
|
+
<View style={{
|
|
185
|
+
backgroundColor: '#aef5b4',
|
|
186
|
+
justifyContent: 'center',
|
|
187
|
+
alignItems: 'center',
|
|
188
|
+
...CButtonShadow(),
|
|
189
|
+
borderRadius: normalize(5),
|
|
190
|
+
paddingHorizontal: normalize(3),
|
|
191
|
+
paddingVertical: normalize(5),
|
|
192
|
+
height: normalize(38),
|
|
193
|
+
width: normalize(38)
|
|
194
|
+
}}>
|
|
195
|
+
<Text style={{ fontSize: normalize(9), fontWeight: 'bold', color: Global.AppTheme.primary_color }}>{data?.marketingdivisionname}</Text>
|
|
196
|
+
</View>
|
|
197
|
+
} */}
|
|
198
|
+
</TouchableOpacity>
|
|
199
|
+
{/* Tax name */}
|
|
200
|
+
{/* <TouchableOpacity
|
|
201
|
+
style={{
|
|
202
|
+
// // flex: 1,
|
|
203
|
+
// width: normalize(100),
|
|
204
|
+
// // backgroundColor: '#4caf50',
|
|
205
|
+
// justifyContent: 'flex-start',
|
|
206
|
+
// alignItems: 'center',
|
|
207
|
+
// borderTopLeftRadius: 10,
|
|
208
|
+
// borderBottomLeftRadius: 10,
|
|
209
|
+
marginLeft: normalize(5)
|
|
210
|
+
}}
|
|
211
|
+
onPress={() => setSecondAction(prev => !prev)}
|
|
212
|
+
>
|
|
213
|
+
{!secondAction && <View style={{
|
|
214
|
+
backgroundColor: '#f5bfae',
|
|
215
|
+
justifyContent: 'center',
|
|
216
|
+
alignItems: 'center',
|
|
217
|
+
...CButtonShadow(),
|
|
218
|
+
borderRadius: normalize(5),
|
|
219
|
+
paddingHorizontal: normalize(3),
|
|
220
|
+
paddingVertical: normalize(5),
|
|
221
|
+
height: normalize(38),
|
|
222
|
+
width: normalize(38)
|
|
223
|
+
}}>
|
|
224
|
+
<HOCIcons.MaterialCommunityIcons
|
|
225
|
+
name={'brightness-percent'}
|
|
226
|
+
size={normalize(20)}
|
|
227
|
+
color={Global.AppTheme.primary_color}
|
|
228
|
+
/>
|
|
229
|
+
<Text numberOfLines={1} style={{ fontSize: normalize(8), fontWeight: 'bold', color: Global.AppTheme.primary_color }}>Tax Name</Text>
|
|
230
|
+
</View>
|
|
231
|
+
}
|
|
232
|
+
{secondAction &&
|
|
233
|
+
<View style={{
|
|
234
|
+
backgroundColor: '#f5bfae',
|
|
235
|
+
justifyContent: 'center',
|
|
236
|
+
alignItems: 'center',
|
|
237
|
+
...CButtonShadow(),
|
|
238
|
+
borderRadius: normalize(5),
|
|
239
|
+
paddingHorizontal: normalize(3),
|
|
240
|
+
paddingVertical: normalize(5),
|
|
241
|
+
height: normalize(38),
|
|
242
|
+
width: normalize(38)
|
|
243
|
+
}}>
|
|
244
|
+
<Text style={{ fontSize: normalize(9), fontWeight: 'bold', color: Global.AppTheme.primary_color }}>{data?.taxname}</Text>
|
|
245
|
+
</View>
|
|
246
|
+
}
|
|
247
|
+
</TouchableOpacity> */}
|
|
248
|
+
</View>
|
|
249
|
+
);
|
|
250
|
+
|
|
251
|
+
return (
|
|
252
|
+
<SwipeRow
|
|
253
|
+
disableLeftSwipe={false}
|
|
254
|
+
disableRightSwipe={false}
|
|
255
|
+
leftOpenValue={190}
|
|
256
|
+
rightOpenValue={-190}
|
|
257
|
+
swipeToClosePercent={10}
|
|
258
|
+
swipeToOpenPercent={10}
|
|
259
|
+
>
|
|
260
|
+
{/* Hidden Row (Swipe Actions) */}
|
|
261
|
+
<View style={{ borderWidth: 0, flexDirection: 'row', justifyContent: 'space-between', minHeight: normalize(70) }}>
|
|
262
|
+
<View style={{ flex: 1, alignItems: 'flex-start' }}>
|
|
263
|
+
{renderLeftActions && renderLeftActions()}
|
|
264
|
+
</View>
|
|
265
|
+
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
|
266
|
+
{renderRightActions && renderRightActions()}
|
|
267
|
+
</View>
|
|
268
|
+
</View>
|
|
269
|
+
<TouchableOpacity
|
|
270
|
+
activeOpacity={0.8}
|
|
271
|
+
onPress={() => {
|
|
272
|
+
callback?.(item); // or navigation / any action you want
|
|
273
|
+
}}
|
|
274
|
+
>
|
|
275
|
+
<View
|
|
276
|
+
style={{
|
|
277
|
+
backgroundColor: '#faeeeb',
|
|
278
|
+
marginHorizontal: normalize(5),
|
|
279
|
+
marginBottom: normalize(10),
|
|
280
|
+
borderRadius: normalize(5),
|
|
281
|
+
shadowColor: Global.AppTheme.primary_color,
|
|
282
|
+
shadowOffset: { width: 4, height: 4 },
|
|
283
|
+
shadowOpacity: 0.6,
|
|
284
|
+
shadowRadius: 10,
|
|
285
|
+
elevation: 8,
|
|
286
|
+
...CButtonShadow(),
|
|
287
|
+
}}>
|
|
288
|
+
<View style={{ flexDirection: 'row' }}>
|
|
289
|
+
<View
|
|
290
|
+
style={{
|
|
291
|
+
backgroundColor: '#870808',
|
|
292
|
+
width: normalize(10),
|
|
293
|
+
height: '100%',
|
|
294
|
+
borderStartStartRadius: normalize(5),
|
|
295
|
+
borderStartEndRadius: normalize(5),
|
|
296
|
+
}} />
|
|
297
|
+
<View style={{ padding: normalize(3) }}>
|
|
298
|
+
{/* Product name */}
|
|
299
|
+
{isNUQ(item.productname) ? (
|
|
300
|
+
<Text
|
|
301
|
+
numberOfLines={1}
|
|
302
|
+
style={{
|
|
303
|
+
fontSize: normalize(12),
|
|
304
|
+
paddingLeft: normalize(5),
|
|
305
|
+
fontWeight: 'bold',
|
|
306
|
+
color: Global.AppTheme.primary_color,
|
|
307
|
+
}}>
|
|
308
|
+
{item.productname}
|
|
309
|
+
</Text>
|
|
310
|
+
) : null}
|
|
311
|
+
|
|
312
|
+
{/* Supplier name */}
|
|
313
|
+
{isNUQ(item.productcode) ? (
|
|
314
|
+
<Text
|
|
315
|
+
numberOfLines={1}
|
|
316
|
+
style={{
|
|
317
|
+
fontSize: normalize(10),
|
|
318
|
+
paddingLeft: normalize(5),
|
|
319
|
+
fontWeight: 'bold',
|
|
320
|
+
color: Global.AppTheme.primary_color,
|
|
321
|
+
}}>
|
|
322
|
+
{item.productcode}
|
|
323
|
+
</Text>
|
|
324
|
+
) : null}
|
|
325
|
+
|
|
326
|
+
{/* Section */}
|
|
327
|
+
<View
|
|
328
|
+
style={{
|
|
329
|
+
flexDirection: 'row',
|
|
330
|
+
width: '95%',
|
|
331
|
+
justifyContent: 'space-between',
|
|
332
|
+
}}>
|
|
333
|
+
{/* Section */}
|
|
334
|
+
<View>
|
|
335
|
+
<View style={{ flexDirection: 'row' }}>
|
|
336
|
+
{/* Indent no */}
|
|
337
|
+
{isNUQ(
|
|
338
|
+
item.expandedcontent[0].expanddata
|
|
339
|
+
) ? (
|
|
340
|
+
<View
|
|
341
|
+
style={{
|
|
342
|
+
flexDirection: 'row',
|
|
343
|
+
alignItems: 'center',
|
|
344
|
+
paddingLeft: normalize(5),
|
|
345
|
+
}}>
|
|
346
|
+
<Icons.FontAwesome5
|
|
347
|
+
name={'file-invoice'}
|
|
348
|
+
size={normalize(11)}
|
|
349
|
+
color={'#094485'}
|
|
350
|
+
/>
|
|
351
|
+
<Text
|
|
352
|
+
style={{
|
|
353
|
+
fontSize: 10,
|
|
354
|
+
color: '#555',
|
|
355
|
+
marginLeft: normalize(5),
|
|
356
|
+
}}>
|
|
357
|
+
{item.expandedcontent[0].expanddata}
|
|
358
|
+
</Text>
|
|
359
|
+
</View>
|
|
360
|
+
) : null}
|
|
361
|
+
|
|
362
|
+
{/* User */}
|
|
363
|
+
{isNUQ(item.expandedcontent[1].expanddata) ? (
|
|
364
|
+
<View
|
|
365
|
+
style={{
|
|
366
|
+
flexDirection: 'row',
|
|
367
|
+
alignItems: 'center',
|
|
368
|
+
paddingLeft: normalize(5),
|
|
369
|
+
}}>
|
|
370
|
+
<Icons.FontAwesome5
|
|
371
|
+
name={'user-alt'}
|
|
372
|
+
size={normalize(11)}
|
|
373
|
+
color={'#094485'}
|
|
374
|
+
/>
|
|
375
|
+
<Text
|
|
376
|
+
numberOfLines={1}
|
|
377
|
+
style={{
|
|
378
|
+
fontSize: 10,
|
|
379
|
+
color: '#555',
|
|
380
|
+
marginLeft: normalize(5),
|
|
381
|
+
}}>
|
|
382
|
+
{item.expandedcontent[1].expanddata}
|
|
383
|
+
</Text>
|
|
384
|
+
</View>
|
|
385
|
+
) : null}
|
|
386
|
+
</View>
|
|
387
|
+
|
|
388
|
+
<View style={{ flexDirection: 'row' }}>
|
|
389
|
+
{/* Date */}
|
|
390
|
+
{/* {isNUQ(data.entrydate) ? (
|
|
391
|
+
<View
|
|
392
|
+
style={{
|
|
393
|
+
flexDirection: 'row',
|
|
394
|
+
alignItems: 'center',
|
|
395
|
+
paddingLeft: normalize(5),
|
|
396
|
+
}}>
|
|
397
|
+
<Icons.FontAwesome5
|
|
398
|
+
name={'calendar-alt'}
|
|
399
|
+
size={normalize(11)}
|
|
400
|
+
color={'#094485'}
|
|
401
|
+
/>
|
|
402
|
+
<Text
|
|
403
|
+
style={{
|
|
404
|
+
fontSize: 10,
|
|
405
|
+
color: '#555',
|
|
406
|
+
marginLeft: normalize(5),
|
|
407
|
+
}}>
|
|
408
|
+
{moment(data.entrydate).format('DD-MM-YYYY')}
|
|
409
|
+
</Text>
|
|
410
|
+
</View>
|
|
411
|
+
) : null} */}
|
|
412
|
+
|
|
413
|
+
{/* Location */}
|
|
414
|
+
{/* {isNUQ(
|
|
415
|
+
type == 'I'
|
|
416
|
+
? data.locationname
|
|
417
|
+
: type == 'W'
|
|
418
|
+
? data.locationname
|
|
419
|
+
: type == 'V'
|
|
420
|
+
? data.locationname
|
|
421
|
+
: type == 'S'
|
|
422
|
+
? data.locationname
|
|
423
|
+
: type == 'B'
|
|
424
|
+
? data.locationname
|
|
425
|
+
: data.susectiondetailname,
|
|
426
|
+
) ? (
|
|
427
|
+
<View
|
|
428
|
+
style={{
|
|
429
|
+
flexDirection: 'row',
|
|
430
|
+
alignItems: 'center',
|
|
431
|
+
paddingLeft: normalize(5),
|
|
432
|
+
}}>
|
|
433
|
+
<Icons.FontAwesome5
|
|
434
|
+
name={'map-marker-alt'}
|
|
435
|
+
size={normalize(11)}
|
|
436
|
+
color={'#094485'}
|
|
437
|
+
/>
|
|
438
|
+
<Text
|
|
439
|
+
numberOfLines={1}
|
|
440
|
+
style={{
|
|
441
|
+
fontSize: 10,
|
|
442
|
+
color: '#555',
|
|
443
|
+
marginLeft: normalize(5),
|
|
444
|
+
}}>
|
|
445
|
+
{type == 'I'
|
|
446
|
+
? data.locationname
|
|
447
|
+
: type == 'W'
|
|
448
|
+
? data.locationname
|
|
449
|
+
: type == 'V'
|
|
450
|
+
? data.locationname
|
|
451
|
+
: type == 'S'
|
|
452
|
+
? data.locationname
|
|
453
|
+
: type == 'B'
|
|
454
|
+
? data.locationname
|
|
455
|
+
: data.susectiondetailname}
|
|
456
|
+
</Text>
|
|
457
|
+
</View>
|
|
458
|
+
) : null} */}
|
|
459
|
+
</View>
|
|
460
|
+
</View>
|
|
461
|
+
</View>
|
|
462
|
+
</View>
|
|
463
|
+
</View>
|
|
464
|
+
</View>
|
|
465
|
+
</TouchableOpacity>
|
|
466
|
+
</SwipeRow>
|
|
467
|
+
);
|
|
468
|
+
};
|
|
469
|
+
|
|
470
|
+
export default SearchProductCard;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
import { View, Text, ScrollView, Dimensions } 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 Loader from '../Custom/Loader';
|
|
6
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
7
|
+
import CTextHeader from '../Custom/TableComponent/CTextHeader';
|
|
8
|
+
import ContextBio from '../ContextAPI/ContextBio';
|
|
9
|
+
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
10
|
+
|
|
11
|
+
const StageByProduct = props => {
|
|
12
|
+
const { argument } = props;
|
|
13
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
14
|
+
// const [data, setData] = useState(null);
|
|
15
|
+
const { invoiceData, setInvoiceData } = useContext(ContextBio);
|
|
16
|
+
|
|
17
|
+
const data = invoiceData?.workOrder[argument.workOrderIndex]?.details[argument.detailIndex]?.workorderstagebyproductdetail;
|
|
18
|
+
|
|
19
|
+
// useEffect for API call
|
|
20
|
+
// useEffect(() => {
|
|
21
|
+
// getData();
|
|
22
|
+
// }, []);
|
|
23
|
+
|
|
24
|
+
// Function for fetch data from API
|
|
25
|
+
function getData() {
|
|
26
|
+
setIsLoading(true);
|
|
27
|
+
let buttonapi = `${APIURL}invget/invcommonget/rninsuworkorderbyproductdetail ${argument.argument}`;
|
|
28
|
+
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>', buttonapi);
|
|
29
|
+
NetworkServiceCall('get', buttonapi).then(function (response) {
|
|
30
|
+
if (response.httpstatus == 200) {
|
|
31
|
+
// setData(response.data.data);
|
|
32
|
+
setInvoiceData(prevData => {
|
|
33
|
+
const updatedWorkOrder = prevData.workOrder.map((item, index) => {
|
|
34
|
+
if (index === argument.workOrderIndex) {
|
|
35
|
+
const updatedDetails = item.details.map((detail, detailIndex) => {
|
|
36
|
+
if (detailIndex === argument.detailIndex) {
|
|
37
|
+
return {...detail, stageByProduct: response.data.data};
|
|
38
|
+
}
|
|
39
|
+
return detail;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return {...item, details: updatedDetails};
|
|
43
|
+
}
|
|
44
|
+
return item;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
...prevData,
|
|
49
|
+
workOrder: updatedWorkOrder,
|
|
50
|
+
EditStatus: true,
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
setIsLoading(false);
|
|
54
|
+
console.log(
|
|
55
|
+
'RESPONSEEEEEEEEEEE FROM CONSULTATTION22222222',
|
|
56
|
+
JSON.stringify(response.data.data),
|
|
57
|
+
);
|
|
58
|
+
} else {
|
|
59
|
+
notifyMessage('Data Not Found.....');
|
|
60
|
+
setIsLoading(false);
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
// getLoading(v => setIsLoading(false));
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return (
|
|
67
|
+
<View style={{ width: Dimensions.get('screen').width * 0.95 }}>
|
|
68
|
+
{/* Container for the page title */}
|
|
69
|
+
<View
|
|
70
|
+
style={{
|
|
71
|
+
borderWidth: 0,
|
|
72
|
+
justifyContent: 'center',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
marginTop: normalize(5),
|
|
75
|
+
marginVertical: normalize(5),
|
|
76
|
+
alignSelf: 'center',
|
|
77
|
+
}}>
|
|
78
|
+
<Text
|
|
79
|
+
style={{
|
|
80
|
+
fontSize: normalize(14),
|
|
81
|
+
fontWeight: 'bold',
|
|
82
|
+
color: '#094485',
|
|
83
|
+
}}>
|
|
84
|
+
Stage-By-product
|
|
85
|
+
</Text>
|
|
86
|
+
</View>
|
|
87
|
+
{isLoading ? (
|
|
88
|
+
<View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
|
|
89
|
+
<Loader />
|
|
90
|
+
</View>
|
|
91
|
+
) : (<ScrollView horizontal={true} style={{ marginVertical: normalize(3) }}>
|
|
92
|
+
<View>
|
|
93
|
+
{
|
|
94
|
+
// Table header section
|
|
95
|
+
data != undefined && data != null ?
|
|
96
|
+
< View style={{ flexDirection: 'row' }}>
|
|
97
|
+
<CTextHeader
|
|
98
|
+
text={'Product'}
|
|
99
|
+
fontSize={10}
|
|
100
|
+
widthArr={Dimensions.get('screen').width * 0.35}
|
|
101
|
+
bgColor={'rgba(184, 184, 191,0.3)'} color={'#094485'} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={0}
|
|
102
|
+
/>
|
|
103
|
+
<CTextHeader
|
|
104
|
+
text={'Quantity'}
|
|
105
|
+
fontSize={10}
|
|
106
|
+
widthArr={Dimensions.get('screen').width * 0.25}
|
|
107
|
+
bgColor={'rgba(184, 184, 191,0.3)'} color={'#094485'} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={0}
|
|
108
|
+
/>
|
|
109
|
+
<CTextHeader
|
|
110
|
+
text={'Unit'}
|
|
111
|
+
fontSize={10}
|
|
112
|
+
widthArr={Dimensions.get('screen').width * 0.25}
|
|
113
|
+
bgColor={'rgba(184, 184, 191,0.3)'} color={'#094485'} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={0}
|
|
114
|
+
/>
|
|
115
|
+
|
|
116
|
+
</View>
|
|
117
|
+
: null
|
|
118
|
+
}
|
|
119
|
+
{data != undefined && data != null ? (
|
|
120
|
+
data.map((item, i) => (
|
|
121
|
+
<View
|
|
122
|
+
key={i}
|
|
123
|
+
style={{
|
|
124
|
+
flexDirection: 'row',
|
|
125
|
+
}}
|
|
126
|
+
>
|
|
127
|
+
{/* Product */}
|
|
128
|
+
<View style={{
|
|
129
|
+
borderWidth: 1,
|
|
130
|
+
borderColor: 'lightgrey',
|
|
131
|
+
elevation: 0,
|
|
132
|
+
borderRadius: 5,
|
|
133
|
+
width: Dimensions.get('screen').width * 0.355,
|
|
134
|
+
paddingTop: 5,
|
|
135
|
+
paddingBottom: 5,
|
|
136
|
+
height: Dimensions.get('screen').height * 0.056,
|
|
137
|
+
alignItems: 'flex-start',
|
|
138
|
+
justifyContent: 'center',
|
|
139
|
+
paddingHorizontal: normalize(10),
|
|
140
|
+
}}>
|
|
141
|
+
<Text style={{
|
|
142
|
+
fontWeight: 'bold',
|
|
143
|
+
color: 'black',
|
|
144
|
+
fontSize: normalize(10),
|
|
145
|
+
}}
|
|
146
|
+
>{item.productname}</Text>
|
|
147
|
+
</View>
|
|
148
|
+
{/* Quantity */}
|
|
149
|
+
<View style={{
|
|
150
|
+
borderWidth: 1,
|
|
151
|
+
borderColor: 'lightgrey',
|
|
152
|
+
elevation: 0,
|
|
153
|
+
borderRadius: 5,
|
|
154
|
+
width: Dimensions.get('screen').width * 0.255,
|
|
155
|
+
paddingTop: 5,
|
|
156
|
+
paddingBottom: 5,
|
|
157
|
+
height: Dimensions.get('screen').height * 0.056,
|
|
158
|
+
alignItems: 'flex-start',
|
|
159
|
+
justifyContent: 'center',
|
|
160
|
+
paddingHorizontal: normalize(10),
|
|
161
|
+
}}>
|
|
162
|
+
<Text style={{
|
|
163
|
+
fontWeight: 'bold',
|
|
164
|
+
color: 'black',
|
|
165
|
+
fontSize: normalize(10),
|
|
166
|
+
}}
|
|
167
|
+
>{item.quantity}</Text>
|
|
168
|
+
</View>
|
|
169
|
+
{/* Unit */}
|
|
170
|
+
<View style={{
|
|
171
|
+
borderWidth: 1,
|
|
172
|
+
borderColor: 'lightgrey',
|
|
173
|
+
elevation: 0,
|
|
174
|
+
borderRadius: 5,
|
|
175
|
+
width: Dimensions.get('screen').width * 0.25,
|
|
176
|
+
paddingTop: 5,
|
|
177
|
+
paddingBottom: 5,
|
|
178
|
+
height: Dimensions.get('screen').height * 0.056,
|
|
179
|
+
alignItems: 'flex-start',
|
|
180
|
+
justifyContent: 'center',
|
|
181
|
+
paddingHorizontal: normalize(10),
|
|
182
|
+
}}>
|
|
183
|
+
<Text style={{
|
|
184
|
+
fontWeight: 'bold',
|
|
185
|
+
color: 'black',
|
|
186
|
+
fontSize: normalize(10),
|
|
187
|
+
}}
|
|
188
|
+
>{item.unitname}</Text>
|
|
189
|
+
</View>
|
|
190
|
+
</View>
|
|
191
|
+
))
|
|
192
|
+
) : null}
|
|
193
|
+
</View>
|
|
194
|
+
</ScrollView>)}
|
|
195
|
+
</View>
|
|
196
|
+
);
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export default StageByProduct;
|