0.0.10 • Published 6 years ago

mui-selectfield-search v0.0.10

Weekly downloads
18
License
MIT
Repository
-
Last release
6 years ago

material-ui-selectfield

Travis npm package

:no_entry: DEPRECATED

THIS PROJECT IS DEPRECATED! PLEASE HEAD OVER TO https://github.com/Sharlaan/material-ui-superselectfield FOR UPDATES!

This repository was originally a fork of: https://github.com/Sharlaan/material-ui-superselectfield

Check it out and don't forget to star it ;)

Demo

https://maximilianpichler.github.io/material-ui-selectfield/

Installation

npm i -S material-ui-selectfield

Dependencies

  • react
  • material-ui
  • react-infinite

Properties

NameTypeDefaultDescription
namestringRequired to differentiate between multiple instances of superSelectField in same page.
floatingLabelstring or nodeThe content to use for the floating label element.
hintTextstringPlaceholder text for the main selections display.
hintTextAutocompletestring'Search'Placeholder text for the autocomplete.
errorTextstringInclude this property to show an error text.
noMatchFoundstring'No match found'Placeholder text when the autocomplete filter fails.
anchorOriginobject{ vertical: 'top', horizontal: 'left' }Anchor position of the menu, accepted values: top, bottom / left, right
checkPositionstring''Position of the checkboxes in multiple mode. Accepted values: '', left, right. If the default value is selected, the checkboxes are not shown
canAutoPositionbooltrueIf present, this property allows the inner Popover component to position the menu in such way options are not hidden by the screen edges.
multipleboolfalseInclude this property to turn superSelectField into a multi-selection dropdown. Checkboxes will appear.
openboolfalseInclude this property to make the dropdown stay always open.
disabledboolfalseInclude this property to disable superSelectField.
valuenull, object, object[]nullSelected value(s)./!\ REQUIRED: each object must expose a 'value' property.
onMenuOpenfunction() => {}Triggers when the dropdown menu is opened
onChangefunction() => {}Triggers when selecting/unselecting an option from the Menu.signature: (selectedValues, name) with selectedValues array of selected values based on selected nodes' value property, and name the value of the superSelectField instance's name property
onAutoCompleteTypingfunction() => {}Exposes the word typed in AutoComplete. Useful for triggering onType API requests.
childrenany[]Datasource is an array of any type of nodes, styled at your convenience./!\ REQUIRED: each node must expose a value property. This value property will be used by default for both option's value and label.A label property can be provided to specify a different value than value.
nb2shownumber5Number of options displayed from the menu.
elementHeightnumber, number[]36Height in pixels of each option element. If elements have different heights, you can provide them in an array.
showAutocompleteThresholdnumber10Maximum number of options from which to display the autocomplete search field. For example, if autoComplete textfield need to be disabled, just set this prop with a value higher than children length.
autocompleteFilterfunctionsee belowProvide your own filtering parser. Default: case insensitive.The search field will appear only if there are more than 10 children (see showAutocompleteThreshold).By default, the parser will check for label props, 'value' otherwise.
useLayerForClickAwayboolfalseIf true, the popover dropdown will render on top of an invisible layer, which will prevent clicks to the underlying elements, and trigger an onRequestClose('clickAway') call.

Styling properties

NameTypeDefaultDescription
styleobject{}Insert your own inlined styles, applied to the root component.
menuStyleobject{}Styles applied to the comtainer which will receive your children components.
menuGroupStyleobject{}Styles applied to the MenuItems hosting your \.
innerDivStyleobject{}Styles applied to the inner div of MenuItems hosting each of your children components.
menuFooterStyleobject{}Styles applied to the Menu's footer.
menuCloseButtonnodeA button for an explicit closing of the menu. Useful on mobiles.
selectedMenuItemStyleobject{color: muiTheme.menuItem.selectedTextColor}Styles to be applied to the selected MenuItem.
selectionsRendererfunctionsee belowProvide your own renderer for selected options. Defaults to concatenating children's values text. Check CodeExample4 for a more advanced renderer example.
checkedIconSVGiconsee belowThe SvgIcon to use for the checked state. This is useful to create icon toggles.
unCheckedIconSVGiconsee belowThe SvgIcon to use for the unchecked state. This is useful to create icon toggles.
hoverColorstring'rgba(69, 90, 100, 0.1)'Overrides the hover background color.
floatingLabelStyleobjectAllows to change the styles of the floating label.
floatingLabelFocusStyleobjectAllows to change the styles of the floating label when focused.
underlineStyleobjectAllows to change the styles of the underline.
underlineFocusStyleobjectAllows to change the styles of the underline when focused.
autocompleteUnderlineStyleobjectAllows to change the styles of the searchTextField's underline.
autocompleteUnderlineFocusStyleobjectAllows to change the styles of the searchTextField's underline when focused.

Default functions

NameDefault function
checkedIcon<CheckedIcon style={{ top: 'calc(50% - 12px)' }} />
unCheckedIcon<UnCheckedIcon style={{ top: 'calc(50% - 12px)' }} />
autocompleteFilter(searchText, text) => !text || text.toLowerCase().includes(searchText.toLowerCase())
selectionsRenderer
0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago