@dhiraj0720/report1chart 2.9.3 → 2.9.4
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/package.json
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { View, Text, ScrollView, StyleSheet } from 'react-native';
|
|
3
3
|
|
|
4
|
-
// Format numbers with commas: 1234567 → 1,234,567
|
|
5
4
|
const formatNumber = (value) => {
|
|
6
5
|
if (value === null || value === undefined || value === '') return '-';
|
|
7
6
|
return Number(value).toLocaleString('en-US');
|
|
8
7
|
};
|
|
9
8
|
|
|
10
|
-
// Percentage cell with arrow and color
|
|
11
9
|
const PercentCell = ({ value }) => {
|
|
12
10
|
if (value === null || value === undefined) return <Text>-</Text>;
|
|
13
11
|
const positive = value >= 0;
|
|
@@ -21,7 +19,6 @@ const PercentCell = ({ value }) => {
|
|
|
21
19
|
);
|
|
22
20
|
};
|
|
23
21
|
|
|
24
|
-
// Reusable Cell
|
|
25
22
|
const Cell = ({ children, bold = false, highlight = false, isFrozen = false }) => (
|
|
26
23
|
<View style={[
|
|
27
24
|
styles.cell,
|
|
@@ -29,7 +26,11 @@ const Cell = ({ children, bold = false, highlight = false, isFrozen = false }) =
|
|
|
29
26
|
bold && styles.bold,
|
|
30
27
|
highlight && styles.highlightCell
|
|
31
28
|
]}>
|
|
32
|
-
<Text
|
|
29
|
+
<Text
|
|
30
|
+
style={[styles.cellText, bold && styles.boldText]}
|
|
31
|
+
numberOfLines={1}
|
|
32
|
+
ellipsizeMode="tail"
|
|
33
|
+
>
|
|
33
34
|
{children}
|
|
34
35
|
</Text>
|
|
35
36
|
</View>
|
|
@@ -40,12 +41,11 @@ const FrozenTableReport1A = ({ rows = [], isFullscreen = false }) => {
|
|
|
40
41
|
return <Text style={{ textAlign: 'center', padding: 20, color: '#666' }}>No data available</Text>;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
// Wider frozen column in fullscreen
|
|
44
44
|
const frozenColumnWidth = isFullscreen ? 180 : 150;
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
47
|
<View style={styles.container}>
|
|
48
|
-
{/* Frozen
|
|
48
|
+
{/* Frozen Column */}
|
|
49
49
|
<View style={[styles.frozenColumn, { width: frozenColumnWidth }]}>
|
|
50
50
|
<Cell bold isFrozen>FAALİYET</Cell>
|
|
51
51
|
{rows.map((row, i) => (
|
|
@@ -58,10 +58,12 @@ const FrozenTableReport1A = ({ rows = [], isFullscreen = false }) => {
|
|
|
58
58
|
{/* Scrollable Columns */}
|
|
59
59
|
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
|
60
60
|
<View>
|
|
61
|
-
{/* Header Row */}
|
|
61
|
+
{/* Header Row - Single Line Only */}
|
|
62
62
|
<View style={styles.headerRow}>
|
|
63
63
|
{['2024', '2025', 'Artış %', '2025 Bütçe', 'Sapma %'].map((header) => (
|
|
64
|
-
<Cell key={header} bold>
|
|
64
|
+
<Cell key={header} bold>
|
|
65
|
+
{header}
|
|
66
|
+
</Cell>
|
|
65
67
|
))}
|
|
66
68
|
</View>
|
|
67
69
|
|
|
@@ -106,8 +108,9 @@ const styles = StyleSheet.create({
|
|
|
106
108
|
flexDirection: 'row',
|
|
107
109
|
},
|
|
108
110
|
cell: {
|
|
109
|
-
minWidth:
|
|
110
|
-
|
|
111
|
+
minWidth: 120, // Increased to prevent wrapping
|
|
112
|
+
maxWidth: 180, // Optional: limit max width
|
|
113
|
+
paddingHorizontal: 12,
|
|
111
114
|
paddingVertical: 12,
|
|
112
115
|
justifyContent: 'center',
|
|
113
116
|
alignItems: 'center',
|
|
@@ -116,7 +119,7 @@ const styles = StyleSheet.create({
|
|
|
116
119
|
},
|
|
117
120
|
frozenCell: {
|
|
118
121
|
justifyContent: 'flex-start',
|
|
119
|
-
paddingLeft:
|
|
122
|
+
paddingLeft: 16,
|
|
120
123
|
},
|
|
121
124
|
cellText: {
|
|
122
125
|
fontSize: 12.5,
|
|
@@ -29,7 +29,7 @@ const Report1AScreen = ({ endpoint, token, onBack }) => {
|
|
|
29
29
|
{/* FULL-WIDTH BLUE HEADER */}
|
|
30
30
|
<View style={styles.header}>
|
|
31
31
|
<TouchableOpacity onPress={onBack} style={styles.backButton}>
|
|
32
|
-
<Text style={styles.backIcon}
|
|
32
|
+
<Text style={styles.backIcon}>‹</Text>
|
|
33
33
|
</TouchableOpacity>
|
|
34
34
|
<Text style={styles.headerTitle}>PERFORMANS RAPORU (USD)</Text>
|
|
35
35
|
</View>
|
|
@@ -99,7 +99,7 @@ const styles = StyleSheet.create({
|
|
|
99
99
|
alignItems: 'center',
|
|
100
100
|
paddingVertical: 18,
|
|
101
101
|
paddingHorizontal: 16,
|
|
102
|
-
backgroundColor: '#
|
|
102
|
+
backgroundColor: '#4E79A7', // Deep blue
|
|
103
103
|
},
|
|
104
104
|
backButton: {
|
|
105
105
|
padding: 8,
|