Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typescript + API Cleanup + Simple Components #30

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open

Conversation

marchaos
Copy link
Owner

@marchaos marchaos commented Nov 30, 2020

Converted all files to TS + Small cleanup to API + new simpler components

Changes

  • Added Types for StickyTree, AutoSizedStickyTree
  • Added a new component StickyList and AutoSizedStickyList which simplifies the API for those that just want to render a list. See CitiesList.tsx in examples.
  • Added examples and Cypress tests - you can run these locally with npm start

Breaking Changes

  • defaultRowHeight prop is now just rowHeight
  • getChildren receives to node object for the parent, and should now return a node as a prop on the info return, e.g
  const getChildren = (node: MyNodeType, nodeInfo: EnhancedStickyTreeNode<MyNodeType>) => {
      return [
           {   
               isSticky: true,
               node: { id: 'child1', name: 'Child 1' }
           }
      ]
  }
  • onRowsRendered props for startNode and endNode are now of type EnhancedStickyTreeNode<TNodeType>
  • rowRenderer now receives the node to render that was returned by getChildren, e.g.
    const rowRenderer = ({ node, style }) => {
        return (
            <div className="node-row" style={style} key={node.id}>
                {node.name}
            </div>
        );
    }

Marc McIntyre added 7 commits November 25, 2020 11:00
* Added example and simple Cypress test
* Added prettier config
* Cleanup
* Fixed TS types for AutoSizedStickyTree
* Fixed build so we include ts definitions.
* Fixed build and tests
* Added basic test for StickyList
* Fixed some prop types for StickyTree
* Added example for List
…u supplied, rather than just the id to avoid having to look up the node again.
@marchaos marchaos changed the title Typescript + Cleanup Typescript + API Cleanup + Simple Components Dec 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant