(
baseline: CSSProperties[][],
columns: Columns,
styles: IConvertedStyle[],
data: Data,
offset: IViewportOffset,
activeCell: ICellCoordinates | undefined,
selectedCells: SelectedCells
)
| 32 | ); |
| 33 | |
| 34 | const getter = ( |
| 35 | baseline: CSSProperties[][], |
| 36 | columns: Columns, |
| 37 | styles: IConvertedStyle[], |
| 38 | data: Data, |
| 39 | offset: IViewportOffset, |
| 40 | activeCell: ICellCoordinates | undefined, |
| 41 | selectedCells: SelectedCells |
| 42 | ) => { |
| 43 | baseline = shallowClone(baseline); |
| 44 | |
| 45 | const cells = selectedCells.length |
| 46 | ? selectedCells |
| 47 | : activeCell |
| 48 | ? [activeCell] |
| 49 | : []; |
| 50 | |
| 51 | const inactiveStyles = styles.filter(style => !style.checksState()); |
| 52 | const selectedStyles = styles.filter(style => style.checksStateSelected()); |
| 53 | const activeStyles = styles.filter(style => style.checksStateActive()); |
| 54 | |
| 55 | cells.forEach(({row: i, column: j}) => { |
| 56 | const iNoOffset = i - offset.rows; |
| 57 | const jNoOffset = j - offset.columns; |
| 58 | |
| 59 | if ( |
| 60 | iNoOffset < 0 || |
| 61 | jNoOffset < 0 || |
| 62 | baseline.length <= iNoOffset || |
| 63 | baseline[iNoOffset].length <= jNoOffset |
| 64 | ) { |
| 65 | return; |
| 66 | } |
| 67 | |
| 68 | const active = isActiveCell(activeCell, i, j); |
| 69 | |
| 70 | const style = { |
| 71 | ...getDataCellStyle( |
| 72 | data[i], |
| 73 | i + offset.rows, |
| 74 | columns[j], |
| 75 | active, |
| 76 | true |
| 77 | )(inactiveStyles), |
| 78 | ...SELECTED_CELL_STYLE, |
| 79 | ...getDataCellStyle( |
| 80 | data[i], |
| 81 | i + offset.rows, |
| 82 | columns[j], |
| 83 | active, |
| 84 | true |
| 85 | )(selectedStyles), |
| 86 | ...getDataCellStyle( |
| 87 | data[i], |
| 88 | i + offset.rows, |
| 89 | columns[j], |
| 90 | active, |
| 91 | true |
nothing calls this directly
no test coverage detected
searching dependent graphs…