@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,193 +0,0 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
2
|
-
import { Defs, LinearGradient, Stop } from 'react-native-svg';
|
|
3
|
-
import { View, Dimensions, TouchableOpacity, Platform } from 'react-native';
|
|
4
|
-
import { LineChart, Grid, XAxis, YAxis } from 'react-native-svg-charts';
|
|
5
|
-
import { Circle, G, Line, Rect, Text } from 'react-native-svg';
|
|
6
|
-
import CText from '../../CustomComponents/CText';
|
|
7
|
-
import moment from 'moment';
|
|
8
|
-
import SDatePickerNew from '../../StaticComponents/SDatePickerNew';
|
|
9
|
-
import { normalize } from '../../CommonStyle/componentStyle';
|
|
10
|
-
import { ScrollView } from 'react-native';
|
|
11
|
-
import { ArrayCheck, isBNUL, ValueCheck } from '../../CommonStyle/ComponentFunctions';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export default function CLineChart(props) {
|
|
15
|
-
|
|
16
|
-
const [index, setIndex] = useState(1);
|
|
17
|
-
const [propsData, setPropsData] = useState(props.data);
|
|
18
|
-
const [data, setData] = useState(isBNUL(propsData) ? (propsData).map(({ value }) => parseFloat(value)) : []);
|
|
19
|
-
const axesSvg = { fontSize: normalize(11), fill: 'grey' };
|
|
20
|
-
const verticalContentInset = { top: 5, bottom: 5 };
|
|
21
|
-
const xAxisHeight = 30;
|
|
22
|
-
|
|
23
|
-
const Gradient = () => (
|
|
24
|
-
<Defs key={'gradient'}>
|
|
25
|
-
<LinearGradient id={'gradient'} x1={'0'} y={'0%'} x2={'100%'} y2={'0%'}>
|
|
26
|
-
<Stop offset={'0%'} stopColor={'rgb(134, 65, 244)'} />
|
|
27
|
-
<Stop offset={'100%'} stopColor={'rgb(66, 194, 244)'} />
|
|
28
|
-
</LinearGradient>
|
|
29
|
-
</Defs>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const Tooltip = ({ x, y }) => (
|
|
33
|
-
|
|
34
|
-
propsData[index] != undefined ?
|
|
35
|
-
<G
|
|
36
|
-
x={10}
|
|
37
|
-
key={'tooltip'}
|
|
38
|
-
onPress={() => console.log('tooltip clicked')}
|
|
39
|
-
>
|
|
40
|
-
<G y={50}>
|
|
41
|
-
<Rect
|
|
42
|
-
height={normalize(30)}
|
|
43
|
-
width={normalize(70)}
|
|
44
|
-
stroke={'grey'}
|
|
45
|
-
fill={'white'}
|
|
46
|
-
ry={10}
|
|
47
|
-
rx={10}
|
|
48
|
-
/>
|
|
49
|
-
<Text
|
|
50
|
-
x={75 / 2}
|
|
51
|
-
dy={normalize(10)}
|
|
52
|
-
alignmentBaseline={'middle'}
|
|
53
|
-
textAnchor={'middle'}
|
|
54
|
-
stroke={'rgb(134, 65, 244)'}
|
|
55
|
-
>
|
|
56
|
-
{`${data[index]}`}
|
|
57
|
-
</Text>
|
|
58
|
-
|
|
59
|
-
<Text
|
|
60
|
-
x={75 / 2}
|
|
61
|
-
dy={normalize(25)}
|
|
62
|
-
alignmentBaseline={'middle'}
|
|
63
|
-
textAnchor={'middle'}
|
|
64
|
-
stroke={'rgb(134, 65, 244)'}
|
|
65
|
-
fontSize={'7'}
|
|
66
|
-
>
|
|
67
|
-
{`${propsData[index].date}`}
|
|
68
|
-
</Text>
|
|
69
|
-
</G>
|
|
70
|
-
<G x={75 / 2}>
|
|
71
|
-
<Circle
|
|
72
|
-
cy={y(data[index])}
|
|
73
|
-
r={6}
|
|
74
|
-
stroke={'rgb(134, 65, 244)'}
|
|
75
|
-
strokeWidth={2}
|
|
76
|
-
fill={'white'}
|
|
77
|
-
/>
|
|
78
|
-
</G>
|
|
79
|
-
</G> : null
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
const Decorator = ({ x, y, data }) => {
|
|
83
|
-
return data.map((value, index) => (
|
|
84
|
-
<Circle
|
|
85
|
-
onPress={() => setIndex(index)}
|
|
86
|
-
key={index}
|
|
87
|
-
cx={x(index)}
|
|
88
|
-
cy={y(value)}
|
|
89
|
-
r={6}
|
|
90
|
-
stroke={'rgb(134, 65, 244)'}
|
|
91
|
-
fill={'white'}
|
|
92
|
-
/>
|
|
93
|
-
));
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
return (
|
|
97
|
-
data != null && data != undefined && data.length > 0 ?
|
|
98
|
-
<>
|
|
99
|
-
<View style={{ alignItems: 'flex-start', borderWidth: 0, borderColor: 'green', backgroundColor: 'white' }}>
|
|
100
|
-
<View style={{ flexDirection: 'row', borderWidth: 0 }}>
|
|
101
|
-
<YAxis
|
|
102
|
-
data={data}
|
|
103
|
-
style={{ borderWidth: 0 }}
|
|
104
|
-
contentInset={verticalContentInset}
|
|
105
|
-
svg={axesSvg}
|
|
106
|
-
/>
|
|
107
|
-
<View style={{ flex: 1, borderWidth: 0 }}>
|
|
108
|
-
<LineChart
|
|
109
|
-
style={{ height: normalize(150) }}
|
|
110
|
-
data={data}
|
|
111
|
-
contentInset={{ top: normalize(10), bottom: normalize(10), left: normalize(10), right: normalize(10) }}
|
|
112
|
-
svg={{
|
|
113
|
-
strokeWidth: normalize(3),
|
|
114
|
-
stroke: 'url(#gradient)',
|
|
115
|
-
}}
|
|
116
|
-
>
|
|
117
|
-
<Grid
|
|
118
|
-
direction="HORIZONTAL"
|
|
119
|
-
// direction='VERTICAL'
|
|
120
|
-
/>
|
|
121
|
-
<Gradient />
|
|
122
|
-
{/* <Tooltip /> */}
|
|
123
|
-
<Decorator />
|
|
124
|
-
</LineChart>
|
|
125
|
-
</View>
|
|
126
|
-
</View>
|
|
127
|
-
<XAxis
|
|
128
|
-
style={{ marginHorizontal: 0, height: normalize(55), borderWidth: 0, width: '100%' }}
|
|
129
|
-
data={propsData}
|
|
130
|
-
formatLabel={(value, index) => propsData[index].displayvalue}
|
|
131
|
-
contentInset={{ left: normalize(20), right: normalize(10)}}
|
|
132
|
-
svg={{ fontSize: normalize(7), fontWeight: 'bold', fill: 'black', translateY: normalize(15), rotation: normalize(75), originY: 0 }}
|
|
133
|
-
/>
|
|
134
|
-
</View>
|
|
135
|
-
</>
|
|
136
|
-
: null
|
|
137
|
-
);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
{/* <CLinechart
|
|
142
|
-
component={Line}
|
|
143
|
-
data={Line.data}
|
|
144
|
-
/> */}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
// var Line = {
|
|
148
|
-
// "keyid": 3,
|
|
149
|
-
// "customcomponent": "CLinechart",
|
|
150
|
-
// "heading": "JULY",
|
|
151
|
-
// "data": [
|
|
152
|
-
// {
|
|
153
|
-
// "value": 220,
|
|
154
|
-
// "display": "JUL 18"
|
|
155
|
-
// },
|
|
156
|
-
// {
|
|
157
|
-
// "value": 189,
|
|
158
|
-
// "display": "JUL 17"
|
|
159
|
-
// },
|
|
160
|
-
// {
|
|
161
|
-
// "value": 178,
|
|
162
|
-
// "display": "JUL 16"
|
|
163
|
-
// },
|
|
164
|
-
// {
|
|
165
|
-
// "value": 170,
|
|
166
|
-
// "display": "JUL 15"
|
|
167
|
-
// },
|
|
168
|
-
// {
|
|
169
|
-
// "value": 156,
|
|
170
|
-
// "display": "JUL 14"
|
|
171
|
-
// },
|
|
172
|
-
// {
|
|
173
|
-
// "value": 196,
|
|
174
|
-
// "display": "JUL 13"
|
|
175
|
-
// },
|
|
176
|
-
// {
|
|
177
|
-
// "value": 122,
|
|
178
|
-
// "display": "JUL 12"
|
|
179
|
-
// },
|
|
180
|
-
// {
|
|
181
|
-
// "value": 139,
|
|
182
|
-
// "display": "JUL 11"
|
|
183
|
-
// },
|
|
184
|
-
// {
|
|
185
|
-
// "value": 167,
|
|
186
|
-
// "display": "JUL 10"
|
|
187
|
-
// },
|
|
188
|
-
// {
|
|
189
|
-
// "value": 145,
|
|
190
|
-
// "display": "JUL 09"
|
|
191
|
-
// }
|
|
192
|
-
// ]
|
|
193
|
-
// }
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
import React, { useEffect, useState } from 'react';
|
|
2
|
-
import { Dimensions, View, Text as RNText, TouchableOpacity, Platform } from 'react-native';
|
|
3
|
-
import { PieChart } from 'react-native-svg-charts';
|
|
4
|
-
import { Circle, G, Line, Text } from 'react-native-svg';
|
|
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 CPiechart(props) {
|
|
11
|
-
const [data, setData] = useState(props.data);
|
|
12
|
-
// console.log(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",props.data)
|
|
13
|
-
const [Nested, setNested] = useState(false);
|
|
14
|
-
const [visibility, setVisibility] = useState(true);
|
|
15
|
-
const [colorcode, setColorCode] = useState(props.colorArr != undefined && props.colorArr != null ? (props.colorArr).filter(word => word != undefined) : null);
|
|
16
|
-
const [styles, setStyles] = useState(props.style != undefined ? props.style : {
|
|
17
|
-
'innerRadius': normalize(52),
|
|
18
|
-
'outerRadius': normalize(30),
|
|
19
|
-
'labelRadius': normalize(70),
|
|
20
|
-
'height': 0.35,
|
|
21
|
-
});
|
|
22
|
-
const pieData =
|
|
23
|
-
data != undefined && data.filter(value => value.value > 0)
|
|
24
|
-
.map((value, index) => ({
|
|
25
|
-
value: value.value,
|
|
26
|
-
svg: { fill: colorcode != undefined ? colorcode[index] : getPieColor(index) },
|
|
27
|
-
key: `pie-${index}`,
|
|
28
|
-
}));
|
|
29
|
-
|
|
30
|
-
function getDateWisePieChart(params) {
|
|
31
|
-
setData([
|
|
32
|
-
{
|
|
33
|
-
'value': 33,
|
|
34
|
-
'display': '2022',
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
'value': 29,
|
|
38
|
-
'display': '2021',
|
|
39
|
-
},
|
|
40
|
-
]);
|
|
41
|
-
}
|
|
42
|
-
const Labels = ({ slices }) => {
|
|
43
|
-
return slices.map((slice, index) => {
|
|
44
|
-
const { labelCentroid, pieCentroid, data } = slice;
|
|
45
|
-
return (
|
|
46
|
-
<G key={index}>
|
|
47
|
-
<Line
|
|
48
|
-
x1={labelCentroid[0]}
|
|
49
|
-
y1={labelCentroid[1]}
|
|
50
|
-
x2={pieCentroid[0]}
|
|
51
|
-
y2={pieCentroid[1]}
|
|
52
|
-
stroke={data.svg.fill}
|
|
53
|
-
/>
|
|
54
|
-
|
|
55
|
-
<G x={labelCentroid[0]} y={labelCentroid[1]}>
|
|
56
|
-
<Circle r={normalize(13)} fill={data.svg.fill} />
|
|
57
|
-
<Circle r={normalize(11)} fill={'white'} />
|
|
58
|
-
<Text
|
|
59
|
-
key={index}
|
|
60
|
-
x={-0.5}
|
|
61
|
-
y={1.5}
|
|
62
|
-
fill={'black'}
|
|
63
|
-
textAnchor={'middle'}
|
|
64
|
-
alignmentBaseline={'middle'}
|
|
65
|
-
fontSize={normalize(10)}
|
|
66
|
-
fontWeight={'bolder'}
|
|
67
|
-
stroke={'white'}
|
|
68
|
-
opacity={'1'}
|
|
69
|
-
strokeWidth={0.4}>
|
|
70
|
-
{data.value}
|
|
71
|
-
</Text>
|
|
72
|
-
</G>
|
|
73
|
-
</G>
|
|
74
|
-
);
|
|
75
|
-
});
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
function getPreviousInfo() {
|
|
79
|
-
setNested(true);
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
pieData.length > 0 && visibility ?
|
|
84
|
-
<View style={{}}>
|
|
85
|
-
{Nested ?
|
|
86
|
-
<CText>KKK</CText> : null}
|
|
87
|
-
|
|
88
|
-
<View style={{ paddingVertical: 0, marginTop: 0 }}>
|
|
89
|
-
|
|
90
|
-
{props.component != undefined ?
|
|
91
|
-
<View style={{ justifyContent: 'space-between', flexDirection: 'row' }}>
|
|
92
|
-
<CText style={{ fontSize: normalize(15), paddingHorizontal: 5, fontWeight: 'bold', color: 'black' }}>{props.component != undefined ? props.component.heading : ''}</CText>
|
|
93
|
-
</View> : null}
|
|
94
|
-
|
|
95
|
-
{props.component != undefined && props.component.date != undefined ?
|
|
96
|
-
<View>
|
|
97
|
-
<SDatePickerNew
|
|
98
|
-
callBack={val => (val == undefined ? null : getDateWisePieChart(val))} />
|
|
99
|
-
</View> : null}
|
|
100
|
-
|
|
101
|
-
<View style={{ flexDirection: 'row', alignItems: 'center'}}>
|
|
102
|
-
<View style={{ flexDirection: 'row' }}>
|
|
103
|
-
<PieChart
|
|
104
|
-
style={{
|
|
105
|
-
marginTop:normalize(-8),
|
|
106
|
-
height: Dimensions.get('screen').height *
|
|
107
|
-
(styles.height), width: Dimensions.get('screen').width * 0.6,
|
|
108
|
-
}}
|
|
109
|
-
data={pieData}
|
|
110
|
-
innerRadius={normalize(styles.innerRadius)}
|
|
111
|
-
outerRadius={normalize(styles.outerRadius)}
|
|
112
|
-
labelRadius={normalize(styles.labelRadius)}
|
|
113
|
-
>
|
|
114
|
-
<Labels />
|
|
115
|
-
</PieChart>
|
|
116
|
-
</View>
|
|
117
|
-
|
|
118
|
-
{/* <View style={{ paddingLeft: 15 }}>
|
|
119
|
-
{data != undefined ? data.map((display, p) => {
|
|
120
|
-
return (
|
|
121
|
-
display != null && display != undefined ?
|
|
122
|
-
<View key={p} style={{ flexDirection: 'row', alignItems: 'center', paddingVertical: normalize(4) }}>
|
|
123
|
-
<View style={{
|
|
124
|
-
paddingVertical: normalize(5), paddingHorizontal: normalize(4),
|
|
125
|
-
backgroundColor: getPieColor(p), borderRadius: 5, alignItems: 'center', justifyContent: 'center',
|
|
126
|
-
marginRight: 5
|
|
127
|
-
}}>
|
|
128
|
-
<CText style={{ fontSize: normalize(12), color: 'black', fontWeight: 'bold', color: 'white' }}>{display.value}</CText>
|
|
129
|
-
</View>
|
|
130
|
-
<CText style={{ fontSize: normalize(12), color: 'black', fontWeight: '500' }}>{display.display}</CText>
|
|
131
|
-
</View> : null)
|
|
132
|
-
}) : null}
|
|
133
|
-
</View> */}
|
|
134
|
-
</View>
|
|
135
|
-
</View>
|
|
136
|
-
</View> : null
|
|
137
|
-
);
|
|
138
|
-
function getPieColor(params) {
|
|
139
|
-
switch (params) {
|
|
140
|
-
case 0: return 'blue';
|
|
141
|
-
case 1: return 'green';
|
|
142
|
-
case 2: return '#cf0404';
|
|
143
|
-
case 3: return '#24bfde';
|
|
144
|
-
case 4: return '#7b36bc';
|
|
145
|
-
case 5: return '#f28909';
|
|
146
|
-
case 6: return '#0cd3cd';
|
|
147
|
-
case 7: return '#ad400a';
|
|
148
|
-
default: return 'black';
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
{/* <CPiechart
|
|
154
|
-
component={PieChart}
|
|
155
|
-
data={PieChart.data}
|
|
156
|
-
style={{
|
|
157
|
-
"innerRadius": normalize(52),
|
|
158
|
-
"outerRadius": normalize(30),
|
|
159
|
-
"labelRadius": normalize(70),
|
|
160
|
-
"height": 0.27
|
|
161
|
-
}} /> */}
|
|
162
|
-
|
|
163
|
-
// var PieChart = {
|
|
164
|
-
// "keyid": 3,
|
|
165
|
-
// "customcomponent": "CPiechart",
|
|
166
|
-
// "heading": "Monthly Profit",
|
|
167
|
-
// // "date": "2021-03-01",
|
|
168
|
-
// "data": [
|
|
169
|
-
// {
|
|
170
|
-
// "value": 23,
|
|
171
|
-
// "display": "JANUVARY"
|
|
172
|
-
// },
|
|
173
|
-
// {
|
|
174
|
-
// "value": 35,
|
|
175
|
-
// "display": "FEBRUVARY"
|
|
176
|
-
// },
|
|
177
|
-
// {
|
|
178
|
-
// "value": 40,
|
|
179
|
-
// "display": "MARCH"
|
|
180
|
-
// },
|
|
181
|
-
// {
|
|
182
|
-
// "value": 87,
|
|
183
|
-
// "display": "APRIL"
|
|
184
|
-
// }
|
|
185
|
-
// ]
|
|
186
|
-
// }
|
package/src/Custom/Loader.js
DELETED
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from 'react';
|
|
2
|
-
import {
|
|
3
|
-
StyleSheet,
|
|
4
|
-
Dimensions,
|
|
5
|
-
View,
|
|
6
|
-
Modal,
|
|
7
|
-
Animated,
|
|
8
|
-
Easing,
|
|
9
|
-
Text,
|
|
10
|
-
Image,
|
|
11
|
-
Platform,
|
|
12
|
-
} from 'react-native';
|
|
13
|
-
import { normalize } from '../CommonStyle/componentStyle';
|
|
14
|
-
import { APIURL } from '../../../../../src/Common/apiConstants';
|
|
15
|
-
|
|
16
|
-
export default function Loader({
|
|
17
|
-
visible = true,
|
|
18
|
-
overlayColor = 'rgba(0,0,0,0.4)',
|
|
19
|
-
loaderColor = 'lightblue',
|
|
20
|
-
size = Platform.OS !== 'web' ? 30 : 50,
|
|
21
|
-
gifSource = { uri: `${APIURL}file/getCommonFile/image/heartpulse.gif` },
|
|
22
|
-
message = '',
|
|
23
|
-
messageStyle = {},
|
|
24
|
-
animationType = 'fade',
|
|
25
|
-
hasBackground = true,
|
|
26
|
-
borderRadius = 20,
|
|
27
|
-
shadow = true,
|
|
28
|
-
}) {
|
|
29
|
-
const [rotation] = useState(new Animated.Value(0));
|
|
30
|
-
const [pulse] = useState(new Animated.Value(1));
|
|
31
|
-
const [fade] = useState(new Animated.Value(0));
|
|
32
|
-
|
|
33
|
-
// Rotation animation
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
if (!gifSource) { // Only animate if not using a GIF
|
|
36
|
-
Animated.loop(
|
|
37
|
-
Animated.timing(rotation, {
|
|
38
|
-
toValue: 1,
|
|
39
|
-
duration: 1500,
|
|
40
|
-
easing: Easing.linear,
|
|
41
|
-
useNativeDriver: true,
|
|
42
|
-
})
|
|
43
|
-
).start();
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
// Pulse animation
|
|
47
|
-
Animated.loop(
|
|
48
|
-
Animated.sequence([
|
|
49
|
-
Animated.timing(pulse, {
|
|
50
|
-
toValue: 1.1,
|
|
51
|
-
duration: 800,
|
|
52
|
-
useNativeDriver: true,
|
|
53
|
-
}),
|
|
54
|
-
Animated.timing(pulse, {
|
|
55
|
-
toValue: 1,
|
|
56
|
-
duration: 800,
|
|
57
|
-
useNativeDriver: true,
|
|
58
|
-
}),
|
|
59
|
-
])
|
|
60
|
-
).start();
|
|
61
|
-
|
|
62
|
-
// Fade in animation
|
|
63
|
-
Animated.timing(fade, {
|
|
64
|
-
toValue: 1,
|
|
65
|
-
duration: 300,
|
|
66
|
-
useNativeDriver: true,
|
|
67
|
-
}).start();
|
|
68
|
-
}, []);
|
|
69
|
-
|
|
70
|
-
const spin = rotation.interpolate({
|
|
71
|
-
inputRange: [0, 1],
|
|
72
|
-
outputRange: ['0deg', '360deg'],
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
const loaderContent = gifSource ? (
|
|
76
|
-
<Image
|
|
77
|
-
style={[styles.icon_style, { width: normalize(size), height: normalize(size) }]}
|
|
78
|
-
source={gifSource}
|
|
79
|
-
resizeMode="contain"
|
|
80
|
-
/>
|
|
81
|
-
) : (
|
|
82
|
-
<Animated.View style={[
|
|
83
|
-
styles.defaultLoader,
|
|
84
|
-
{
|
|
85
|
-
borderColor: loaderColor,
|
|
86
|
-
transform: [{ rotate: spin }, { scale: pulse }],
|
|
87
|
-
width: normalize(size),
|
|
88
|
-
height: normalize(size),
|
|
89
|
-
borderWidth: normalize(size / 10),
|
|
90
|
-
},
|
|
91
|
-
]}>
|
|
92
|
-
<View style={[
|
|
93
|
-
styles.innerCircle,
|
|
94
|
-
{
|
|
95
|
-
backgroundColor: loaderColor,
|
|
96
|
-
width: normalize(size / 2),
|
|
97
|
-
height: normalize(size / 2),
|
|
98
|
-
},
|
|
99
|
-
]} />
|
|
100
|
-
</Animated.View>
|
|
101
|
-
);
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<Modal
|
|
108
|
-
animationType={animationType}
|
|
109
|
-
transparent={true}
|
|
110
|
-
visible={visible}
|
|
111
|
-
onRequestClose={() => { }}
|
|
112
|
-
>
|
|
113
|
-
<Animated.View style={[
|
|
114
|
-
styles.modalContainer,
|
|
115
|
-
{
|
|
116
|
-
backgroundColor: overlayColor,
|
|
117
|
-
opacity: fade,
|
|
118
|
-
},
|
|
119
|
-
]}>
|
|
120
|
-
<Animated.View style={[
|
|
121
|
-
styles.loaderContainer,
|
|
122
|
-
{
|
|
123
|
-
backgroundColor: hasBackground ? 'white' : 'transparent',
|
|
124
|
-
borderRadius: normalize(borderRadius),
|
|
125
|
-
transform: [{ scale: pulse }],
|
|
126
|
-
...(shadow && styles.shadowStyle),
|
|
127
|
-
},
|
|
128
|
-
]}>
|
|
129
|
-
{loaderContent}
|
|
130
|
-
{message ? (
|
|
131
|
-
<Text style={[styles.messageText, messageStyle]}>
|
|
132
|
-
{message}
|
|
133
|
-
</Text>
|
|
134
|
-
) : null}
|
|
135
|
-
</Animated.View>
|
|
136
|
-
</Animated.View>
|
|
137
|
-
</Modal>
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const styles = StyleSheet.create({
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
modalContainer: {
|
|
145
|
-
flex: 1,
|
|
146
|
-
justifyContent: 'center',
|
|
147
|
-
alignItems: 'center',
|
|
148
|
-
},
|
|
149
|
-
loaderContainer: {
|
|
150
|
-
padding: normalize(20),
|
|
151
|
-
justifyContent: 'center',
|
|
152
|
-
alignItems: 'center',
|
|
153
|
-
},
|
|
154
|
-
icon_style: {
|
|
155
|
-
justifyContent: 'center',
|
|
156
|
-
alignItems: 'center',
|
|
157
|
-
},
|
|
158
|
-
defaultLoader: {
|
|
159
|
-
borderRadius: normalize(100),
|
|
160
|
-
justifyContent: 'center',
|
|
161
|
-
alignItems: 'center',
|
|
162
|
-
},
|
|
163
|
-
innerCircle: {
|
|
164
|
-
borderRadius: normalize(100),
|
|
165
|
-
},
|
|
166
|
-
messageText: {
|
|
167
|
-
marginTop: normalize(15),
|
|
168
|
-
fontSize: normalize(14),
|
|
169
|
-
color: '#555',
|
|
170
|
-
textAlign: 'center',
|
|
171
|
-
},
|
|
172
|
-
shadowStyle: {
|
|
173
|
-
shadowColor: '#000',
|
|
174
|
-
shadowOffset: {
|
|
175
|
-
width: 0,
|
|
176
|
-
height: 2,
|
|
177
|
-
},
|
|
178
|
-
shadowOpacity: 0.25,
|
|
179
|
-
shadowRadius: 3.84,
|
|
180
|
-
elevation: 5,
|
|
181
|
-
},
|
|
182
|
-
});
|