react-open-source-grid 1.6.7 → 1.7.0

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.
@@ -1 +1 @@
1
- export * from './index-DgcHJP8T.js';
1
+ export * from './index-Ds2EPIvF.js';
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./index-DgcHJP8T.js";export{e as createPreset};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./index-Ds2EPIvF.js";export{e as createPreset};
package/dist/index.html CHANGED
@@ -70,8 +70,8 @@
70
70
  }
71
71
  })();
72
72
  </script>
73
- <script type="module" crossorigin src="/assets/index-DgcHJP8T.js"></script>
74
- <link rel="stylesheet" crossorigin href="/assets/index-CQcTDWao.css">
73
+ <script type="module" crossorigin src="/assets/index-Ds2EPIvF.js"></script>
74
+ <link rel="stylesheet" crossorigin href="/assets/index-90D-dENa.css">
75
75
  </head>
76
76
  <body>
77
77
  <!-- SEO Content Section -->
@@ -0,0 +1,20 @@
1
+ /**
2
+ * ChartOverlay - Floating panel component for displaying charts over the grid
3
+ */
4
+ import React from 'react';
5
+ import type { ChartConfig, ChartType } from './types';
6
+ import './ChartOverlay.css';
7
+ export interface ChartOverlayProps {
8
+ config: ChartConfig;
9
+ onClose: () => void;
10
+ onChangeType?: (type: ChartType) => void;
11
+ onToggleTheme?: () => void;
12
+ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left' | 'center';
13
+ draggable?: boolean;
14
+ resizable?: boolean;
15
+ }
16
+ /**
17
+ * ChartOverlay component - renders a floating chart panel
18
+ */
19
+ export declare const ChartOverlay: React.FC<ChartOverlayProps>;
20
+ export default ChartOverlay;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * QuickChart - A reusable chart component using Recharts
3
+ * Supports line, bar, area, and pie charts with customization options
4
+ */
5
+ import React from 'react';
6
+ import type { ChartConfig, ChartType } from './types';
7
+ import './QuickChart.css';
8
+ export interface QuickChartProps {
9
+ config: ChartConfig;
10
+ onClose?: () => void;
11
+ onChangeType?: (type: ChartType) => void;
12
+ onToggleTheme?: () => void;
13
+ allowTypeSwitch?: boolean;
14
+ allowThemeSwitch?: boolean;
15
+ width?: number;
16
+ height?: number;
17
+ }
18
+ /**
19
+ * QuickChart component for rendering interactive charts
20
+ */
21
+ export declare const QuickChart: React.FC<QuickChartProps>;
22
+ export default QuickChart;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Charts module exports
3
+ *
4
+ * This module provides integrated charting functionality for the DataGrid.
5
+ * Includes types, utilities, and components for creating charts from grid selections.
6
+ */
7
+ export type { CellAddress, GridCellRange, ChartType, ChartSeries, ChartConfig, RangeToChartOptions, NormalizedRange, } from './types';
8
+ export { buildChartConfigFromRange, normalizeRange, updateChartType, updateChartTheme, } from './rangeToChart';
9
+ export { QuickChart } from './QuickChart';
10
+ export type { QuickChartProps } from './QuickChart';
11
+ export { ChartOverlay } from './ChartOverlay';
12
+ export type { ChartOverlayProps } from './ChartOverlay';
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Utilities for converting grid cell ranges to chart configurations
3
+ */
4
+ import type { ChartConfig, GridCellRange, NormalizedRange, RangeToChartOptions } from './types';
5
+ /**
6
+ * Normalize a grid cell range so that start is always top-left and end is bottom-right
7
+ */
8
+ export declare function normalizeRange(range: GridCellRange): NormalizedRange;
9
+ /**
10
+ * Build a chart configuration from a grid cell range
11
+ *
12
+ * @param options - Configuration options including range, data, and chart type
13
+ * @returns ChartConfig ready to be rendered
14
+ */
15
+ export declare function buildChartConfigFromRange(options: RangeToChartOptions): ChartConfig;
16
+ /**
17
+ * Update an existing chart config with a new chart type
18
+ */
19
+ export declare function updateChartType(config: ChartConfig, newType: ChartConfig['type']): ChartConfig;
20
+ /**
21
+ * Update an existing chart config with a new theme
22
+ */
23
+ export declare function updateChartTheme(config: ChartConfig, newTheme: 'light' | 'dark'): ChartConfig;
@@ -0,0 +1,63 @@
1
+ /**
2
+ * Chart types and interfaces for integrated charting functionality
3
+ */
4
+ import type { Column, Row } from '../components/DataGrid/types';
5
+ /**
6
+ * Represents a cell address in the grid
7
+ */
8
+ export interface CellAddress {
9
+ rowIndex: number;
10
+ colIndex: number;
11
+ }
12
+ /**
13
+ * Represents a rectangular range of cells in the grid
14
+ * start and end can be in any order (normalized during processing)
15
+ */
16
+ export interface GridCellRange {
17
+ start: CellAddress;
18
+ end: CellAddress;
19
+ }
20
+ /**
21
+ * Supported chart types
22
+ */
23
+ export type ChartType = 'line' | 'bar' | 'area' | 'pie';
24
+ /**
25
+ * Represents a data series in the chart
26
+ */
27
+ export interface ChartSeries {
28
+ name: string;
29
+ data: number[];
30
+ color?: string;
31
+ }
32
+ /**
33
+ * Complete chart configuration
34
+ */
35
+ export interface ChartConfig {
36
+ id: string;
37
+ type: ChartType;
38
+ title?: string;
39
+ xLabels: (string | number)[];
40
+ series: ChartSeries[];
41
+ theme?: 'light' | 'dark';
42
+ }
43
+ /**
44
+ * Options for converting a grid range to a chart configuration
45
+ */
46
+ export interface RangeToChartOptions {
47
+ range: GridCellRange;
48
+ rows: Row[];
49
+ columns: Column[];
50
+ chartType: ChartType;
51
+ useFirstColumnAsCategory?: boolean;
52
+ title?: string;
53
+ theme?: 'light' | 'dark';
54
+ }
55
+ /**
56
+ * Result of normalizing a grid cell range
57
+ */
58
+ export interface NormalizedRange {
59
+ startRow: number;
60
+ endRow: number;
61
+ startCol: number;
62
+ endCol: number;
63
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Charts Demo Page
3
+ *
4
+ * Demonstrates the integrated charting functionality with Quick Charts
5
+ */
6
+ import React from 'react';
7
+ import './ChartsDemo.css';
8
+ export declare const ChartsDemo: React.FC;
9
+ export default ChartsDemo;