File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212
1313Spreadsheet-like table UI for SolidJS.
1414
15+ __ Demo:__ https://alexanderrafferty.com/projects/solid-tabular/
16+
1517⚠️ This library is currently in early development, and breaking changes will definitely occur.
1618
1719## Features
Original file line number Diff line number Diff line change 11- Extract out context menu
22- Extract out cell content
33- Lift cell component to top level?
4- - Column auto-sizing
5- - Fix reactivity in Basic Usage story
4+ - Column auto-sizing
Original file line number Diff line number Diff line change 1- import { createSignal , onMount } from 'solid-js'
1+ import { createMemo , createSignal , onMount } from 'solid-js'
22import type { Meta , StoryObj } from 'storybook-solidjs-vite'
33import { fn } from 'storybook/test'
44import { ActiveRange , Table } from 'src'
@@ -13,7 +13,7 @@ const meta = {
1313 const [ activeRange , setActiveRange ] = createSignal < ActiveRange > ( )
1414 const [ widths , setWidths ] = createSignal ( new Map < string , number > ( ) )
1515
16- const [ data , setData ] = createSignal < Record < string , unknown > [ ] > ( props . data ?? [ ] )
16+ const [ fetchedData , setFetchedData ] = createSignal < Record < string , unknown > [ ] > ( )
1717
1818 onMount ( ( ) => {
1919 if ( ! props . url ) return
@@ -24,10 +24,12 @@ const meta = {
2424 header : true ,
2525 skipEmptyLines : true ,
2626 } )
27- setData ( parsed . data )
27+ setFetchedData ( parsed . data )
2828 } )
2929 } )
3030
31+ const data = createMemo ( ( ) => fetchedData ( ) ?? props . data ?? [ ] )
32+
3133 return (
3234 < div
3335 style = { {
You can’t perform that action at this time.
0 commit comments