0.1.0 • Published 5 years ago

foreign-record-selector v0.1.0

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

ForeignRecordSelector

npm package

Used for selecting a foreign record.

Getting started

npm install @cmds/foreign-record-selector --save

Prop Types

PropertyTypeRequired?Description
idStringUnique id for the instance of this foreign record selector
queryStringSearch query to display inside the input
loadingBooleanDisplays loading indicator instead of the results
noResultsBooleanDisplays 'No matching records.' instead of the results
recordsArrayAn array of record ids
createRecordNameArrayThe name of the record created when the create new record button is click
onQueryChangeFunctionTriggers when the user updates the search query input: ({query: string})
onCreateRecordClickFunctionTriggers when the user clicks on the create new record button: ({e: ClickEvent})
onCloseClickFunctionTriggers when the user clicks on the close button: ({e: ClickEvent})
onSelectFunctionTriggers when the user clicks on one of the records displayed in the results: ({id: string, e: ClickEvent})
recordRendererFunctionResponsible for rendering a record given the id to be displayed in the results: ({id: string, onClick: Function})

More information

This component is designed and developed as part of Cosmos Design System.

0.1.0

5 years ago