react-data-matrix 0.4.1 → 1.0.0-rc.1
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,10 @@
|
|
|
1
|
+
type Rgb = readonly [number, number, number];
|
|
2
|
+
export declare const parseHex: (hex: string) => Rgb;
|
|
3
|
+
export declare const relativeLuminance: (hex: string) => number;
|
|
4
|
+
export declare const contrastRatio: (a: string, b: string) => number;
|
|
5
|
+
/** Black or white, whichever contrasts more with `background` (ties → black). */
|
|
6
|
+
export declare const pickText: (background: string) => "#000000" | "#ffffff";
|
|
7
|
+
/** Colour at position `t` (0..1) along evenly spaced `stops`, mixed in OKLab. */
|
|
8
|
+
export declare const interpolateColour: (stops: readonly string[], t: number) => string;
|
|
9
|
+
export declare const isSafeColour: (value: string) => boolean;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { MatrixTheme } from '../types.js';
|
|
2
|
+
import { arcade } from './arcade.js';
|
|
3
|
+
import { aurora } from './aurora.js';
|
|
4
|
+
import { beacon } from './beacon.js';
|
|
5
|
+
import { blueprint } from './blueprint.js';
|
|
6
|
+
import { boardroom } from './boardroom.js';
|
|
7
|
+
import { broadsheet } from './broadsheet.js';
|
|
8
|
+
import { brutal } from './brutal.js';
|
|
9
|
+
import { canopy } from './canopy.js';
|
|
10
|
+
import { clay } from './clay.js';
|
|
11
|
+
import { contour } from './contour.js';
|
|
12
|
+
import { fjord } from './fjord.js';
|
|
13
|
+
import { glasshouse } from './glasshouse.js';
|
|
14
|
+
import { graphite } from './graphite.js';
|
|
15
|
+
import { ledger } from './ledger.js';
|
|
16
|
+
import { midnight } from './midnight.js';
|
|
17
|
+
import { neon } from './neon.js';
|
|
18
|
+
import { noir } from './noir.js';
|
|
19
|
+
import { original } from './original.js';
|
|
20
|
+
import { sherbet } from './sherbet.js';
|
|
21
|
+
import { signal } from './signal.js';
|
|
22
|
+
import { sunset } from './sunset.js';
|
|
23
|
+
import { swiss } from './swiss.js';
|
|
24
|
+
import { terminal } from './terminal.js';
|
|
25
|
+
import { thermal } from './thermal.js';
|
|
26
|
+
import { tidewater } from './tidewater.js';
|
|
27
|
+
import { whitespace } from './whitespace.js';
|
|
28
|
+
export { arcade, aurora, beacon, blueprint, boardroom, broadsheet, brutal, canopy, clay, contour, fjord, glasshouse, graphite, ledger, midnight, neon, noir, original, sherbet, signal, sunset, swiss, terminal, thermal, tidewater, whitespace, };
|
|
29
|
+
export declare const presets: {
|
|
30
|
+
original: MatrixTheme;
|
|
31
|
+
aurora: MatrixTheme;
|
|
32
|
+
midnight: MatrixTheme;
|
|
33
|
+
broadsheet: MatrixTheme;
|
|
34
|
+
brutal: MatrixTheme;
|
|
35
|
+
glasshouse: MatrixTheme;
|
|
36
|
+
terminal: MatrixTheme;
|
|
37
|
+
sherbet: MatrixTheme;
|
|
38
|
+
graphite: MatrixTheme;
|
|
39
|
+
blueprint: MatrixTheme;
|
|
40
|
+
thermal: MatrixTheme;
|
|
41
|
+
whitespace: MatrixTheme;
|
|
42
|
+
boardroom: MatrixTheme;
|
|
43
|
+
clay: MatrixTheme;
|
|
44
|
+
arcade: MatrixTheme;
|
|
45
|
+
sunset: MatrixTheme;
|
|
46
|
+
tidewater: MatrixTheme;
|
|
47
|
+
canopy: MatrixTheme;
|
|
48
|
+
fjord: MatrixTheme;
|
|
49
|
+
neon: MatrixTheme;
|
|
50
|
+
ledger: MatrixTheme;
|
|
51
|
+
contour: MatrixTheme;
|
|
52
|
+
signal: MatrixTheme;
|
|
53
|
+
beacon: MatrixTheme;
|
|
54
|
+
noir: MatrixTheme;
|
|
55
|
+
swiss: MatrixTheme;
|
|
56
|
+
};
|
|
57
|
+
export type PresetName = keyof typeof presets;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { MatrixValue } from '../types/index.js';
|
|
2
|
+
import type { MatrixTheme, SeverityColour } from './types.js';
|
|
3
|
+
export declare const FALLBACK_CELL_COLOUR = "#d0d0d0";
|
|
4
|
+
export interface SeverityScale {
|
|
5
|
+
/** Distinct data colours ranked by their lowest score: 0 = least severe. */
|
|
6
|
+
tiers: ReadonlyMap<string, number>;
|
|
7
|
+
minScore: number;
|
|
8
|
+
maxScore: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const createSeverityScale: (values: readonly MatrixValue[]) => SeverityScale;
|
|
11
|
+
export interface CellColours extends SeverityColour {
|
|
12
|
+
/** Set when the value's own colour failed the allowlist and the fallback was used. */
|
|
13
|
+
rejectedColour?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare const cellColours: (theme: MatrixTheme, { value, scale }: {
|
|
16
|
+
value: MatrixValue;
|
|
17
|
+
scale: SeverityScale;
|
|
18
|
+
}) => CellColours;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MatrixTheme } from './types.js';
|
|
2
|
+
export type CssVariables = Record<`--rdm-${string}`, string>;
|
|
3
|
+
export declare const themeToCssVars: (theme: MatrixTheme) => CssVariables;
|
|
4
|
+
export declare const themeToDataAttributes: (theme: MatrixTheme) => {
|
|
5
|
+
'data-palette': string;
|
|
6
|
+
'data-scheme': "light" | "dark";
|
|
7
|
+
'data-variant': import("./types.js").CellVariant;
|
|
8
|
+
'data-emphasis': "label" | "score";
|
|
9
|
+
'data-align': "center" | "start";
|
|
10
|
+
'data-axis-case': "upper" | "none";
|
|
11
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export type CellVariant = 'fill' | 'outline' | 'chip' | 'dot';
|
|
2
|
+
export interface SeverityColour {
|
|
3
|
+
bg: string;
|
|
4
|
+
fg: string;
|
|
5
|
+
}
|
|
6
|
+
export interface MatrixTheme {
|
|
7
|
+
name: string;
|
|
8
|
+
scheme: 'light' | 'dark';
|
|
9
|
+
/** System font stack only; the library never loads remote fonts. */
|
|
10
|
+
font: string;
|
|
11
|
+
fontSize: string;
|
|
12
|
+
/** Solid colour (6-digit hex); contrast checks measure against it. */
|
|
13
|
+
surface: string;
|
|
14
|
+
/** Optional `background-image` layered over `surface`, e.g. a gradient. */
|
|
15
|
+
backdrop?: string;
|
|
16
|
+
text: string;
|
|
17
|
+
mutedText: string;
|
|
18
|
+
headerSurface: string;
|
|
19
|
+
headerText: string;
|
|
20
|
+
line: string;
|
|
21
|
+
lineWidth: string;
|
|
22
|
+
lineStyle: 'solid' | 'dashed';
|
|
23
|
+
radius: string;
|
|
24
|
+
gap: string;
|
|
25
|
+
cellPadding: string;
|
|
26
|
+
cellShadow: string;
|
|
27
|
+
cellVariant: CellVariant;
|
|
28
|
+
emphasis: 'label' | 'score';
|
|
29
|
+
align: 'center' | 'start';
|
|
30
|
+
axisCase: 'upper' | 'none';
|
|
31
|
+
/** Low → high severity ramp (opaque 6-digit hex). Omit to use each value's own `colour`. */
|
|
32
|
+
palette?: readonly SeverityColour[];
|
|
33
|
+
/** `tier`: one palette step per colour tier; `score`: continuous heatmap by score. */
|
|
34
|
+
scale: 'tier' | 'score';
|
|
35
|
+
focus: string;
|
|
36
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import type { CSSProperties, MouseEvent } from 'react';
|
|
2
|
+
import type { MatrixTheme } from '../theme/types.js';
|
|
3
|
+
export interface MatrixDetail {
|
|
4
|
+
id: number;
|
|
5
|
+
position: number;
|
|
6
|
+
matrix_type: string;
|
|
7
|
+
likelihood: string;
|
|
8
|
+
consequence: number;
|
|
9
|
+
header_title: string;
|
|
10
|
+
header_sub_title: string;
|
|
11
|
+
row_header_title: string;
|
|
12
|
+
row_header_sub_title: string;
|
|
13
|
+
}
|
|
14
|
+
export interface MatrixValue {
|
|
15
|
+
id: number;
|
|
16
|
+
matrix_id: number;
|
|
17
|
+
description: string;
|
|
18
|
+
score_value: number;
|
|
19
|
+
colour: string;
|
|
20
|
+
position: number;
|
|
21
|
+
likelihood_descriptor: string;
|
|
22
|
+
consequence_descriptor: number;
|
|
23
|
+
response: string;
|
|
24
|
+
}
|
|
25
|
+
export interface MatrixData {
|
|
26
|
+
id: number;
|
|
27
|
+
matrix_size: number;
|
|
28
|
+
matrix_name: string;
|
|
29
|
+
primary_header_title: string;
|
|
30
|
+
primary_row_header_title: string;
|
|
31
|
+
matrix_description: string;
|
|
32
|
+
matrix_details: MatrixDetail[];
|
|
33
|
+
matrix_values: MatrixValue[];
|
|
34
|
+
}
|
|
35
|
+
/** Elements that accept per-instance inline overrides via `styles`. */
|
|
36
|
+
export type MatrixSlot = 'root' | 'caption' | 'table' | 'axisTitle' | 'columnHeader' | 'rowHeader' | 'cell';
|
|
37
|
+
export type MatrixSlotStyles = Partial<Record<MatrixSlot, CSSProperties>>;
|
|
38
|
+
/** What `onCellClick` receives besides the cell itself. */
|
|
39
|
+
export interface CellClickContext {
|
|
40
|
+
/** The likelihood row the cell is in. */
|
|
41
|
+
row: Readonly<MatrixDetail>;
|
|
42
|
+
/** The consequence column the cell is in. */
|
|
43
|
+
column: Readonly<MatrixDetail>;
|
|
44
|
+
/** Also fired by Enter and Space: each cell is a native button when a handler is set. */
|
|
45
|
+
event: MouseEvent<HTMLButtonElement>;
|
|
46
|
+
}
|
|
47
|
+
/** Root inline style; also accepts theme variable overrides like `--rdm-radius`. */
|
|
48
|
+
export type MatrixRootStyle = CSSProperties & {
|
|
49
|
+
[variable: `--rdm-${string}`]: string;
|
|
50
|
+
};
|
|
51
|
+
export interface ReactMatrixProps {
|
|
52
|
+
data: MatrixData;
|
|
53
|
+
/** Preset or custom theme (default `original`). Tweak with `{ ...preset, radius: '4px' }`. */
|
|
54
|
+
theme?: MatrixTheme;
|
|
55
|
+
/** Inline overrides per element, applied after the theme. */
|
|
56
|
+
styles?: MatrixSlotStyles;
|
|
57
|
+
className?: string;
|
|
58
|
+
style?: MatrixRootStyle;
|
|
59
|
+
/** Render semantic markup with `rdm-*` classes and `data-*` hooks only: no theme, no base stylesheet. */
|
|
60
|
+
unstyled?: boolean;
|
|
61
|
+
/** Most likely row on top (default `true`). */
|
|
62
|
+
reverseMatrixValues?: boolean;
|
|
63
|
+
/** CSP nonce for the base <style> element. */
|
|
64
|
+
nonce?: string;
|
|
65
|
+
/**
|
|
66
|
+
* Called when a person chooses a cell by pointer or keyboard. Without it, cells
|
|
67
|
+
* are plain text. The data is the consumer's own and is rendered as text only;
|
|
68
|
+
* never inject it as HTML in the handler.
|
|
69
|
+
*/
|
|
70
|
+
onCellClick?: (cell: Readonly<MatrixValue>, context: CellClickContext) => void;
|
|
71
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-data-matrix",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://bronz3beard.github.io/react-matrix",
|
|
@@ -16,25 +16,26 @@
|
|
|
16
16
|
"data grid",
|
|
17
17
|
"data matrix"
|
|
18
18
|
],
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
19
|
+
"devEngines": {
|
|
20
|
+
"runtime": {
|
|
21
|
+
"name": "node",
|
|
22
|
+
"version": "^22.12.0 || ^24.0.0 || >=26.0.0",
|
|
23
|
+
"onFail": "error"
|
|
24
|
+
}
|
|
22
25
|
},
|
|
23
|
-
"
|
|
24
|
-
"
|
|
26
|
+
"type": "module",
|
|
27
|
+
"main": "./dist/index.js",
|
|
25
28
|
"types": "./dist/index.d.ts",
|
|
26
29
|
"exports": {
|
|
27
30
|
".": {
|
|
28
|
-
"
|
|
29
|
-
"
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"default": "./dist/index.js"
|
|
30
33
|
}
|
|
31
34
|
},
|
|
35
|
+
"sideEffects": false,
|
|
32
36
|
"files": [
|
|
33
|
-
"dist/
|
|
34
|
-
"dist
|
|
35
|
-
"dist/react-data-matrix.es.js",
|
|
36
|
-
"dist/react-data-matrix.umd.js",
|
|
37
|
-
"README.md"
|
|
37
|
+
"dist/index.js",
|
|
38
|
+
"dist/**/*.d.ts"
|
|
38
39
|
],
|
|
39
40
|
"repository": {
|
|
40
41
|
"type": "git",
|
|
@@ -46,12 +47,18 @@
|
|
|
46
47
|
"description": "View structured data in a matrix table (data grid), showing a value located at an X and Y coordinate.",
|
|
47
48
|
"scripts": {
|
|
48
49
|
"dev": "vite",
|
|
49
|
-
"build": "tsc && vite build",
|
|
50
|
-
"build:
|
|
51
|
-
"
|
|
50
|
+
"build": "tsc -p tsconfig.json && vite build -c vite.lib.config.ts && tsc -p tsconfig.lib.json",
|
|
51
|
+
"build:site": "vite build",
|
|
52
|
+
"build:watch": "vite build -c vite.lib.config.ts --watch",
|
|
53
|
+
"typecheck": "tsc -p tsconfig.json && tsc -p tsconfig.node.json --noEmit",
|
|
54
|
+
"test": "vitest run",
|
|
55
|
+
"test:e2e": "E2E_FIXTURES=1 npm run build:site && playwright test",
|
|
56
|
+
"test:e2e:docker": "sh scripts/e2e-docker.sh",
|
|
57
|
+
"check:package": "node scripts/check-package.mjs && node scripts/check-treeshake.mjs && publint --strict && attw --pack --profile esm-only",
|
|
58
|
+
"lint": "eslint . --report-unused-disable-directives --max-warnings 0",
|
|
52
59
|
"preview": "vite preview",
|
|
53
60
|
"mock:publish": "npm pack --dry-run",
|
|
54
|
-
"
|
|
61
|
+
"prepublishOnly": "npm run build"
|
|
55
62
|
},
|
|
56
63
|
"browserslist": {
|
|
57
64
|
"production": [
|
|
@@ -65,26 +72,32 @@
|
|
|
65
72
|
"last 1 safari version"
|
|
66
73
|
]
|
|
67
74
|
},
|
|
75
|
+
"peerDependencies": {
|
|
76
|
+
"react": "^18.3.0 || ^19.0.0",
|
|
77
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
78
|
+
},
|
|
68
79
|
"devDependencies": {
|
|
69
|
-
"@
|
|
70
|
-
"@
|
|
71
|
-
"@
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
75
|
-
"@
|
|
76
|
-
"@
|
|
77
|
-
"@
|
|
78
|
-
"
|
|
79
|
-
"eslint
|
|
80
|
-
"eslint-plugin-react-hooks": "^
|
|
81
|
-
"eslint-plugin-react-refresh": "^0.
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"
|
|
80
|
+
"@arethetypeswrong/cli": "^0.18.5",
|
|
81
|
+
"@axe-core/playwright": "^4.13.0",
|
|
82
|
+
"@eslint/js": "^10.0.1",
|
|
83
|
+
"@playwright/test": "1.63.0",
|
|
84
|
+
"@testing-library/dom": "^10.4.2",
|
|
85
|
+
"@testing-library/react": "^16.3.3",
|
|
86
|
+
"@types/node": "^22.20.4",
|
|
87
|
+
"@types/react": "^19.3.0",
|
|
88
|
+
"@types/react-dom": "^19.3.0",
|
|
89
|
+
"@vitejs/plugin-react": "^6.1.1",
|
|
90
|
+
"eslint": "^10.11.0",
|
|
91
|
+
"eslint-plugin-react-hooks": "^7.1.1",
|
|
92
|
+
"eslint-plugin-react-refresh": "^0.5.7",
|
|
93
|
+
"jsdom": "^30.1.0",
|
|
94
|
+
"lightningcss": "^1.33.0",
|
|
95
|
+
"publint": "^0.3.24",
|
|
96
|
+
"react": "^19.3.0",
|
|
97
|
+
"react-dom": "^19.3.0",
|
|
98
|
+
"typescript": "~6.0.3",
|
|
99
|
+
"typescript-eslint": "^8.70.0",
|
|
100
|
+
"vite": "^8.3.0",
|
|
101
|
+
"vitest": "^5.0.1"
|
|
89
102
|
}
|
|
90
103
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare const getCustomStyles: (hasStyle: boolean) => {};
|
|
2
|
-
export declare const getContainerStyles: (hasStyle: boolean, styles: React.CSSProperties) => React.CSSProperties;
|
|
3
|
-
export declare const getTableBoarder: (hasStyle: boolean) => {
|
|
4
|
-
border?: undefined;
|
|
5
|
-
} | {
|
|
6
|
-
border: string;
|
|
7
|
-
};
|
|
8
|
-
export declare const getTableStyles: (hasStyle: boolean, styles: React.CSSProperties) => React.CSSProperties;
|
|
9
|
-
export declare const getHeaderPrimaryTitleStyles: (hasStyle: boolean, styles: React.CSSProperties) => React.CSSProperties;
|
|
10
|
-
export declare const getHeaderRowStyles: (hasStyle: boolean, styles: React.CSSProperties) => React.CSSProperties;
|
|
11
|
-
export declare const getHeaderTitleStyles: (hasStyle: boolean, styles: React.CSSProperties) => React.CSSProperties;
|
|
12
|
-
export declare const getHeaderSubTitleStyles: (hasStyle: boolean, styles: React.CSSProperties) => React.CSSProperties;
|
package/dist/lib/index.d.ts
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export interface MatrixDetail {
|
|
3
|
-
id: number;
|
|
4
|
-
position: number;
|
|
5
|
-
matrix_type: string;
|
|
6
|
-
likelihood: string;
|
|
7
|
-
consequence: number;
|
|
8
|
-
header_title: string;
|
|
9
|
-
header_sub_title: string;
|
|
10
|
-
row_header_title: string;
|
|
11
|
-
row_header_sub_title: string;
|
|
12
|
-
}
|
|
13
|
-
export interface MatrixValue {
|
|
14
|
-
id: number;
|
|
15
|
-
matrix_id: number;
|
|
16
|
-
description: string;
|
|
17
|
-
score_value: number;
|
|
18
|
-
colour: string;
|
|
19
|
-
position: number;
|
|
20
|
-
likelihood_descriptor: string;
|
|
21
|
-
consequence_descriptor: number;
|
|
22
|
-
response: string;
|
|
23
|
-
}
|
|
24
|
-
export interface MatrixData {
|
|
25
|
-
id: number;
|
|
26
|
-
matrix_size: number;
|
|
27
|
-
matrix_name: string;
|
|
28
|
-
primary_header_title: string;
|
|
29
|
-
primary_row_header_title: string;
|
|
30
|
-
matrix_description: string;
|
|
31
|
-
matrix_details: MatrixDetail[];
|
|
32
|
-
matrix_values: MatrixValue[];
|
|
33
|
-
}
|
|
34
|
-
export interface ReactMatrixProps {
|
|
35
|
-
data: MatrixData;
|
|
36
|
-
hasTableBorder?: boolean;
|
|
37
|
-
hasInlineStyles?: boolean | undefined;
|
|
38
|
-
hasContainerStyles?: boolean | undefined;
|
|
39
|
-
reverseMatrixValues?: boolean;
|
|
40
|
-
matrixSizeSelected?: number;
|
|
41
|
-
rowPrimaryUpper?: boolean;
|
|
42
|
-
headerPrimaryUpper?: boolean;
|
|
43
|
-
tableContainerStyles?: React.CSSProperties;
|
|
44
|
-
tableStyles?: React.CSSProperties;
|
|
45
|
-
thRowStyles?: React.CSSProperties;
|
|
46
|
-
thTitleStyles?: React.CSSProperties;
|
|
47
|
-
thSubTitleStyles?: React.CSSProperties;
|
|
48
|
-
thPrimaryTitleStyles?: React.CSSProperties;
|
|
49
|
-
trRowStyles?: React.CSSProperties;
|
|
50
|
-
trTitleStyles?: React.CSSProperties;
|
|
51
|
-
trSubTitleStyles?: React.CSSProperties;
|
|
52
|
-
trPrimaryTitleStyles?: React.CSSProperties;
|
|
53
|
-
tdStyles?: React.CSSProperties;
|
|
54
|
-
customHeaderRowIdValue?: string;
|
|
55
|
-
customDynamicHeaderTitleIdValue?: string;
|
|
56
|
-
customDynamicSubHeaderTitleIdValue?: string;
|
|
57
|
-
customRowDynamicIdValue?: string;
|
|
58
|
-
customRowHeaderDynamicIdValue?: string;
|
|
59
|
-
customTableDataDynamicIdValue?: string;
|
|
60
|
-
}
|
|
61
|
-
export interface MatrixHeaderProps {
|
|
62
|
-
data: MatrixData;
|
|
63
|
-
hasInlineStyles?: boolean | undefined;
|
|
64
|
-
headerPrimaryUpper?: boolean;
|
|
65
|
-
thRowStyles?: React.CSSProperties;
|
|
66
|
-
thTitleStyles?: React.CSSProperties;
|
|
67
|
-
thSubTitleStyles?: React.CSSProperties;
|
|
68
|
-
thPrimaryTitleStyles?: React.CSSProperties;
|
|
69
|
-
customHeaderRowIdValue?: string;
|
|
70
|
-
customDynamicHeaderTitleIdValue?: string;
|
|
71
|
-
customDynamicSubHeaderTitleIdValue?: string;
|
|
72
|
-
}
|
|
73
|
-
export interface MatrixRowsProps {
|
|
74
|
-
data: MatrixData;
|
|
75
|
-
rowPrimaryUpper?: boolean;
|
|
76
|
-
hasInlineStyles?: boolean | undefined;
|
|
77
|
-
reverseMatrixValues?: boolean;
|
|
78
|
-
trRowStyles?: React.CSSProperties;
|
|
79
|
-
trTitleStyles?: React.CSSProperties;
|
|
80
|
-
trSubTitleStyles?: React.CSSProperties;
|
|
81
|
-
trPrimaryTitleStyles?: React.CSSProperties;
|
|
82
|
-
tdStyles?: React.CSSProperties;
|
|
83
|
-
customRowDynamicIdValue?: string;
|
|
84
|
-
customRowHeaderDynamicIdValue?: string;
|
|
85
|
-
customTableDataDynamicIdValue?: string;
|
|
86
|
-
}
|
|
87
|
-
export interface TableDataProps {
|
|
88
|
-
data: {
|
|
89
|
-
id: number;
|
|
90
|
-
colour: string;
|
|
91
|
-
position: number;
|
|
92
|
-
matrix_id: number;
|
|
93
|
-
score_value: number;
|
|
94
|
-
description: string;
|
|
95
|
-
response: string;
|
|
96
|
-
likelihood_descriptor: string;
|
|
97
|
-
consequence_descriptor: number;
|
|
98
|
-
};
|
|
99
|
-
tdStyles?: React.CSSProperties;
|
|
100
|
-
hasInlineStyles?: boolean;
|
|
101
|
-
customTableDataDynamicIdValue?: string;
|
|
102
|
-
}
|
package/dist/lib/utils/data.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const groupObjectsByProp: <T>(array: T[], prop: keyof T) => T[][];
|
|
2
|
-
export declare const capitaliseFirstCharacter: (stringValue: string) => string;
|
|
3
|
-
export declare const capitaliseString: (stringValue: string) => string;
|
|
4
|
-
export declare const callAll: <T extends (...args: never[]) => void>(...fns: T[]) => (...args: Parameters<T>) => void;
|