@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,336 +0,0 @@
|
|
|
1
|
-
import React, { memo, useState, useRef, useEffect, useCallback } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
View,
|
|
4
|
-
TextInput,
|
|
5
|
-
Text,
|
|
6
|
-
Animated,
|
|
7
|
-
TouchableOpacity,
|
|
8
|
-
Keyboard,
|
|
9
|
-
} from 'react-native';
|
|
10
|
-
import HOCIcons from '../HOC/HOCIcons';
|
|
11
|
-
import { isNU, isNUQ, isNUQZ, normalize } from '../CommonStyle/ComponentFunctions';
|
|
12
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
13
|
-
|
|
14
|
-
const CCustomTextInput = (props) => {
|
|
15
|
-
// Initialize text from props or empty string
|
|
16
|
-
const [text, setText] = useState(() => {
|
|
17
|
-
const initialValue = props?.data?.value;
|
|
18
|
-
return initialValue !== undefined && initialValue !== null
|
|
19
|
-
? String(initialValue)
|
|
20
|
-
: '';
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const [infoVisible, setInfoVisible] = useState(false);
|
|
24
|
-
const [isInputFocused, setIsInputFocused] = useState(false);
|
|
25
|
-
const shakeAnimation = useRef(new Animated.Value(0)).current;
|
|
26
|
-
|
|
27
|
-
// Destructure props for easier access
|
|
28
|
-
const {
|
|
29
|
-
data = {},
|
|
30
|
-
callBack,
|
|
31
|
-
onEndEditCallback,
|
|
32
|
-
validationtype,
|
|
33
|
-
required = false,
|
|
34
|
-
disabled = false,
|
|
35
|
-
info,
|
|
36
|
-
CloseIcon,
|
|
37
|
-
CloseCallBack,
|
|
38
|
-
iconstyle,
|
|
39
|
-
inputstyle,
|
|
40
|
-
CCommonHeight,
|
|
41
|
-
CBorderWidth,
|
|
42
|
-
CIconCallBack,
|
|
43
|
-
custompositiontextviewstyle,
|
|
44
|
-
custompositiontextstyle,
|
|
45
|
-
...textInputProps
|
|
46
|
-
} = props;
|
|
47
|
-
|
|
48
|
-
// Merge default data with props data
|
|
49
|
-
const mergedData = {
|
|
50
|
-
// itemwidth: "100%",
|
|
51
|
-
displaytext: 'Name',
|
|
52
|
-
iconname: 'home',
|
|
53
|
-
type: 'default',
|
|
54
|
-
editable: true,
|
|
55
|
-
placeholder: '',
|
|
56
|
-
decimal: 2,
|
|
57
|
-
icongroup: 5,
|
|
58
|
-
tfontsize: normalize(14),
|
|
59
|
-
placeholdercolor: '#e1e1e1',
|
|
60
|
-
alignment: 'left',
|
|
61
|
-
...data,
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
// Handle external value changes
|
|
65
|
-
useEffect(() => {
|
|
66
|
-
const newValue = props?.data?.value;
|
|
67
|
-
if (newValue !== undefined && newValue !== null) {
|
|
68
|
-
setText(String(newValue));
|
|
69
|
-
}
|
|
70
|
-
}, [props?.data?.value]);
|
|
71
|
-
|
|
72
|
-
// Keyboard listener
|
|
73
|
-
useEffect(() => {
|
|
74
|
-
const keyboardDidHideListener = Keyboard.addListener(
|
|
75
|
-
'keyboardDidHide',
|
|
76
|
-
() => {
|
|
77
|
-
if (isInputFocused) {
|
|
78
|
-
setIsInputFocused(false);
|
|
79
|
-
// Call any on blur callback if needed
|
|
80
|
-
if (onEndEditCallback && isNUQZ(validationtype)) {
|
|
81
|
-
onEndEditCallback(text);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
);
|
|
86
|
-
|
|
87
|
-
return () => {
|
|
88
|
-
keyboardDidHideListener.remove();
|
|
89
|
-
};
|
|
90
|
-
}, [isInputFocused, text, validationtype, onEndEditCallback]);
|
|
91
|
-
|
|
92
|
-
// Shake animation
|
|
93
|
-
const shake = useCallback(() => {
|
|
94
|
-
shakeAnimation.setValue(0);
|
|
95
|
-
Animated.sequence([
|
|
96
|
-
Animated.timing(shakeAnimation, {
|
|
97
|
-
toValue: 10,
|
|
98
|
-
duration: 50,
|
|
99
|
-
useNativeDriver: true,
|
|
100
|
-
}),
|
|
101
|
-
Animated.timing(shakeAnimation, {
|
|
102
|
-
toValue: -10,
|
|
103
|
-
duration: 50,
|
|
104
|
-
useNativeDriver: true,
|
|
105
|
-
}),
|
|
106
|
-
Animated.timing(shakeAnimation, {
|
|
107
|
-
toValue: 10,
|
|
108
|
-
duration: 50,
|
|
109
|
-
useNativeDriver: true,
|
|
110
|
-
}),
|
|
111
|
-
Animated.timing(shakeAnimation, {
|
|
112
|
-
toValue: 0,
|
|
113
|
-
duration: 50,
|
|
114
|
-
useNativeDriver: true,
|
|
115
|
-
}),
|
|
116
|
-
]).start();
|
|
117
|
-
}, [shakeAnimation]);
|
|
118
|
-
|
|
119
|
-
// Validation functions
|
|
120
|
-
const validateEmail = useCallback((email) => {
|
|
121
|
-
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
122
|
-
return emailRegex.test(email);
|
|
123
|
-
}, []);
|
|
124
|
-
|
|
125
|
-
const validateMobileNumber = useCallback((number) => {
|
|
126
|
-
const mobileRegex = /^\d{10}$/;
|
|
127
|
-
return mobileRegex.test(number);
|
|
128
|
-
}, []);
|
|
129
|
-
|
|
130
|
-
// Handle text change
|
|
131
|
-
const handleTextChange = useCallback((value) => {
|
|
132
|
-
setText(value);
|
|
133
|
-
if (callBack) {
|
|
134
|
-
callBack(value);
|
|
135
|
-
}
|
|
136
|
-
}, [callBack]);
|
|
137
|
-
|
|
138
|
-
// Handle end editing with validation
|
|
139
|
-
const handleEndEditing = useCallback(() => {
|
|
140
|
-
if (!isNUQZ(validationtype)) {return;}
|
|
141
|
-
|
|
142
|
-
let isValid = true;
|
|
143
|
-
|
|
144
|
-
switch (validationtype) {
|
|
145
|
-
case 1: // Email validation
|
|
146
|
-
isValid = validateEmail(text);
|
|
147
|
-
if (!isValid) {
|
|
148
|
-
shake();
|
|
149
|
-
handleTextChange('');
|
|
150
|
-
}
|
|
151
|
-
break;
|
|
152
|
-
|
|
153
|
-
case 2: // Mobile number validation
|
|
154
|
-
isValid = validateMobileNumber(text);
|
|
155
|
-
if (!isValid) {
|
|
156
|
-
shake();
|
|
157
|
-
handleTextChange('');
|
|
158
|
-
} else if (onEndEditCallback) {
|
|
159
|
-
onEndEditCallback(text);
|
|
160
|
-
}
|
|
161
|
-
break;
|
|
162
|
-
|
|
163
|
-
case 3: // Generic callback
|
|
164
|
-
if (onEndEditCallback) {
|
|
165
|
-
onEndEditCallback(text);
|
|
166
|
-
}
|
|
167
|
-
break;
|
|
168
|
-
|
|
169
|
-
default:
|
|
170
|
-
break;
|
|
171
|
-
}
|
|
172
|
-
}, [validationtype, text, validateEmail, validateMobileNumber, onEndEditCallback, shake, handleTextChange]);
|
|
173
|
-
|
|
174
|
-
// Handle clear button
|
|
175
|
-
const handleClear = useCallback(() => {
|
|
176
|
-
handleTextChange('');
|
|
177
|
-
if (CloseCallBack) {
|
|
178
|
-
CloseCallBack(true);
|
|
179
|
-
}
|
|
180
|
-
}, [handleTextChange, CloseCallBack]);
|
|
181
|
-
|
|
182
|
-
// Handle icon press
|
|
183
|
-
const handleIconPress = useCallback(() => {
|
|
184
|
-
if (CIconCallBack) {
|
|
185
|
-
CIconCallBack(mergedData);
|
|
186
|
-
}
|
|
187
|
-
}, [CIconCallBack, mergedData]);
|
|
188
|
-
|
|
189
|
-
// Calculate styles
|
|
190
|
-
const containerStyle = inputstyle || {
|
|
191
|
-
flexDirection: 'row',
|
|
192
|
-
borderWidth: CBorderWidth ?? 1,
|
|
193
|
-
borderColor: 'lightgrey',
|
|
194
|
-
borderRadius: 10,
|
|
195
|
-
alignItems: 'center',
|
|
196
|
-
height: CCommonHeight ?? normalize(35),
|
|
197
|
-
};
|
|
198
|
-
|
|
199
|
-
const labelViewStyle = custompositiontextviewstyle || {
|
|
200
|
-
position: 'absolute',
|
|
201
|
-
top: normalize(-6),
|
|
202
|
-
left: normalize(10),
|
|
203
|
-
backgroundColor: 'white',
|
|
204
|
-
flexDirection: 'row',
|
|
205
|
-
alignItems: 'center',
|
|
206
|
-
zIndex: 1,
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
const labelTextStyle = custompositiontextstyle || {
|
|
210
|
-
color: '#164c92',
|
|
211
|
-
fontSize: normalize(10),
|
|
212
|
-
textAlign: 'left',
|
|
213
|
-
fontWeight: 'normal',
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
const textInputStyle = {
|
|
217
|
-
borderWidth: 0,
|
|
218
|
-
flex: 1,
|
|
219
|
-
paddingRight: normalize(5),
|
|
220
|
-
fontSize: mergedData.tfontsize,
|
|
221
|
-
height: mergedData.textarea ? normalize(60) : normalize(35),
|
|
222
|
-
color: 'black',
|
|
223
|
-
fontWeight: mergedData.tfontweight || 'normal',
|
|
224
|
-
textAlign: mergedData.alignment,
|
|
225
|
-
};
|
|
226
|
-
|
|
227
|
-
return (
|
|
228
|
-
<Animated.View style={{
|
|
229
|
-
width: mergedData.itemwidth,
|
|
230
|
-
marginVertical: normalize(5),
|
|
231
|
-
transform: [{ translateX: shakeAnimation }],
|
|
232
|
-
}}>
|
|
233
|
-
{/* Floating Label */}
|
|
234
|
-
{isNUQ(mergedData.displaytext) && (
|
|
235
|
-
<View style={labelViewStyle}>
|
|
236
|
-
<Text style={labelTextStyle}>
|
|
237
|
-
{mergedData.displaytext}
|
|
238
|
-
</Text>
|
|
239
|
-
{required && (
|
|
240
|
-
<Text style={{ color: 'red', fontSize: normalize(10) }}>
|
|
241
|
-
{' *'}
|
|
242
|
-
</Text>
|
|
243
|
-
)}
|
|
244
|
-
</View>
|
|
245
|
-
)}
|
|
246
|
-
|
|
247
|
-
{/* Input Container */}
|
|
248
|
-
<View style={containerStyle}>
|
|
249
|
-
{/* Icon */}
|
|
250
|
-
{iconstyle && (
|
|
251
|
-
<HOCIcons.Icons
|
|
252
|
-
icongroup={iconstyle.icongroup ?? 5}
|
|
253
|
-
name={iconstyle.iconname ?? 'file-alt'}
|
|
254
|
-
size={iconstyle.iconsize ?? normalize(15)}
|
|
255
|
-
color={iconstyle.iconcolor ?? 'darkblue'}
|
|
256
|
-
style={iconstyle.style ?? { paddingHorizontal: 5 }}
|
|
257
|
-
onPress={handleIconPress}
|
|
258
|
-
/>
|
|
259
|
-
)}
|
|
260
|
-
|
|
261
|
-
{/* TextInput */}
|
|
262
|
-
<TextInput
|
|
263
|
-
style={textInputStyle}
|
|
264
|
-
value={text}
|
|
265
|
-
onChangeText={handleTextChange}
|
|
266
|
-
onFocus={() => {
|
|
267
|
-
setIsInputFocused(true);
|
|
268
|
-
setInfoVisible(true);
|
|
269
|
-
}}
|
|
270
|
-
onBlur={() => {
|
|
271
|
-
setIsInputFocused(false);
|
|
272
|
-
setInfoVisible(false);
|
|
273
|
-
handleEndEditing();
|
|
274
|
-
}}
|
|
275
|
-
autoCapitalize={mergedData.capitalize || 'none'}
|
|
276
|
-
keyboardType={mergedData.type}
|
|
277
|
-
maxLength={mergedData.maxlength || 200}
|
|
278
|
-
editable={!disabled}
|
|
279
|
-
multiline={!!mergedData.textarea}
|
|
280
|
-
numberOfLines={mergedData.textarea ? 5 : 1}
|
|
281
|
-
placeholder={mergedData.placeholder || ''}
|
|
282
|
-
placeholderTextColor={mergedData.placeholdercolor}
|
|
283
|
-
spellCheck={false}
|
|
284
|
-
autoCorrect={false}
|
|
285
|
-
{...textInputProps}
|
|
286
|
-
/>
|
|
287
|
-
|
|
288
|
-
{/* Clear Button */}
|
|
289
|
-
{CloseIcon && (
|
|
290
|
-
<TouchableOpacity onPress={handleClear}>
|
|
291
|
-
<HOCIcons.MaterialCommunityIcons
|
|
292
|
-
name={'close-circle'}
|
|
293
|
-
color={Global.AppTheme.primary_color}
|
|
294
|
-
size={normalize(18)}
|
|
295
|
-
style={{ marginHorizontal: normalize(5) }}
|
|
296
|
-
/>
|
|
297
|
-
</TouchableOpacity>
|
|
298
|
-
)}
|
|
299
|
-
</View>
|
|
300
|
-
|
|
301
|
-
{/* Info Text */}
|
|
302
|
-
{(infoVisible && isNU(info)) && (
|
|
303
|
-
<View style={{
|
|
304
|
-
marginTop: normalize(3),
|
|
305
|
-
borderRadius: 5,
|
|
306
|
-
borderWidth: 0,
|
|
307
|
-
width: '100%',
|
|
308
|
-
flexDirection: 'row',
|
|
309
|
-
alignItems: 'center',
|
|
310
|
-
}}>
|
|
311
|
-
<HOCIcons.Entypo
|
|
312
|
-
icongroup={5}
|
|
313
|
-
name={'info-with-circle'}
|
|
314
|
-
size={normalize(10)}
|
|
315
|
-
color={'grey'}
|
|
316
|
-
style={{ textAlign: 'center', paddingHorizontal: normalize(3) }}
|
|
317
|
-
/>
|
|
318
|
-
<Text
|
|
319
|
-
adjustsFontSizeToFit
|
|
320
|
-
style={{
|
|
321
|
-
width: '90%',
|
|
322
|
-
color: 'grey',
|
|
323
|
-
fontStyle: 'italic',
|
|
324
|
-
fontSize: normalize(9),
|
|
325
|
-
textAlign: 'left',
|
|
326
|
-
}}
|
|
327
|
-
>
|
|
328
|
-
{' '}{info}
|
|
329
|
-
</Text>
|
|
330
|
-
</View>
|
|
331
|
-
)}
|
|
332
|
-
</Animated.View>
|
|
333
|
-
);
|
|
334
|
-
};
|
|
335
|
-
|
|
336
|
-
export default memo(CCustomTextInput);
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { StyleSheet, View, ImageBackground, ScrollView } from 'react-native';
|
|
3
|
-
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
4
|
-
|
|
5
|
-
const CDetailView = (props) => {
|
|
6
|
-
const styles = StyleSheet.create({
|
|
7
|
-
CDetailView: {
|
|
8
|
-
flex: 1,
|
|
9
|
-
shadowColor: '#000',
|
|
10
|
-
shadowOffset: { width: 0, height: 2 },
|
|
11
|
-
shadowOpacity: 0.8,
|
|
12
|
-
shadowRadius: 2,
|
|
13
|
-
borderTopLeftRadius: 20,
|
|
14
|
-
borderTopRightRadius: 20,
|
|
15
|
-
width: '100%',
|
|
16
|
-
backgroundColor: props.backgroundColor ? props.backgroundColor : 'white',
|
|
17
|
-
},
|
|
18
|
-
image: {
|
|
19
|
-
flex: 1,
|
|
20
|
-
},
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return (
|
|
25
|
-
<View style={styles.CDetailView}>
|
|
26
|
-
<ImageBackground
|
|
27
|
-
source={props.bgimage != undefined ? { uri: props.bgimage } : { uri: `${APIURL}file/getCommonFile/image/IMA.png` }}
|
|
28
|
-
resizeMode={props.bgimage != undefined ? 'stretch' : 'contain'}
|
|
29
|
-
imageStyle={props.bgimage != undefined ? { opacity: 1 } : { opacity: 0.1 }}
|
|
30
|
-
style={styles.image}
|
|
31
|
-
>
|
|
32
|
-
{props.children}
|
|
33
|
-
</ImageBackground>
|
|
34
|
-
</View>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export default CDetailView;
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import { View, Text, FlatList } from 'react-native';
|
|
3
|
-
import { notifyMessage, Loader, isBNUL, isNU } from '../CommonStyle/ComponentFunctions';
|
|
4
|
-
import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
|
|
5
|
-
import HOCIcons from '../HOC/HOCIcons';
|
|
6
|
-
import {
|
|
7
|
-
MenuOption,
|
|
8
|
-
} from 'react-native-popup-menu';
|
|
9
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
10
|
-
|
|
11
|
-
export default function CDropDownList(props) {
|
|
12
|
-
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
FetchDropdownList();
|
|
15
|
-
}, []);
|
|
16
|
-
|
|
17
|
-
const [loading, setLoading] = useState(false);
|
|
18
|
-
const [displayData, setDisplayData] = useState([]);
|
|
19
|
-
const [refresh, setRefresh] = useState(0);
|
|
20
|
-
const [searchData, setSearchData] = useState('');
|
|
21
|
-
|
|
22
|
-
function FetchDropdownList() {
|
|
23
|
-
setDisplayData([]);
|
|
24
|
-
setLoading(true);
|
|
25
|
-
props.dropdownapi && props.dropdownapi != null && props.dropdownapi != undefined ?
|
|
26
|
-
(console.log('CDropDownList props.dropdownapi', props.dropdownapi),
|
|
27
|
-
NetworkServiceCall('get', props.dropdownapi, '').then(
|
|
28
|
-
function (response) {
|
|
29
|
-
// console.log('CDropDownList response', JSON.stringify(response))
|
|
30
|
-
if (
|
|
31
|
-
response.httpstatus &&
|
|
32
|
-
response.httpstatus != null &&
|
|
33
|
-
response.httpstatus != undefined &&
|
|
34
|
-
response.httpstatus == 200
|
|
35
|
-
) {
|
|
36
|
-
setDisplayData(response.data.data);
|
|
37
|
-
setLoading(false);
|
|
38
|
-
} else {
|
|
39
|
-
notifyMessage('Data Not Found');
|
|
40
|
-
setLoading(false);
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
))
|
|
44
|
-
: props.dropdownarray && props.dropdownarray != null && props.dropdownarray != undefined ?
|
|
45
|
-
(setDisplayData(props.dropdownarray), // Changed props.dropdownarray.data.data to props.dropdownarray
|
|
46
|
-
setLoading(false))
|
|
47
|
-
:
|
|
48
|
-
setLoading(false);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
function renderItem(data) {
|
|
52
|
-
|
|
53
|
-
return (
|
|
54
|
-
<MenuOption
|
|
55
|
-
onSelect={() => {
|
|
56
|
-
data.item.selected = true,
|
|
57
|
-
setRefresh(refresh + 1),
|
|
58
|
-
props.callback(data.item);
|
|
59
|
-
}}
|
|
60
|
-
disabled={false}
|
|
61
|
-
style={{
|
|
62
|
-
paddingVertical: normalize(5),
|
|
63
|
-
borderWidth: 0.5,
|
|
64
|
-
borderColor: 'lightgrey',
|
|
65
|
-
flexDirection: 'row',
|
|
66
|
-
alignItems: 'center',
|
|
67
|
-
}}
|
|
68
|
-
>
|
|
69
|
-
{data.item.hideicon ?
|
|
70
|
-
null
|
|
71
|
-
:
|
|
72
|
-
<HOCIcons.Icons
|
|
73
|
-
icongroup={isNU(data.item.icongroup) ? data.item.icongroup : 3}
|
|
74
|
-
name={data.item.icon ? data.item.icon : data.item.selected ? 'radiobox-marked' : 'circle-double'}//radiobox-marked
|
|
75
|
-
color={'black'}
|
|
76
|
-
size={normalize(10)}
|
|
77
|
-
style={{
|
|
78
|
-
marginRight: normalize(4),
|
|
79
|
-
borderWidth: 0,
|
|
80
|
-
textAlign: 'center',
|
|
81
|
-
}}
|
|
82
|
-
/>
|
|
83
|
-
}
|
|
84
|
-
{data.item.badgenumber != null && data.item.badgenumber != undefined ?
|
|
85
|
-
<View style={{ borderWidth: 0, borderRadius: 100, height: normalize(14), width: normalize(14), position: 'absolute', backgroundColor: '#912c2c', right: 0, top: 0, justifyContent: 'center', alignItems: 'center' }}>
|
|
86
|
-
<Text style={{ fontSize: normalize(10), textAlign: 'center', color: 'white' }}>{data.item.badgenumber}</Text>
|
|
87
|
-
</View>
|
|
88
|
-
: null}
|
|
89
|
-
|
|
90
|
-
<Text
|
|
91
|
-
style={{
|
|
92
|
-
borderWidth: 0,
|
|
93
|
-
fontWeight: data.item.selected ? 'bold' : 'normal',
|
|
94
|
-
fontSize: normalize(12),
|
|
95
|
-
color: 'black',
|
|
96
|
-
}}
|
|
97
|
-
>
|
|
98
|
-
{data.item.displayvalue != null && data.item.displayvalue != undefined ? data.item.displayvalue.toUpperCase() : null}
|
|
99
|
-
</Text>
|
|
100
|
-
</MenuOption>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
function GetDropdown(data) {
|
|
105
|
-
const newDropDownData = data != undefined
|
|
106
|
-
? data.filter(function (item) {
|
|
107
|
-
const dataItem = item.displayvalue
|
|
108
|
-
? item.displayvalue.toUpperCase()
|
|
109
|
-
: ''.toUpperCase();
|
|
110
|
-
const textData = searchData.toUpperCase();
|
|
111
|
-
return dataItem.indexOf(textData) > -1;
|
|
112
|
-
})
|
|
113
|
-
: null;
|
|
114
|
-
|
|
115
|
-
return (
|
|
116
|
-
<FlatList
|
|
117
|
-
keyboardShouldPersistTaps={'handled'}
|
|
118
|
-
data={newDropDownData}
|
|
119
|
-
renderItem={renderItem}
|
|
120
|
-
ListFooterComponent={() => {
|
|
121
|
-
return (
|
|
122
|
-
<>
|
|
123
|
-
{isNU(props.info) ?
|
|
124
|
-
<View style={{ marginTop: normalize(3), borderRadius: 5, borderWidth: 0, width: '100%', borderColor: 'lightgrey', flexDirection: 'row', alignItems: 'center', backgroundColor: 'white' }}>
|
|
125
|
-
<HOCIcons.Entypo
|
|
126
|
-
icongroup={5}
|
|
127
|
-
name={'info-with-circle'}
|
|
128
|
-
size={normalize(12)}
|
|
129
|
-
color={'grey'}
|
|
130
|
-
style={{ textAlign: 'center', padding: normalize(3), paddingLeft: normalize(8) }}
|
|
131
|
-
/>
|
|
132
|
-
<Text adjustsFontSizeToFit style={{ width: '90%', color: 'grey', fontStyle: 'italic', fontSize: normalize(11), textAlign: 'left' }}>
|
|
133
|
-
{' '}{isNU(props.info) ? props.info : null}
|
|
134
|
-
</Text>
|
|
135
|
-
</View>
|
|
136
|
-
: null}
|
|
137
|
-
</>
|
|
138
|
-
);
|
|
139
|
-
}}
|
|
140
|
-
// estimatedItemSize={normalize(25)}
|
|
141
|
-
/>
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
return (
|
|
146
|
-
<View style={{ borderWidth: 0.5, borderRadius: 5, borderColor: 'lightgrey', backgroundColor: 'white' }}>
|
|
147
|
-
{loading ? <Loader /> : null}
|
|
148
|
-
{isBNUL(displayData) ?
|
|
149
|
-
GetDropdown(displayData)
|
|
150
|
-
: null}
|
|
151
|
-
</View>
|
|
152
|
-
);
|
|
153
|
-
}
|