@dhiraj0720/report1chart 2.9.5 → 2.9.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/package.json
CHANGED
|
@@ -19,11 +19,12 @@ const PercentCell = ({ value }) => {
|
|
|
19
19
|
);
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
const Cell = ({ children, bold = false, isFrozen = false }) => (
|
|
22
|
+
const Cell = ({ children, bold = false, highlight = false, isFrozen = false }) => (
|
|
23
23
|
<View style={[
|
|
24
24
|
styles.cell,
|
|
25
25
|
isFrozen && styles.frozenCell,
|
|
26
|
-
bold && styles.
|
|
26
|
+
bold && styles.bold,
|
|
27
|
+
highlight && styles.highlightCell
|
|
27
28
|
]}>
|
|
28
29
|
<Text
|
|
29
30
|
style={[styles.cellText, bold && styles.boldText]}
|
|
@@ -35,43 +36,40 @@ const Cell = ({ children, bold = false, isFrozen = false }) => (
|
|
|
35
36
|
</View>
|
|
36
37
|
);
|
|
37
38
|
|
|
38
|
-
const FrozenTableReport1A = ({ rows = [] }) => {
|
|
39
|
+
const FrozenTableReport1A = ({ rows = [], isFullscreen = false }) => {
|
|
39
40
|
if (!rows.length) {
|
|
40
41
|
return <Text style={{ textAlign: 'center', padding: 20, color: '#666' }}>No data available</Text>;
|
|
41
42
|
}
|
|
42
43
|
|
|
43
|
-
const frozenColumnWidth =
|
|
44
|
-
const rowHeight = 48; // Fixed height for perfect alignment
|
|
44
|
+
const frozenColumnWidth = isFullscreen ? 180 : 130;
|
|
45
45
|
|
|
46
46
|
return (
|
|
47
47
|
<View style={styles.container}>
|
|
48
|
-
{/* Frozen Column
|
|
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) => (
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
</Cell>
|
|
56
|
-
</View>
|
|
52
|
+
<Cell key={i} bold isFrozen>
|
|
53
|
+
{row.name}
|
|
54
|
+
</Cell>
|
|
57
55
|
))}
|
|
58
56
|
</View>
|
|
59
57
|
|
|
60
|
-
{/* Scrollable Columns
|
|
58
|
+
{/* Scrollable Columns */}
|
|
61
59
|
<ScrollView horizontal showsHorizontalScrollIndicator={false}>
|
|
62
60
|
<View>
|
|
63
|
-
{/* Header */}
|
|
61
|
+
{/* Header Row - Single Line Only */}
|
|
64
62
|
<View style={styles.headerRow}>
|
|
65
63
|
{['2024', '2025', 'Artış %', '2025 Bütçe', 'Sapma %'].map((header) => (
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
</
|
|
64
|
+
<Cell key={header} bold>
|
|
65
|
+
{header}
|
|
66
|
+
</Cell>
|
|
69
67
|
))}
|
|
70
68
|
</View>
|
|
71
69
|
|
|
72
70
|
{/* Data Rows */}
|
|
73
71
|
{rows.map((row, i) => (
|
|
74
|
-
<View key={i} style={
|
|
72
|
+
<View key={i} style={styles.dataRow}>
|
|
75
73
|
<Cell>{formatNumber(row.actual2024)}</Cell>
|
|
76
74
|
<Cell>{formatNumber(row.actual2025)}</Cell>
|
|
77
75
|
<Cell><PercentCell value={row.actualChangePercent} /></Cell>
|
|
@@ -98,42 +96,45 @@ const styles = StyleSheet.create({
|
|
|
98
96
|
backgroundColor: '#fff',
|
|
99
97
|
},
|
|
100
98
|
frozenColumn: {
|
|
101
|
-
backgroundColor: '#
|
|
99
|
+
backgroundColor: '#f4f6f8',
|
|
102
100
|
borderRightWidth: 1,
|
|
103
101
|
borderColor: '#ddd',
|
|
104
102
|
},
|
|
105
103
|
headerRow: {
|
|
106
104
|
flexDirection: 'row',
|
|
107
|
-
backgroundColor: '#
|
|
105
|
+
backgroundColor: '#f4f6f8',
|
|
108
106
|
},
|
|
109
107
|
dataRow: {
|
|
110
108
|
flexDirection: 'row',
|
|
111
109
|
},
|
|
112
110
|
cell: {
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
minWidth: 100, // Increased to prevent wrapping
|
|
112
|
+
maxWidth: 180, // Optional: limit max width
|
|
115
113
|
paddingHorizontal: 12,
|
|
114
|
+
paddingVertical: 12,
|
|
116
115
|
justifyContent: 'center',
|
|
117
116
|
alignItems: 'center',
|
|
118
117
|
borderBottomWidth: 1,
|
|
119
|
-
borderColor: '#
|
|
118
|
+
borderColor: '#e0e0e0',
|
|
120
119
|
},
|
|
121
120
|
frozenCell: {
|
|
122
121
|
justifyContent: 'flex-start',
|
|
123
122
|
paddingLeft: 16,
|
|
124
|
-
paddingRight: 8,
|
|
125
|
-
},
|
|
126
|
-
boldCell: {
|
|
127
|
-
backgroundColor: '#e9f0f8',
|
|
128
123
|
},
|
|
129
124
|
cellText: {
|
|
130
125
|
fontSize: 12.5,
|
|
131
126
|
textAlign: 'center',
|
|
132
127
|
color: '#333',
|
|
133
128
|
},
|
|
129
|
+
bold: {
|
|
130
|
+
backgroundColor: '#e9f0f8',
|
|
131
|
+
},
|
|
134
132
|
boldText: {
|
|
135
133
|
fontWeight: '700',
|
|
136
134
|
},
|
|
135
|
+
highlightCell: {
|
|
136
|
+
backgroundColor: '#e9f0f8',
|
|
137
|
+
},
|
|
137
138
|
percentText: {
|
|
138
139
|
fontWeight: '700',
|
|
139
140
|
fontSize: 12.5,
|
|
@@ -3,20 +3,32 @@ import { ScrollView, TouchableOpacity, Text, StyleSheet } from 'react-native';
|
|
|
3
3
|
|
|
4
4
|
const MonthSelector = ({ months, selected, onSelect }) => (
|
|
5
5
|
<ScrollView horizontal showsHorizontalScrollIndicator={false} style={styles.row}>
|
|
6
|
+
{/* SELECT ALL */}
|
|
6
7
|
<TouchableOpacity
|
|
7
8
|
style={[styles.btn, selected === 'ALL' && styles.active]}
|
|
8
9
|
onPress={() => onSelect('ALL')}
|
|
9
10
|
>
|
|
10
|
-
<Text style={
|
|
11
|
+
<Text style={[
|
|
12
|
+
styles.text,
|
|
13
|
+
selected === 'ALL' && styles.activeText // ← This was missing!
|
|
14
|
+
]}>
|
|
15
|
+
Select all
|
|
16
|
+
</Text>
|
|
11
17
|
</TouchableOpacity>
|
|
12
18
|
|
|
19
|
+
{/* MONTHS */}
|
|
13
20
|
{months.map(m => (
|
|
14
21
|
<TouchableOpacity
|
|
15
22
|
key={m}
|
|
16
23
|
style={[styles.btn, selected === m && styles.active]}
|
|
17
24
|
onPress={() => onSelect(m)}
|
|
18
25
|
>
|
|
19
|
-
<Text style={
|
|
26
|
+
<Text style={[
|
|
27
|
+
styles.text,
|
|
28
|
+
selected === m && styles.activeText // ← This was missing!
|
|
29
|
+
]}>
|
|
30
|
+
{m}
|
|
31
|
+
</Text>
|
|
20
32
|
</TouchableOpacity>
|
|
21
33
|
))}
|
|
22
34
|
</ScrollView>
|
|
@@ -33,7 +45,16 @@ const styles = StyleSheet.create({
|
|
|
33
45
|
backgroundColor: '#eef2f7',
|
|
34
46
|
marginRight: 8,
|
|
35
47
|
},
|
|
36
|
-
active: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
48
|
+
active: {
|
|
49
|
+
backgroundColor: '#0f172a' // Dark background when active
|
|
50
|
+
},
|
|
51
|
+
text: {
|
|
52
|
+
color: '#000',
|
|
53
|
+
fontWeight: '600',
|
|
54
|
+
fontSize: 14,
|
|
55
|
+
},
|
|
56
|
+
activeText: {
|
|
57
|
+
color: '#fff', // White text when active
|
|
58
|
+
fontWeight: '700'
|
|
59
|
+
},
|
|
60
|
+
});
|