@dhiraj0720/report1chart 2.9.3 → 2.9.5

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.3",
3
+ "version": "2.9.5",
4
4
  "main": "src/index.jsx",
5
5
  "scripts": {
6
6
  "test": "echo 'No tests'"
@@ -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,53 +19,59 @@ const PercentCell = ({ value }) => {
21
19
  );
22
20
  };
23
21
 
24
- // Reusable Cell
25
- const Cell = ({ children, bold = false, highlight = false, isFrozen = false }) => (
22
+ const Cell = ({ children, bold = false, isFrozen = false }) => (
26
23
  <View style={[
27
24
  styles.cell,
28
25
  isFrozen && styles.frozenCell,
29
- bold && styles.bold,
30
- highlight && styles.highlightCell
26
+ bold && styles.boldCell
31
27
  ]}>
32
- <Text style={[styles.cellText, bold && styles.boldText]}>
28
+ <Text
29
+ style={[styles.cellText, bold && styles.boldText]}
30
+ numberOfLines={1}
31
+ ellipsizeMode="tail"
32
+ >
33
33
  {children}
34
34
  </Text>
35
35
  </View>
36
36
  );
37
37
 
38
- const FrozenTableReport1A = ({ rows = [], isFullscreen = false }) => {
38
+ const FrozenTableReport1A = ({ rows = [] }) => {
39
39
  if (!rows.length) {
40
40
  return <Text style={{ textAlign: 'center', padding: 20, color: '#666' }}>No data available</Text>;
41
41
  }
42
42
 
43
- // Wider frozen column in fullscreen
44
- const frozenColumnWidth = isFullscreen ? 180 : 150;
43
+ const frozenColumnWidth = 150;
44
+ const rowHeight = 48; // Fixed height for perfect alignment
45
45
 
46
46
  return (
47
47
  <View style={styles.container}>
48
- {/* Frozen Left Column - FAALİYET */}
48
+ {/* Frozen Column - Fixed Height Rows */}
49
49
  <View style={[styles.frozenColumn, { width: frozenColumnWidth }]}>
50
50
  <Cell bold isFrozen>FAALİYET</Cell>
51
51
  {rows.map((row, i) => (
52
- <Cell key={i} bold isFrozen>
53
- {row.name}
54
- </Cell>
52
+ <View key={i} style={{ height: rowHeight }}>
53
+ <Cell bold isFrozen>
54
+ {row.name}
55
+ </Cell>
56
+ </View>
55
57
  ))}
56
58
  </View>
57
59
 
58
- {/* Scrollable Columns */}
60
+ {/* Scrollable Columns - Same Fixed Height Rows */}
59
61
  <ScrollView horizontal showsHorizontalScrollIndicator={false}>
60
62
  <View>
61
- {/* Header Row */}
63
+ {/* Header */}
62
64
  <View style={styles.headerRow}>
63
65
  {['2024', '2025', 'Artış %', '2025 Bütçe', 'Sapma %'].map((header) => (
64
- <Cell key={header} bold>{header}</Cell>
66
+ <View key={header} style={{ height: rowHeight }}>
67
+ <Cell bold>{header}</Cell>
68
+ </View>
65
69
  ))}
66
70
  </View>
67
71
 
68
72
  {/* Data Rows */}
69
73
  {rows.map((row, i) => (
70
- <View key={i} style={styles.dataRow}>
74
+ <View key={i} style={[styles.dataRow, { height: rowHeight }]}>
71
75
  <Cell>{formatNumber(row.actual2024)}</Cell>
72
76
  <Cell>{formatNumber(row.actual2025)}</Cell>
73
77
  <Cell><PercentCell value={row.actualChangePercent} /></Cell>
@@ -94,44 +98,42 @@ const styles = StyleSheet.create({
94
98
  backgroundColor: '#fff',
95
99
  },
96
100
  frozenColumn: {
97
- backgroundColor: '#f4f6f8',
101
+ backgroundColor: '#f5f7fa',
98
102
  borderRightWidth: 1,
99
103
  borderColor: '#ddd',
100
104
  },
101
105
  headerRow: {
102
106
  flexDirection: 'row',
103
- backgroundColor: '#f4f6f8',
107
+ backgroundColor: '#f0f0f0',
104
108
  },
105
109
  dataRow: {
106
110
  flexDirection: 'row',
107
111
  },
108
112
  cell: {
109
- minWidth: 110,
110
- paddingHorizontal: 14, // +7 left/right for spacious feel
111
- paddingVertical: 12,
113
+ flex: 1,
114
+ minWidth: 105,
115
+ paddingHorizontal: 12,
112
116
  justifyContent: 'center',
113
117
  alignItems: 'center',
114
118
  borderBottomWidth: 1,
115
- borderColor: '#e0e0e0',
119
+ borderColor: '#eee',
116
120
  },
117
121
  frozenCell: {
118
122
  justifyContent: 'flex-start',
119
- paddingLeft: 18,
123
+ paddingLeft: 16,
124
+ paddingRight: 8,
125
+ },
126
+ boldCell: {
127
+ backgroundColor: '#e9f0f8',
120
128
  },
121
129
  cellText: {
122
130
  fontSize: 12.5,
123
131
  textAlign: 'center',
124
132
  color: '#333',
125
133
  },
126
- bold: {
127
- backgroundColor: '#e9f0f8',
128
- },
129
134
  boldText: {
130
135
  fontWeight: '700',
131
136
  },
132
- highlightCell: {
133
- backgroundColor: '#e9f0f8',
134
- },
135
137
  percentText: {
136
138
  fontWeight: '700',
137
139
  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}>←</Text>
32
+ <Text style={styles.backIcon}>‹</Text>
33
33
  </TouchableOpacity>
34
34
  <Text style={styles.headerTitle}>PERFORMANS RAPORU (USD)</Text>
35
35
  </View>
@@ -97,9 +97,11 @@ const styles = StyleSheet.create({
97
97
  header: {
98
98
  flexDirection: 'row',
99
99
  alignItems: 'center',
100
- paddingVertical: 18,
101
100
  paddingHorizontal: 16,
102
- backgroundColor: '#1565c0', // Deep blue
101
+ paddingVertical: 18,
102
+ backgroundColor: '#4E79A7',
103
+ borderBottomWidth: 1,
104
+ borderColor: '#4E79A7',
103
105
  },
104
106
  backButton: {
105
107
  padding: 8,
@@ -205,7 +205,7 @@ const styles = StyleSheet.create({
205
205
  borderBottomWidth: 1,
206
206
  borderColor: '#4E79A7',
207
207
  },
208
- backIcon: { fontSize: 28, color: '#fff', fontWeight: '800' },
208
+ backIcon: { fontSize: 32, color: '#fff', fontWeight: '800' },
209
209
  headerTitle: { fontSize: 19, fontWeight: '700', color: '#fff', flex: 1, textAlign: 'center' },
210
210
 
211
211
  filterBar: {