@jescon-technologies/react-native-ui-kit 0.0.5 → 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,246 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Text, TouchableOpacity } from 'react-native';
|
|
3
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
4
|
-
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
5
|
-
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
6
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
7
|
-
import { CButtonShadow, isNUQ } from '../CommonStyle/ComponentFunctions';
|
|
8
|
-
import { SwipeRow } from 'react-native-swipe-list-view';
|
|
9
|
-
|
|
10
|
-
const SwipableProductCard = ({
|
|
11
|
-
data,
|
|
12
|
-
argumentname,
|
|
13
|
-
renderLeftActions,
|
|
14
|
-
renderRightActions,
|
|
15
|
-
navigation,
|
|
16
|
-
type,
|
|
17
|
-
}) => (
|
|
18
|
-
<SwipeRow
|
|
19
|
-
disableLeftSwipe={false}
|
|
20
|
-
disableRightSwipe={false}
|
|
21
|
-
leftOpenValue={190}
|
|
22
|
-
rightOpenValue={-190}
|
|
23
|
-
swipeToClosePercent={10}
|
|
24
|
-
swipeToOpenPercent={10}
|
|
25
|
-
>
|
|
26
|
-
{/* Hidden Row (Swipe Actions) */}
|
|
27
|
-
<View style={{
|
|
28
|
-
borderWidth: 0,
|
|
29
|
-
flexDirection: 'row',
|
|
30
|
-
justifyContent: 'space-between',
|
|
31
|
-
minHeight: normalize(70),
|
|
32
|
-
}}>
|
|
33
|
-
<View style={{ flex: 1, alignItems: 'flex-start' }}>
|
|
34
|
-
{renderLeftActions && renderLeftActions(data)}
|
|
35
|
-
</View>
|
|
36
|
-
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
|
37
|
-
{renderRightActions && renderRightActions(data)}
|
|
38
|
-
</View>
|
|
39
|
-
</View>
|
|
40
|
-
|
|
41
|
-
{/* Main Content */}
|
|
42
|
-
<TouchableOpacity
|
|
43
|
-
onLongPress={() => {
|
|
44
|
-
const pdfUrl =
|
|
45
|
-
argumentname == 3
|
|
46
|
-
? `${APIURL}fljrcommonbill/jrcommonbreport/AMAGDBI01.dbo.rnjrinsuproductdetail(${data.code || data?.insuproduct},${Global.userData.suuser})/0/ProductDetail`
|
|
47
|
-
: `${APIURL}fljrcommonbill/jrcommonbreport/AMAGDBI01.dbo.rnjrinsusupplier(${data.code},${Global.userData.suuser})/0/SupplierDetail`;
|
|
48
|
-
|
|
49
|
-
isNUQ(type) ? navigation.navigate('CProductPhysicalQuantityScreen', {
|
|
50
|
-
productCode: data?.insuproduct || 0,
|
|
51
|
-
}) : navigation.navigate('PDFScreen', { pdfSource: pdfUrl });
|
|
52
|
-
}}
|
|
53
|
-
>
|
|
54
|
-
<View
|
|
55
|
-
style={{
|
|
56
|
-
backgroundColor: '#faeeeb',
|
|
57
|
-
marginHorizontal: normalize(10),
|
|
58
|
-
marginBottom: normalize(10),
|
|
59
|
-
borderRadius: normalize(5),
|
|
60
|
-
shadowColor: Global.AppTheme.primary_color,
|
|
61
|
-
shadowOffset: { width: 4, height: 4 },
|
|
62
|
-
shadowOpacity: 0.6,
|
|
63
|
-
shadowRadius: 10,
|
|
64
|
-
elevation: 8,
|
|
65
|
-
...CButtonShadow(),
|
|
66
|
-
}}
|
|
67
|
-
>
|
|
68
|
-
<View style={{ flexDirection: 'row', minHeight: normalize(40) }}>
|
|
69
|
-
<View
|
|
70
|
-
style={{
|
|
71
|
-
backgroundColor: isNUQ(data?.color) ? data?.color : '#870808',
|
|
72
|
-
width: normalize(10),
|
|
73
|
-
height: '100%',
|
|
74
|
-
borderStartStartRadius: normalize(5),
|
|
75
|
-
borderStartEndRadius: normalize(5),
|
|
76
|
-
}}
|
|
77
|
-
/>
|
|
78
|
-
<View
|
|
79
|
-
style={{
|
|
80
|
-
padding: normalize(3),
|
|
81
|
-
flexDirection: 'row',
|
|
82
|
-
justifyContent: 'space-between',
|
|
83
|
-
alignItems: 'flex-start',
|
|
84
|
-
}}
|
|
85
|
-
>
|
|
86
|
-
<View style={{ width: '80%', justifyContent: 'center' }}>
|
|
87
|
-
{/* Product/Supplier name and code */}
|
|
88
|
-
{isNUQ(argumentname == 3 ? data.productname : data.suppliername) && data.code ? (
|
|
89
|
-
<Text
|
|
90
|
-
numberOfLines={3}
|
|
91
|
-
style={{
|
|
92
|
-
fontSize: normalize(12.5),
|
|
93
|
-
paddingLeft: normalize(5),
|
|
94
|
-
fontWeight: 'bold',
|
|
95
|
-
color: Global.AppTheme.primary_color,
|
|
96
|
-
}}
|
|
97
|
-
>
|
|
98
|
-
{data.code} - {argumentname == 3 ? data.productname : data.suppliername}
|
|
99
|
-
{argumentname == 3 && data.classificationname ? ` (${data.classificationname})` : ''}
|
|
100
|
-
</Text>
|
|
101
|
-
) : null}
|
|
102
|
-
|
|
103
|
-
{isNUQ(argumentname == 3 ? data.productname : data.suppliername) && type ? (
|
|
104
|
-
<Text
|
|
105
|
-
numberOfLines={3}
|
|
106
|
-
style={{
|
|
107
|
-
fontSize: normalize(12.5),
|
|
108
|
-
paddingLeft: normalize(5),
|
|
109
|
-
fontWeight: 'bold',
|
|
110
|
-
color: Global.AppTheme.primary_color,
|
|
111
|
-
}}
|
|
112
|
-
>
|
|
113
|
-
{data.code} - {argumentname == 3 ? data.productname : data.suppliername}
|
|
114
|
-
{argumentname == 3 && data.classificationname ? ` (${data.classificationname})` : ''}
|
|
115
|
-
</Text>
|
|
116
|
-
) : null}
|
|
117
|
-
|
|
118
|
-
{/* Marketing division */}
|
|
119
|
-
{isNUQ(argumentname == 3 && data.marketingdivisionname) ? (
|
|
120
|
-
<Text
|
|
121
|
-
numberOfLines={3}
|
|
122
|
-
style={{
|
|
123
|
-
fontSize: normalize(10),
|
|
124
|
-
paddingLeft: normalize(5),
|
|
125
|
-
color: Global.AppTheme.primary_color,
|
|
126
|
-
}}
|
|
127
|
-
>
|
|
128
|
-
{argumentname == 3 && data.marketingdivisionname}
|
|
129
|
-
</Text>
|
|
130
|
-
) : null}
|
|
131
|
-
{/* Tax name */}
|
|
132
|
-
{isNUQ(argumentname == 3 && data.taxname) ? (
|
|
133
|
-
<Text
|
|
134
|
-
numberOfLines={3}
|
|
135
|
-
style={{
|
|
136
|
-
fontSize: normalize(10),
|
|
137
|
-
paddingLeft: normalize(5),
|
|
138
|
-
color: Global.AppTheme.primary_color,
|
|
139
|
-
}}
|
|
140
|
-
>
|
|
141
|
-
{argumentname == 3 && data.taxname}
|
|
142
|
-
</Text>
|
|
143
|
-
) : null}
|
|
144
|
-
{/* Designation and gst no */}
|
|
145
|
-
{argumentname == 8 ? (
|
|
146
|
-
<View style={{ flexDirection: 'row' }}>
|
|
147
|
-
{isNUQ(data.designation) ? (
|
|
148
|
-
<View
|
|
149
|
-
style={{
|
|
150
|
-
flexDirection: 'row',
|
|
151
|
-
alignItems: 'center',
|
|
152
|
-
paddingLeft: normalize(5),
|
|
153
|
-
}}
|
|
154
|
-
>
|
|
155
|
-
<Icons.FontAwesome5 name={'user-tie'} size={normalize(11)} color={'#094485'} />
|
|
156
|
-
<Text
|
|
157
|
-
numberOfLines={1}
|
|
158
|
-
style={{
|
|
159
|
-
fontSize: 10,
|
|
160
|
-
color: '#555',
|
|
161
|
-
marginLeft: normalize(5),
|
|
162
|
-
}}
|
|
163
|
-
>
|
|
164
|
-
{data.designation}
|
|
165
|
-
</Text>
|
|
166
|
-
</View>
|
|
167
|
-
) : null}
|
|
168
|
-
{isNUQ(data.gstno) ? (
|
|
169
|
-
<View
|
|
170
|
-
style={{
|
|
171
|
-
flexDirection: 'row',
|
|
172
|
-
alignItems: 'center',
|
|
173
|
-
paddingLeft: normalize(5),
|
|
174
|
-
}}
|
|
175
|
-
>
|
|
176
|
-
<Icons.FontAwesome5 name={'mobile'} size={normalize(11)} color={'#094485'} />
|
|
177
|
-
<Text
|
|
178
|
-
numberOfLines={1}
|
|
179
|
-
style={{
|
|
180
|
-
fontSize: 10,
|
|
181
|
-
color: '#555',
|
|
182
|
-
marginLeft: normalize(5),
|
|
183
|
-
}}
|
|
184
|
-
>
|
|
185
|
-
{data.gstno}
|
|
186
|
-
</Text>
|
|
187
|
-
</View>
|
|
188
|
-
) : null}
|
|
189
|
-
</View>
|
|
190
|
-
) : null}
|
|
191
|
-
{/* Email and phone number */}
|
|
192
|
-
{argumentname == 8 ? (
|
|
193
|
-
<View style={{ flexDirection: 'row' }}>
|
|
194
|
-
{isNUQ(data.email) ? (
|
|
195
|
-
<View
|
|
196
|
-
style={{
|
|
197
|
-
flexDirection: 'row',
|
|
198
|
-
alignItems: 'center',
|
|
199
|
-
paddingLeft: normalize(5),
|
|
200
|
-
}}
|
|
201
|
-
>
|
|
202
|
-
<Icons.FontAwesome5 name={'envelope'} size={normalize(11)} color={'#094485'} />
|
|
203
|
-
<Text
|
|
204
|
-
numberOfLines={1}
|
|
205
|
-
style={{
|
|
206
|
-
fontSize: 10,
|
|
207
|
-
color: '#555',
|
|
208
|
-
marginLeft: normalize(5),
|
|
209
|
-
}}
|
|
210
|
-
>
|
|
211
|
-
{data.email}
|
|
212
|
-
</Text>
|
|
213
|
-
</View>
|
|
214
|
-
) : null}
|
|
215
|
-
{isNUQ(data.phoneno) ? (
|
|
216
|
-
<View
|
|
217
|
-
style={{
|
|
218
|
-
flexDirection: 'row',
|
|
219
|
-
alignItems: 'center',
|
|
220
|
-
paddingLeft: normalize(5),
|
|
221
|
-
}}
|
|
222
|
-
>
|
|
223
|
-
<Icons.FontAwesome5 name={'mobile'} size={normalize(11)} color={'#094485'} />
|
|
224
|
-
<Text
|
|
225
|
-
numberOfLines={1}
|
|
226
|
-
style={{
|
|
227
|
-
fontSize: 10,
|
|
228
|
-
color: '#555',
|
|
229
|
-
marginLeft: normalize(5),
|
|
230
|
-
}}
|
|
231
|
-
>
|
|
232
|
-
{data.phoneno}
|
|
233
|
-
</Text>
|
|
234
|
-
</View>
|
|
235
|
-
) : null}
|
|
236
|
-
</View>
|
|
237
|
-
) : null}
|
|
238
|
-
</View>
|
|
239
|
-
</View>
|
|
240
|
-
</View>
|
|
241
|
-
</View>
|
|
242
|
-
</TouchableOpacity>
|
|
243
|
-
</SwipeRow>
|
|
244
|
-
);
|
|
245
|
-
|
|
246
|
-
export default SwipableProductCard;
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
import React, { useContext, useState } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
Text,
|
|
5
|
-
TouchableOpacity,
|
|
6
|
-
Dimensions,
|
|
7
|
-
StyleSheet,
|
|
8
|
-
Image as RNImage,
|
|
9
|
-
ActivityIndicator,
|
|
10
|
-
} from 'react-native';
|
|
11
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
12
|
-
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
13
|
-
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
14
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
15
|
-
import { CButtonShadow, isNUQ, notifyMessage } from '../CommonStyle/ComponentFunctions';
|
|
16
|
-
import { SwipeRow } from 'react-native-swipe-list-view';
|
|
17
|
-
import STextInputNew from '../Components/STextInputNew';
|
|
18
|
-
import ContextBio from '../ContextAPI/ContextBio';
|
|
19
|
-
|
|
20
|
-
const SwipableProductImageCard = ({
|
|
21
|
-
data,
|
|
22
|
-
argumentname,
|
|
23
|
-
renderLeftActions,
|
|
24
|
-
renderRightActions,
|
|
25
|
-
navigation,
|
|
26
|
-
type,
|
|
27
|
-
}) => {
|
|
28
|
-
const [uploading, setUploading] = useState(false);
|
|
29
|
-
const [refreshKey, setRefreshKey] = useState(Date.now()); // used for forcing image refresh
|
|
30
|
-
const { invoiceData, setInvoiceData } = useContext(ContextBio);
|
|
31
|
-
|
|
32
|
-
const handlePress = () => {
|
|
33
|
-
const pdfUrl =
|
|
34
|
-
argumentname == 3
|
|
35
|
-
? `${APIURL}fljrcommonbill/jrcommonbreport/AMAGDBI01.dbo.rnjrinsuproductdetail(${data.code || data?.insuproduct
|
|
36
|
-
},${Global.userData.suuser})/0/ProductDetail`
|
|
37
|
-
: `${APIURL}fljrcommonbill/jrcommonbreport/AMAGDBI01.dbo.rnjrinsusupplier(${data.code},${Global.userData.suuser})/0/SupplierDetail`;
|
|
38
|
-
|
|
39
|
-
isNUQ(type)
|
|
40
|
-
? navigation.navigate('CProductPhysicalQuantityScreen', {
|
|
41
|
-
productCode: data?.insuproduct || 0,
|
|
42
|
-
})
|
|
43
|
-
: navigation.navigate('PDFScreen', { pdfSource: pdfUrl });
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<SwipeRow
|
|
48
|
-
disableLeftSwipe={false}
|
|
49
|
-
disableRightSwipe={false}
|
|
50
|
-
leftOpenValue={190}
|
|
51
|
-
rightOpenValue={-190}
|
|
52
|
-
swipeToClosePercent={10}
|
|
53
|
-
swipeToOpenPercent={10}
|
|
54
|
-
>
|
|
55
|
-
{/* Hidden Row (Swipe Actions) */}
|
|
56
|
-
<View style={{
|
|
57
|
-
borderWidth: 0,
|
|
58
|
-
flexDirection: 'row',
|
|
59
|
-
justifyContent: 'space-between',
|
|
60
|
-
minHeight: normalize(70),
|
|
61
|
-
}}>
|
|
62
|
-
<View style={{ flex: 1, alignItems: 'flex-start' }}>
|
|
63
|
-
{renderLeftActions && renderLeftActions(data)}
|
|
64
|
-
</View>
|
|
65
|
-
<View style={{ flex: 1, alignItems: 'flex-end' }}>
|
|
66
|
-
{renderRightActions && renderRightActions(data)}
|
|
67
|
-
</View>
|
|
68
|
-
</View>
|
|
69
|
-
|
|
70
|
-
{/* Main Content */}
|
|
71
|
-
<TouchableOpacity onPress={handlePress} activeOpacity={0.8}>
|
|
72
|
-
<View style={styles.cardContainer}>
|
|
73
|
-
<View style={styles.cardContent}>
|
|
74
|
-
{/* Left color indicator */}
|
|
75
|
-
<View
|
|
76
|
-
style={[
|
|
77
|
-
styles.colorIndicator,
|
|
78
|
-
{ backgroundColor: isNUQ(data?.color) ? data?.color : '#870808' },
|
|
79
|
-
]}
|
|
80
|
-
/>
|
|
81
|
-
|
|
82
|
-
{/* Main content */}
|
|
83
|
-
<View style={styles.textContainer}>
|
|
84
|
-
{isNUQ(
|
|
85
|
-
argumentname == 3 ? data.productname : data.suppliername,
|
|
86
|
-
) &&
|
|
87
|
-
data.code && (
|
|
88
|
-
<Text style={styles.titleText} numberOfLines={3}>
|
|
89
|
-
{data.code} -{' '}
|
|
90
|
-
{argumentname == 3 ? data.productname : data.suppliername}
|
|
91
|
-
{argumentname == 3 && data.classificationname
|
|
92
|
-
? ` (${data.classificationname})`
|
|
93
|
-
: ''}
|
|
94
|
-
</Text>
|
|
95
|
-
)}
|
|
96
|
-
|
|
97
|
-
{/* HSN Code input */}
|
|
98
|
-
<View style={styles.hsnContainer}>
|
|
99
|
-
<STextInputNew
|
|
100
|
-
data={{
|
|
101
|
-
borderWidth: 1,
|
|
102
|
-
value: data.hsncode,
|
|
103
|
-
borderColor: 'lightgrey',
|
|
104
|
-
elevation: 0,
|
|
105
|
-
borderRadius: 5,
|
|
106
|
-
fontWeight: 'normal',
|
|
107
|
-
color: 'black',
|
|
108
|
-
itemwidth: Dimensions.get('screen').width * 0.5,
|
|
109
|
-
paddingTop: 5,
|
|
110
|
-
paddingBottom: 5,
|
|
111
|
-
height: Dimensions.get('screen').height * 0.03,
|
|
112
|
-
textAlign: 'center',
|
|
113
|
-
marginTop: normalize(2),
|
|
114
|
-
marginHorizontal: normalize(2),
|
|
115
|
-
fontSize: normalize(10),
|
|
116
|
-
placeholder: 'hsncode',
|
|
117
|
-
}}
|
|
118
|
-
callBack={val => {
|
|
119
|
-
data.hsncode = val;
|
|
120
|
-
data.flag = 2;
|
|
121
|
-
setInvoiceData(prevData => ({
|
|
122
|
-
...prevData,
|
|
123
|
-
EditStatus: true,
|
|
124
|
-
}));
|
|
125
|
-
}}
|
|
126
|
-
/>
|
|
127
|
-
</View>
|
|
128
|
-
</View>
|
|
129
|
-
|
|
130
|
-
{/* Image upload button */}
|
|
131
|
-
<TouchableOpacity
|
|
132
|
-
style={styles.imageContainer}
|
|
133
|
-
onPress={() => {
|
|
134
|
-
navigation.navigate('FileExplorer', {
|
|
135
|
-
data: [{ savedimages: '' }],
|
|
136
|
-
visibility: 1, // only image
|
|
137
|
-
eventData: null,
|
|
138
|
-
callBack: updated => {
|
|
139
|
-
if (updated.savedimages) {
|
|
140
|
-
const fileName = updated.savedimages.toLowerCase();
|
|
141
|
-
console.log('jjjjjjj',JSON.stringify(fileName));
|
|
142
|
-
if (!fileName.endsWith('.png')) {
|
|
143
|
-
notifyMessage('Only PNG images are allowed.');
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
setUploading(true);
|
|
148
|
-
data.productimage = updated.savedimages;
|
|
149
|
-
data.flag = 2;
|
|
150
|
-
setInvoiceData(prevData => ({
|
|
151
|
-
...prevData,
|
|
152
|
-
EditStatus: true,
|
|
153
|
-
}));
|
|
154
|
-
setTimeout(() => {
|
|
155
|
-
setUploading(false);
|
|
156
|
-
setRefreshKey(Date.now()); // bust cache
|
|
157
|
-
}, 400);
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
});
|
|
161
|
-
}}>
|
|
162
|
-
{uploading ? (
|
|
163
|
-
<ActivityIndicator size="small" color="#094485" />
|
|
164
|
-
) : isNUQ(data?.productimage) ? (
|
|
165
|
-
<RNImage
|
|
166
|
-
key={refreshKey}
|
|
167
|
-
style={styles.productImage}
|
|
168
|
-
source={{
|
|
169
|
-
uri: `${APIURL}invfile/getFile/image/${data.productimage}?t=${refreshKey}`,
|
|
170
|
-
}}
|
|
171
|
-
resizeMode="cover"
|
|
172
|
-
/>
|
|
173
|
-
) : (
|
|
174
|
-
<View style={styles.cameraIcon}>
|
|
175
|
-
<Icons.FontAwesome5
|
|
176
|
-
name="camera"
|
|
177
|
-
color="#094485"
|
|
178
|
-
size={normalize(20)}
|
|
179
|
-
/>
|
|
180
|
-
<Text style={{ fontSize: normalize(5), fontWeight: 'bold' }}>
|
|
181
|
-
PNG ONLY
|
|
182
|
-
</Text>
|
|
183
|
-
</View>
|
|
184
|
-
)}
|
|
185
|
-
</TouchableOpacity>
|
|
186
|
-
|
|
187
|
-
</View>
|
|
188
|
-
</View>
|
|
189
|
-
</TouchableOpacity>
|
|
190
|
-
</SwipeRow>
|
|
191
|
-
);
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
const styles = StyleSheet.create({
|
|
195
|
-
cardContainer: {
|
|
196
|
-
backgroundColor: '#faeeeb',
|
|
197
|
-
marginHorizontal: normalize(10),
|
|
198
|
-
marginBottom: normalize(10),
|
|
199
|
-
borderRadius: normalize(5),
|
|
200
|
-
shadowColor: Global.AppTheme.primary_color,
|
|
201
|
-
shadowOffset: { width: 4, height: 4 },
|
|
202
|
-
shadowOpacity: 0.6,
|
|
203
|
-
shadowRadius: 10,
|
|
204
|
-
elevation: 8,
|
|
205
|
-
...CButtonShadow(),
|
|
206
|
-
},
|
|
207
|
-
cardContent: {
|
|
208
|
-
flexDirection: 'row',
|
|
209
|
-
minHeight: normalize(40),
|
|
210
|
-
},
|
|
211
|
-
colorIndicator: {
|
|
212
|
-
width: normalize(10),
|
|
213
|
-
height: '100%',
|
|
214
|
-
borderTopLeftRadius: normalize(5),
|
|
215
|
-
borderBottomLeftRadius: normalize(5),
|
|
216
|
-
},
|
|
217
|
-
textContainer: {
|
|
218
|
-
flex: 1,
|
|
219
|
-
paddingVertical: normalize(8),
|
|
220
|
-
paddingHorizontal: normalize(5),
|
|
221
|
-
justifyContent: 'center',
|
|
222
|
-
},
|
|
223
|
-
titleText: {
|
|
224
|
-
fontSize: normalize(12.5),
|
|
225
|
-
fontWeight: 'bold',
|
|
226
|
-
color: Global.AppTheme.primary_color,
|
|
227
|
-
marginBottom: normalize(4),
|
|
228
|
-
},
|
|
229
|
-
hsnContainer: {
|
|
230
|
-
flexDirection: 'row',
|
|
231
|
-
marginTop: normalize(2),
|
|
232
|
-
},
|
|
233
|
-
imageContainer: {
|
|
234
|
-
width: normalize(50),
|
|
235
|
-
height: normalize(50),
|
|
236
|
-
backgroundColor: 'white',
|
|
237
|
-
borderRadius: normalize(35),
|
|
238
|
-
alignItems: 'center',
|
|
239
|
-
justifyContent: 'center',
|
|
240
|
-
margin: normalize(5),
|
|
241
|
-
borderWidth: 1,
|
|
242
|
-
borderColor: '#e0e0e0',
|
|
243
|
-
},
|
|
244
|
-
productImage: {
|
|
245
|
-
width: '100%',
|
|
246
|
-
height: '100%',
|
|
247
|
-
borderRadius: normalize(35),
|
|
248
|
-
},
|
|
249
|
-
cameraIcon: {
|
|
250
|
-
padding: normalize(10),
|
|
251
|
-
},
|
|
252
|
-
});
|
|
253
|
-
|
|
254
|
-
export default SwipableProductImageCard;
|