11import * as React from "react" ;
22import { Story , Meta } from "@storybook/react/types-6-0" ;
3- import { createEmptyMatrix , Spreadsheet , Props , CellBase } from ".." ;
3+ import {
4+ createEmptyMatrix ,
5+ Spreadsheet ,
6+ Props ,
7+ CellBase ,
8+ createColorScaleDataViewer ,
9+ } from ".." ;
410import * as Matrix from "../matrix" ;
511import { AsyncCellDataEditor , AsyncCellDataViewer } from "./AsyncCellData" ;
612import CustomCell from "./CustomCell" ;
713import { RangeEdit , RangeView } from "./RangeDataComponents" ;
814import { SelectEdit , SelectView } from "./SelectDataComponents" ;
915import { CustomCornerIndicator } from "./CustomCornerIndicator" ;
10- import createColorScaleDataViewer from "../ColorScaleDataViewer" ;
1116
1217type StringCell = CellBase < string | undefined > ;
1318type NumberCell = CellBase < number | undefined > ;
@@ -145,9 +150,7 @@ export const WithCornerIndicator: Story<Props<StringCell>> = (props) => (
145150) ;
146151
147152export const Filter : Story < Props < StringCell > > = ( props ) => {
148- const [ data , setData ] = React . useState (
149- EMPTY_DATA as Matrix . Matrix < StringCell >
150- ) ;
153+ const [ data , setData ] = React . useState ( EMPTY_DATA ) ;
151154 const [ filter , setFilter ] = React . useState ( "" ) ;
152155
153156 const handleFilterChange = React . useCallback (
@@ -166,7 +169,7 @@ export const Filter: Story<Props<StringCell>> = (props) => {
166169 if ( filter . length === 0 ) {
167170 return data ;
168171 }
169- const filtered : Matrix . Matrix < StringCell > = [ ] ;
172+ const filtered = createEmptyMatrix < StringCell > ( 0 , 0 ) ;
170173 for ( let row = 0 ; row < data . length ; row ++ ) {
171174 if ( data . length !== 0 ) {
172175 for ( let column = 0 ; column < data [ 0 ] . length ; column ++ ) {
0 commit comments