@maruware/dx-react-grid-formatters
v0.1.0
Published
Formatters for [@devexpress/dx-react-grid](https://www.npmjs.com/package/@devexpress/dx-react-grid)
Downloads
5
Readme
dx-react-grid-formatters
Formatters for @devexpress/dx-react-grid
Install
npm i -S @maruware/dx-react-grid-formatters
yarn add @maruware/dx-react-grid-formatters
Example
cd example
yarn install
yarn start
Open http://localhost:3000
Usage
BooleanFormatter
<DataTypeProvider
for={['isReady']}
formatterComponent={BooleanFormatter}
/>
UrlFormatter
<DataTypeProvider
for={['url']}
formatterComponent={UrlFormatter}
/>
MapChipFormatter
const StatusFormatter = GetMapChipFormatter({
normal: {
label: 'Normal',
color: blueGrey[500]
},
warning: {
label: 'Warning',
color: amber[500]
},
error: {
label: 'Error',
color: pink[500]
}
})
// ...
<DataTypeProvider
for={['status']}
formatterComponent={StatusFormatter}
/>
TimeFormatter
<DataTypeProvider
for={['createdAt']}
formatterComponent={TimeFormatter}
/>
RelativeTimeFormatter
<DataTypeProvider
for={['updatedAt']}
formatterComponent={RelativeTimeFormatter}
/>