Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit ce95cfc

Browse files
author
Marc-André Rivet
committed
fix conditional styles regression
1 parent 622325b commit ce95cfc

4 files changed

Lines changed: 6 additions & 8 deletions

File tree

src/dash-table/components/Table/props.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export interface ICellCoordinates {
8484
export type ColumnId = string;
8585
export type Columns = IColumn[];
8686
export type Data = Datum[];
87-
export type Datum = IDatumObject | any;
87+
export type Datum = IDatumObject;
8888
export type Indices = number[];
8989
export type RowId = string | number;
9090
export type SelectedCells = ICellCoordinates[];

src/dash-table/derived/data/virtual.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const getter = (
2222
sort_by: SortBy = []
2323
): IDerivedData => {
2424
const map = new Map<Datum, number>();
25-
R.addIndex(R.forEach)((datum, index) => {
25+
R.addIndex<Datum>(R.forEach)((datum, index) => {
2626
map.set(datum, index);
2727
}, data);
2828

src/dash-table/derived/edges/data.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,13 @@ const getter = (
8181
}
8282

8383
const active = isActiveCell(activeCell, i, j);
84-
const column_id = columns[jWithOffset].id;
8584

8685
const priority = active ? ACTIVE_PRIORITY : SELECTED_PRIORITY;
8786
const defaultEdge = active ? Environment.activeEdge : Environment.defaultEdge;
8887

8988
const style: BorderStyle = {
9089
...getDataCellEdges(
91-
data[iWithOffset][column_id],
90+
data[iWithOffset],
9291
iWithOffset,
9392
columns[j],
9493
active,
@@ -102,15 +101,15 @@ const getter = (
102101
borderTop: [defaultEdge, priority],
103102

104103
...getDataCellEdges(
105-
data[iWithOffset][column_id],
104+
data[iWithOffset],
106105
iWithOffset,
107106
columns[j],
108107
active,
109108
true,
110109
priority
111110
)(selectedStyles),
112111
...getDataCellEdges(
113-
data[iWithOffset][column_id],
112+
data[iWithOffset],
114113
iWithOffset,
115114
columns[j],
116115
active,

src/dash-table/derived/header/operations.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import React from 'react';
44
import { memoizeOneFactory } from 'core/memoizer';
55

66
import {
7-
Datum,
87
Selection
98
} from 'dash-table/components/Table/props';
109

@@ -29,7 +28,7 @@ const getter = (
2928
headerRows: number,
3029
rowSelectable: Selection,
3130
rowDeletable: boolean
32-
): JSX.Element[][] => R.addIndex<Datum, JSX.Element[]>(R.map)(
31+
): JSX.Element[][] => R.addIndex<number, JSX.Element[]>(R.map)(
3332
() => [
3433
...(rowDeletable ? [rowDeleteHeader()] : []),
3534
...(rowSelectable ? [rowSelectCell()] : [])

0 commit comments

Comments
 (0)