@jescon-technologies/react-native-ui-kit 0.0.5 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Common/ErrorBoundary.d.ts +15 -0
- package/dist/Common/ErrorBoundary.d.ts.map +1 -0
- package/dist/Common/ErrorBoundary.js +64 -0
- package/dist/Common/ErrorBoundary.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/src/Common/ErrorBoundary.d.ts +15 -0
- package/dist/src/Common/ErrorBoundary.d.ts.map +1 -0
- package/dist/src/Common/ErrorBoundary.js +64 -0
- package/dist/src/Common/ErrorBoundary.js.map +1 -0
- package/package.json +17 -5
- package/.gitattributes +0 -2
- package/index.d.ts +0 -66
- package/index.js +0 -66
- package/src/Alerts/AAlert.js +0 -137
- package/src/Alerts/AAlertIOS.js +0 -97
- package/src/Alerts/ABlink.js +0 -40
- package/src/Common/ErrorBoundary.tsx +0 -73
- package/src/Common/Icons.js +0 -49
- package/src/Common/NetworkServiceCall.js +0 -265
- package/src/CommonStyle/CommonTheme.js +0 -11
- package/src/CommonStyle/ComponentFunctions.js +0 -632
- package/src/CommonStyle/PopupStyle.js +0 -146
- package/src/CommonStyle/commonStyle.js +0 -93
- package/src/CommonStyle/componentStyle.js +0 -545
- package/src/CommonStyle/optionListStyles.js +0 -175
- package/src/Components/ByProductPage.js +0 -200
- package/src/Components/CDropDownListNew.js +0 -153
- package/src/Components/CSupplierList.js +0 -88
- package/src/Components/CVerificationCard.js +0 -2822
- package/src/Components/CustomButton.js +0 -67
- package/src/Components/CustomCard.js +0 -127
- package/src/Components/CustomTextInput.js +0 -47
- package/src/Components/EquipmentPage.js +0 -313
- package/src/Components/FilterInput.Copy.js +0 -723
- package/src/Components/FilterInput.js +0 -569
- package/src/Components/HSubHeading.js +0 -68
- package/src/Components/HeaderCard.js +0 -40
- package/src/Components/MoreOptionsScreen.js +0 -251
- package/src/Components/NonSwipableProductCard.js +0 -226
- package/src/Components/NonSwipableSupplierCard.js +0 -348
- package/src/Components/ProductCard.js +0 -1336
- package/src/Components/QualityProductCard.js +0 -1059
- package/src/Components/RateProductCard.js +0 -1452
- package/src/Components/RawMaterial.js +0 -261
- package/src/Components/SDropDownEdited.js +0 -549
- package/src/Components/SDropDownNew.js +0 -529
- package/src/Components/SHelpDescription.js +0 -147
- package/src/Components/STextInputNew.js +0 -510
- package/src/Components/SearchProductCard.js +0 -470
- package/src/Components/StageByProduct.js +0 -199
- package/src/Components/SupplierCard.js +0 -243
- package/src/Components/SupplierInvoiceCard.js +0 -405
- package/src/Components/SwipableSupplierCard.js +0 -136
- package/src/Components/TagTemplate.js +0 -74
- package/src/Components/WrappedComponent.js +0 -25
- package/src/Custom/CBooking.js +0 -944
- package/src/Custom/CBookingPostpone.js +0 -1822
- package/src/Custom/CCalendar.js +0 -560
- package/src/Custom/CCard.js +0 -880
- package/src/Custom/CDetailCard.js +0 -205
- package/src/Custom/CHelpImage.js +0 -52
- package/src/Custom/CReport.js +0 -569
- package/src/Custom/CScrollView.js +0 -73
- package/src/Custom/CSignature.js +0 -112
- package/src/Custom/CSliderMenu.js +0 -339
- package/src/Custom/CSupplierCard.js +0 -99
- package/src/Custom/CTemplateCard.js +0 -438
- package/src/Custom/CTokenAllocation.js +0 -1402
- package/src/Custom/CTokenListOverlay.js +0 -122
- package/src/Custom/CWardStatus.js +0 -444
- package/src/Custom/Charts/CBarChart.js +0 -218
- package/src/Custom/Charts/CDashBoardList.js +0 -133
- package/src/Custom/Charts/CDashBoardTable.js +0 -172
- package/src/Custom/Charts/CLineChart.js +0 -193
- package/src/Custom/Charts/CPieChart.js +0 -186
- package/src/Custom/Loader.js +0 -182
- package/src/Custom/OUserView.js +0 -1121
- package/src/Custom/PreviewDosage.js +0 -115
- package/src/Custom/SearchLoader.js +0 -32
- package/src/Custom/TableComponent/CActivityTable.js +0 -707
- package/src/Custom/TableComponent/CMoreButtonTable.js +0 -197
- package/src/Custom/TableComponent/CTable.js +0 -185
- package/src/Custom/TableComponent/CTextBody.js +0 -40
- package/src/Custom/TableComponent/CTextHeader.js +0 -17
- package/src/Custom/TableComponent/PreviewPrescriptionNew.js +0 -1011
- package/src/Custom/TableComponent/SDropdownTable.js +0 -491
- package/src/Custom/TableComponent/TagTable.js +0 -1200
- package/src/CustomComponents/CAddColumn.js +0 -140
- package/src/CustomComponents/CAssessmentDelete.js +0 -307
- package/src/CustomComponents/CAwesomeButton.js +0 -83
- package/src/CustomComponents/CAwesomeMoreButton.js +0 -54
- package/src/CustomComponents/CBackHandler.js +0 -273
- package/src/CustomComponents/CCalendar.js +0 -243
- package/src/CustomComponents/CCommentOverlay.js +0 -202
- package/src/CustomComponents/CComments.js +0 -162
- package/src/CustomComponents/CContainerView.js +0 -24
- package/src/CustomComponents/CCustomTextInput.js +0 -336
- package/src/CustomComponents/CDetailView.js +0 -40
- package/src/CustomComponents/CDropDownList.js +0 -153
- package/src/CustomComponents/CDropdownSelect.js +0 -555
- package/src/CustomComponents/CFooterView.js +0 -42
- package/src/CustomComponents/CImagePickerSave.js +0 -316
- package/src/CustomComponents/CModalOverlay.js +0 -91
- package/src/CustomComponents/CNetworkStatus.js +0 -327
- package/src/CustomComponents/CNotesInstructions.js +0 -1000
- package/src/CustomComponents/COverlay.js +0 -81
- package/src/CustomComponents/CRemarks.js +0 -176
- package/src/CustomComponents/CRowAdd.js +0 -143
- package/src/CustomComponents/CSummaryDropDown.js +0 -327
- package/src/CustomComponents/CText.js +0 -9
- package/src/CustomComponents/CVectorIcon.js +0 -34
- package/src/CustomComponents/HtmlContentViewer.js +0 -65
- package/src/CustomComponents/PdfContentViewer.js +0 -90
- package/src/CustomComponents/SDropDownDosage.js +0 -1087
- package/src/CustomComponents/SwipableProductCard.js +0 -246
- package/src/CustomComponents/SwipableProductImageCard.js +0 -254
- package/src/CustomComponents/WorkOrderDetails.js +0 -1216
- package/src/CustomComponents/WorkOrderDetailsPage.js +0 -1213
- package/src/HOC/ConfirmOverlay.js +0 -192
- package/src/HOC/HHeading.js +0 -70
- package/src/HOC/HMoreButton.js +0 -88
- package/src/HOC/HNatureHeading.js +0 -402
- package/src/HOC/HOCIcons.js +0 -80
- package/src/HOC/HOverlayCentered.js +0 -140
- package/src/HOC/HShadowButton.js +0 -45
- package/src/HOC/HShadowCountButton.js +0 -82
- package/src/HOC/OptionOverlay.js +0 -48
- package/src/Json/Chart.json +0 -818
- package/src/Json/Consultation.json +0 -622
- package/src/Json/CreditBill.json +0 -490
- package/src/Json/Dropdown.json +0 -216
- package/src/Json/DropdownConsultation.json +0 -228
- package/src/Json/DynamicReports.json +0 -623
- package/src/Json/Footer.json +0 -79
- package/src/Media/AudioScreen.js +0 -342
- package/src/Media/BarcodeScan.js +0 -145
- package/src/Media/CAudioPlay.js +0 -228
- package/src/Media/CCaptureImageWithoutEdit.js +0 -330
- package/src/Media/CImageGallery.js +0 -289
- package/src/Media/CImageZoom.js +0 -82
- package/src/Media/CSingleImage.js +0 -391
- package/src/Media/CSketchCanvas.js +0 -76
- package/src/Media/CVideoPlay.js +0 -31
- package/src/Media/DocumentScreen.js +0 -362
- package/src/Media/DrawingScreen.js +0 -578
- package/src/Media/ImageScreen.js +0 -309
- package/src/Media/RecordAudio.js +0 -250
- package/src/Media/RecordVideo.js +0 -223
- package/src/Media/VideoScreen.js +0 -378
- package/src/Navigation/PageNavigation.js +0 -224
- package/src/Navigation/useFocusEffect.js +0 -2
- package/src/Navigation/useFocusEffect.native.js +0 -1
- package/src/Navigation/useFocusEffect.web.js +0 -1
- package/src/Navigation/useIsFocused.js +0 -1
- package/src/Navigation/useIsFocused.native.js +0 -1
- package/src/Navigation/useIsFocused.web.js +0 -1
- package/src/Navigation/useNavigation.js +0 -2
- package/src/Navigation/useNavigation.native.js +0 -1
- package/src/Navigation/useNavigation.web.js +0 -1
- package/src/Screens/CMedications.js +0 -528
- package/src/Screens/CWebViewGallery.js +0 -203
- package/src/Screens/ChartScan.js +0 -279
- package/src/Screens/ChartScreenNew.js +0 -1579
- package/src/Screens/Consultation.js +0 -1500
- package/src/Screens/Dashboard.js +0 -778
- package/src/Screens/FileExplorer.js +0 -288
- package/src/Screens/Footer.js +0 -340
- package/src/Screens/ForgotPassword.js +0 -288
- package/src/Screens/HeaderBlock.js +0 -353
- package/src/Screens/Login.js +0 -328
- package/src/Screens/Notification.js +0 -149
- package/src/Screens/OcrScreen.js +0 -20
- package/src/Screens/PdfPreview.js +0 -507
- package/src/Screens/RegistrationDetails.js +0 -467
- package/src/Screens/SearchScreen.js +0 -582
- package/src/Screens/Splash.js +0 -788
- package/src/Screens/SwipeLeftView.js +0 -1867
- package/src/StaticComponents/SAlphabet.js +0 -47
- package/src/StaticComponents/SCheckBox.js +0 -42
- package/src/StaticComponents/SDatePicker.js +0 -208
- package/src/StaticComponents/SDatePickerLabel.js +0 -253
- package/src/StaticComponents/SDatePickerNew.js +0 -258
- package/src/StaticComponents/SDateTimePickerNew.js +0 -381
- package/src/StaticComponents/SDropDownGenerate.js +0 -450
- package/src/StaticComponents/SDropDownHoc.js +0 -636
- package/src/StaticComponents/SDropDownIcon.js +0 -500
- package/src/StaticComponents/SMenuBox.js +0 -131
- package/src/StaticComponents/SOverlay.js +0 -177
- package/src/StaticComponents/SOverlayTextInput.js +0 -109
- package/src/StaticComponents/SSearch.js +0 -438
- package/src/StaticComponents/SSearchBar.js +0 -53
- package/src/StaticComponents/SSpeedDial.js +0 -303
- package/src/StaticComponents/STextInput.js +0 -289
- package/src/StaticComponents/STextInputProps.js +0 -36
- package/src/StaticComponents/STimePicker.js +0 -171
- package/src/StaticComponents/STimingDropDownNew.js +0 -1585
- package/src/StaticComponents/STimingSwitch.js +0 -34
- package/src/layout/CContainerView.js +0 -21
- package/src/layout/CDetailView.js +0 -81
- package/src/layout/HeaderBlock.js +0 -353
- package/src/layout/INVLoginLayout.js +0 -657
- package/src/layout/Loader.js +0 -176
|
@@ -1,1000 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect, useContext, memo } from 'react';
|
|
2
|
-
import { Text, View, StyleSheet, TouchableOpacity, TextInput, ScrollView, ActivityIndicator, Dimensions } from 'react-native';
|
|
3
|
-
import { colors } from '../CommonStyle/commonStyle';
|
|
4
|
-
import ComponentStyles, { normalize } from '../CommonStyle/componentStyle';
|
|
5
|
-
import popupStyles, { getPopupHeadingOptionText, getPopupTextAreaContainer, getPopupTextAreaChildContainer, getPopupTextAreaStyle } from '../CommonStyle/PopupStyle';
|
|
6
|
-
import CMultiSelect from './CMultiSelect';
|
|
7
|
-
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
8
|
-
import Entypo from 'react-native-vector-icons/Entypo';
|
|
9
|
-
import MaterialIcons from 'react-native-vector-icons/MaterialIcons';
|
|
10
|
-
import { Global } from '../../../../../src/Common/Global';
|
|
11
|
-
import { getLoading, isBNUL, isNU, isNUQ, notifyMessage, ValueCheck } from '../CommonStyle/ComponentFunctions';
|
|
12
|
-
import { Icons } from '@jescon-technologies/react-native-ui-kit';;
|
|
13
|
-
import CAwesomeButton from './CAwesomeButton';
|
|
14
|
-
import Loader from '../Custom/Loader';
|
|
15
|
-
import STimingSwitch from '../StaticComponents/STimingSwitch';
|
|
16
|
-
import EmrResponseComponentContext from '../Handlers/emrResponseComponentContext';
|
|
17
|
-
import HOCIcons from '../HOC/HOCIcons';
|
|
18
|
-
|
|
19
|
-
function CNotesInstructions(props) {
|
|
20
|
-
|
|
21
|
-
const { responseJSON, setResponseJSON } = useContext(EmrResponseComponentContext);
|
|
22
|
-
const [displayText, setDisplayText] = useState(true);
|
|
23
|
-
const { width, height } = Dimensions.get('window');
|
|
24
|
-
const [data, setData] = useState(props.data);
|
|
25
|
-
|
|
26
|
-
const [isShow, setIsShow] = useState(false);
|
|
27
|
-
const [additionalNote, setAdditionalNote] = useState();
|
|
28
|
-
const [isMsgShow, setIsMsgShow] = useState(false);
|
|
29
|
-
const [msg, setMsg] = useState();
|
|
30
|
-
const [stage, setStage] = useState(2); // FAV
|
|
31
|
-
const [displayData, setDisplayData] = useState([]);
|
|
32
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
33
|
-
const [refresh, setRefresh] = useState(0);
|
|
34
|
-
const [checked, setChecked] = useState(false);
|
|
35
|
-
const [editStatus, setEditStatus] = useState(false);
|
|
36
|
-
|
|
37
|
-
const defaultdata = {
|
|
38
|
-
editstatus: false,
|
|
39
|
-
editmode: false,
|
|
40
|
-
favorite: false,
|
|
41
|
-
savetext: '',
|
|
42
|
-
savecode: 0,
|
|
43
|
-
temptext: '',
|
|
44
|
-
deletestatus: false,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const [createMode, setCreateMode] = useState(defaultdata);
|
|
48
|
-
|
|
49
|
-
useEffect(() => {
|
|
50
|
-
NotesInstructionRetrieve();
|
|
51
|
-
}, []);
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
// useEffect(() => {
|
|
55
|
-
// setData(props.data)
|
|
56
|
-
// if (props.primarydata && props.primarydata.datavalue != 0 && props.primarydata.displayvalue != null) {
|
|
57
|
-
// setStage(3)
|
|
58
|
-
// setAdditionalNote(props.primarydata.displayvalue)
|
|
59
|
-
// }
|
|
60
|
-
// else {
|
|
61
|
-
// setStage(2);
|
|
62
|
-
// }
|
|
63
|
-
// if (props.data.key == 2) {
|
|
64
|
-
// setStage(3)
|
|
65
|
-
// }
|
|
66
|
-
// else {
|
|
67
|
-
// NotesInstructionRetrieve()
|
|
68
|
-
// }
|
|
69
|
-
// }, []);
|
|
70
|
-
|
|
71
|
-
function removeSelected() {
|
|
72
|
-
if (data.name == 'Notes') {
|
|
73
|
-
var temp = data.NotesArray;
|
|
74
|
-
var indexX = temp.findIndex(sitem => sitem.datavalue === props.primarydata.datavalue);
|
|
75
|
-
temp.splice(indexX, 1);
|
|
76
|
-
setData({ ...data, ['NotesArray']: temp });
|
|
77
|
-
}
|
|
78
|
-
else if (data.name == 'Instructions') {
|
|
79
|
-
var temp = data.InstructionsArray;
|
|
80
|
-
var indexX = temp.findIndex(sitem => sitem.datavalue === props.primarydata.datavalue);
|
|
81
|
-
temp.splice(indexX, 1);
|
|
82
|
-
setData({ ...data, ['InstructionsArray']: temp });
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
function NotesInstructionRetrieve() {
|
|
87
|
-
|
|
88
|
-
setStage(2);
|
|
89
|
-
setIsLoading(true);
|
|
90
|
-
let nature = "'" + data.nature + "'" + ',' + Global.userData.suuser;
|
|
91
|
-
|
|
92
|
-
let api = props.data.buttonapi != undefined ? props.data.buttonapi : props.selectionapi;
|
|
93
|
-
|
|
94
|
-
console.log('api........',props.data.buttonapi);
|
|
95
|
-
|
|
96
|
-
const splitArray = api.split(',');
|
|
97
|
-
|
|
98
|
-
splitArray.push(nature);
|
|
99
|
-
|
|
100
|
-
let savebuttonapi = splitArray.join();
|
|
101
|
-
|
|
102
|
-
let buttonapi = props.data.name == 'Notes' || props.data.name == 'Instructions' ? savebuttonapi : props.data.buttonapi;
|
|
103
|
-
|
|
104
|
-
var tempString = [];
|
|
105
|
-
|
|
106
|
-
let saveapi;
|
|
107
|
-
|
|
108
|
-
if (props.data.name == 'Notes' || props.data.name == 'Instructions') {
|
|
109
|
-
|
|
110
|
-
props.data.name == 'Notes' ?
|
|
111
|
-
isBNUL(data.NotesArray) ? data.NotesArray.map((item, i) => {
|
|
112
|
-
tempString.push(item.datavalue);
|
|
113
|
-
}) : null
|
|
114
|
-
: props.data.name == 'Instructions' ?
|
|
115
|
-
isBNUL(data.InstructionsArray) ? data.InstructionsArray.map((item, i) => {
|
|
116
|
-
tempString.push(item.datavalue);
|
|
117
|
-
}) : null
|
|
118
|
-
: null;
|
|
119
|
-
|
|
120
|
-
// var ValueString = tempString.length > 0 ? tempString.toString() : '0';
|
|
121
|
-
var ValueString = '0';
|
|
122
|
-
|
|
123
|
-
const splitApi = buttonapi.split(',');
|
|
124
|
-
|
|
125
|
-
splitApi[1] = "'" + ValueString + "'";
|
|
126
|
-
|
|
127
|
-
saveapi = splitApi.join();
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
else {
|
|
131
|
-
props.data.name == 'Infection Control' ?
|
|
132
|
-
isBNUL(data.infectioncontrol) ? data.infectioncontrol.map((data, i) => {
|
|
133
|
-
tempString.push(data.datavalue);
|
|
134
|
-
})
|
|
135
|
-
: null
|
|
136
|
-
: null;
|
|
137
|
-
// var ValueString = tempString.length > 0 ? tempString.toString() : '0';
|
|
138
|
-
var ValueString = '0';
|
|
139
|
-
saveapi = buttonapi + " '" + ValueString + "'";
|
|
140
|
-
}
|
|
141
|
-
setDisplayData([]);
|
|
142
|
-
console.log('NotesInstructionRetrieve.....................', JSON.stringify(APIURL + saveapi));
|
|
143
|
-
|
|
144
|
-
NetworkServiceCall('get', APIURL + saveapi, '').then(function (response) {
|
|
145
|
-
if (response.httpstatus == 200) {
|
|
146
|
-
setDisplayData(response.data.data);
|
|
147
|
-
setDisplayText(true);
|
|
148
|
-
setIsLoading(false);
|
|
149
|
-
|
|
150
|
-
} else {
|
|
151
|
-
setDisplayData(null);
|
|
152
|
-
setDisplayText(false);
|
|
153
|
-
setIsLoading(false);
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
getLoading(v => setIsLoading(false));
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function getArray(params) {
|
|
163
|
-
// console.log("PARAMSSSSSSSSSSSSSS JSONNNNNNNNNNNNN",JSON.stringify(params))
|
|
164
|
-
switch (params.name) {
|
|
165
|
-
case 'Notes': return params.NotesArray != undefined ? params.NotesArray : [];
|
|
166
|
-
case 'Instructions': return params.InstructionsArray != undefined ? params.InstructionsArray : [];
|
|
167
|
-
}
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
function RetrieveAll() {
|
|
171
|
-
|
|
172
|
-
setStage(4);
|
|
173
|
-
setIsLoading(true);
|
|
174
|
-
let nature = "'" + data.nature + "'" + ',' + Global.userData.suuser;
|
|
175
|
-
|
|
176
|
-
let api = data.buttonapi != undefined ? data.buttonapi : props.selectionapi;
|
|
177
|
-
console.log('apiiiiiiiiiiiiiiii', JSON.stringify(api));
|
|
178
|
-
|
|
179
|
-
const splitArray = api.split(',');
|
|
180
|
-
splitArray.push(nature);
|
|
181
|
-
let savebuttonapi = splitArray.join();
|
|
182
|
-
console.log('RetrieveAll..............', JSON.stringify(APIURL + savebuttonapi));
|
|
183
|
-
setDisplayData([]);
|
|
184
|
-
|
|
185
|
-
NetworkServiceCall('get', APIURL + savebuttonapi, '')
|
|
186
|
-
.then(function (response) {
|
|
187
|
-
if (response.httpstatus == 200
|
|
188
|
-
&& response.data != undefined
|
|
189
|
-
&& response.data.data != undefined
|
|
190
|
-
&& response.data.data.length > 0) {
|
|
191
|
-
|
|
192
|
-
// if (ValueCheck(props.data) && props.data.length > 0) {
|
|
193
|
-
// var results = response.data.data.map((item) => {
|
|
194
|
-
// getArray(props.data).map((xxx) => {
|
|
195
|
-
// if (item.datavalue == xxx.datavalue) {
|
|
196
|
-
// item.selected = true
|
|
197
|
-
// }
|
|
198
|
-
// })
|
|
199
|
-
// })
|
|
200
|
-
// }
|
|
201
|
-
|
|
202
|
-
setDisplayData(response.data.data);
|
|
203
|
-
setDisplayText(false);
|
|
204
|
-
setIsLoading(false);
|
|
205
|
-
|
|
206
|
-
} else {
|
|
207
|
-
setDisplayData(null);
|
|
208
|
-
setDisplayText(true);
|
|
209
|
-
setIsLoading(false);
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
getLoading(v => setIsLoading(false));
|
|
214
|
-
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
function saveInfectionControl() {
|
|
218
|
-
var tempString = [];
|
|
219
|
-
data.infectioncontrol &&
|
|
220
|
-
data.infectioncontrol != null &&
|
|
221
|
-
data.infectioncontrol != undefined &&
|
|
222
|
-
data.infectioncontrol.length > 0
|
|
223
|
-
? data.infectioncontrol.map((data, i) => {
|
|
224
|
-
tempString.push(data.datavalue);
|
|
225
|
-
})
|
|
226
|
-
: null;
|
|
227
|
-
var ValueString = tempString.length > 0 ? tempString.toString() : '0';
|
|
228
|
-
// if (ValueString != null && ValueString != undefined) {
|
|
229
|
-
setIsLoading(true);
|
|
230
|
-
let buttonapi =
|
|
231
|
-
'emrinstructions/updateinfectioncontrol/' +
|
|
232
|
-
data.homrpatientchart +
|
|
233
|
-
'/' +
|
|
234
|
-
ValueString;
|
|
235
|
-
NetworkServiceCall('get', APIURL + buttonapi, '').then(function (
|
|
236
|
-
response,
|
|
237
|
-
) {
|
|
238
|
-
if (response.httpstatus == 200) {
|
|
239
|
-
props.visibility(false);
|
|
240
|
-
notifyMessage('Data Saved!!!', 1);
|
|
241
|
-
setIsLoading(false);
|
|
242
|
-
} else {
|
|
243
|
-
props.visibility(false);
|
|
244
|
-
setIsLoading(false);
|
|
245
|
-
//alert("Request Failed!")
|
|
246
|
-
notifyMessage('Data Not Saved!!!', 2);
|
|
247
|
-
}
|
|
248
|
-
});
|
|
249
|
-
|
|
250
|
-
getLoading(v => setIsLoading(false));
|
|
251
|
-
// }
|
|
252
|
-
}
|
|
253
|
-
|
|
254
|
-
function saveData(deletestatus) {
|
|
255
|
-
|
|
256
|
-
if (isNUQ(createMode.savetext)) {
|
|
257
|
-
|
|
258
|
-
let url = APIURL + 'commontemplatesave/RnCommonTemplateSave';
|
|
259
|
-
|
|
260
|
-
let dataset1 = {
|
|
261
|
-
groups: {
|
|
262
|
-
hosumrclassificationnature: props.arguments,
|
|
263
|
-
notesinstruction: createMode.savetext,
|
|
264
|
-
nature: createMode.favorite ? 'G' : data.nature,
|
|
265
|
-
editstatus: deletestatus ? 3 : createMode.editmode ? 2 : 1, // 1 insertion, 2 - updation , 3 - deletion
|
|
266
|
-
datavalue: createMode.editmode ? createMode.savecode : 0,
|
|
267
|
-
noteorinstruction: data.name == 'Notes' ? 1 : 2,
|
|
268
|
-
suuser: Global.userData.suuser,
|
|
269
|
-
// editstatus: editStatus ? 1 : 0,
|
|
270
|
-
},
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
let dataset2 = {
|
|
274
|
-
infectioncontroldetail: {
|
|
275
|
-
code: 0,
|
|
276
|
-
suavailability: 1,
|
|
277
|
-
infectioncontrol: createMode.savetext,
|
|
278
|
-
informationmode: 11111,
|
|
279
|
-
communicationmode: 11111,
|
|
280
|
-
remarks: 'Infection Control Added',
|
|
281
|
-
flag: 1,
|
|
282
|
-
suuser: Global.userData.suuser,
|
|
283
|
-
},
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
var params = data.name == 'Notes' || data.name == 'Instructions' ? dataset1 : dataset2;
|
|
287
|
-
|
|
288
|
-
setIsLoading(true);
|
|
289
|
-
params.groups.procedurename = data.name == 'Notes' ? 'hosumrnotes1' : 'hosumrinstruction1';
|
|
290
|
-
|
|
291
|
-
console.log('saveData', JSON.stringify(params, null, 2));
|
|
292
|
-
console.log('url...............', url);
|
|
293
|
-
|
|
294
|
-
NetworkServiceCall('post', url, params).then(function (response) {
|
|
295
|
-
if (response.httpstatus == 200) {
|
|
296
|
-
|
|
297
|
-
if (createMode.favorite) { // favourite turned on
|
|
298
|
-
setStage(2); // FAV Screen
|
|
299
|
-
NotesInstructionRetrieve();
|
|
300
|
-
}
|
|
301
|
-
else {
|
|
302
|
-
setStage(4); // ALL Screen
|
|
303
|
-
RetrieveAll();
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
} else {
|
|
307
|
-
|
|
308
|
-
setIsLoading(false);
|
|
309
|
-
setIsMsgShow(true);
|
|
310
|
-
setMsg(response.data.alertdata.alertMessage);
|
|
311
|
-
setTimeout(() => {
|
|
312
|
-
setIsMsgShow(false);
|
|
313
|
-
}, 2000);
|
|
314
|
-
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
getLoading(v => setIsLoading(false));
|
|
318
|
-
|
|
319
|
-
} else {
|
|
320
|
-
|
|
321
|
-
setIsMsgShow(true);
|
|
322
|
-
setMsg('Null cannot be save...Please type');
|
|
323
|
-
setTimeout(() => {
|
|
324
|
-
setIsMsgShow(false);
|
|
325
|
-
}, 2000);
|
|
326
|
-
}
|
|
327
|
-
Global.EditStatus = 1;
|
|
328
|
-
responseJSON.consultationEdit.editStatus = true;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
function deSelectItem(item) {
|
|
332
|
-
|
|
333
|
-
console.log('>>>>>>>>>>>>>>>>>>>>>>>>>INS', JSON.stringify(displayData));
|
|
334
|
-
|
|
335
|
-
Global.EditStatus = 1;
|
|
336
|
-
responseJSON.consultationEdit.editStatus = true;
|
|
337
|
-
// props.IconColour(true);
|
|
338
|
-
var tempString = [];
|
|
339
|
-
var ValueString = '';
|
|
340
|
-
if (data.name == 'Notes') {
|
|
341
|
-
var temp = data.NotesArray;
|
|
342
|
-
var indexX = temp.findIndex(sitem => sitem.datavalue === item.datavalue);
|
|
343
|
-
temp.splice(indexX, 1);
|
|
344
|
-
setData({ ...data, ['NotesArray']: temp });
|
|
345
|
-
var tempArray = ValueCheck(displayData) ? displayData : [];
|
|
346
|
-
var indexXX = tempArray.findIndex(
|
|
347
|
-
sitem => sitem.datavalue === item.datavalue,
|
|
348
|
-
);
|
|
349
|
-
indexXX != -1 ? (tempArray[indexXX].selected = false) : null;
|
|
350
|
-
setDisplayData(tempArray);
|
|
351
|
-
data.NotesArray &&
|
|
352
|
-
data.NotesArray.map((data, i) => {
|
|
353
|
-
tempString.push(data.datavalue);
|
|
354
|
-
var str = tempString.join();
|
|
355
|
-
ValueString = str.toString();
|
|
356
|
-
});
|
|
357
|
-
data.value = ValueString;
|
|
358
|
-
setData({ ...data, ['value']: ValueString });
|
|
359
|
-
} else if (data.name == 'Instructions') {
|
|
360
|
-
var temp = data.InstructionsArray;
|
|
361
|
-
var indexX = temp.findIndex(sitem => sitem.datavalue === item.datavalue);
|
|
362
|
-
temp.splice(indexX, 1);
|
|
363
|
-
setData({ ...data, ['InstructionsArray']: temp });
|
|
364
|
-
var tempArray = ValueCheck(displayData) ? displayData : [];
|
|
365
|
-
var indexXX = tempArray.findIndex(
|
|
366
|
-
sitem => sitem.datavalue === item.datavalue,
|
|
367
|
-
);
|
|
368
|
-
indexXX != -1 ? (tempArray[indexXX].selected = false) : null;
|
|
369
|
-
setDisplayData(tempArray);
|
|
370
|
-
data.InstructionsArray &&
|
|
371
|
-
data.InstructionsArray.map((data, i) => {
|
|
372
|
-
tempString.push(data.datavalue);
|
|
373
|
-
var str = tempString.join();
|
|
374
|
-
ValueString = str.toString();
|
|
375
|
-
});
|
|
376
|
-
data.value = ValueString;
|
|
377
|
-
setData({ ...data, ['value']: ValueString });
|
|
378
|
-
} else {
|
|
379
|
-
var temp = data.infectioncontrol;
|
|
380
|
-
var indexX = temp.findIndex(sitem => sitem.datavalue === item.datavalue);
|
|
381
|
-
temp.splice(indexX, 1);
|
|
382
|
-
setData({ ...data, ['infectioncontrol']: temp });
|
|
383
|
-
var tempArray = ValueCheck(displayData) ? displayData : [];
|
|
384
|
-
if (tempArray != null && tempArray != undefined) {
|
|
385
|
-
var indexXX = tempArray.findIndex(
|
|
386
|
-
sitem => sitem.datavalue === item.datavalue,
|
|
387
|
-
);
|
|
388
|
-
indexXX != -1 ? (tempArray[indexXX].selected = false) : null;
|
|
389
|
-
setDisplayData(tempArray);
|
|
390
|
-
}
|
|
391
|
-
data.infectioncontrol &&
|
|
392
|
-
data.infectioncontrol.map((data, i) => {
|
|
393
|
-
tempString.push(data.datavalue);
|
|
394
|
-
var str = tempString.join();
|
|
395
|
-
ValueString = str.toString();
|
|
396
|
-
});
|
|
397
|
-
data.value = ValueString;
|
|
398
|
-
setData({ ...data, ['value']: ValueString });
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
function getcontainerStyle() {
|
|
403
|
-
return {
|
|
404
|
-
...layoutstyles.component_container,
|
|
405
|
-
borderWidth: 0,
|
|
406
|
-
paddingTop: height * 0.005,
|
|
407
|
-
paddingBottom: height * 0.005,
|
|
408
|
-
};
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
function ForIConColor(val) {
|
|
412
|
-
props.IconColour(true);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
function displaySelectedItems(data) {
|
|
416
|
-
//TO display Selected Items
|
|
417
|
-
let displaydata =
|
|
418
|
-
data.NotesArray && data.NotesArray.length > 0
|
|
419
|
-
? data.NotesArray
|
|
420
|
-
: data.InstructionsArray &&
|
|
421
|
-
data.InstructionsArray.length > 0
|
|
422
|
-
? data.InstructionsArray
|
|
423
|
-
: data.infectioncontrol;
|
|
424
|
-
// let displaydata = data.InstructionsArray
|
|
425
|
-
return (
|
|
426
|
-
<View style={{}}>
|
|
427
|
-
<View style={layoutstyles.display_selectedItems_container}>
|
|
428
|
-
{
|
|
429
|
-
// data.NotesArray && data.NotesArray.map((block, i) => {
|
|
430
|
-
displaydata &&
|
|
431
|
-
displaydata.map((block, i) => {
|
|
432
|
-
// if(block.displayvalue != null && block.displayvalue != undefined){
|
|
433
|
-
return (
|
|
434
|
-
<View key={i}>
|
|
435
|
-
<View style={{ width: '90%', flexDirection: 'row' }}>
|
|
436
|
-
|
|
437
|
-
<View style={{
|
|
438
|
-
borderWidth: 0.5, width: Dimensions.get('screen').width - normalize(44), marginBottom: normalize(5), borderRadius: normalize(7),
|
|
439
|
-
paddingHorizontal: normalize(0), flexDirection: 'row', alignItems: 'center',
|
|
440
|
-
}}>
|
|
441
|
-
|
|
442
|
-
<Icons.FontAwesome5
|
|
443
|
-
name="dot-circle"
|
|
444
|
-
color={Global.AppTheme.primary_color}
|
|
445
|
-
size={normalize(15)}
|
|
446
|
-
style={{ paddingHorizontal: normalize(5) }}
|
|
447
|
-
/>
|
|
448
|
-
|
|
449
|
-
<Text style={{ textAlign: 'left', width: '90%' }}>
|
|
450
|
-
{block.displayvalue}
|
|
451
|
-
</Text>
|
|
452
|
-
</View>
|
|
453
|
-
|
|
454
|
-
<View style={layoutstyles.display_selectedItems_view}>
|
|
455
|
-
<TouchableOpacity
|
|
456
|
-
style={layoutstyles.close_Image_View}
|
|
457
|
-
onPress={() => deSelectItem(block)}>
|
|
458
|
-
<View style={layoutstyles.close_Image}>
|
|
459
|
-
<Icons.Entypo
|
|
460
|
-
name="trash"
|
|
461
|
-
color="red"
|
|
462
|
-
size={normalize(15)}
|
|
463
|
-
/>
|
|
464
|
-
</View>
|
|
465
|
-
</TouchableOpacity>
|
|
466
|
-
</View>
|
|
467
|
-
</View>
|
|
468
|
-
</View>
|
|
469
|
-
);
|
|
470
|
-
// }
|
|
471
|
-
})
|
|
472
|
-
}
|
|
473
|
-
</View>
|
|
474
|
-
</View>
|
|
475
|
-
);
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
function getAllTabFunctions(key) {
|
|
481
|
-
switch (key) {
|
|
482
|
-
case 'CNI01':
|
|
483
|
-
saveData(false);
|
|
484
|
-
break;
|
|
485
|
-
case 'CNI02':
|
|
486
|
-
|
|
487
|
-
// setAdditionalNote('');
|
|
488
|
-
setCreateMode(prevstate => {
|
|
489
|
-
const updatejson = {
|
|
490
|
-
...prevstate,
|
|
491
|
-
savetext: '',
|
|
492
|
-
};
|
|
493
|
-
return updatejson;
|
|
494
|
-
});
|
|
495
|
-
break;
|
|
496
|
-
case 'CNI03':
|
|
497
|
-
saveData(true);
|
|
498
|
-
break;
|
|
499
|
-
}
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
function MainOnPress(item) {
|
|
503
|
-
|
|
504
|
-
if (item.stage == 2) {
|
|
505
|
-
NotesInstructionRetrieve();
|
|
506
|
-
}
|
|
507
|
-
else if (item.stage == 4) {
|
|
508
|
-
RetrieveAll();
|
|
509
|
-
}
|
|
510
|
-
else if (item.stage == 3) {
|
|
511
|
-
setCreateMode(defaultdata);
|
|
512
|
-
setStage(3);
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
return (
|
|
517
|
-
<View style={{ flex: 1, width: '100%', borderWidth: 0 }}>
|
|
518
|
-
<Text style={{ alignSelf: 'center', fontSize: normalize(12), fontWeight: 'bold', marginBottom: normalize(2), color: Global.AppTheme.primary_color }}>
|
|
519
|
-
{ValueCheck(responseJSON) &&
|
|
520
|
-
ValueCheck(responseJSON.consultationEdit) &&
|
|
521
|
-
ValueCheck(responseJSON.consultationEdit.heading) ?
|
|
522
|
-
responseJSON.consultationEdit.heading : ''}
|
|
523
|
-
{' '}
|
|
524
|
-
{ValueCheck(data) && ValueCheck(data.name) ? data.name.toUpperCase() : data.name}
|
|
525
|
-
</Text>
|
|
526
|
-
<View
|
|
527
|
-
style={{
|
|
528
|
-
width: '100%',
|
|
529
|
-
borderRadius: 5,
|
|
530
|
-
height: normalize(45),
|
|
531
|
-
flexDirection: 'row',
|
|
532
|
-
alignItems: 'center',
|
|
533
|
-
justifyContent: 'space-evenly',
|
|
534
|
-
marginVertical: normalize(5),
|
|
535
|
-
}}>
|
|
536
|
-
{[{
|
|
537
|
-
'display': 'FAV',
|
|
538
|
-
'stage': 2,
|
|
539
|
-
'color': '#eaf2ff',
|
|
540
|
-
'iconname': 'heart',
|
|
541
|
-
'shadowcolor': '#fff',
|
|
542
|
-
},
|
|
543
|
-
{
|
|
544
|
-
'display': ValueCheck(data) && ValueCheck(data.name) ? data.name.toUpperCase() : data.name,
|
|
545
|
-
'stage': 4,
|
|
546
|
-
'color': '#eaf2ff',
|
|
547
|
-
'iconname': 'menu',
|
|
548
|
-
'shadowcolor': '#fff',
|
|
549
|
-
},
|
|
550
|
-
{
|
|
551
|
-
'display': 'CREATE',
|
|
552
|
-
'stage': 3,
|
|
553
|
-
'color': '#eaf2ff',
|
|
554
|
-
'iconname': 'add-to-list',
|
|
555
|
-
'shadowcolor': '#fff',
|
|
556
|
-
},
|
|
557
|
-
].map((item, i) => {
|
|
558
|
-
return (
|
|
559
|
-
<TouchableOpacity
|
|
560
|
-
key={i}
|
|
561
|
-
onPress={() => {
|
|
562
|
-
MainOnPress(item);
|
|
563
|
-
}}
|
|
564
|
-
style={{
|
|
565
|
-
borderRadius: 7,
|
|
566
|
-
borderWidth: 1,
|
|
567
|
-
height: normalize(40),
|
|
568
|
-
width: normalize(55),
|
|
569
|
-
backgroundColor: stage == item.stage ? item.color : '#fff',
|
|
570
|
-
borderColor: stage == item.stage ? '#eaf2ff' : Global.AppTheme.primary_color,
|
|
571
|
-
alignItems: 'center',
|
|
572
|
-
justifyContent: 'center',
|
|
573
|
-
padding: 0,
|
|
574
|
-
elevation: 2,
|
|
575
|
-
shadowColor: '#000',
|
|
576
|
-
shadowOffset: { width: 0, height: 2 },
|
|
577
|
-
shadowOpacity: 0.1,
|
|
578
|
-
shadowRadius: 2,
|
|
579
|
-
}}
|
|
580
|
-
>
|
|
581
|
-
<View style={{
|
|
582
|
-
flex: 1,
|
|
583
|
-
alignItems: 'center',
|
|
584
|
-
justifyContent: 'center',
|
|
585
|
-
}}>
|
|
586
|
-
<Icons.Entypo
|
|
587
|
-
name={item.iconname}
|
|
588
|
-
style={{ paddingRight: 0 }}
|
|
589
|
-
color={Global.AppTheme.primary_color}
|
|
590
|
-
size={normalize(20)}
|
|
591
|
-
/>
|
|
592
|
-
<Text adjustsFontSizeToFit numberOfLines={1} style={{
|
|
593
|
-
color: Global.AppTheme.primary_color,
|
|
594
|
-
fontSize: normalize(10),
|
|
595
|
-
fontWeight: stage == item.stage ? 'bold' : 'normal',
|
|
596
|
-
textAlign: 'center',
|
|
597
|
-
}}>
|
|
598
|
-
{item.display}
|
|
599
|
-
</Text>
|
|
600
|
-
</View>
|
|
601
|
-
</TouchableOpacity>
|
|
602
|
-
);
|
|
603
|
-
})}
|
|
604
|
-
</View>
|
|
605
|
-
|
|
606
|
-
<View style={{ flex: 1, borderWidth: 0 }}>
|
|
607
|
-
{stage == 2 ? ( // FAV
|
|
608
|
-
|
|
609
|
-
<View style={{ flex: 1, borderWidth: 0 }}>
|
|
610
|
-
{isBNUL(displayData) ?
|
|
611
|
-
<CMultiSelect
|
|
612
|
-
component={data}
|
|
613
|
-
searchableData={displayData}
|
|
614
|
-
singlecallBack={(i, items) => {
|
|
615
|
-
setDisplayData(prevstate => {
|
|
616
|
-
const updatejson = [...prevstate];
|
|
617
|
-
|
|
618
|
-
const findindex = updatejson.findIndex(item => item.datavalue === items.datavalue);
|
|
619
|
-
|
|
620
|
-
updatejson[findindex] = {
|
|
621
|
-
...updatejson[findindex],
|
|
622
|
-
selected: !updatejson[findindex].selected,
|
|
623
|
-
};
|
|
624
|
-
return updatejson;
|
|
625
|
-
});
|
|
626
|
-
}}
|
|
627
|
-
selectCallBack={(val) => {
|
|
628
|
-
props.notesSelectCallBack(displayData);
|
|
629
|
-
props.visibility(false);
|
|
630
|
-
}}
|
|
631
|
-
editCallBack={(val) => {
|
|
632
|
-
|
|
633
|
-
let prevcodearray = displayData.filter((i, k) => { return i.selected ? { ...i } : undefined; });
|
|
634
|
-
let prevcode = isBNUL(prevcodearray) ? prevcodearray[0] : null;
|
|
635
|
-
|
|
636
|
-
setCreateMode(prevstate => {
|
|
637
|
-
const updatejson = {
|
|
638
|
-
...prevstate,
|
|
639
|
-
editmode: true,
|
|
640
|
-
editstatus: false,
|
|
641
|
-
favorite: stage == 2 ? true : false,
|
|
642
|
-
savetext: isNU(prevcode) ? prevcode.displayvalue : '',
|
|
643
|
-
savecode: isNU(prevcode) ? prevcode.datavalue : '',
|
|
644
|
-
temptext: isNU(prevcode) ? prevcode.displayvalue : '',
|
|
645
|
-
};
|
|
646
|
-
return updatejson;
|
|
647
|
-
});
|
|
648
|
-
setStage(3);
|
|
649
|
-
}}
|
|
650
|
-
/>
|
|
651
|
-
: null}
|
|
652
|
-
</View>
|
|
653
|
-
|
|
654
|
-
) : stage == 3 ? ( // CREATE
|
|
655
|
-
|
|
656
|
-
<View style={{ flex: 1 }}>
|
|
657
|
-
<ScrollView keyboardShouldPersistTaps="handled">
|
|
658
|
-
<View style={{}}>
|
|
659
|
-
{/* <ScrollView
|
|
660
|
-
keyboardShouldPersistTaps="handled"
|
|
661
|
-
style={{ flex: 1 }}
|
|
662
|
-
contentContainerStyle={{
|
|
663
|
-
alignItems: 'center',
|
|
664
|
-
justifyContent: 'center',
|
|
665
|
-
}}>
|
|
666
|
-
{(
|
|
667
|
-
data.NotesArray &&
|
|
668
|
-
data.NotesArray != null &&
|
|
669
|
-
data.NotesArray != undefined
|
|
670
|
-
) ||
|
|
671
|
-
(
|
|
672
|
-
data.InstructionsArray &&
|
|
673
|
-
data.InstructionsArray != null &&
|
|
674
|
-
data.InstructionsArray != undefined
|
|
675
|
-
) ||
|
|
676
|
-
(
|
|
677
|
-
data.infectioncontrol &&
|
|
678
|
-
data.infectioncontrol != null &&
|
|
679
|
-
data.infectioncontrol != undefined
|
|
680
|
-
) ? (
|
|
681
|
-
displaySelectedItems(props.data)
|
|
682
|
-
) : (
|
|
683
|
-
<View style={{ paddingTop: 50 }}>
|
|
684
|
-
<Text style={[ComponentStyles.no_data_found_text]}>
|
|
685
|
-
No data..Please Add {data.name}{' '}
|
|
686
|
-
</Text>
|
|
687
|
-
</View>
|
|
688
|
-
)}
|
|
689
|
-
</ScrollView> */}
|
|
690
|
-
|
|
691
|
-
<View
|
|
692
|
-
style={{
|
|
693
|
-
position: 'absolute',
|
|
694
|
-
bottom: normalize(-5),
|
|
695
|
-
width: '100%',
|
|
696
|
-
justifyContent: 'center',
|
|
697
|
-
alignItems: 'center',
|
|
698
|
-
}}>
|
|
699
|
-
{props.data.name == 'Infection Control' ? (
|
|
700
|
-
<TouchableOpacity style={{
|
|
701
|
-
justifyContent: 'center',
|
|
702
|
-
borderRadius: 10,
|
|
703
|
-
alignItems: 'center',
|
|
704
|
-
paddingHorizontal: normalize(10),
|
|
705
|
-
}}
|
|
706
|
-
onPress={() => saveInfectionControl()}
|
|
707
|
-
>
|
|
708
|
-
<View style={{
|
|
709
|
-
flexDirection: 'column',
|
|
710
|
-
backgroundColor: '#f7f4f4',
|
|
711
|
-
borderRadius: 10,
|
|
712
|
-
paddingHorizontal: normalize(5),
|
|
713
|
-
paddingVertical: normalize(0),
|
|
714
|
-
alignItems: 'center',
|
|
715
|
-
}}>
|
|
716
|
-
<Entypo
|
|
717
|
-
name="save"
|
|
718
|
-
color={Global.AppTheme.primary_color}
|
|
719
|
-
size={normalize(20)}
|
|
720
|
-
/>
|
|
721
|
-
<Text
|
|
722
|
-
style={{
|
|
723
|
-
fontSize: normalize(11),
|
|
724
|
-
color: Global.AppTheme.primary_color,
|
|
725
|
-
fontWeight: 'bold',
|
|
726
|
-
}}>
|
|
727
|
-
{' '}
|
|
728
|
-
{'Save'}
|
|
729
|
-
</Text>
|
|
730
|
-
</View>
|
|
731
|
-
</TouchableOpacity>
|
|
732
|
-
) : null}
|
|
733
|
-
</View>
|
|
734
|
-
</View>
|
|
735
|
-
|
|
736
|
-
<View style={{ flex: 1, alignSelf: 'center' }}>
|
|
737
|
-
<View style={{ flexDirection: 'row', justifyContent: 'space-between', alignItems: 'center', borderWidth: 0 }}>
|
|
738
|
-
<Text style={{ fontWeight: '300', fontSize: normalize(12), color: 'black', borderWidth: 0, flex: 1 }}>
|
|
739
|
-
{createMode.editmode ? 'Edit' : 'Create'}
|
|
740
|
-
{' '}
|
|
741
|
-
{ValueCheck(data) && ValueCheck(data.name) ? data.name.slice(0, -1) : null}
|
|
742
|
-
{' '}
|
|
743
|
-
{createMode.editmode && isNUQ(createMode.temptext) ?
|
|
744
|
-
<Text style={{ fontWeight: '400' }}>
|
|
745
|
-
{' - '}{createMode.temptext}
|
|
746
|
-
</Text>
|
|
747
|
-
: null}
|
|
748
|
-
</Text>
|
|
749
|
-
<View style={{ flexDirection: 'row', alignSelf: 'flex-start' }}>
|
|
750
|
-
{data.name == 'Notes' || data.name == 'Instructions' ? (
|
|
751
|
-
<TouchableOpacity
|
|
752
|
-
onPress={() => {
|
|
753
|
-
setCreateMode(prevstate => {
|
|
754
|
-
const updatejson = {
|
|
755
|
-
...prevstate,
|
|
756
|
-
favorite: !prevstate.favorite,
|
|
757
|
-
editstatus: true,
|
|
758
|
-
};
|
|
759
|
-
return updatejson;
|
|
760
|
-
});
|
|
761
|
-
}}
|
|
762
|
-
style={{
|
|
763
|
-
width: normalize(40),
|
|
764
|
-
justifyContent: 'center',
|
|
765
|
-
alignItems: 'center',
|
|
766
|
-
}}>
|
|
767
|
-
<HOCIcons.Fontisto
|
|
768
|
-
name={createMode.favorite ? 'toggle-on' : 'toggle-off'}
|
|
769
|
-
size={normalize(30)}
|
|
770
|
-
color={createMode.favorite ? 'green' : '#646464'}
|
|
771
|
-
// style={{ textAlign: 'center', borderWidth: 0, }}
|
|
772
|
-
/>
|
|
773
|
-
<Text numberOfLines={1} adjustsFontSizeToFit style={{ bottom: normalize(-3), position: 'absolute', color: Global.AppTheme.primary_color, fontSize: normalize(9), textAlign: 'center', fontWeight: 'bold' }}>Favourite</Text>
|
|
774
|
-
</TouchableOpacity>
|
|
775
|
-
) : null}
|
|
776
|
-
</View>
|
|
777
|
-
</View>
|
|
778
|
-
|
|
779
|
-
{isLoading ? null : (
|
|
780
|
-
isMsgShow ?
|
|
781
|
-
<Text style={ComponentStyles.errorMsgText}>
|
|
782
|
-
{msg}
|
|
783
|
-
</Text> : null
|
|
784
|
-
)}
|
|
785
|
-
<View
|
|
786
|
-
style={{
|
|
787
|
-
flexDirection: 'row',
|
|
788
|
-
borderWidth: 0.7,
|
|
789
|
-
borderColor: 'black',
|
|
790
|
-
width: '90%',
|
|
791
|
-
justifyContent: 'flex-start',
|
|
792
|
-
alignItems: 'center',
|
|
793
|
-
borderRadius: 7,
|
|
794
|
-
marginBottom: height * 0.003,
|
|
795
|
-
height: height * 0.30,
|
|
796
|
-
backgroundColor: '#fff',
|
|
797
|
-
marginTop: normalize(5),
|
|
798
|
-
}}>
|
|
799
|
-
<TextInput
|
|
800
|
-
placeholder={'Type Here'}
|
|
801
|
-
keyboardType={'default'}
|
|
802
|
-
multiline={true}
|
|
803
|
-
numberOfLines={5}
|
|
804
|
-
placeholderTextColor={'lightgray'}
|
|
805
|
-
onChangeText={changevalue =>
|
|
806
|
-
|
|
807
|
-
setCreateMode(prevstate => {
|
|
808
|
-
const updatejson = {
|
|
809
|
-
...prevstate,
|
|
810
|
-
editstatus: true,
|
|
811
|
-
savetext: changevalue,
|
|
812
|
-
};
|
|
813
|
-
return updatejson;
|
|
814
|
-
})
|
|
815
|
-
}
|
|
816
|
-
value={createMode.savetext}
|
|
817
|
-
style={getPopupTextAreaStyle(width, height)}
|
|
818
|
-
/>
|
|
819
|
-
</View>
|
|
820
|
-
</View>
|
|
821
|
-
</ScrollView>
|
|
822
|
-
|
|
823
|
-
<View style={{ flexDirection: 'row' }}>
|
|
824
|
-
{[
|
|
825
|
-
{
|
|
826
|
-
'displaytext': 'Save',
|
|
827
|
-
'fontcolor': Global.AppTheme.primary_color,
|
|
828
|
-
'shadowcolor': '#fff',
|
|
829
|
-
'size': 10,
|
|
830
|
-
'iconname': 'save',
|
|
831
|
-
'iconcolor': Global.AppTheme.primary_color,
|
|
832
|
-
'selected': false,
|
|
833
|
-
'visibility': createMode.editstatus && isNUQ(createMode.savetext) ? true : false,
|
|
834
|
-
'iconsize': 20,
|
|
835
|
-
'functionid': 'CNI01',
|
|
836
|
-
},
|
|
837
|
-
{
|
|
838
|
-
'displaytext': 'Delete',
|
|
839
|
-
'fontcolor': 'red',
|
|
840
|
-
'shadowcolor': '#fff',
|
|
841
|
-
'size': 10,
|
|
842
|
-
'iconname': 'trash-alt',
|
|
843
|
-
'iconcolor': Global.AppTheme.primary_color,
|
|
844
|
-
'selected': false,
|
|
845
|
-
'visibility': createMode.editmode ? true : false,
|
|
846
|
-
'iconsize': 20,
|
|
847
|
-
'functionid': 'CNI03',
|
|
848
|
-
},
|
|
849
|
-
{
|
|
850
|
-
'displaytext': 'Clear',
|
|
851
|
-
'fontcolor': Global.AppTheme.primary_color,
|
|
852
|
-
'shadowcolor': '#fff',
|
|
853
|
-
'size': 10,
|
|
854
|
-
'iconname': 'eraser',
|
|
855
|
-
'iconcolor': Global.AppTheme.primary_color,
|
|
856
|
-
'selected': false,
|
|
857
|
-
'visibility': isNUQ(createMode.savetext) ? true : false,
|
|
858
|
-
'iconsize': 20,
|
|
859
|
-
'functionid': 'CNI02',
|
|
860
|
-
},
|
|
861
|
-
].map((item, i) => {
|
|
862
|
-
return item.visibility ?
|
|
863
|
-
(
|
|
864
|
-
<View key={i} style={{ borderRadius: normalize(10), paddingLeft: normalize(10) }}>
|
|
865
|
-
<CAwesomeButton
|
|
866
|
-
data={item}
|
|
867
|
-
callBack={val => val == undefined ? null : getAllTabFunctions(item.functionid)}
|
|
868
|
-
/>
|
|
869
|
-
</View>)
|
|
870
|
-
: null;
|
|
871
|
-
})}
|
|
872
|
-
</View>
|
|
873
|
-
</View>
|
|
874
|
-
|
|
875
|
-
) : stage == 4 ? ( // ALL
|
|
876
|
-
|
|
877
|
-
<View style={{ borderWidth: 0, flex: 1 }}>
|
|
878
|
-
{isBNUL(displayData) ?
|
|
879
|
-
<CMultiSelect
|
|
880
|
-
component={data}
|
|
881
|
-
searchableData={displayData}
|
|
882
|
-
singlecallBack={(i, items) => {
|
|
883
|
-
setDisplayData(prevstate => {
|
|
884
|
-
const updatejson = [...prevstate];
|
|
885
|
-
|
|
886
|
-
const findindex = updatejson.findIndex(item => item.datavalue === items.datavalue);
|
|
887
|
-
|
|
888
|
-
updatejson[findindex] = {
|
|
889
|
-
...updatejson[findindex],
|
|
890
|
-
selected: !updatejson[findindex].selected,
|
|
891
|
-
};
|
|
892
|
-
return updatejson;
|
|
893
|
-
});
|
|
894
|
-
}}
|
|
895
|
-
selectCallBack={(val) => {
|
|
896
|
-
props.notesSelectCallBack(displayData);
|
|
897
|
-
props.visibility(false);
|
|
898
|
-
}}
|
|
899
|
-
editCallBack={(val) => {
|
|
900
|
-
|
|
901
|
-
let prevcodearray = displayData.filter((i, k) => { return i.selected ? { ...i } : undefined; });
|
|
902
|
-
let prevcode = isBNUL(prevcodearray) ? prevcodearray[0] : null;
|
|
903
|
-
|
|
904
|
-
setCreateMode(prevstate => {
|
|
905
|
-
const updatejson = {
|
|
906
|
-
...prevstate,
|
|
907
|
-
editstatus: false,
|
|
908
|
-
editmode: true,
|
|
909
|
-
favorite: stage == 2 ? true : false,
|
|
910
|
-
savetext: isNU(prevcode) ? prevcode.displayvalue : '',
|
|
911
|
-
savecode: isNU(prevcode) ? prevcode.datavalue : '',
|
|
912
|
-
temptext: isNU(prevcode) ? prevcode.displayvalue : '',
|
|
913
|
-
};
|
|
914
|
-
return updatejson;
|
|
915
|
-
});
|
|
916
|
-
|
|
917
|
-
setStage(3);
|
|
918
|
-
}}
|
|
919
|
-
/>
|
|
920
|
-
: null}
|
|
921
|
-
</View>
|
|
922
|
-
|
|
923
|
-
)
|
|
924
|
-
: null}
|
|
925
|
-
</View>
|
|
926
|
-
{isLoading ?
|
|
927
|
-
<Loader displaytext={true} />
|
|
928
|
-
: null}
|
|
929
|
-
</View>
|
|
930
|
-
);
|
|
931
|
-
|
|
932
|
-
}
|
|
933
|
-
export default memo(CNotesInstructions);
|
|
934
|
-
|
|
935
|
-
const layoutstyles = StyleSheet.create({
|
|
936
|
-
display_selectedItems_container: {
|
|
937
|
-
flexDirection: 'row',
|
|
938
|
-
flexWrap: 'wrap',
|
|
939
|
-
overflow: 'hidden',
|
|
940
|
-
},
|
|
941
|
-
component_container: {
|
|
942
|
-
flexDirection: 'row',
|
|
943
|
-
borderWidth: 0.5,
|
|
944
|
-
borderColor: colors.color_componentBordercolor,
|
|
945
|
-
borderRadius: 7,
|
|
946
|
-
margin: 2,
|
|
947
|
-
marginRight: 5,
|
|
948
|
-
// backgroundColor:'red'
|
|
949
|
-
},
|
|
950
|
-
display_selectedItems_view: {
|
|
951
|
-
padding: 2,
|
|
952
|
-
justifyContent: 'center',
|
|
953
|
-
},
|
|
954
|
-
close_Image_View: {
|
|
955
|
-
width: '100%',
|
|
956
|
-
alignItems: 'flex-end',
|
|
957
|
-
},
|
|
958
|
-
close_Image: {
|
|
959
|
-
width: normalize(22),
|
|
960
|
-
height: normalize(22),
|
|
961
|
-
justifyContent: 'center',
|
|
962
|
-
borderRadius: 90,
|
|
963
|
-
borderColor: 'black',
|
|
964
|
-
},
|
|
965
|
-
display_selectedItems_Text: {
|
|
966
|
-
fontSize: normalize(14),
|
|
967
|
-
color: colors.color_componentText,
|
|
968
|
-
textAlign: 'justify',
|
|
969
|
-
},
|
|
970
|
-
});
|
|
971
|
-
|
|
972
|
-
{
|
|
973
|
-
/**
|
|
974
|
-
To select the Notes or Instructions
|
|
975
|
-
Stage 1- To Display selected items
|
|
976
|
-
stage 2- To list the Items
|
|
977
|
-
stage 3- can add a new item
|
|
978
|
-
{
|
|
979
|
-
"display": "FAV",
|
|
980
|
-
"stage": 2,
|
|
981
|
-
"color": "#eaf2ff",
|
|
982
|
-
"iconname": "heart",
|
|
983
|
-
"shadowcolor": "#fff"
|
|
984
|
-
},
|
|
985
|
-
{
|
|
986
|
-
"display": "ALL",
|
|
987
|
-
"stage": 4,
|
|
988
|
-
"color": "#eaf2ff",
|
|
989
|
-
"iconname": "menu",
|
|
990
|
-
"shadowcolor": "#fff"
|
|
991
|
-
},
|
|
992
|
-
{
|
|
993
|
-
"display": "CREATE",
|
|
994
|
-
"stage": 3,
|
|
995
|
-
"color": "#eaf2ff",
|
|
996
|
-
"iconname": "add-to-list",
|
|
997
|
-
"shadowcolor": "#fff"
|
|
998
|
-
}
|
|
999
|
-
*/
|
|
1000
|
-
}
|