@jescon-technologies/react-native-ui-kit 0.0.4 → 0.0.6
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 +3 -7
- package/package.json +3 -2
- package/src/Alerts/AAlert.js +4 -4
- 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/RecordAudio.js +1 -1
- 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,569 @@
|
|
|
1
|
+
import React, { useContext, useRef, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
View,
|
|
4
|
+
Text,
|
|
5
|
+
TextInput,
|
|
6
|
+
StyleSheet,
|
|
7
|
+
TouchableOpacity,
|
|
8
|
+
Platform,
|
|
9
|
+
Keyboard,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
12
|
+
import DateTimePicker from '@react-native-community/datetimepicker';
|
|
13
|
+
import { Menu, MenuTrigger, MenuOptions } from 'react-native-popup-menu';
|
|
14
|
+
import moment from 'moment';
|
|
15
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
16
|
+
import CDropDownList from '../CustomComponents/CDropDownList';
|
|
17
|
+
import ContextBio from '../ContextAPI/ContextBio';
|
|
18
|
+
import CustomTextInput from './CustomTextInput';
|
|
19
|
+
|
|
20
|
+
const FilterInput = ({
|
|
21
|
+
label,
|
|
22
|
+
inputValue,
|
|
23
|
+
onChangeText,
|
|
24
|
+
btnBackgroundColor,
|
|
25
|
+
iconName,
|
|
26
|
+
iconSize,
|
|
27
|
+
iconColor,
|
|
28
|
+
btnBorderColor,
|
|
29
|
+
type,
|
|
30
|
+
selected,
|
|
31
|
+
onSelect,
|
|
32
|
+
addTextOperators,
|
|
33
|
+
addOptionsUpdate,
|
|
34
|
+
addOperatorsUpdate,
|
|
35
|
+
}) => {
|
|
36
|
+
const { invoiceData, setInvoiceData } = useContext(ContextBio);
|
|
37
|
+
|
|
38
|
+
// State management
|
|
39
|
+
const [numberOperator, setNumberOperator] = useState(0);
|
|
40
|
+
const [dateOperator, setDateOperator] = useState(0);
|
|
41
|
+
const [textOperator, setTextOperator] = useState(0);
|
|
42
|
+
const [textInput, setTextInput] = useState('');
|
|
43
|
+
const [firstNumber, setFirstNumber] = useState('');
|
|
44
|
+
const [secondNumber, setSecondNumber] = useState('');
|
|
45
|
+
const [date, setDate] = useState(new Date());
|
|
46
|
+
const [secondDate, setSecondDate] = useState(new Date());
|
|
47
|
+
const [dateVisibility, setDateVisibility] = useState(false);
|
|
48
|
+
const [secondDateVisibility, setSecondDateVisibility] = useState(false);
|
|
49
|
+
const [option, setOption] = useState('');
|
|
50
|
+
|
|
51
|
+
// Refs
|
|
52
|
+
const inputRef = useRef(null);
|
|
53
|
+
const secondNumberRef = useRef(null);
|
|
54
|
+
const menuRef = useRef(null);
|
|
55
|
+
const menuInputRef = useRef(null);
|
|
56
|
+
|
|
57
|
+
// Operator configurations
|
|
58
|
+
const textOperators = [
|
|
59
|
+
{ datavalue: 1, icon: '', displayvalue: 'Exact', value: 1 },
|
|
60
|
+
{ datavalue: 2, icon: '', displayvalue: 'Like', value: 2 },
|
|
61
|
+
{ datavalue: 3, icon: '', displayvalue: 'Middle', value: 3 },
|
|
62
|
+
{ datavalue: 4, icon: '', displayvalue: 'Last', value: 4 },
|
|
63
|
+
];
|
|
64
|
+
|
|
65
|
+
const genderLabels = [
|
|
66
|
+
{ datavalue: 'M', icon: '', displayvalue: 'Male', value: 'M' },
|
|
67
|
+
{ datavalue: 'F', icon: '', displayvalue: 'Female', value: 'F' },
|
|
68
|
+
];
|
|
69
|
+
|
|
70
|
+
const checkingOperators = [
|
|
71
|
+
{ datavalue: 1, icon: '', displayvalue: 'Exact', value: 1 },
|
|
72
|
+
{ datavalue: 5, icon: '', displayvalue: 'Less Than', value: 5 },
|
|
73
|
+
{ datavalue: 7, icon: '', displayvalue: 'Greater Than', value: 7 },
|
|
74
|
+
{ datavalue: 8, icon: '', displayvalue: 'Less Than or Equal to', value: 8 },
|
|
75
|
+
{ datavalue: 9, icon: '', displayvalue: 'Greater Than or Equal to', value: 9 },
|
|
76
|
+
{ datavalue: 6, icon: '', displayvalue: 'Between', value: 6 },
|
|
77
|
+
];
|
|
78
|
+
|
|
79
|
+
// Helper functions
|
|
80
|
+
const menuOpen = () => menuRef.current?.open();
|
|
81
|
+
const menuClose = () => menuRef.current?.close();
|
|
82
|
+
|
|
83
|
+
const handleOpenMenu = () => {
|
|
84
|
+
onSelect();
|
|
85
|
+
setTimeout(() => menuInputRef.current?.focus(), 300);
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const handleButtonClick = () => {
|
|
89
|
+
onSelect();
|
|
90
|
+
if (type === 'date') {
|
|
91
|
+
setDateVisibility(true);
|
|
92
|
+
} else if (type === 'number') {
|
|
93
|
+
inputRef.current?.focus();
|
|
94
|
+
} else if (type === 'select') {
|
|
95
|
+
menuOpen();
|
|
96
|
+
} else {
|
|
97
|
+
menuOpen();
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const handleNumberOperatorClick = (value) => {
|
|
102
|
+
setNumberOperator(value);
|
|
103
|
+
handleInputChange(firstNumber, secondNumber, value);
|
|
104
|
+
if (value === 6) {
|
|
105
|
+
setTimeout(() => secondNumberRef.current?.focus(), 300);
|
|
106
|
+
}
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const handleTextInputChange = (text, operator) => {
|
|
110
|
+
onChangeText({ firstValue: text, operator });
|
|
111
|
+
setTextOperator(0);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const handleDateChange = (event, selectedDate) => {
|
|
115
|
+
const currentDate = selectedDate || date;
|
|
116
|
+
setDateVisibility(false);
|
|
117
|
+
setDate(currentDate);
|
|
118
|
+
handleDateInputChange(currentDate, secondDate, dateOperator);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const handleSecondDateChange = (event, selectedDate) => {
|
|
122
|
+
const currentDate = selectedDate || secondDate;
|
|
123
|
+
setSecondDateVisibility(false);
|
|
124
|
+
setSecondDate(currentDate);
|
|
125
|
+
handleDateInputChange(date, currentDate, dateOperator);
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
const handleDateOperatorClick = (value) => {
|
|
129
|
+
setDateOperator(value);
|
|
130
|
+
handleDateInputChange(date, secondDate, value);
|
|
131
|
+
if (value === 6) {setSecondDateVisibility(true);}
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const getValues = (firstValue, secondValue, operator) => {
|
|
135
|
+
return { firstValue, operator, secondValue };
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const handleInputChange = (firstValue, secondValue, operator) => {
|
|
139
|
+
onChangeText(getValues(firstValue, secondValue, operator));
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
const handleDateInputChange = (firstValue, secondValue, operator) => {
|
|
143
|
+
onChangeText(getValues(firstValue, secondValue, operator));
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
const handleSelectChange = (value) => {
|
|
147
|
+
onChangeText({ firstValue: value });
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
const handleClearInput = () => {
|
|
151
|
+
if (type === 'number') {
|
|
152
|
+
setFirstNumber('');
|
|
153
|
+
setSecondNumber('');
|
|
154
|
+
handleInputChange('', '', numberOperator);
|
|
155
|
+
} else if (type === 'date') {
|
|
156
|
+
setDate(new Date());
|
|
157
|
+
setSecondDate(new Date());
|
|
158
|
+
handleDateInputChange('', '', dateOperator);
|
|
159
|
+
} else if (type === 'select') {
|
|
160
|
+
setOption('');
|
|
161
|
+
handleSelectChange('');
|
|
162
|
+
} else {
|
|
163
|
+
setTextInput('');
|
|
164
|
+
handleTextInputChange('', textOperator);
|
|
165
|
+
}
|
|
166
|
+
setInvoiceData(prev => ({ ...prev, EditStatus: true }));
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
// Render methods
|
|
170
|
+
const renderTextInputField = () => (
|
|
171
|
+
<View style={styles.inputRow}>
|
|
172
|
+
<Menu ref={menuRef} onOpen={handleOpenMenu}>
|
|
173
|
+
<MenuTrigger>
|
|
174
|
+
<View style={styles.inputField}>
|
|
175
|
+
<Text style={inputValue.firstValue ? styles.valueText : styles.placeholderText}>
|
|
176
|
+
{inputValue.firstValue || label}
|
|
177
|
+
</Text>
|
|
178
|
+
{inputValue.firstValue && (
|
|
179
|
+
<TouchableOpacity onPress={handleClearInput} style={styles.clearButton}>
|
|
180
|
+
<Icons.FontAwesome5 name="times" size={12} color={colors.icon} />
|
|
181
|
+
</TouchableOpacity>
|
|
182
|
+
)}
|
|
183
|
+
</View>
|
|
184
|
+
</MenuTrigger>
|
|
185
|
+
<MenuOptions customStyles={styles.menuOptions}>
|
|
186
|
+
<View style={styles.menuInputContainer}>
|
|
187
|
+
<CustomTextInput
|
|
188
|
+
inputRef={menuInputRef}
|
|
189
|
+
style={styles.menuInput}
|
|
190
|
+
placeholder={label}
|
|
191
|
+
value={inputValue.firstValue}
|
|
192
|
+
onChangeText={(value) => {
|
|
193
|
+
setTextInput(value);
|
|
194
|
+
handleTextInputChange(value, textOperator);
|
|
195
|
+
setInvoiceData(prev => ({ ...prev, EditStatus: true }));
|
|
196
|
+
}}
|
|
197
|
+
onSubmitEditing={() => {
|
|
198
|
+
menuClose();
|
|
199
|
+
Keyboard.dismiss();
|
|
200
|
+
}}
|
|
201
|
+
/>
|
|
202
|
+
</View>
|
|
203
|
+
</MenuOptions>
|
|
204
|
+
</Menu>
|
|
205
|
+
<OperatorDropdown
|
|
206
|
+
options={textOperators}
|
|
207
|
+
onSelect={(val) => {
|
|
208
|
+
addTextOperators(val);
|
|
209
|
+
setTextOperator(val.datavalue);
|
|
210
|
+
handleTextInputChange(textInput, val.datavalue);
|
|
211
|
+
setInvoiceData(prev => ({ ...prev, EditStatus: true }));
|
|
212
|
+
}}
|
|
213
|
+
/>
|
|
214
|
+
</View>
|
|
215
|
+
);
|
|
216
|
+
|
|
217
|
+
const renderNumberInputField = () => (
|
|
218
|
+
<View style={styles.numberInputContainer}>
|
|
219
|
+
<View style={styles.numberInputWrapper}>
|
|
220
|
+
<TextInput
|
|
221
|
+
ref={inputRef}
|
|
222
|
+
style={styles.numberInput}
|
|
223
|
+
placeholder={label}
|
|
224
|
+
keyboardType="numeric"
|
|
225
|
+
value={firstNumber}
|
|
226
|
+
placeholderTextColor={colors.placeholder}
|
|
227
|
+
onChangeText={(value) => {
|
|
228
|
+
setFirstNumber(value);
|
|
229
|
+
handleInputChange(value, secondNumber, numberOperator);
|
|
230
|
+
onSelect();
|
|
231
|
+
setInvoiceData(prev => ({ ...prev, EditStatus: true }));
|
|
232
|
+
}}
|
|
233
|
+
/>
|
|
234
|
+
{firstNumber !== '' && (
|
|
235
|
+
<TouchableOpacity onPress={handleClearInput} style={styles.clearButton}>
|
|
236
|
+
<Icons.FontAwesome5 name="times" size={12} color={colors.icon} />
|
|
237
|
+
</TouchableOpacity>
|
|
238
|
+
)}
|
|
239
|
+
</View>
|
|
240
|
+
<OperatorDropdown
|
|
241
|
+
options={checkingOperators}
|
|
242
|
+
onSelect={(val) => {
|
|
243
|
+
addOperatorsUpdate(val);
|
|
244
|
+
handleNumberOperatorClick(val.datavalue);
|
|
245
|
+
setInvoiceData(prev => ({ ...prev, EditStatus: true }));
|
|
246
|
+
}}
|
|
247
|
+
/>
|
|
248
|
+
{numberOperator === 6 && (
|
|
249
|
+
<View style={styles.numberInputWrapper}>
|
|
250
|
+
<TextInput
|
|
251
|
+
ref={secondNumberRef}
|
|
252
|
+
style={styles.numberInput}
|
|
253
|
+
placeholder={label}
|
|
254
|
+
keyboardType="numeric"
|
|
255
|
+
value={secondNumber}
|
|
256
|
+
placeholderTextColor={colors.placeholder}
|
|
257
|
+
onChangeText={(value) => {
|
|
258
|
+
setSecondNumber(value);
|
|
259
|
+
handleInputChange(firstNumber, value, numberOperator);
|
|
260
|
+
}}
|
|
261
|
+
/>
|
|
262
|
+
{secondNumber !== '' && (
|
|
263
|
+
<TouchableOpacity onPress={() => {
|
|
264
|
+
setSecondNumber('');
|
|
265
|
+
handleInputChange(firstNumber, '', numberOperator);
|
|
266
|
+
}} style={styles.clearButton}>
|
|
267
|
+
<Icons.FontAwesome5 name="times" size={12} color={colors.icon} />
|
|
268
|
+
</TouchableOpacity>
|
|
269
|
+
)}
|
|
270
|
+
</View>
|
|
271
|
+
)}
|
|
272
|
+
</View>
|
|
273
|
+
);
|
|
274
|
+
|
|
275
|
+
const renderSelectField = () => (
|
|
276
|
+
<View style={styles.selectContainer}>
|
|
277
|
+
<Text style={option ? styles.valueText : styles.placeholderText}>
|
|
278
|
+
{option || 'Select'}
|
|
279
|
+
</Text>
|
|
280
|
+
<Menu ref={menuRef}>
|
|
281
|
+
<MenuTrigger customStyles={styles.menuTrigger}>
|
|
282
|
+
<Icons.FontAwesome5 name="chevron-down" size={14} color={colors.icon} />
|
|
283
|
+
</MenuTrigger>
|
|
284
|
+
<MenuOptions customStyles={styles.menuOptions}>
|
|
285
|
+
<CDropDownList
|
|
286
|
+
dropdownarray={genderLabels}
|
|
287
|
+
callback={(val) => {
|
|
288
|
+
handleSelectChange(val.value);
|
|
289
|
+
addOptionsUpdate(val);
|
|
290
|
+
setOption(val.displayvalue);
|
|
291
|
+
onSelect();
|
|
292
|
+
setInvoiceData(prev => ({ ...prev, EditStatus: true }));
|
|
293
|
+
}}
|
|
294
|
+
/>
|
|
295
|
+
</MenuOptions>
|
|
296
|
+
</Menu>
|
|
297
|
+
{option !== '' && (
|
|
298
|
+
<TouchableOpacity onPress={handleClearInput} style={styles.clearButton}>
|
|
299
|
+
<Icons.FontAwesome5 name="times" size={12} color={colors.icon} />
|
|
300
|
+
</TouchableOpacity>
|
|
301
|
+
)}
|
|
302
|
+
</View>
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
const renderDateField = () => (
|
|
306
|
+
<View style={styles.inputRow}>
|
|
307
|
+
<TouchableOpacity
|
|
308
|
+
onPress={() => {
|
|
309
|
+
setDateVisibility(true);
|
|
310
|
+
onSelect();
|
|
311
|
+
setInvoiceData(prev => ({ ...prev, EditStatus: true }));
|
|
312
|
+
}}
|
|
313
|
+
>
|
|
314
|
+
<View style={styles.inputField}>
|
|
315
|
+
<Text style={inputValue.firstValue ? styles.valueText : styles.placeholderText}>
|
|
316
|
+
{inputValue.firstValue ? moment(inputValue.firstValue).format('DD-MM-YYYY') : 'Select date'}
|
|
317
|
+
</Text>
|
|
318
|
+
{inputValue.firstValue && (
|
|
319
|
+
<TouchableOpacity onPress={handleClearInput} style={styles.clearButton}>
|
|
320
|
+
<Icons.FontAwesome5 name="times" size={12} color={colors.icon} />
|
|
321
|
+
</TouchableOpacity>
|
|
322
|
+
)}
|
|
323
|
+
</View>
|
|
324
|
+
</TouchableOpacity>
|
|
325
|
+
{dateVisibility && (
|
|
326
|
+
<DateTimePicker
|
|
327
|
+
value={date}
|
|
328
|
+
mode="date"
|
|
329
|
+
display={Platform.OS === 'ios' ? 'spinner' : 'default'}
|
|
330
|
+
onChange={handleDateChange}
|
|
331
|
+
/>
|
|
332
|
+
)}
|
|
333
|
+
<OperatorDropdown
|
|
334
|
+
options={checkingOperators}
|
|
335
|
+
onSelect={(val) => {
|
|
336
|
+
addOperatorsUpdate(val);
|
|
337
|
+
handleDateOperatorClick(val.datavalue);
|
|
338
|
+
setInvoiceData(prev => ({ ...prev, EditStatus: true }));
|
|
339
|
+
}}
|
|
340
|
+
/>
|
|
341
|
+
{secondDateVisibility && (
|
|
342
|
+
<DateTimePicker
|
|
343
|
+
value={secondDate}
|
|
344
|
+
mode="date"
|
|
345
|
+
display={Platform.OS === 'ios' ? 'spinner' : 'default'}
|
|
346
|
+
onChange={handleSecondDateChange}
|
|
347
|
+
/>
|
|
348
|
+
)}
|
|
349
|
+
</View>
|
|
350
|
+
);
|
|
351
|
+
|
|
352
|
+
const renderInputField = () => {
|
|
353
|
+
switch (type) {
|
|
354
|
+
case 'text':
|
|
355
|
+
case 'mobile':
|
|
356
|
+
return renderTextInputField();
|
|
357
|
+
case 'number':
|
|
358
|
+
return renderNumberInputField();
|
|
359
|
+
case 'select':
|
|
360
|
+
return renderSelectField();
|
|
361
|
+
case 'date':
|
|
362
|
+
return renderDateField();
|
|
363
|
+
default:
|
|
364
|
+
return null;
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
|
|
368
|
+
return (
|
|
369
|
+
<View style={styles.mainContainer}>
|
|
370
|
+
<TouchableOpacity
|
|
371
|
+
onPress={handleButtonClick}
|
|
372
|
+
style={[
|
|
373
|
+
styles.filterButton,
|
|
374
|
+
{
|
|
375
|
+
backgroundColor: btnBackgroundColor || colors.buttonBackground,
|
|
376
|
+
borderColor: selected ? colors.selectedBorder : (btnBorderColor || colors.defaultBorder),
|
|
377
|
+
shadowColor: selected ? colors.selectedBorder : '#000',
|
|
378
|
+
elevation: selected ? 3 : 1,
|
|
379
|
+
},
|
|
380
|
+
]}
|
|
381
|
+
activeOpacity={0.7}
|
|
382
|
+
>
|
|
383
|
+
<Icons.FontAwesome5
|
|
384
|
+
name={iconName || 'file'}
|
|
385
|
+
size={iconSize || 14}
|
|
386
|
+
color={selected ? colors.selectedIcon : (iconColor || colors.defaultIcon)}
|
|
387
|
+
/>
|
|
388
|
+
<Text
|
|
389
|
+
numberOfLines={1}
|
|
390
|
+
style={[
|
|
391
|
+
styles.buttonLabel,
|
|
392
|
+
{ color: selected ? colors.selectedText : colors.defaultText },
|
|
393
|
+
]}
|
|
394
|
+
>
|
|
395
|
+
{label}
|
|
396
|
+
</Text>
|
|
397
|
+
</TouchableOpacity>
|
|
398
|
+
<View style={styles.inputWrapper}>
|
|
399
|
+
{renderInputField()}
|
|
400
|
+
</View>
|
|
401
|
+
</View>
|
|
402
|
+
);
|
|
403
|
+
};
|
|
404
|
+
|
|
405
|
+
const OperatorDropdown = ({ options, onSelect }) => (
|
|
406
|
+
<Menu>
|
|
407
|
+
<MenuTrigger customStyles={styles.menuTrigger}>
|
|
408
|
+
<View style={styles.operatorTrigger}>
|
|
409
|
+
<Icons.FontAwesome5 name="chevron-down" size={14} color={colors.icon} />
|
|
410
|
+
</View>
|
|
411
|
+
</MenuTrigger>
|
|
412
|
+
<MenuOptions customStyles={styles.menuOptions}>
|
|
413
|
+
<CDropDownList dropdownarray={options} callback={onSelect} />
|
|
414
|
+
</MenuOptions>
|
|
415
|
+
</Menu>
|
|
416
|
+
);
|
|
417
|
+
|
|
418
|
+
// Color constants for consistent theming
|
|
419
|
+
const colors = {
|
|
420
|
+
buttonBackground: '#f5f5f5',
|
|
421
|
+
defaultBorder: '#094485',
|
|
422
|
+
selectedBorder: '#0288d1',
|
|
423
|
+
defaultIcon: '#094485',
|
|
424
|
+
selectedIcon: '#0288d1',
|
|
425
|
+
defaultText: '#094485',
|
|
426
|
+
selectedText: '#0288d1',
|
|
427
|
+
placeholder: '#9e9e9e',
|
|
428
|
+
icon: '#9e9e9e',
|
|
429
|
+
inputBorder: '#e0e0e0',
|
|
430
|
+
inputBackground: '#ffffff',
|
|
431
|
+
menuBackground: '#ffffff',
|
|
432
|
+
valueText: '#333333',
|
|
433
|
+
};
|
|
434
|
+
|
|
435
|
+
const styles = StyleSheet.create({
|
|
436
|
+
mainContainer: {
|
|
437
|
+
marginVertical: 8,
|
|
438
|
+
width: 120,
|
|
439
|
+
alignSelf: 'center',
|
|
440
|
+
marginHorizontal: 4,
|
|
441
|
+
},
|
|
442
|
+
filterButton: {
|
|
443
|
+
paddingVertical: 8,
|
|
444
|
+
paddingHorizontal: 12,
|
|
445
|
+
borderRadius: 8,
|
|
446
|
+
alignItems: 'center',
|
|
447
|
+
borderWidth: 1,
|
|
448
|
+
height: 60,
|
|
449
|
+
justifyContent: 'center',
|
|
450
|
+
backgroundColor: colors.buttonBackground,
|
|
451
|
+
shadowOffset: { width: 0, height: 2 },
|
|
452
|
+
shadowOpacity: 0.1,
|
|
453
|
+
shadowRadius: 4,
|
|
454
|
+
},
|
|
455
|
+
buttonLabel: {
|
|
456
|
+
fontSize: 12,
|
|
457
|
+
fontWeight: '500',
|
|
458
|
+
marginTop: 4,
|
|
459
|
+
},
|
|
460
|
+
inputWrapper: {
|
|
461
|
+
marginTop: 8,
|
|
462
|
+
},
|
|
463
|
+
inputRow: {
|
|
464
|
+
flexDirection: 'row',
|
|
465
|
+
alignItems: 'center',
|
|
466
|
+
},
|
|
467
|
+
inputField: {
|
|
468
|
+
height: 40,
|
|
469
|
+
borderColor: colors.inputBorder,
|
|
470
|
+
borderWidth: 1,
|
|
471
|
+
borderRadius: 8,
|
|
472
|
+
paddingHorizontal: 10,
|
|
473
|
+
width: 90,
|
|
474
|
+
backgroundColor: colors.inputBackground,
|
|
475
|
+
justifyContent: 'center',
|
|
476
|
+
flexDirection: 'row',
|
|
477
|
+
alignItems: 'center',
|
|
478
|
+
justifyContent: 'space-between',
|
|
479
|
+
},
|
|
480
|
+
placeholderText: {
|
|
481
|
+
color: colors.placeholder,
|
|
482
|
+
fontSize: 12,
|
|
483
|
+
flex: 1,
|
|
484
|
+
},
|
|
485
|
+
valueText: {
|
|
486
|
+
color: colors.valueText,
|
|
487
|
+
fontSize: 12,
|
|
488
|
+
flex: 1,
|
|
489
|
+
},
|
|
490
|
+
clearButton: {
|
|
491
|
+
padding: 4,
|
|
492
|
+
},
|
|
493
|
+
menuOptions: {
|
|
494
|
+
optionsContainer: {
|
|
495
|
+
borderRadius: 8,
|
|
496
|
+
padding: 8,
|
|
497
|
+
backgroundColor: colors.menuBackground,
|
|
498
|
+
shadowColor: '#000',
|
|
499
|
+
shadowOffset: { width: 0, height: 2 },
|
|
500
|
+
shadowOpacity: 0.2,
|
|
501
|
+
shadowRadius: 4,
|
|
502
|
+
elevation: 3,
|
|
503
|
+
minWidth: 150,
|
|
504
|
+
},
|
|
505
|
+
},
|
|
506
|
+
menuInputContainer: {
|
|
507
|
+
width: '100%',
|
|
508
|
+
padding: 8,
|
|
509
|
+
},
|
|
510
|
+
menuInput: {
|
|
511
|
+
height: 40,
|
|
512
|
+
borderColor: colors.inputBorder,
|
|
513
|
+
borderWidth: 1,
|
|
514
|
+
borderRadius: 8,
|
|
515
|
+
paddingHorizontal: 10,
|
|
516
|
+
backgroundColor: colors.inputBackground,
|
|
517
|
+
color: colors.valueText,
|
|
518
|
+
fontSize: 12,
|
|
519
|
+
},
|
|
520
|
+
menuTrigger: {
|
|
521
|
+
triggerWrapper: {
|
|
522
|
+
borderWidth: 0,
|
|
523
|
+
width: 30,
|
|
524
|
+
justifyContent: 'center',
|
|
525
|
+
alignItems: 'center',
|
|
526
|
+
},
|
|
527
|
+
},
|
|
528
|
+
operatorTrigger: {
|
|
529
|
+
width: 30,
|
|
530
|
+
height: 40,
|
|
531
|
+
justifyContent: 'center',
|
|
532
|
+
alignItems: 'center',
|
|
533
|
+
},
|
|
534
|
+
numberInputContainer: {
|
|
535
|
+
flexDirection: 'row',
|
|
536
|
+
alignItems: 'center',
|
|
537
|
+
},
|
|
538
|
+
numberInputWrapper: {
|
|
539
|
+
flexDirection: 'row',
|
|
540
|
+
alignItems: 'center',
|
|
541
|
+
flex: 1,
|
|
542
|
+
},
|
|
543
|
+
numberInput: {
|
|
544
|
+
height: 40,
|
|
545
|
+
borderColor: colors.inputBorder,
|
|
546
|
+
borderWidth: 1,
|
|
547
|
+
borderRadius: 8,
|
|
548
|
+
paddingHorizontal: 8,
|
|
549
|
+
flex: 1,
|
|
550
|
+
backgroundColor: colors.inputBackground,
|
|
551
|
+
color: colors.valueText,
|
|
552
|
+
fontSize: 12,
|
|
553
|
+
marginRight: 4,
|
|
554
|
+
},
|
|
555
|
+
selectContainer: {
|
|
556
|
+
height: 40,
|
|
557
|
+
borderColor: colors.inputBorder,
|
|
558
|
+
borderWidth: 1,
|
|
559
|
+
borderRadius: 8,
|
|
560
|
+
paddingHorizontal: 10,
|
|
561
|
+
width: '100%',
|
|
562
|
+
backgroundColor: colors.inputBackground,
|
|
563
|
+
flexDirection: 'row',
|
|
564
|
+
alignItems: 'center',
|
|
565
|
+
justifyContent: 'space-between',
|
|
566
|
+
},
|
|
567
|
+
});
|
|
568
|
+
|
|
569
|
+
export default FilterInput;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
|
+
import { View, TouchableOpacity, Text } from 'react-native';
|
|
3
|
+
import HOCIcons from '../HOC/HOCIcons';
|
|
4
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
5
|
+
|
|
6
|
+
function HSubHeading(props) {
|
|
7
|
+
|
|
8
|
+
const styles = props.styles != undefined ? props.styles : {
|
|
9
|
+
'iconname': 'file',
|
|
10
|
+
'bgcolor': '#f2efef',
|
|
11
|
+
'iconsize': 18,
|
|
12
|
+
'iconcolor': 'black',
|
|
13
|
+
'displaytext': 'Testing',
|
|
14
|
+
'textsize': 15,
|
|
15
|
+
'textcolor': 'darkblue',
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<TouchableOpacity
|
|
20
|
+
onPress={() => props.callBack(true)}
|
|
21
|
+
style={{
|
|
22
|
+
backgroundColor: styles.bgcolor != undefined ? styles.bgcolor : '#f2efef',
|
|
23
|
+
paddingVertical: 3,
|
|
24
|
+
paddingHorizontal: 6,
|
|
25
|
+
marginTop: 3,
|
|
26
|
+
marginBottom: 2,
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'row',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
justifyContent: 'center',
|
|
31
|
+
elevation: 5,
|
|
32
|
+
borderWidth: 0.5,
|
|
33
|
+
borderColor: 'lightgrey',
|
|
34
|
+
width: '88%',
|
|
35
|
+
alignSelf: 'center',
|
|
36
|
+
}}>
|
|
37
|
+
<TouchableOpacity
|
|
38
|
+
onPress={() => props.Expand != undefined ? props.Expand(1) : null}
|
|
39
|
+
disabled={props.Expand != undefined ? false : true}
|
|
40
|
+
style={{ width: normalize(20), alignItems: 'center', marginRight: 5 }}
|
|
41
|
+
>
|
|
42
|
+
<HOCIcons.Icons
|
|
43
|
+
icongroup={styles.icongroup ? styles.icongroup : 5}
|
|
44
|
+
name={styles.iconname}
|
|
45
|
+
color={styles.iconcolor}
|
|
46
|
+
size={normalize(styles.iconsize)}
|
|
47
|
+
/>
|
|
48
|
+
</TouchableOpacity>
|
|
49
|
+
|
|
50
|
+
<Text
|
|
51
|
+
style={{
|
|
52
|
+
textShadowRadius: 2,
|
|
53
|
+
fontSize: normalize(styles.textsize),
|
|
54
|
+
fontWeight: 'bold',
|
|
55
|
+
color: styles.textcolor,
|
|
56
|
+
flex: 1,
|
|
57
|
+
}}>
|
|
58
|
+
{styles.displaytext}
|
|
59
|
+
</Text>
|
|
60
|
+
|
|
61
|
+
{/* <View style={{ flexDirection: 'row', width: normalize(60), justifyContent: 'space-around' }}>
|
|
62
|
+
{props.children}
|
|
63
|
+
</View> */}
|
|
64
|
+
</TouchableOpacity>
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export default memo(HSubHeading);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { View, Text, Dimensions } from 'react-native';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
4
|
+
|
|
5
|
+
const HeaderCard = ({ suppliername, invoicenumber }) => {
|
|
6
|
+
return (
|
|
7
|
+
<View style={{
|
|
8
|
+
backgroundColor: '#fff',
|
|
9
|
+
padding: 10,
|
|
10
|
+
borderRadius: 10,
|
|
11
|
+
shadowColor: '#000',
|
|
12
|
+
shadowOpacity: 0.1,
|
|
13
|
+
shadowRadius: 5,
|
|
14
|
+
elevation: 3,
|
|
15
|
+
marginVertical: 5,
|
|
16
|
+
marginHorizontal: 5,
|
|
17
|
+
// width: Dimensions.get('screen').width * 0.92,
|
|
18
|
+
borderLeftWidth: 3,
|
|
19
|
+
borderLeftColor: '#094485',
|
|
20
|
+
}}>
|
|
21
|
+
{suppliername != undefined && suppliername != null && suppliername != '' ||
|
|
22
|
+
invoicenumber != undefined && invoicenumber != null && invoicenumber != '' ?
|
|
23
|
+
<View style={{ padding: 5 }}>
|
|
24
|
+
{suppliername != undefined && suppliername != null && suppliername != ''
|
|
25
|
+
? <Text style={{
|
|
26
|
+
fontWeight: 'bold', marginLeft: normalize(5), fontSize: normalize(14),
|
|
27
|
+
color: '#094485', marginHorizontal: normalize(5),
|
|
28
|
+
|
|
29
|
+
}}>{suppliername}</Text> : null}
|
|
30
|
+
{invoicenumber != undefined && invoicenumber != null && invoicenumber != ''
|
|
31
|
+
? <Text style={{
|
|
32
|
+
fontWeight: 'bold', marginLeft: normalize(5), fontSize: normalize(12),
|
|
33
|
+
color: '#333', marginHorizontal: normalize(5),
|
|
34
|
+
}}>{invoicenumber}</Text> : null}
|
|
35
|
+
</View> : null}
|
|
36
|
+
</View>
|
|
37
|
+
);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default HeaderCard;
|