0.5.3 • Published 2 years ago

material_multi_select_list v0.5.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

NAME

material_multi_select_list

ABOUT

This package allows you to select multiple items from a list.

The source list must be in the form of text and value.

EXAMPLE


const list = [{text: "item 1", value: 1}, {text: "item 2", value: 2}, {text: "item 3", value: 3}];

const [selectedList, setSelectedList] = useState([1 , 3]);

return (
    <TransferList
        title="Multi select list"
        borderWidth={2}
        buttonCleanAllText={"unselect all"}
        buttonSelectAllText={"select all"}
        leftIcon={<ChevronLeft />}
        rightIcon={<ChevronRight/>}
        searchIcon={<SearchIcon />}
        menuIcon={<MenuOutlined />}
        pageSize={5}
        sourceList={list}
        selectedList={selectedList}
        onChange={setSelectedList}
    />
);

Properties

TransferList.propTypes = {
  borderWidth: PropTypes.number,
  maximumSelectableItemText: PropTypes.string,
  buttonCleanAllText: PropTypes.string,
  buttonSelectAllText: PropTypes.string,
  searchBoxPlaceholder: PropTypes.string,
  menuShowAllText: PropTypes.string,
  menuShowSelectedText: PropTypes.string,
  menuShowUnselectedText: PropTypes.string,
  onChange: PropTypes.func,
  sourceList: PropTypes.array,
  selectedList: PropTypes.array,
  title: PropTypes.string,
  pageSize: PropTypes.number,
  searchIcon: PropTypes.any,
  menuIcon: PropTypes.any,
  rightIcon: PropTypes.any,
  leftIcon: PropTypes.any,
  maximumSelectableItem: PropTypes.number,
  readyOnly: PropTypes.bool
};

Default value of properties

TransferList.defaultProps = {
  borderWidth: 0,
  maximumSelectableItemText: "Maximum selectable item : ",
  buttonCleanAllText: "Clean all",
  buttonSelectAllText: "Select all",
  searchBoxPlaceholder: "Search",
  menuShowAllText: "Show all",
  menuShowSelectedText: "Show selected",
  menuShowUnselectedText: "Show unselected",
  onChange: () => [],
  sourceList: [],
  selectedList: [],
  title: "Title",
  pageSize: 5,
  searchIcon: "S",
  menuIcon: "M",
  rightIcon: ">",
  leftIcon: "<",
  maximumSelectableItem: -1,
  readyOnly: false
};

Properties Example

You can add the following component as a value to icons property

searchIcon = { <FontAwesomeIcon icon={faSearch}/> }

About onChange

To use it, you must add its value as follows

onChange={newSelectedItemValueList =>{}}

0.4.9

2 years ago

0.4.8

2 years ago

0.5.3

2 years ago

0.4.6

2 years ago

0.5.0

2 years ago

0.5.2

2 years ago

0.5.1

2 years ago

0.4.5

2 years ago

0.4.4

2 years ago

0.4.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.3.9

3 years ago

0.4.0

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.6

3 years ago

0.3.5

3 years ago

0.3.4

3 years ago

0.3.0

3 years ago

0.2.9

3 years ago

0.3.2

3 years ago

0.3.1

3 years ago

0.3.3

3 years ago

0.2.8

3 years ago

0.2.7

3 years ago

0.2.6

3 years ago

0.2.3

3 years ago

0.2.5

3 years ago

0.2.4

3 years ago

0.2.1

3 years ago

0.1.2

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.9

3 years ago

0.1.4

3 years ago

0.2.2

3 years ago

0.1.3

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.0

3 years ago