@jescon-technologies/react-native-ui-kit 0.0.6 → 0.0.8
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 +2 -66
- package/index.js +1 -66
- package/package.json +1 -1
- package/src/Alerts/AAlert.js +0 -137
- package/src/Alerts/AAlertIOS.js +0 -97
- package/src/Alerts/ABlink.js +0 -40
- 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,218 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Defs, LinearGradient, Stop, Text, Line } from 'react-native-svg';
|
|
3
|
-
import { View, Dimensions, TouchableOpacity } from 'react-native';
|
|
4
|
-
import { BarChart, Grid, XAxis } from 'react-native-svg-charts';
|
|
5
|
-
import CText from '../../CustomComponents/CText';
|
|
6
|
-
import moment from 'moment';
|
|
7
|
-
import SDatePickerNew from '../../StaticComponents/SDatePickerNew';
|
|
8
|
-
import { normalize } from '../../CommonStyle/componentStyle';
|
|
9
|
-
|
|
10
|
-
export default function CBarChart(props) {
|
|
11
|
-
const fill = '#0e4482';
|
|
12
|
-
// const OverlayHOCComponentChart = HChart(HeaderBlock);
|
|
13
|
-
const { height, width } = Dimensions.get('screen');
|
|
14
|
-
const [propsData, setPropsData] = useState(props.data);
|
|
15
|
-
const [Nested, setNested] = useState(false);
|
|
16
|
-
const [data, setData] = useState((propsData).map(({ value }) => value));
|
|
17
|
-
const axesSvg = { fontSize: normalize(11), fill: 'grey' };
|
|
18
|
-
const verticalContentInset = { top: 5, bottom: 5 };
|
|
19
|
-
const xAxisHeight = 30;
|
|
20
|
-
|
|
21
|
-
function getDateWiseLineChart(params) {
|
|
22
|
-
console.log('TYGWUFYUFUF', moment(params).format('YYYY-MM-DD'));
|
|
23
|
-
setPropsData([{
|
|
24
|
-
'value': 55,
|
|
25
|
-
'display': 'JAN',
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
'value': 35,
|
|
29
|
-
'display': 'FEB',
|
|
30
|
-
}]);
|
|
31
|
-
setData(([{
|
|
32
|
-
'value': 55,
|
|
33
|
-
'display': 'JANUVARY',
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
'value': 35,
|
|
37
|
-
'display': 'FEBRUVARY',
|
|
38
|
-
}]).map(({ value }) => value));
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function getPreviousInfo() {
|
|
42
|
-
setNested(true);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
const CUT_OFF = props.component != undefined && props.component.benchmarkcutoff != undefined &&
|
|
46
|
-
props.component.benchmarkcutoff != 0 ? props.component.benchmarkcutoff : 0;
|
|
47
|
-
console.log('CUTTTTTTTT OFFFFFFFFFFFF', JSON.stringify(CUT_OFF));
|
|
48
|
-
const Labels = ({ x, y, bandwidth, data }) => (
|
|
49
|
-
data.map((value, index) => (
|
|
50
|
-
<Text
|
|
51
|
-
key={index}
|
|
52
|
-
x={x(index) + (bandwidth / 2)}
|
|
53
|
-
y={value < CUT_OFF ? y(value) - 10 : y(value) + 15}
|
|
54
|
-
fontSize={normalize(10)}
|
|
55
|
-
fontWeight={'bold'}
|
|
56
|
-
fill={value >= CUT_OFF ? 'white' : 'red'}
|
|
57
|
-
alignmentBaseline={'middle'}
|
|
58
|
-
textAnchor={'middle'}
|
|
59
|
-
>
|
|
60
|
-
{value}
|
|
61
|
-
</Text>)));
|
|
62
|
-
|
|
63
|
-
const Gradient = () => (
|
|
64
|
-
<Defs key={'gradient'}>
|
|
65
|
-
<LinearGradient id={'gradient'} x1={'0%'} y={'0%'} x2={'0%'} y2={'100%'}>
|
|
66
|
-
<Stop offset={'0%'} stopColor={'black'} />
|
|
67
|
-
<Stop offset={'100%'} stopColor={'grey'} />
|
|
68
|
-
</LinearGradient>
|
|
69
|
-
</Defs>
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
const HorizontalLine = (({ y }) => (
|
|
73
|
-
<Line
|
|
74
|
-
key={'zero-axis'}
|
|
75
|
-
x1={'0%'}
|
|
76
|
-
x2={'100%'}
|
|
77
|
-
y1={y(50)}
|
|
78
|
-
y2={y(50)}
|
|
79
|
-
stroke={'green'}
|
|
80
|
-
strokeDasharray={[4, 6]}
|
|
81
|
-
strokeWidth={normalize(3)}
|
|
82
|
-
/>
|
|
83
|
-
));
|
|
84
|
-
return (
|
|
85
|
-
data != null && data != undefined ?
|
|
86
|
-
<>
|
|
87
|
-
{Nested ?
|
|
88
|
-
<CHistoryChart data={{
|
|
89
|
-
'keyid': 3,
|
|
90
|
-
'customcomponent': 'CBarChart',
|
|
91
|
-
'heading': 'Monthly Profit',
|
|
92
|
-
'date': '2021-03-01',
|
|
93
|
-
'data': [
|
|
94
|
-
{
|
|
95
|
-
'value': 65,
|
|
96
|
-
'display': 'Billed',
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
'value': 65,
|
|
100
|
-
'display': 'Dispensed',
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
'value': 467,
|
|
104
|
-
'display': 'Picked',
|
|
105
|
-
},
|
|
106
|
-
],
|
|
107
|
-
}} /> : null}
|
|
108
|
-
<View style={{ marginRight: 2, marginTop: 10 }}>
|
|
109
|
-
<View style={{ justifyContent: 'space-between', flexDirection: 'row' }}>
|
|
110
|
-
<CText style={{ fontSize: normalize(15), paddingHorizontal: 5, fontWeight: 'bold', color: 'black' }}>{props.component.heading}</CText>
|
|
111
|
-
{/* <TouchableOpacity onPress={() => getPreviousInfo()} style={{ alignItems: 'center' }}>
|
|
112
|
-
<MaterialCommunityIcons name={'scale-balance'} color="black" size={normalize(20)} style={{ opacity: 0.8 }} />
|
|
113
|
-
<CText style={{ fontSize: normalize(10), color: 'black' }}>{"Compare"}</CText>
|
|
114
|
-
</TouchableOpacity> */}
|
|
115
|
-
</View>
|
|
116
|
-
|
|
117
|
-
{props.component.date != undefined ?
|
|
118
|
-
<View>
|
|
119
|
-
<SDatePickerNew
|
|
120
|
-
callBack={val => (val == undefined ? null : getDateWiseLineChart(val))} />
|
|
121
|
-
</View> : null}
|
|
122
|
-
|
|
123
|
-
<View style={{ height: normalize(225), padding: normalize(5), flexDirection: 'row' }}>
|
|
124
|
-
<View style={{ flex: 1 }}>
|
|
125
|
-
<BarChart
|
|
126
|
-
style={{ flex: 1 }}
|
|
127
|
-
data={data}
|
|
128
|
-
svg={{
|
|
129
|
-
strokeWidth: 2,
|
|
130
|
-
fill: 'url(#gradient)',
|
|
131
|
-
}}
|
|
132
|
-
spacingInner={0.5}
|
|
133
|
-
spacing={0.2}
|
|
134
|
-
gridMin={0}
|
|
135
|
-
>
|
|
136
|
-
{CUT_OFF != 0 ? <HorizontalLine /> : null}
|
|
137
|
-
<Grid />
|
|
138
|
-
<Gradient />
|
|
139
|
-
<Labels />
|
|
140
|
-
</BarChart>
|
|
141
|
-
<XAxis
|
|
142
|
-
style={{ marginHorizontal: -10, height: xAxisHeight }}
|
|
143
|
-
data={propsData}
|
|
144
|
-
formatLabel={(value, index) => propsData[index].display}
|
|
145
|
-
contentInset={{ left: normalize(20), right: normalize(40) }}
|
|
146
|
-
svg={{ fontSize: normalize(9), fontWeight: 'bold', fill: 'black', translateY: normalize(8), rotation: normalize(10), originY: 40 }}
|
|
147
|
-
/>
|
|
148
|
-
</View>
|
|
149
|
-
</View>
|
|
150
|
-
|
|
151
|
-
{CUT_OFF != 0 ?
|
|
152
|
-
<View style={{ flexDirection: 'row', justifyContent: 'space-evenly', width: '50%', marginBottom: normalize(10) }}>
|
|
153
|
-
<CText style={{ color: 'darkgreen', fontWeight: 'bold' }}>----</CText>
|
|
154
|
-
<CText style={{ color: 'black', fontSize: normalize(14) }}>Benchmark: {CUT_OFF}</CText>
|
|
155
|
-
</View> : null}
|
|
156
|
-
</View>
|
|
157
|
-
</>
|
|
158
|
-
: null
|
|
159
|
-
);
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
// <CBarChart
|
|
163
|
-
// component={BarChart}
|
|
164
|
-
// data={BarChart.data}
|
|
165
|
-
// />
|
|
166
|
-
|
|
167
|
-
// var BarChart = {
|
|
168
|
-
// "keyid": 3,
|
|
169
|
-
// "customcomponent": "CBarChart",
|
|
170
|
-
// "date": "2021-03-01",
|
|
171
|
-
// "benchmarkcutoff": 23,
|
|
172
|
-
// "heading": "Yearly",
|
|
173
|
-
// "data": [
|
|
174
|
-
// {
|
|
175
|
-
// "value": 13,
|
|
176
|
-
// "display": "1"
|
|
177
|
-
// },
|
|
178
|
-
// {
|
|
179
|
-
// "value": 45,
|
|
180
|
-
// "display": "2"
|
|
181
|
-
// },
|
|
182
|
-
// {
|
|
183
|
-
// "value": 87,
|
|
184
|
-
// "display": "3"
|
|
185
|
-
// },
|
|
186
|
-
// {
|
|
187
|
-
// "value": 98,
|
|
188
|
-
// "display": "4"
|
|
189
|
-
// },
|
|
190
|
-
// {
|
|
191
|
-
// "value": 34,
|
|
192
|
-
// "display": "5"
|
|
193
|
-
// },
|
|
194
|
-
// {
|
|
195
|
-
// "value": 19,
|
|
196
|
-
// "display": "6"
|
|
197
|
-
// },
|
|
198
|
-
// {
|
|
199
|
-
// "value": 12,
|
|
200
|
-
// "display": "7"
|
|
201
|
-
// },
|
|
202
|
-
// {
|
|
203
|
-
// "value": 13,
|
|
204
|
-
// "display": "8"
|
|
205
|
-
// },
|
|
206
|
-
// {
|
|
207
|
-
// "value": 67,
|
|
208
|
-
// "display": "9"
|
|
209
|
-
// },
|
|
210
|
-
// {
|
|
211
|
-
// "value": 45,
|
|
212
|
-
// "display": "10"
|
|
213
|
-
// }
|
|
214
|
-
// ]
|
|
215
|
-
// }
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Text, TouchableOpacity, Dimensions } from 'react-native';
|
|
3
|
-
import { FlashList } from '@shopify/flash-list';
|
|
4
|
-
import { isBNU, isBNUL } from '../../CommonStyle/ComponentFunctions';
|
|
5
|
-
// import PieChart from 'react-native-pie-chart';
|
|
6
|
-
import { normalize } from '../../CommonStyle/componentStyle';
|
|
7
|
-
import Icons from '../../Common/Icons';
|
|
8
|
-
|
|
9
|
-
export default function CDashBoardList(params) {
|
|
10
|
-
function renderDataNew(params, l, pindex) {
|
|
11
|
-
let newdata = isBNUL(params.item.data) ? params.item.data.filter(function (item) { return item; }) : [];
|
|
12
|
-
return (
|
|
13
|
-
isBNUL(newdata) ?
|
|
14
|
-
<View style={{
|
|
15
|
-
margin: normalize(5),
|
|
16
|
-
borderWidth: 1,
|
|
17
|
-
backgroundColor: params.item.view ? '#ffffff36' : '#ffffff00',
|
|
18
|
-
borderColor: 'lightgrey',
|
|
19
|
-
borderRadius: 5,
|
|
20
|
-
justifyContent: 'center',
|
|
21
|
-
alignItems: 'center',
|
|
22
|
-
padding: normalize(5),
|
|
23
|
-
}}>
|
|
24
|
-
<View style={{ borderWidth: 0, width: '100%', justifyContent: 'center', alignItems: 'center', paddingBottom: normalize(5), borderWidth: 0 }}>
|
|
25
|
-
<Text
|
|
26
|
-
style={{
|
|
27
|
-
fontSize: normalize(10),
|
|
28
|
-
fontWeight: 'bold',
|
|
29
|
-
color: 'black',
|
|
30
|
-
}}>
|
|
31
|
-
{params.item.heading}
|
|
32
|
-
</Text>
|
|
33
|
-
</View>
|
|
34
|
-
|
|
35
|
-
<View
|
|
36
|
-
style={{
|
|
37
|
-
flexDirection: 'row',
|
|
38
|
-
borderRadius: 5,
|
|
39
|
-
justifyContent: 'center',
|
|
40
|
-
alignItems: 'center',
|
|
41
|
-
}}
|
|
42
|
-
>
|
|
43
|
-
|
|
44
|
-
<PieChart
|
|
45
|
-
widthAndHeight={normalize(150)}
|
|
46
|
-
series={isBNUL(newdata) ? newdata.map((val) => { return isBNU(val.value) ? val.value : undefined; }) : []}
|
|
47
|
-
sliceColor={isBNUL(newdata) ? newdata.map((val) => { return isBNU(val.bcolor) ? val.bcolor : undefined; }) : []}
|
|
48
|
-
coverRadius={0.1}
|
|
49
|
-
coverFill={'#ffffff8a'}
|
|
50
|
-
/>
|
|
51
|
-
|
|
52
|
-
<View style={{ height: normalize(210), width: normalize(160) }}>
|
|
53
|
-
<FlashList
|
|
54
|
-
showsVerticalScrollIndicator={true}
|
|
55
|
-
persistentscrollbar={true}
|
|
56
|
-
data={newdata}
|
|
57
|
-
nestedScrollEnabled={true}
|
|
58
|
-
renderItem={val => renderChartList(val, pindex, l, params.index, newdata, params.item.view)}
|
|
59
|
-
keyExtractor={(item, index) => index.toString()}
|
|
60
|
-
estimatedItemSize={normalize(20)}
|
|
61
|
-
/>
|
|
62
|
-
<View style={{ justifyContent: 'center', alignItems: 'center', marginVertical: 0, zIndex: 3 }}>
|
|
63
|
-
<Text style={{ fontSize: normalize(10), color: 'darkblue' }}>Scroll down</Text>
|
|
64
|
-
<Icons.FontAwesome5
|
|
65
|
-
name={'sort-down'}
|
|
66
|
-
size={normalize(18)}
|
|
67
|
-
color={'darkblue'}
|
|
68
|
-
/>
|
|
69
|
-
</View>
|
|
70
|
-
</View>
|
|
71
|
-
</View>
|
|
72
|
-
</View>
|
|
73
|
-
: null
|
|
74
|
-
);
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
function renderChartList(v, pindex, pview, newindex, darray, arrayview) {
|
|
78
|
-
return (
|
|
79
|
-
<TouchableOpacity
|
|
80
|
-
onPress={() => { params.callback(pindex, true, pview, newindex, darray, v.index, v.item.link, false); }}
|
|
81
|
-
style={{
|
|
82
|
-
flexDirection: 'row',
|
|
83
|
-
alignItems: 'center',
|
|
84
|
-
justifyContent: 'flex-start',
|
|
85
|
-
borderWidth: (arrayview && v.item.view) ? 0 : 0,
|
|
86
|
-
borderRadius: 5,
|
|
87
|
-
borderColor: 'grey',
|
|
88
|
-
marginVertical: normalize(3),
|
|
89
|
-
marginHorizontal: normalize(5),
|
|
90
|
-
padding: normalize(3),
|
|
91
|
-
borderWidth: 0,
|
|
92
|
-
backgroundColor: (arrayview && v.item.view) ? '#f0f0f0' : 'transparent',
|
|
93
|
-
}}>
|
|
94
|
-
<View style={{ borderWidth: 0, borderColor: '#808080', backgroundColor: v.item.bcolor, textAlign: 'center', justifyContent: 'center', alignItems: 'center', borderRadius: 5, width: normalize(35), height: normalize(20) }}>
|
|
95
|
-
<Text adjustsFontSizeToFit numberOfLines={2} style={{
|
|
96
|
-
fontSize: normalize(11),
|
|
97
|
-
color: '#000000',
|
|
98
|
-
fontWeight: 'bold',
|
|
99
|
-
textShadowColor: '#ffffff',
|
|
100
|
-
textShadowRadius: 1,
|
|
101
|
-
textAlign: 'center',
|
|
102
|
-
textShadowOffset: { width: 0, height: 1 },
|
|
103
|
-
}}>
|
|
104
|
-
{v.item.value}
|
|
105
|
-
</Text>
|
|
106
|
-
</View>
|
|
107
|
-
<Text adjustsFontSizeToFit numberOfLines={2} style={{ marginHorizontal: normalize(5), fontWeight: 'bold', fontSize: normalize(10), color: '#000000', borderWidth: 0, width: '75%' }}>{v.item.display}</Text>
|
|
108
|
-
</TouchableOpacity>
|
|
109
|
-
);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
function renderChartListNew(params, i) {
|
|
113
|
-
let newdata = isBNUL(params) ? params.filter(function (item) { return item; }) : [];
|
|
114
|
-
return (
|
|
115
|
-
<FlashList
|
|
116
|
-
showsHorizontalScrollIndicator={false}
|
|
117
|
-
horizontal={true}
|
|
118
|
-
nestedScrollEnabled={true}
|
|
119
|
-
data={newdata}
|
|
120
|
-
renderItem={val => renderDataNew(val, newdata, i)}
|
|
121
|
-
keyExtractor={(item, index) => index.toString()}
|
|
122
|
-
estimatedItemSize={normalize(300)}
|
|
123
|
-
/>
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return (
|
|
129
|
-
<View>
|
|
130
|
-
{renderChartListNew(params.data, params.index)}
|
|
131
|
-
</View>
|
|
132
|
-
);
|
|
133
|
-
}
|
|
@@ -1,172 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { View, Text, TouchableOpacity, Dimensions, ScrollView } from 'react-native';
|
|
3
|
-
import { FlashList } from '@shopify/flash-list';
|
|
4
|
-
import { ArrayCheck, isBNU, isBNUL, isPermitted, notifyMessage, ValueCheck } from '../../CommonStyle/ComponentFunctions';
|
|
5
|
-
import { normalize } from '../../CommonStyle/componentStyle';
|
|
6
|
-
import CTextHeader from '../TableComponent/CTextHeader';
|
|
7
|
-
import { Global } from '../../Common/Global';
|
|
8
|
-
import Icons from '../../Common/Icons';
|
|
9
|
-
import FileViewer from 'react-native-file-viewer';
|
|
10
|
-
import RNFetchBlob from 'rn-fetch-blob';
|
|
11
|
-
|
|
12
|
-
export default function CDashBoardTable(params) {
|
|
13
|
-
function renderDataNew(params, l, pindex) {
|
|
14
|
-
let newdata = isBNUL(params.item.data) ? params.item.data.filter(function (item) { return item; }) : [];
|
|
15
|
-
return (
|
|
16
|
-
isBNUL(newdata) ?
|
|
17
|
-
<View>
|
|
18
|
-
<View
|
|
19
|
-
style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: normalize(5), paddingHorizontal: normalize(5) }}>
|
|
20
|
-
<Icons.FontAwesome5 name={'dot-circle'} color={'black'} size={normalize(10)} />
|
|
21
|
-
<Text style={{
|
|
22
|
-
fontSize: normalize(11),
|
|
23
|
-
fontWeight: '800',
|
|
24
|
-
color: Global.AppTheme.primary_color,
|
|
25
|
-
}}> {params.item.heading}
|
|
26
|
-
</Text>
|
|
27
|
-
|
|
28
|
-
<TouchableOpacity
|
|
29
|
-
onPress={() => getExcelReport(newdata)}
|
|
30
|
-
style={{ position: 'absolute', right: normalize(30) }}>
|
|
31
|
-
<Icons.FontAwesome5 name={'file-excel'} color={Global.AppTheme.primary_color} size={normalize(15)} />
|
|
32
|
-
</TouchableOpacity>
|
|
33
|
-
</View>
|
|
34
|
-
|
|
35
|
-
<ScrollView horizontal={true}>
|
|
36
|
-
<View style={{ marginTop: normalize(3), marginHorizontal: normalize(5) }}>
|
|
37
|
-
<View style={{ flexDirection: 'row' }}>
|
|
38
|
-
{newdata.map((item, i) => {
|
|
39
|
-
return (
|
|
40
|
-
<View key={i}>
|
|
41
|
-
<View style={{ flexDirection: 'row' }}>
|
|
42
|
-
{[{ 'header': item.displayheader, 'width': item.width }].map((header, j) => {
|
|
43
|
-
return (
|
|
44
|
-
<View key={j} style={{ flexDirection: 'row', justifyContent: 'space-between' }}>
|
|
45
|
-
<CTextHeader key={i}
|
|
46
|
-
text={header.header}
|
|
47
|
-
widthArr={Dimensions.get('screen').width * header.width}
|
|
48
|
-
bgColor={'#eae8e8'} color={'black'} borderColor={'lightgrey'} marginHorizontal={normalize(2)} borderRadius={5} elevation={3}
|
|
49
|
-
/>
|
|
50
|
-
</View>
|
|
51
|
-
);
|
|
52
|
-
})}
|
|
53
|
-
</View>
|
|
54
|
-
|
|
55
|
-
<View>
|
|
56
|
-
{item.rows.map((details, k) => {
|
|
57
|
-
return (
|
|
58
|
-
<TouchableOpacity key={k}
|
|
59
|
-
style={{
|
|
60
|
-
flexDirection: 'row',
|
|
61
|
-
marginTop: 1,
|
|
62
|
-
backgroundColor: 'white',
|
|
63
|
-
padding: 1,
|
|
64
|
-
}}>
|
|
65
|
-
{getSwitchComponent(item, details, k)}
|
|
66
|
-
</TouchableOpacity>);
|
|
67
|
-
})}
|
|
68
|
-
</View>
|
|
69
|
-
</View>
|
|
70
|
-
);
|
|
71
|
-
})}
|
|
72
|
-
</View>
|
|
73
|
-
</View>
|
|
74
|
-
</ScrollView>
|
|
75
|
-
</View>
|
|
76
|
-
: null
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function getExcelReport(params) {
|
|
81
|
-
|
|
82
|
-
var arrayString = ArrayCheck(params) && ValueCheck(params[0].rows) && ArrayCheck(params[0].rows) ? params[0].rows.map(s => s.value) : null;
|
|
83
|
-
var headerString = ArrayCheck(arrayString) ? arrayString.map(d => `${d}`).join(',') + '\n' : null;
|
|
84
|
-
|
|
85
|
-
var rowEliminate1st = ArrayCheck(params) ? params.slice(0) : null;
|
|
86
|
-
var dataArrFormat = ArrayCheck(rowEliminate1st) ?
|
|
87
|
-
rowEliminate1st.flatMap(
|
|
88
|
-
(o, i) => o.rows.flatMap(
|
|
89
|
-
(y, k) => getObjectMAP(o)
|
|
90
|
-
)
|
|
91
|
-
) : [];
|
|
92
|
-
var rowString = ArrayCheck(dataArrFormat) ? dataArrFormat.map(d => `${d.data1},"${d.data2}","${d.data3}","${d.data4}","${d.data5}","${d.data6}","${d.data7}","${d.data8}","${d.data9}","${d.data10}","${d.data11}","${d.data12}","${d.data13}","${d.data14}","${d.data15}","${d.data16}","${d.data17}","${d.data18}","${d.data19}","${d.data20}"\n`).join('') : null;
|
|
93
|
-
var csvString = `${headerString}${rowString}`;
|
|
94
|
-
console.log('OBJECTSTSTSTTSTSTSTSTTSTTSTTSTTS', JSON.stringify(csvString));
|
|
95
|
-
getExcel(csvString);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
function getObjectMAP(params) {
|
|
99
|
-
var objects = {};
|
|
100
|
-
for (var x = 1; x < 71; x++) {
|
|
101
|
-
objects['data' + x] = ValueCheck(params.rows[x - 1]) ? params.rows[x - 1].value : '';
|
|
102
|
-
}
|
|
103
|
-
return objects;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const getExcel = async (arg1) => {
|
|
107
|
-
if (await isPermitted()) {
|
|
108
|
-
let filePath = RNFetchBlob.fs.dirs.DownloadDir +
|
|
109
|
-
'/' + 'ExcelTable' + Math.floor(Math.random() * 90 + 10) + '.csv';
|
|
110
|
-
RNFetchBlob.fs.writeFile(filePath, arg1, 'utf8').then(response => {
|
|
111
|
-
console.log(filePath);
|
|
112
|
-
console.log('response', response);
|
|
113
|
-
OpenFileView(filePath);
|
|
114
|
-
notifyMessage(filePath, 1);
|
|
115
|
-
})
|
|
116
|
-
.catch(errors => {
|
|
117
|
-
console.log('DOWNLOAD FAILED', errors);
|
|
118
|
-
notifyMessage('Download Failed', 2);
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
function OpenFileView(arg) {
|
|
124
|
-
console.log('EXCEL PATHHHHHHHHHHHHHHHH', JSON.stringify(arg));
|
|
125
|
-
FileViewer.open(arg)
|
|
126
|
-
.then(() => {
|
|
127
|
-
notifyMessage('SUCCESS', 1);
|
|
128
|
-
})
|
|
129
|
-
.catch((error) => {
|
|
130
|
-
notifyMessage('ERROR' + error, 2);
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
function renderChartListNew(params, i) {
|
|
135
|
-
let newdata = isBNUL(params) ? params.filter(function (item) { return item; }) : [];
|
|
136
|
-
return (
|
|
137
|
-
<FlashList
|
|
138
|
-
showsHorizontalScrollIndicator={false}
|
|
139
|
-
nestedScrollEnabled={true}
|
|
140
|
-
data={newdata}
|
|
141
|
-
renderItem={val => renderDataNew(val, newdata, i)}
|
|
142
|
-
keyExtractor={(item, index) => index.toString()}
|
|
143
|
-
estimatedItemSize={normalize(300)}
|
|
144
|
-
/>
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
return (
|
|
150
|
-
<View>
|
|
151
|
-
{renderChartListNew(params.data, params.index)}
|
|
152
|
-
</View>
|
|
153
|
-
);
|
|
154
|
-
|
|
155
|
-
function getSwitchComponent(item, details, rowkey) {
|
|
156
|
-
switch (item.columntype) {
|
|
157
|
-
case 1:
|
|
158
|
-
return (
|
|
159
|
-
<View
|
|
160
|
-
style={{
|
|
161
|
-
borderWidth: 1, justifyContent: 'center', backgroundColor: '#fff', borderColor: 'lightgrey', height: normalize(25),
|
|
162
|
-
borderRadius: 5, elevation: 3, width: Dimensions.get('screen').width * item.width, alignItems: 'center',
|
|
163
|
-
}}>
|
|
164
|
-
<Text adjustsFontSizeToFit numberOfLines={1} style={{
|
|
165
|
-
fontSize: normalize(13), fontWeight: 'bold', paddingVertical: normalize(2.5),
|
|
166
|
-
color: 'black',
|
|
167
|
-
}}>{details.value}</Text>
|
|
168
|
-
</View>
|
|
169
|
-
);
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|