2.0.2 • Published 5 months ago

list-of-todos v2.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 months ago

list-of-todos Weekly downloads

A simple ToDo list.


Demo

You can access the storybook for this component here.

Props

NameTypeRequiredDefaultDescription
classNameItemCSSPropertiesno...The className for an item
classNameListCSSPropertiesno...The className for the list
itemsTask[]no[]The initial list of items
onChange(items: Task[]) => voidyes-The function called when there are changes in the list of items
styleItemCSSPropertiesno...The custom style for an item
styleListCSSPropertiesno...The custom style for the list

Props of Task

NameTypeRequiredDefaultDescription
idstringyes-The unique if of the item
textstringyes-The text representing the item
donebooleannofalseIt is true if the task was completed

Versions

ListOfTodos usesReact
1.0.x16.8.0
1.1.x16.9.0

About versioning schema used for ListOfTodos

  • Major - it will be increased if any major version of any dependat package changes or there are breaking changes in this package
  • Minor - it will be increased if any minor or patch version of any dependat package changes or there is added functionality in a backwards compatible manner
  • Patch - it will be increased if there are backwards compatible bug fixes

Example

Displaying a list having initially two items:

import * as React from "react";
import ListOfTodos from "list-of-todos";

class App extends React.Component {
  private items: Task[] = [
    {
      id: '1',
      text: 'Text 1',
      done: true
    },
    {
      id: '2',
      text: 'Text 2'
    }
  ];

  render() {
    return (
      <div className="App">
        <ListOfTodos items={this.items} onChange={this.handleChange} />
      </div>
    );
  }

  handleChange = (items: Task[]) => console.log({ items });
}

export default App;

Changelog

1.0.0

  • list-of-todos is made publicly available

1.0.1

  • Inlined the icons in buttons

1.0.2

  • Fixed the layout

1.0.3

  • Added a second argument to onChange

1.0.4

  • Added a key for react when rendering a task in the list

1.1.0

  • Updated packages

1.1.1

  • Updated packages
  • Moved from npm to yarn

1.1.2

  • Updated packages

1.1.3

  • Updated packages

1.1.4

  • Fixed crash produced by "export * from"

1.1.5

  • Added two new props: classNameItem and classNameList

1.2.0

  • Accepting React 17 as peerDependencies
  • Fixed security warnings

1.2.1

  • Updated packages
2.0.2

5 months ago

2.0.1

5 months ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago