@jescon-technologies/react-native-ui-kit 0.0.6 → 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
package/src/Json/Footer.json
DELETED
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"componentFooter": [
|
|
3
|
-
{
|
|
4
|
-
"itemid": 1,
|
|
5
|
-
"iconname": "save",
|
|
6
|
-
"heading": "Save",
|
|
7
|
-
"functionname": "save",
|
|
8
|
-
"componentname": "CODropdownAPI",
|
|
9
|
-
"name": "Save"
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
"itemid": 2,
|
|
13
|
-
"iconname": "check-square-o",
|
|
14
|
-
"heading": "Verify",
|
|
15
|
-
"functionname": "screen",
|
|
16
|
-
"componentname": "Verification",
|
|
17
|
-
"name": "Verify"
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"itemid": 3,
|
|
21
|
-
"iconname": "eyedropper",
|
|
22
|
-
"heading": "Lab Results",
|
|
23
|
-
"functionname": "labresults",
|
|
24
|
-
"componentname": "CLabChart",
|
|
25
|
-
"name": "Lab Results"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"itemid": 4,
|
|
29
|
-
"iconname": "file-text-o",
|
|
30
|
-
"heading": "Add Nature",
|
|
31
|
-
"functionname": "overlay",
|
|
32
|
-
"componentname": "AddScreenOverlay",
|
|
33
|
-
"buttonapi": "emr/emrcommonget/exec rndddaaddclassificationnature",
|
|
34
|
-
"name": "Add Nature"
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
"itemid": 7,
|
|
38
|
-
"iconname": "th-list",
|
|
39
|
-
"heading": "More",
|
|
40
|
-
"functionname": "exit",
|
|
41
|
-
"componentname": "CODropdownAPI",
|
|
42
|
-
"name": "More",
|
|
43
|
-
"morebuttons": [
|
|
44
|
-
{
|
|
45
|
-
"itemid": 51,
|
|
46
|
-
"iconname": "list-ul",
|
|
47
|
-
"heading": "MicroTemplate",
|
|
48
|
-
"buttonapi": "emr/emrcommonget/exec rndddatemplate",
|
|
49
|
-
"functionname": "overlay",
|
|
50
|
-
"componentname": "AddScreenOverlay"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"itemid": 53,
|
|
54
|
-
"iconname": "list-alt",
|
|
55
|
-
"heading": "Template",
|
|
56
|
-
"buttonapi": "emr/emrcommonget/exec rndddatemplate",
|
|
57
|
-
"functionname": "overlay",
|
|
58
|
-
"componentname": "AddScreenOverlay"
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
"itemid": 1,
|
|
62
|
-
"iconname": "star-o",
|
|
63
|
-
"heading": "SaveAs Template",
|
|
64
|
-
"buttonapi": "",
|
|
65
|
-
"functionname": "screen",
|
|
66
|
-
"componentname": "SaveAsTemplate"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"itemid": 5,
|
|
70
|
-
"iconname": "folder",
|
|
71
|
-
"heading": "Files",
|
|
72
|
-
"buttonapi": "",
|
|
73
|
-
"functionname": "context",
|
|
74
|
-
"componentname": "FileExplorer"
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
}
|
package/src/Media/AudioScreen.js
DELETED
|
@@ -1,342 +0,0 @@
|
|
|
1
|
-
import React, {useState, useEffect, memo, useContext} from 'react';
|
|
2
|
-
import {
|
|
3
|
-
SafeAreaView,
|
|
4
|
-
Image,
|
|
5
|
-
StyleSheet,
|
|
6
|
-
Dimensions,
|
|
7
|
-
Button,
|
|
8
|
-
FlatList,
|
|
9
|
-
Text,
|
|
10
|
-
View,
|
|
11
|
-
TouchableOpacity,
|
|
12
|
-
ActivityIndicator,
|
|
13
|
-
PermissionsAndroid,
|
|
14
|
-
} from 'react-native';
|
|
15
|
-
import {audioURL, APIURL} from '../../../../../src/Common/apiConstants';
|
|
16
|
-
import Fontisto from 'react-native-vector-icons/Fontisto';
|
|
17
|
-
import AntDesign from 'react-native-vector-icons/AntDesign';
|
|
18
|
-
import CAudioPlay from '../Media/CAudioPlay';
|
|
19
|
-
// import DocumentPicker from 'react-native-document-picker';
|
|
20
|
-
import { useNavigation } from '../Navigation/useNavigation';
|
|
21
|
-
|
|
22
|
-
import ReactNativeBlobUtil from 'react-native-blob-util';
|
|
23
|
-
import Sound from 'react-native-sound';
|
|
24
|
-
import SSpeedDial from '../StaticComponents/SSpeedDial';
|
|
25
|
-
import {Global} from '../../../../../src/Common/Global';
|
|
26
|
-
|
|
27
|
-
function AudioScreen(props) {
|
|
28
|
-
const navigation = useNavigation();
|
|
29
|
-
const [data, setData] = useState(
|
|
30
|
-
props?.data?.savedaudio ? props.data.savedaudio : null,
|
|
31
|
-
//props.route.params.gallery.savedaudio
|
|
32
|
-
);
|
|
33
|
-
// console.log("savedaudio",JSON.stringify(data));
|
|
34
|
-
const [refreshCount, setrefreshCount] = useState(1); // TO refresh the page when add something on page
|
|
35
|
-
const [mediaUrlLink, setMediaUrlLink] = useState(false);
|
|
36
|
-
const [isAudioShow, setAudioShow] = useState(false);
|
|
37
|
-
const [deleteAudio, setDeleteAudio] = useState(false);
|
|
38
|
-
const [open, setOpen] = useState(true);
|
|
39
|
-
const [loading, setLoading] = useState(false);
|
|
40
|
-
const [process, setProcess] = useState('');
|
|
41
|
-
const [disablesave, setDisablesave] = useState(true);
|
|
42
|
-
useEffect(() => {
|
|
43
|
-
props.setData(data);
|
|
44
|
-
}, [data]);
|
|
45
|
-
|
|
46
|
-
function firebaseimagesave() {
|
|
47
|
-
console.log('firebaseimagesaveeeeeeeeee', data);
|
|
48
|
-
data.map(item => {
|
|
49
|
-
if (item.uritype == false) {
|
|
50
|
-
firebaseupload(item);
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const firebaseupload = async item => {
|
|
56
|
-
console.log('firebaseupload', item.uri);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
function deleteSelectedAudio(itemid) {
|
|
60
|
-
data
|
|
61
|
-
.filter(item => item.deletestatus === true)
|
|
62
|
-
.forEach(item => data.splice(data.indexOf(item), 1));
|
|
63
|
-
setDeleteAudio(!deleteAudio);
|
|
64
|
-
setrefreshCount(refreshCount + 1);
|
|
65
|
-
}
|
|
66
|
-
function changeStatus(data) {
|
|
67
|
-
data.item.deletestatus = !data.item.deletestatus;
|
|
68
|
-
setrefreshCount(refreshCount + 1);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function retrievefirebaseimage(data) {}
|
|
72
|
-
|
|
73
|
-
function renderAudio(data) {
|
|
74
|
-
// retrievefirebaseimage(data)
|
|
75
|
-
return data.item.filename ? (
|
|
76
|
-
<View style={{flexDirection: 'row'}}>
|
|
77
|
-
<View style={{alignItems: 'center', flexDirection: 'row'}}>
|
|
78
|
-
<TouchableOpacity onLongPress={() => setDeleteAudio(true)}>
|
|
79
|
-
<CAudioPlay
|
|
80
|
-
audio={audioURL + data.item.filename}
|
|
81
|
-
component={data.item.file}
|
|
82
|
-
navigation={props.navigation}
|
|
83
|
-
deleterequest={val =>
|
|
84
|
-
val == undefined ? null : Delete_Media(val)
|
|
85
|
-
}
|
|
86
|
-
/>
|
|
87
|
-
</TouchableOpacity>
|
|
88
|
-
|
|
89
|
-
{deleteAudio ? (
|
|
90
|
-
<TouchableOpacity onPress={() => changeStatus(data)}>
|
|
91
|
-
<View style={{justifyContent: 'center', alignItems: 'center'}}>
|
|
92
|
-
<Fontisto
|
|
93
|
-
name={
|
|
94
|
-
!data.item.deletestatus
|
|
95
|
-
? 'checkbox-passive'
|
|
96
|
-
: 'checkbox-active'
|
|
97
|
-
}
|
|
98
|
-
size={25}
|
|
99
|
-
color={!data.item.deletestatus ? 'lightgrey' : 'blue'}
|
|
100
|
-
/>
|
|
101
|
-
</View>
|
|
102
|
-
</TouchableOpacity>
|
|
103
|
-
) : null}
|
|
104
|
-
</View>
|
|
105
|
-
</View>
|
|
106
|
-
) : null;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
const getResolvedPath = async (uri, filen) => {
|
|
110
|
-
const fileBase64 = await ReactNativeBlobUtil.fs.readFile(uri, 'base64');
|
|
111
|
-
const relativePath = ReactNativeBlobUtil.fs.dirs.CacheDir;
|
|
112
|
-
//const fileName = `${Date.now()}.aac`
|
|
113
|
-
const fileName = `${filen}`;
|
|
114
|
-
const path = `${relativePath}/${fileName}`;
|
|
115
|
-
|
|
116
|
-
// Create temporary file
|
|
117
|
-
await ReactNativeBlobUtil.fs.writeFile(path, fileBase64, 'base64');
|
|
118
|
-
return {relativePath, fileName, path};
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
const isPermitted = async () => {
|
|
122
|
-
if (Platform.OS === 'android') {
|
|
123
|
-
try {
|
|
124
|
-
const granted = await PermissionsAndroid.request(
|
|
125
|
-
PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
|
|
126
|
-
);
|
|
127
|
-
return granted === PermissionsAndroid.RESULTS.GRANTED;
|
|
128
|
-
} catch (err) {
|
|
129
|
-
alert('Write permission err', err);
|
|
130
|
-
return false;
|
|
131
|
-
}
|
|
132
|
-
} else {
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
|
|
137
|
-
async function browseFromDevice() {
|
|
138
|
-
if (await isPermitted()) {
|
|
139
|
-
try {
|
|
140
|
-
const res = await DocumentPicker.pick({
|
|
141
|
-
type: [DocumentPicker.types.audio],
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
const {relativePath, fileName, path} = await getResolvedPath(
|
|
145
|
-
res[0].uri,
|
|
146
|
-
res[0].name,
|
|
147
|
-
);
|
|
148
|
-
console.log('res[0].uri', JSON.stringify(res[0].uri));
|
|
149
|
-
console.log('res[0].name', JSON.stringify(res[0].name));
|
|
150
|
-
console.log('relativePath', JSON.stringify(relativePath));
|
|
151
|
-
console.log('fileName', JSON.stringify(fileName));
|
|
152
|
-
console.log('path', JSON.stringify(path));
|
|
153
|
-
let dataset = {
|
|
154
|
-
uri: 'file://' + path,
|
|
155
|
-
filetype: res[0].type,
|
|
156
|
-
filename: res[0].name,
|
|
157
|
-
uritype: false,
|
|
158
|
-
};
|
|
159
|
-
console.log('dataset', JSON.stringify(dataset));
|
|
160
|
-
const localAudio = new Sound(fileName, relativePath, error => {
|
|
161
|
-
if (error) {
|
|
162
|
-
console.log('failed to load the sound', error);
|
|
163
|
-
return;
|
|
164
|
-
}
|
|
165
|
-
// Loaded audio successfully
|
|
166
|
-
const audioDuration = localAudio.getDuration();
|
|
167
|
-
if (!audioDuration) {return;} // Audio length could not be estimated
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
Media_Upload(dataset);
|
|
171
|
-
} catch (err) {
|
|
172
|
-
if (DocumentPicker.isCancel(err)) {
|
|
173
|
-
// User cancelled the picker, exit any dialogs or menus and move on
|
|
174
|
-
} else {
|
|
175
|
-
throw err;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
async function Media_Upload(image) {
|
|
182
|
-
setLoading(true);
|
|
183
|
-
let date = new Date().getDate(); //Current Date
|
|
184
|
-
let month = new Date().getMonth() + 1; //Current Month
|
|
185
|
-
let year = new Date().getFullYear(); //Current Year
|
|
186
|
-
let hours = new Date().getHours(); //Current Hours
|
|
187
|
-
let min = new Date().getMinutes(); //Current Minutes
|
|
188
|
-
let sec = new Date().getSeconds(); //Current Seconds
|
|
189
|
-
let millisec = new Date().getMilliseconds(); //Current milliSeconds
|
|
190
|
-
let uniquename = '.aac';
|
|
191
|
-
|
|
192
|
-
let fileid_autogenerate = data != null && data.length > 0 ? data.length : 0;
|
|
193
|
-
let dataset2 = {
|
|
194
|
-
fileid: fileid_autogenerate + 1,
|
|
195
|
-
filename: uniquename,
|
|
196
|
-
filetype: image.filetype,
|
|
197
|
-
uri: image.uri,
|
|
198
|
-
uritype: false,
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
if (!dataset2.uritype) {
|
|
202
|
-
//console.log("dataset.uritype>>>>>>>>>>>>>",dataset.uritype);
|
|
203
|
-
if (dataset2.uri) {
|
|
204
|
-
//console.log("dataset.uri>>>>>>>>>>>>>>>",dataset.uri);
|
|
205
|
-
var formData = new FormData();
|
|
206
|
-
formData.append('file', {
|
|
207
|
-
uri: dataset2.uri,
|
|
208
|
-
type: 'audio/aac',
|
|
209
|
-
name: dataset2.filename,
|
|
210
|
-
});
|
|
211
|
-
// console.log("formData>>>>>>>>>>>>>",JSON.stringify(formData));
|
|
212
|
-
|
|
213
|
-
NetworkServiceCall(
|
|
214
|
-
'multiform',
|
|
215
|
-
APIURL + 'file/fileupload/emr/audio',
|
|
216
|
-
formData,
|
|
217
|
-
)
|
|
218
|
-
.then(function (responsedata) {
|
|
219
|
-
// console.log("responsedata>>>>>>>>>>>>>>>",JSON.stringify(responsedata));
|
|
220
|
-
if (responsedata.httpstatus == 200) {
|
|
221
|
-
console.log(
|
|
222
|
-
'responsedata.httpstatus>>>>>>>>>>>>>>>',
|
|
223
|
-
JSON.stringify(responsedata.httpstatus),
|
|
224
|
-
);
|
|
225
|
-
dataset2.filename = responsedata.data.fileuri;
|
|
226
|
-
// data.push(dataset2)
|
|
227
|
-
// props.setData([...data, dataset2]);
|
|
228
|
-
console.log(
|
|
229
|
-
'img66666666666666666666666666666666666666',
|
|
230
|
-
dataset2.filename,
|
|
231
|
-
);
|
|
232
|
-
setData(
|
|
233
|
-
data != null
|
|
234
|
-
? prevData => [...prevData, dataset2.filename]
|
|
235
|
-
: [dataset2.filename],
|
|
236
|
-
);
|
|
237
|
-
setrefreshCount(refreshCount + 1);
|
|
238
|
-
props.editStatus(1);
|
|
239
|
-
props.data.usertype =
|
|
240
|
-
Global.PatientDetails != undefined &&
|
|
241
|
-
Global.PatientDetails.usertype != undefined &&
|
|
242
|
-
Global.PatientDetails.usertype != null
|
|
243
|
-
? Global.PatientDetails.usertype
|
|
244
|
-
: 'Z';
|
|
245
|
-
props.data.suuser =
|
|
246
|
-
Global.userData != undefined &&
|
|
247
|
-
Global.userData.suuser != undefined &&
|
|
248
|
-
Global.userData.suuser != null
|
|
249
|
-
? Global.userData.suuser
|
|
250
|
-
: 0;
|
|
251
|
-
setLoading(false);
|
|
252
|
-
setOpen(false);
|
|
253
|
-
//props.route.params.onSelect(true)
|
|
254
|
-
} else {
|
|
255
|
-
setLoading(false);
|
|
256
|
-
setOpen(false);
|
|
257
|
-
}
|
|
258
|
-
})
|
|
259
|
-
.catch(error => {
|
|
260
|
-
// console.log("errorrrrrrrrrr",JSON.stringify(error))
|
|
261
|
-
setLoading(false);
|
|
262
|
-
});
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
}
|
|
266
|
-
|
|
267
|
-
function RecordAudio() {
|
|
268
|
-
console.log('record audiooooooooooooooo');
|
|
269
|
-
navigation.navigate('RecordAudio', {onSelect: Media_Upload});
|
|
270
|
-
}
|
|
271
|
-
return (
|
|
272
|
-
<View style={{flex: 1}}>
|
|
273
|
-
<View style={styles.itemContainer}>
|
|
274
|
-
{deleteAudio ? (
|
|
275
|
-
<TouchableOpacity
|
|
276
|
-
style={{alignItems: 'center', padding: 10}}
|
|
277
|
-
onPress={deleteSelectedAudio}>
|
|
278
|
-
<View>
|
|
279
|
-
<AntDesign name="delete" size={30} color={'red'} />
|
|
280
|
-
</View>
|
|
281
|
-
</TouchableOpacity>
|
|
282
|
-
) : null}
|
|
283
|
-
<FlatList
|
|
284
|
-
data={data}
|
|
285
|
-
renderItem={renderAudio}
|
|
286
|
-
contentContainerStyle={{alignItems: 'center', paddingTop: 10}}
|
|
287
|
-
keyExtractor={item => item.fileid}
|
|
288
|
-
/>
|
|
289
|
-
<View>
|
|
290
|
-
{loading ? (
|
|
291
|
-
<View
|
|
292
|
-
style={{
|
|
293
|
-
flex: 1,
|
|
294
|
-
backgroundColor: '#fff',
|
|
295
|
-
alignItems: 'center',
|
|
296
|
-
padding: 10,
|
|
297
|
-
}}>
|
|
298
|
-
<ActivityIndicator size="large" color="#0000ff" />
|
|
299
|
-
</View>
|
|
300
|
-
) : null}
|
|
301
|
-
</View>
|
|
302
|
-
|
|
303
|
-
<SSpeedDial
|
|
304
|
-
buttons={[
|
|
305
|
-
{
|
|
306
|
-
functionid: 1,
|
|
307
|
-
color: 'darkblue',
|
|
308
|
-
iconname: 'add',
|
|
309
|
-
title: 'Browse',
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
functionid: 2,
|
|
313
|
-
color: 'darkblue',
|
|
314
|
-
iconname: 'audiotrack',
|
|
315
|
-
title: 'Record Audio',
|
|
316
|
-
},
|
|
317
|
-
]}
|
|
318
|
-
callBack={val => (val == undefined ? null : getFunctions(val))}
|
|
319
|
-
/>
|
|
320
|
-
</View>
|
|
321
|
-
</View>
|
|
322
|
-
);
|
|
323
|
-
|
|
324
|
-
function getFunctions(key) {
|
|
325
|
-
switch (key) {
|
|
326
|
-
case 1:
|
|
327
|
-
browseFromDevice();
|
|
328
|
-
break;
|
|
329
|
-
case 2:
|
|
330
|
-
RecordAudio();
|
|
331
|
-
break;
|
|
332
|
-
}
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
const styles = StyleSheet.create({
|
|
337
|
-
itemContainer: {
|
|
338
|
-
flex: 1,
|
|
339
|
-
},
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
export default memo(AudioScreen);
|
package/src/Media/BarcodeScan.js
DELETED
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
import React, { Component } from 'react';
|
|
2
|
-
import { Text, View, TouchableOpacity } from 'react-native';
|
|
3
|
-
// import { RNCamera } from 'react-native-camera';
|
|
4
|
-
import { colors } from '../CommonStyle/commonStyle';
|
|
5
|
-
import Overlay from 'react-native-modal-overlay';
|
|
6
|
-
import ComponentStyles,{normalize} from '../CommonStyle/componentStyle';
|
|
7
|
-
import popupStyles from '../CommonStyle/PopupStyle';
|
|
8
|
-
|
|
9
|
-
class BarcodeScan extends Component {
|
|
10
|
-
|
|
11
|
-
constructor(props) {
|
|
12
|
-
super(props);
|
|
13
|
-
this.camera = null;
|
|
14
|
-
this.barcodeCodes = [];
|
|
15
|
-
|
|
16
|
-
this.state = {
|
|
17
|
-
camera: {
|
|
18
|
-
type: RNCamera.Constants.Type.back,
|
|
19
|
-
flashMode: RNCamera.Constants.FlashMode.auto,
|
|
20
|
-
},
|
|
21
|
-
isLoading: false,
|
|
22
|
-
isshowOK: false,
|
|
23
|
-
scannedBarCode: {},
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
onSubmit(scanResult) {
|
|
28
|
-
if (scanResult.data != null) {
|
|
29
|
-
this.props.route.params.onSelect({
|
|
30
|
-
data: scanResult.data,
|
|
31
|
-
type: scanResult.type,
|
|
32
|
-
});
|
|
33
|
-
this.props.navigation.goBack();
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
onBarCodeRead(scanResult) {
|
|
38
|
-
if (scanResult.data != null) {
|
|
39
|
-
if (!this.barcodeCodes.includes(scanResult.data)) {
|
|
40
|
-
if (!this.state.isshowOK) {
|
|
41
|
-
this.setState({ scannedBarCode: scanResult });
|
|
42
|
-
this.setState({ isshowOK: true });
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
async takePicture() {
|
|
50
|
-
if (this.camera) {
|
|
51
|
-
const options = { quality: 0.5, base64: true };
|
|
52
|
-
const data = await this.camera.takePictureAsync(options);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
pendingView() {
|
|
57
|
-
return (
|
|
58
|
-
<View
|
|
59
|
-
style={{
|
|
60
|
-
flex: 1,
|
|
61
|
-
backgroundColor: 'lightgreen',
|
|
62
|
-
justifyContent: 'center',
|
|
63
|
-
alignItems: 'center',
|
|
64
|
-
}}
|
|
65
|
-
>
|
|
66
|
-
<Text>Waiting</Text>
|
|
67
|
-
</View>
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
render() {
|
|
72
|
-
return (
|
|
73
|
-
<View style={layoutstyles.container}>
|
|
74
|
-
<RNCamera
|
|
75
|
-
ref={ref => {
|
|
76
|
-
this.camera = ref;
|
|
77
|
-
}}
|
|
78
|
-
defaultTouchToFocus
|
|
79
|
-
flashMode={this.state.camera.flashMode}
|
|
80
|
-
mirrorImage={false}
|
|
81
|
-
onBarCodeRead={this.onBarCodeRead.bind(this)}
|
|
82
|
-
onFocusChanged={() => { }}
|
|
83
|
-
onZoomChanged={() => { }}
|
|
84
|
-
permissionDialogTitle={'Permission to use camera'}
|
|
85
|
-
permissionDialogMessage={'We need your permission to use your camera phone'}
|
|
86
|
-
style={layoutstyles.preview}
|
|
87
|
-
type={this.state.camera.type}
|
|
88
|
-
/>
|
|
89
|
-
{this.state.isshowOK ?
|
|
90
|
-
<Overlay visible={this.state.isshowOK}
|
|
91
|
-
onClose={() => this.setState({ isshowOK: false })}
|
|
92
|
-
closeOnTouchOutside
|
|
93
|
-
animationType="zoomIn"
|
|
94
|
-
containerStyle={layoutstyles.overlay_containerstyle}
|
|
95
|
-
animationDuration={500}
|
|
96
|
-
childrenWrapperStyle={layoutstyles.overlay_childwrapper_style}
|
|
97
|
-
>
|
|
98
|
-
<View style={ComponentStyles.View_col_center}>
|
|
99
|
-
<Text style={ComponentStyles.popup_heading}>Data Scanned Successfully</Text>
|
|
100
|
-
<View style={layoutstyles.overlay_screen_button_view}>
|
|
101
|
-
<TouchableOpacity
|
|
102
|
-
style={popupStyles.overlay_screen_small_button_style}
|
|
103
|
-
onPress={() => this.onSubmit(this.state.scannedBarCode)}>
|
|
104
|
-
<Text style={popupStyles.overlay_screen_button_text}>OK</Text>
|
|
105
|
-
</TouchableOpacity>
|
|
106
|
-
<TouchableOpacity
|
|
107
|
-
style={popupStyles.overlay_screen_small_button_style}
|
|
108
|
-
onPress={() => this.setState({ isshowOK: false })}
|
|
109
|
-
>
|
|
110
|
-
<Text style={popupStyles.overlay_screen_button_text}>CANCEL</Text>
|
|
111
|
-
</TouchableOpacity>
|
|
112
|
-
</View>
|
|
113
|
-
</View>
|
|
114
|
-
</Overlay>
|
|
115
|
-
: null}
|
|
116
|
-
</View>
|
|
117
|
-
);
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
const layoutstyles = {
|
|
122
|
-
container: {
|
|
123
|
-
flex: 1,
|
|
124
|
-
},
|
|
125
|
-
preview: {
|
|
126
|
-
flex: 1,
|
|
127
|
-
justifyContent: 'flex-end',
|
|
128
|
-
alignItems: 'center',
|
|
129
|
-
},
|
|
130
|
-
overlay_containerstyle: {
|
|
131
|
-
backgroundColor: 'rgba(0, 0, 0, 0.50)',
|
|
132
|
-
},
|
|
133
|
-
overlay_childwrapper_style: {
|
|
134
|
-
borderRadius: 20,
|
|
135
|
-
width: '100%',
|
|
136
|
-
backgroundColor: colors.color_Background_color,
|
|
137
|
-
|
|
138
|
-
},
|
|
139
|
-
overlay_screen_button_view: {
|
|
140
|
-
flexDirection: 'row', justifyContent: 'space-evenly', margin: 5,
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
export default BarcodeScan;
|
|
145
|
-
|