@jescon-technologies/react-native-ui-kit 0.0.4 → 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 -2
- 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,327 @@
|
|
|
1
|
+
import React, { useState, useContext, useEffect } from 'react';
|
|
2
|
+
import { View, Text, TouchableOpacity, TextInput, FlatList, Dimensions, ScrollView } from 'react-native';
|
|
3
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
4
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
5
|
+
import CFooterView from '../CustomComponents/CFooterView';
|
|
6
|
+
import EmrResponseComponentContext from '../Handlers/emrResponseComponentContext';
|
|
7
|
+
import { getLoading, isNU, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
|
|
8
|
+
import CAwesomeButton from '../CustomComponents/CAwesomeButton';
|
|
9
|
+
import SSearchBar from '../StaticComponents/SSearchBar';
|
|
10
|
+
import SAlphabet from '../StaticComponents/SAlphabet';
|
|
11
|
+
import { getListviewItem, getListviewItemText } from '../CommonStyle/PopupStyle';
|
|
12
|
+
import { Global } from '../../../../../src/Common/Global';
|
|
13
|
+
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
14
|
+
import { NetworkServiceCall } from '@jescon-technologies/react-native-ui-kit';
|
|
15
|
+
import { useNavigation } from '../Navigation/useNavigation';
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
import Loader from '../Custom/Loader';
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
var DropDownALL = [];
|
|
22
|
+
export default function CSummaryDropDown(props) {
|
|
23
|
+
|
|
24
|
+
const { responseJSON, setResponseJSON } = useContext(EmrResponseComponentContext);
|
|
25
|
+
const hosumrclassificationnature = responseJSON.consultation[responseJSON.natureindex].hosumrclassificationnature;
|
|
26
|
+
const navigation = useNavigation();
|
|
27
|
+
const [data, setData] = useState();
|
|
28
|
+
const [routine, setRoutine] = useState();
|
|
29
|
+
const [searchData, setSearchData] = useState('');
|
|
30
|
+
const [parameterName, setParameterName] = useState('');
|
|
31
|
+
const [refresh, setRefresh] = useState(0);
|
|
32
|
+
const [stage, setStage] = useState(1);
|
|
33
|
+
const [selected, setSelected] = useState(0);
|
|
34
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
35
|
+
const [alphaFilter, setAlphaFilter] = useState(false);
|
|
36
|
+
const [filterPurpose, setFilterPurpose] = useState([]);
|
|
37
|
+
const [tempString, settempString] = useState([]);
|
|
38
|
+
const [displayData, setDisplayData] = useState([]);
|
|
39
|
+
const [selectedValue, setSelectedValue] = useState(props.value);
|
|
40
|
+
const [edituser, setEditUser] = useState();
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
setAlphaFilter(false);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
FetchDropdownList();
|
|
49
|
+
}, []);
|
|
50
|
+
|
|
51
|
+
function FetchDropdownList() {
|
|
52
|
+
setSearchData('');
|
|
53
|
+
setIsLoading(true);
|
|
54
|
+
let buttonapi = APIURL + 'emr/emrcommonget/rnsummarydropdown ' + Global.userData.hosuconsultant + ',' + hosumrclassificationnature;
|
|
55
|
+
console.log('JJJJJJJMMMMMMMMMHHHHHHHHHHHHHHHHH3', buttonapi);
|
|
56
|
+
NetworkServiceCall('get', buttonapi, '')
|
|
57
|
+
.then(function (response) {
|
|
58
|
+
if (response.data.data != null && response.data.data != undefined) {
|
|
59
|
+
DropDownALL = response.data.data;
|
|
60
|
+
setDisplayData(response.data.data);
|
|
61
|
+
setIsLoading(false);
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
setDisplayData([]);
|
|
65
|
+
setIsLoading(false);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function getNavigateToSummary() {
|
|
71
|
+
navigation.navigate('SummaryTemplate', { type: 1 });
|
|
72
|
+
props.visibility(false);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function getAllTabFunctions(key) {
|
|
76
|
+
switch (key) {
|
|
77
|
+
case 'ALL01': getRetrival(1);
|
|
78
|
+
break;
|
|
79
|
+
case 'ALL02': getRetrival(2);
|
|
80
|
+
break;
|
|
81
|
+
default: break;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function getRetrival(type) {
|
|
86
|
+
|
|
87
|
+
var x = tempString.toString();
|
|
88
|
+
var procedurename = 'rnhomrsummarytemplate '; // rnlatemplatesummaryretrival_01112024 rnlatemplatesummaryretrival
|
|
89
|
+
setIsLoading(true);
|
|
90
|
+
let buttonapi = APIURL + 'emr/emrcommonget/' + procedurename + type + ',' + Global.PatientDetails.hopapatient + ',' + Global.userData.hosuconsultant + ',' + hosumrclassificationnature + ',' + x + ',' + Global.ParameterInfo.homrpatientchart;
|
|
91
|
+
console.log('getRetrival buttonapi', buttonapi);
|
|
92
|
+
|
|
93
|
+
NetworkServiceCall('get', buttonapi, '')
|
|
94
|
+
.then(function (response) {
|
|
95
|
+
if (response.data.NewData != null && response.data.NewData != undefined && responseJSON.consultationEdit.NewData != undefined) {
|
|
96
|
+
if (type == 1) {
|
|
97
|
+
|
|
98
|
+
// console.log('response.data.NewData', JSON.stringify([response.data.NewData[0]]));
|
|
99
|
+
|
|
100
|
+
const updatedResponseJSON = {
|
|
101
|
+
...responseJSON,
|
|
102
|
+
editStatus: true,
|
|
103
|
+
consultation: [...responseJSON.consultation],
|
|
104
|
+
};
|
|
105
|
+
const natureindex = updatedResponseJSON.natureindex ?? 0;
|
|
106
|
+
updatedResponseJSON.consultation[natureindex] = {
|
|
107
|
+
...updatedResponseJSON.consultation[natureindex],
|
|
108
|
+
editStatus: true,
|
|
109
|
+
NewData: [...updatedResponseJSON.consultation[natureindex].NewData],
|
|
110
|
+
};
|
|
111
|
+
updatedResponseJSON.consultation[natureindex].NewData = [response.data.NewData[0]];
|
|
112
|
+
setResponseJSON(updatedResponseJSON);
|
|
113
|
+
|
|
114
|
+
navigation.navigate('ConsultationEdit', { data: updatedResponseJSON.consultation[updatedResponseJSON.natureindex].NewData[0].editArray, parent: updatedResponseJSON.consultation[updatedResponseJSON.natureindex] });
|
|
115
|
+
|
|
116
|
+
setIsLoading(false);
|
|
117
|
+
props.visibility(false);
|
|
118
|
+
|
|
119
|
+
// responseJSON.consultationEdit.NewData = [];
|
|
120
|
+
// responseJSON.consultationEdit.editStatus = true;
|
|
121
|
+
// setTimeout(() => {
|
|
122
|
+
// responseJSON.consultationEdit.NewData.push(response.data.NewData[0]);
|
|
123
|
+
// navigation.navigate('ConsultationEdit', { data: responseJSON.consultationEdit.NewData[0].editArray, parent: responseJSON.consultationEdit });
|
|
124
|
+
// setResponseJSON({
|
|
125
|
+
// ...responseJSON,
|
|
126
|
+
// "consultationEdit": responseJSON.consultationEdit
|
|
127
|
+
// });
|
|
128
|
+
// setIsLoading(false);
|
|
129
|
+
// props.visibility(false);
|
|
130
|
+
// });
|
|
131
|
+
|
|
132
|
+
} else {
|
|
133
|
+
navigation.navigate('SummaryTemplate', { type: 2, data: response.data.NewData });
|
|
134
|
+
setIsLoading(false);
|
|
135
|
+
props.visibility(false);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
setIsLoading(false);
|
|
140
|
+
props.visibility(false);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
getLoading(v => setIsLoading(false));
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function renderItem(data) {
|
|
147
|
+
|
|
148
|
+
return (
|
|
149
|
+
data.item.displayvalue != undefined && data.item.displayvalue != '' ?
|
|
150
|
+
<TouchableOpacity
|
|
151
|
+
style={[getListviewItem(data.item.selected), { flexDirection: 'row', alignItems: 'center' }]}
|
|
152
|
+
onPress={() => onSelectItem(data.item, false)}
|
|
153
|
+
activeOpacity={0.5}
|
|
154
|
+
>
|
|
155
|
+
<Icons.FontAwesome name="dot-circle-o" color={Global.AppTheme.primary_color} size={normalize(10)}
|
|
156
|
+
style={{ paddingHorizontal: normalize(2), paddingLeft: normalize(4) }} />
|
|
157
|
+
<Text style={selectedValue != null && selectedValue != undefined ? selectedValue == item.datavalue ? getListviewItemText(true) : getListviewItemText(false) : getListviewItemText(false)}>
|
|
158
|
+
{data.item.displayvalue.toUpperCase()}
|
|
159
|
+
</Text>
|
|
160
|
+
</TouchableOpacity>
|
|
161
|
+
: null
|
|
162
|
+
);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function onSelectItem(datavalue, multiselect) {
|
|
166
|
+
if (multiselect == true) {
|
|
167
|
+
if (tempString.includes(datavalue.datavalue)) {
|
|
168
|
+
datavalue.selected = !datavalue.selected;
|
|
169
|
+
setSelected(selected + 1);
|
|
170
|
+
var index = tempString.indexOf(datavalue.datavalue);
|
|
171
|
+
if (index > -1) {
|
|
172
|
+
tempString.splice(index, 1);
|
|
173
|
+
}
|
|
174
|
+
} else {
|
|
175
|
+
datavalue.selected = !datavalue.selected;
|
|
176
|
+
setSelected(selected + 1);
|
|
177
|
+
tempString.push(datavalue.datavalue);
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
displayData.map((sub) => sub.selected = false);
|
|
181
|
+
datavalue.selected = true;
|
|
182
|
+
tempString.splice(0, tempString.length);
|
|
183
|
+
tempString.push(datavalue.datavalue);
|
|
184
|
+
setEditUser(datavalue);
|
|
185
|
+
setSelected(selected + 1);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function getAlphabetData(alpha, index) {
|
|
190
|
+
var filter = displayData.filter(value => (value.displayvalue != undefined ? value.displayvalue : '').charAt(0) == alpha);
|
|
191
|
+
setFilterPurpose(filter);
|
|
192
|
+
index == 0 ? setSearchData('') : setSearchData(alpha);
|
|
193
|
+
index == 0 ? setAlphaFilter(false) : setAlphaFilter(true);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function GetDropdown(data) {
|
|
197
|
+
const newDropDownData = data.filter(function (item) {
|
|
198
|
+
const dataItem = item.displayvalue ? item.displayvalue.toUpperCase() : ''.toUpperCase();
|
|
199
|
+
const textData = searchData.toUpperCase();
|
|
200
|
+
return dataItem.indexOf(textData) > -1;
|
|
201
|
+
});
|
|
202
|
+
return (
|
|
203
|
+
<View style={{ flexDirection: 'row' }}>
|
|
204
|
+
<FlatList
|
|
205
|
+
data={newDropDownData}
|
|
206
|
+
renderItem={renderItem}
|
|
207
|
+
initialNumToRender={10}
|
|
208
|
+
maxToRenderPerBatch={20}
|
|
209
|
+
keyExtractor={(item, index) => 'key' + index}
|
|
210
|
+
/>
|
|
211
|
+
|
|
212
|
+
<SAlphabet
|
|
213
|
+
callBack={val =>
|
|
214
|
+
val == undefined ? null : getAlphabetData(val.alpha, val.index)
|
|
215
|
+
} />
|
|
216
|
+
</View>
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return (
|
|
221
|
+
<View style={{ marginTop: normalize(-5) }}>
|
|
222
|
+
{isLoading ?
|
|
223
|
+
<Loader displaytext={true} />
|
|
224
|
+
: null}
|
|
225
|
+
<Text style={{ alignSelf: 'center', fontSize: normalize(12), fontWeight: 'bold', marginBottom: normalize(2), color: Global.AppTheme.primary_color }}>{ValueCheck(responseJSON) && ValueCheck(responseJSON.consultationEdit) && ValueCheck(responseJSON.consultationEdit.heading) ? responseJSON.consultationEdit.heading : 'SUMMARY'}</Text>
|
|
226
|
+
|
|
227
|
+
<View style={{
|
|
228
|
+
flexDirection: 'row', backgroundColor: '#fff', width: '100%', borderRadius: 6,
|
|
229
|
+
justifyContent: 'space-evenly', height: normalize(45), alignItems: 'center', marginRight: normalize(8),
|
|
230
|
+
}}>
|
|
231
|
+
{[{ 'iconname': 'archive', 'displayvalue': 'ALL', 'color': Global.AppTheme.primary_color, 'shadowcolor': '#fff', 'stage': 1 },
|
|
232
|
+
{ 'iconname': 'add-to-list', 'displayvalue': 'CREATE', 'color': Global.AppTheme.primary_color, 'shadowcolor': '#fff', 'stage': 2 }].map((buttons, i) => {
|
|
233
|
+
return (
|
|
234
|
+
<TouchableOpacity
|
|
235
|
+
key={i}
|
|
236
|
+
onPress={() => buttons.stage == 1 ? setStage(buttons.stage) : getNavigateToSummary()}
|
|
237
|
+
style={{
|
|
238
|
+
borderRadius: 7,
|
|
239
|
+
borderWidth: 1,
|
|
240
|
+
height: normalize(35),
|
|
241
|
+
width: normalize(50),
|
|
242
|
+
backgroundColor: stage == buttons.stage ? '#eaf2ff' : '#fff',
|
|
243
|
+
borderColor: stage == buttons.stage ? '#eaf2ff' : Global.AppTheme.primary_color,
|
|
244
|
+
alignItems: 'center',
|
|
245
|
+
justifyContent: 'center',
|
|
246
|
+
padding: 0,
|
|
247
|
+
elevation: 1,
|
|
248
|
+
shadowColor: '#000',
|
|
249
|
+
shadowOffset: { width: 0, height: 1 },
|
|
250
|
+
shadowOpacity: 0.2,
|
|
251
|
+
shadowRadius: 1,
|
|
252
|
+
}}
|
|
253
|
+
>
|
|
254
|
+
<View style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}>
|
|
255
|
+
<Icons.Entypo name={buttons.iconname} style={{ paddingRight: 0 }}
|
|
256
|
+
color={Global.AppTheme.primary_color} size={normalize(17)} />
|
|
257
|
+
<Text style={{
|
|
258
|
+
color: Global.AppTheme.primary_color,
|
|
259
|
+
fontSize: normalize(10),
|
|
260
|
+
fontWeight: stage == buttons.stage ? 'bold' : 'normal',
|
|
261
|
+
}}>{buttons.displayvalue}</Text>
|
|
262
|
+
</View>
|
|
263
|
+
</TouchableOpacity>
|
|
264
|
+
);
|
|
265
|
+
})}
|
|
266
|
+
</View>
|
|
267
|
+
|
|
268
|
+
{stage == 1 ?
|
|
269
|
+
<View style={{ flex: 1 }}>
|
|
270
|
+
<View style={{ flexDirection: 'row', marginTop: normalize(5) }}>
|
|
271
|
+
<SSearchBar
|
|
272
|
+
onChangeText={val => setSearchData(val)}
|
|
273
|
+
/>
|
|
274
|
+
</View>
|
|
275
|
+
|
|
276
|
+
<View style={{ flexDirection: 'row', justifyContent: 'space-between', flex: 1 }}>
|
|
277
|
+
<View style={{ flex: 1 }}>
|
|
278
|
+
{GetDropdown(alphaFilter ? filterPurpose : displayData)}
|
|
279
|
+
</View>
|
|
280
|
+
</View>
|
|
281
|
+
</View>
|
|
282
|
+
: null}
|
|
283
|
+
|
|
284
|
+
{stage == 1 ?
|
|
285
|
+
<CFooterView style={{ borderRadius: normalize(10), backgroundColor: '#fff' }}>
|
|
286
|
+
<View style={{ flexDirection: 'row' }}>
|
|
287
|
+
{[{
|
|
288
|
+
'displaytext': 'Select',
|
|
289
|
+
'fontcolor': Global.AppTheme.primary_color,
|
|
290
|
+
'shadowcolor': '#f1f3f6',
|
|
291
|
+
'size': 10,
|
|
292
|
+
'iconname': 'file-medical',
|
|
293
|
+
'iconcolor': Global.AppTheme.primary_color,
|
|
294
|
+
'selected': false,
|
|
295
|
+
'visibility': true,
|
|
296
|
+
'iconsize': 20,
|
|
297
|
+
'functionid': 'ALL01',
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
'displaytext': 'Edit',
|
|
301
|
+
'fontcolor': Global.AppTheme.primary_color,
|
|
302
|
+
'shadowcolor': '#f1f3f6',
|
|
303
|
+
'size': 10,
|
|
304
|
+
'iconname': 'edit',
|
|
305
|
+
'iconcolor': Global.AppTheme.primary_color,
|
|
306
|
+
'selected': false,
|
|
307
|
+
'visibility': isNU(edituser) ? true : false, // isNU(edituser) && edituser.editstatus ? true : false,
|
|
308
|
+
'iconsize': 20,
|
|
309
|
+
'functionid': 'ALL02',
|
|
310
|
+
}].map((item, i) => {
|
|
311
|
+
return (
|
|
312
|
+
item.visibility ?
|
|
313
|
+
<View key={i} style={{ borderRadius: normalize(10), paddingLeft: normalize(10) }}>
|
|
314
|
+
<CAwesomeButton
|
|
315
|
+
data={item}
|
|
316
|
+
callBack={val => val == undefined ? null : getAllTabFunctions(item.functionid)}
|
|
317
|
+
/>
|
|
318
|
+
</View>
|
|
319
|
+
: null
|
|
320
|
+
);
|
|
321
|
+
})}
|
|
322
|
+
</View>
|
|
323
|
+
</CFooterView> : null}
|
|
324
|
+
|
|
325
|
+
</View>
|
|
326
|
+
);
|
|
327
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
|
+
import { Text, TouchableOpacity } from 'react-native';
|
|
3
|
+
import FontAwesome5 from 'react-native-vector-icons/FontAwesome5';
|
|
4
|
+
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
5
|
+
import { notifyMessage } from '../CommonStyle/ComponentFunctions';
|
|
6
|
+
import { normalize } from '../CommonStyle/componentStyle';
|
|
7
|
+
|
|
8
|
+
export default function CVectorIcon(props) {
|
|
9
|
+
const [data, setData] = useState(props.data);
|
|
10
|
+
return (
|
|
11
|
+
<TouchableOpacity
|
|
12
|
+
disabled={data.disabled != undefined ? data.disabled : false}
|
|
13
|
+
style={{ alignItems: 'center', width: data.width != undefined ? normalize(70) : normalize(50) }}
|
|
14
|
+
onPress={() => data.functionid != undefined ? getCallBack(data) : notifyMessage('Incorporate soon',3)}>
|
|
15
|
+
<Icons.FontAwesome5 name={data.iconname != undefined ? data.iconname : 'file'}
|
|
16
|
+
color={data.iconcolor != undefined ? data.iconcolor : 'white'}
|
|
17
|
+
size={data.iconsize != undefined ? normalize(data.iconsize) : normalize(20)} />
|
|
18
|
+
<Text
|
|
19
|
+
numberOfLines={1}
|
|
20
|
+
style={{
|
|
21
|
+
// flex:1,
|
|
22
|
+
width:normalize(50),
|
|
23
|
+
color: data.fontcolor != undefined ? data.fontcolor : '#fff',
|
|
24
|
+
textAlign: data.textAlign != undefined ? data.textAlign : 'center',
|
|
25
|
+
fontSize: data.size != undefined ? normalize(data.size) : normalize(10),
|
|
26
|
+
fontWeight: data.fontWeight != undefined ? data.fontWeight : 'normal',
|
|
27
|
+
}}>{data.displaytext != undefined ? data.displaytext : ''}</Text>
|
|
28
|
+
</TouchableOpacity>
|
|
29
|
+
);
|
|
30
|
+
|
|
31
|
+
function getCallBack(item) {
|
|
32
|
+
props.callBack(item);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { Platform } from 'react-native';
|
|
3
|
+
import { WebView } from 'react-native-webview';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const HtmlContentViewer = ({
|
|
7
|
+
htmlContent,
|
|
8
|
+
uri,
|
|
9
|
+
width = '100%',
|
|
10
|
+
height = 500,
|
|
11
|
+
iframeRef: externalIframeRef,
|
|
12
|
+
onLoad,
|
|
13
|
+
onMessage,
|
|
14
|
+
}) => {
|
|
15
|
+
const internalIframeRef = useRef(null);
|
|
16
|
+
const iframeRef = externalIframeRef || internalIframeRef;
|
|
17
|
+
|
|
18
|
+
// ✅ Hook is ALWAYS called
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
if (Platform.OS === 'web' && iframeRef.current) {
|
|
21
|
+
const iframe = iframeRef.current;
|
|
22
|
+
const doc =
|
|
23
|
+
iframe.contentDocument || iframe.contentWindow?.document;
|
|
24
|
+
|
|
25
|
+
if (doc) {
|
|
26
|
+
doc.open();
|
|
27
|
+
doc.write(htmlContent);
|
|
28
|
+
doc.close();
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}, [htmlContent]);
|
|
32
|
+
|
|
33
|
+
// 🌐 Web / Electron
|
|
34
|
+
if (Platform.OS === 'web') {
|
|
35
|
+
return htmlContent ? (
|
|
36
|
+
<iframe
|
|
37
|
+
ref={iframeRef}
|
|
38
|
+
title="html-content"
|
|
39
|
+
style={{ width, height, border: 'none' }}
|
|
40
|
+
/>
|
|
41
|
+
) : (
|
|
42
|
+
<iframe
|
|
43
|
+
src={uri}
|
|
44
|
+
title="uri-content"
|
|
45
|
+
style={{ width, height, border: 'none' }}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// 📱 Android / iOS
|
|
51
|
+
return (
|
|
52
|
+
<WebView
|
|
53
|
+
androidHardwareAccelerationDisabled
|
|
54
|
+
scalesPageToFit
|
|
55
|
+
mixedContentMode="compatibility"
|
|
56
|
+
originWhitelist={['*']}
|
|
57
|
+
source={htmlContent ? { html: htmlContent } : { uri }}
|
|
58
|
+
onLoad={onLoad}
|
|
59
|
+
onMessage={onMessage}
|
|
60
|
+
style={{ width, height }}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export default HtmlContentViewer;
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { Platform, View, ActivityIndicator, StyleSheet } from 'react-native';
|
|
3
|
+
import Pdf from 'react-native-pdf';
|
|
4
|
+
|
|
5
|
+
const PdfContentViewer = ({
|
|
6
|
+
link,
|
|
7
|
+
style,
|
|
8
|
+
onLoadComplete,
|
|
9
|
+
onError,
|
|
10
|
+
}) => {
|
|
11
|
+
const [isLoading, setIsLoading] = useState(true);
|
|
12
|
+
const [localPdfUrl, setLocalPdfUrl] = useState(null);
|
|
13
|
+
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
async function preparePdf() {
|
|
16
|
+
if (!link) {return;}
|
|
17
|
+
console.log('Preparing PDF from link:', link);
|
|
18
|
+
setIsLoading(true);
|
|
19
|
+
try {
|
|
20
|
+
if (Platform.OS === 'web') {
|
|
21
|
+
const localPath = await window.electronAPI.openPdfPreview(link);
|
|
22
|
+
setLocalPdfUrl(localPath);
|
|
23
|
+
} else {
|
|
24
|
+
setLocalPdfUrl(link);
|
|
25
|
+
}
|
|
26
|
+
} catch (err) {
|
|
27
|
+
console.error('PDF prepare error', err);
|
|
28
|
+
onError?.(err);
|
|
29
|
+
} finally {
|
|
30
|
+
setIsLoading(false);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
preparePdf();
|
|
35
|
+
return () => (mounted = false);
|
|
36
|
+
}, [link]);
|
|
37
|
+
|
|
38
|
+
if (!localPdfUrl) {return null;}
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<View style={[styles.container, style]}>
|
|
42
|
+
{isLoading && (
|
|
43
|
+
<View style={styles.loader}>
|
|
44
|
+
<ActivityIndicator size="large" />
|
|
45
|
+
</View>
|
|
46
|
+
)}
|
|
47
|
+
{Platform.OS === 'web' ? (
|
|
48
|
+
<iframe
|
|
49
|
+
src={localPdfUrl}
|
|
50
|
+
style={styles.pdfView}
|
|
51
|
+
title="PDF Viewer"
|
|
52
|
+
onLoad={() => onLoadComplete?.(localPdfUrl)}
|
|
53
|
+
onError={(e) => onError?.(e)}
|
|
54
|
+
/>
|
|
55
|
+
) : (
|
|
56
|
+
<Pdf
|
|
57
|
+
onLoadProgress={n => { }}
|
|
58
|
+
trustAllCerts={false}
|
|
59
|
+
onPressLink={uri => { }}
|
|
60
|
+
onPageChanged={(page, numberOfPages) => { }}
|
|
61
|
+
source={{ uri: localPdfUrl }}
|
|
62
|
+
style={styles.pdfView}
|
|
63
|
+
onLoadComplete={(pages, path) =>
|
|
64
|
+
onLoadComplete?.(path, pages)
|
|
65
|
+
}
|
|
66
|
+
onError={onError}
|
|
67
|
+
/>
|
|
68
|
+
)}
|
|
69
|
+
</View>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default PdfContentViewer;
|
|
74
|
+
|
|
75
|
+
const styles = StyleSheet.create({
|
|
76
|
+
container: { flex: 1 },
|
|
77
|
+
pdfView: {
|
|
78
|
+
flex: 1,
|
|
79
|
+
width: '100%',
|
|
80
|
+
height: '100%',
|
|
81
|
+
borderWidth: 0,
|
|
82
|
+
},
|
|
83
|
+
loader: {
|
|
84
|
+
...StyleSheet.absoluteFillObject,
|
|
85
|
+
justifyContent: 'center',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
zIndex: 10,
|
|
88
|
+
backgroundColor: 'rgba(255,255,255,0.6)',
|
|
89
|
+
},
|
|
90
|
+
});
|