@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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dhiraj0720/report1chart",
3
- "version": "2.9.5",
3
+ "version": "2.9.7",
4
4
  "main": "src/index.jsx",
5
5
  "scripts": {
6
6
  "test": "echo 'No tests'"
@@ -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.boldCell
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 = 150;
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 - Fixed Height Rows */}
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
- <View key={i} style={{ height: rowHeight }}>
53
- <Cell bold isFrozen>
54
- {row.name}
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 - Same Fixed Height Rows */}
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
- <View key={header} style={{ height: rowHeight }}>
67
- <Cell bold>{header}</Cell>
68
- </View>
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={[styles.dataRow, { height: rowHeight }]}>
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: '#f5f7fa',
99
+ backgroundColor: '#f4f6f8',
102
100
  borderRightWidth: 1,
103
101
  borderColor: '#ddd',
104
102
  },
105
103
  headerRow: {
106
104
  flexDirection: 'row',
107
- backgroundColor: '#f0f0f0',
105
+ backgroundColor: '#f4f6f8',
108
106
  },
109
107
  dataRow: {
110
108
  flexDirection: 'row',
111
109
  },
112
110
  cell: {
113
- flex: 1,
114
- minWidth: 105,
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: '#eee',
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={styles.text}>Select all</Text>
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={styles.text}>{m}</Text>
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: { backgroundColor: '#0f172a' },
37
- text: { color: '#000', fontWeight: '600' },
38
- activeText: { color: '#fff', fontWeight: '700' },
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
+ });
@@ -65,9 +65,9 @@ const styles = StyleSheet.create({
65
65
  borderColor: '#eee',
66
66
  },
67
67
  backIcon: {
68
- fontSize: 28,
68
+ fontSize: 32,
69
69
  color: '#000',
70
- fontWeight: '300',
70
+ fontWeight: '700',
71
71
  },
72
72
  headerTitle: {
73
73
  fontSize: 19,