react-data-matrix 0.4.2 → 1.0.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.
- package/README.md +416 -280
- package/dist/components/MatrixHeaders.d.ts +8 -0
- package/dist/components/MatrixRows.d.ts +16 -0
- package/dist/components/TableData.d.ts +17 -0
- package/dist/grid.d.ts +13 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +1414 -0
- package/dist/theme/baseCss.d.ts +2 -0
- package/dist/theme/colour.d.ts +10 -0
- package/dist/theme/presets/arcade.d.ts +2 -0
- package/dist/theme/presets/aurora.d.ts +2 -0
- package/dist/theme/presets/beacon.d.ts +2 -0
- package/dist/theme/presets/blueprint.d.ts +2 -0
- package/dist/theme/presets/boardroom.d.ts +2 -0
- package/dist/theme/presets/broadsheet.d.ts +2 -0
- package/dist/theme/presets/brutal.d.ts +2 -0
- package/dist/theme/presets/canopy.d.ts +2 -0
- package/dist/theme/presets/clay.d.ts +2 -0
- package/dist/theme/presets/contour.d.ts +2 -0
- package/dist/theme/presets/fjord.d.ts +2 -0
- package/dist/theme/presets/glasshouse.d.ts +2 -0
- package/dist/theme/presets/graphite.d.ts +2 -0
- package/dist/theme/presets/index.d.ts +57 -0
- package/dist/theme/presets/ledger.d.ts +2 -0
- package/dist/theme/presets/midnight.d.ts +2 -0
- package/dist/theme/presets/neon.d.ts +2 -0
- package/dist/theme/presets/noir.d.ts +2 -0
- package/dist/theme/presets/original.d.ts +2 -0
- package/dist/theme/presets/sherbet.d.ts +2 -0
- package/dist/theme/presets/signal.d.ts +2 -0
- package/dist/theme/presets/sunset.d.ts +2 -0
- package/dist/theme/presets/swiss.d.ts +2 -0
- package/dist/theme/presets/terminal.d.ts +2 -0
- package/dist/theme/presets/thermal.d.ts +2 -0
- package/dist/theme/presets/tidewater.d.ts +2 -0
- package/dist/theme/presets/whitespace.d.ts +2 -0
- package/dist/theme/severity.d.ts +18 -0
- package/dist/theme/tokens.d.ts +11 -0
- package/dist/theme/types.d.ts +36 -0
- package/dist/types/index.d.ts +71 -0
- package/package.json +50 -37
- package/dist/lib/components/MatrixHeaders.d.ts +0 -4
- package/dist/lib/components/MatrixRows.d.ts +0 -4
- package/dist/lib/components/TableData.d.ts +0 -4
- package/dist/lib/helpers/getStyles.d.ts +0 -12
- package/dist/lib/index.d.ts +0 -4
- package/dist/lib/types/index.d.ts +0 -102
- package/dist/lib/utils/data.d.ts +0 -2
- package/dist/lib/utils/functions.d.ts +0 -4
- package/dist/manifest.json +0 -7
- package/dist/react-data-matrix.es.js +0 -913
- package/dist/react-data-matrix.umd.js +0 -28
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MatrixDetail, MatrixSlotStyles } from '../types/index.js';
|
|
2
|
+
interface MatrixHeadersProps {
|
|
3
|
+
title: string;
|
|
4
|
+
columns: MatrixDetail[];
|
|
5
|
+
styles: MatrixSlotStyles;
|
|
6
|
+
}
|
|
7
|
+
declare const MatrixHeaders: ({ title, columns, styles }: MatrixHeadersProps) => import("react").JSX.Element;
|
|
8
|
+
export default MatrixHeaders;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { GridRow } from '../grid.js';
|
|
2
|
+
import type { SeverityColour } from '../theme/types.js';
|
|
3
|
+
import type { MatrixDetail, MatrixSlotStyles, ReactMatrixProps } from '../types/index.js';
|
|
4
|
+
interface MatrixRowsProps {
|
|
5
|
+
rowTitle: string;
|
|
6
|
+
columnTitle: string;
|
|
7
|
+
columns: MatrixDetail[];
|
|
8
|
+
rows: GridRow[];
|
|
9
|
+
tiers: ReadonlyMap<string, number>;
|
|
10
|
+
/** Severity colour per value id; `null` when unstyled. */
|
|
11
|
+
colours: ReadonlyMap<number, SeverityColour> | null;
|
|
12
|
+
styles: MatrixSlotStyles;
|
|
13
|
+
onCellClick?: ReactMatrixProps['onCellClick'];
|
|
14
|
+
}
|
|
15
|
+
declare const MatrixRows: ({ rowTitle, columnTitle, columns, rows, tiers, colours, styles, onCellClick, }: MatrixRowsProps) => import("react").JSX.Element;
|
|
16
|
+
export default MatrixRows;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { CSSProperties, MouseEvent } from 'react';
|
|
2
|
+
import type { SeverityColour } from '../theme/types.js';
|
|
3
|
+
import type { MatrixValue } from '../types/index.js';
|
|
4
|
+
interface TableDataProps {
|
|
5
|
+
value: MatrixValue | null;
|
|
6
|
+
row: string;
|
|
7
|
+
column: number;
|
|
8
|
+
tier?: number;
|
|
9
|
+
colours?: SeverityColour;
|
|
10
|
+
style?: CSSProperties;
|
|
11
|
+
/** Set when the consumer passed `onCellClick`: the cell becomes a native button. */
|
|
12
|
+
onActivate?: (event: MouseEvent<HTMLButtonElement>) => void;
|
|
13
|
+
/** Row, column and rating, so the button makes sense outside the table's context. */
|
|
14
|
+
accessibleName?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const TableData: ({ value, row, column, tier, colours, style, onActivate, accessibleName, }: TableDataProps) => import("react").JSX.Element;
|
|
17
|
+
export default TableData;
|
package/dist/grid.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { MatrixData, MatrixDetail, MatrixValue } from './types/index.js';
|
|
2
|
+
export interface GridRow {
|
|
3
|
+
detail: MatrixDetail;
|
|
4
|
+
cells: (MatrixValue | null)[];
|
|
5
|
+
}
|
|
6
|
+
export interface Grid {
|
|
7
|
+
columns: MatrixDetail[];
|
|
8
|
+
rows: GridRow[];
|
|
9
|
+
issues: string[];
|
|
10
|
+
}
|
|
11
|
+
export declare const buildGrid: (data: MatrixData, { reverse }: {
|
|
12
|
+
reverse: boolean;
|
|
13
|
+
}) => Grid;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ReactMatrixProps } from './types/index.js';
|
|
2
|
+
declare const ReactMatrix: ({ data, theme, styles, className, style, unstyled, reverseMatrixValues, nonce, onCellClick, }: ReactMatrixProps) => import("react").JSX.Element;
|
|
3
|
+
export default ReactMatrix;
|
|
4
|
+
export * from './theme/presets/index.js';
|
|
5
|
+
export type { CellClickContext, MatrixData, MatrixDetail, MatrixRootStyle, MatrixSlot, MatrixSlotStyles, MatrixValue, ReactMatrixProps, } from './types/index.js';
|
|
6
|
+
export type { CellVariant, MatrixTheme, SeverityColour } from './theme/types.js';
|