mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-03-31 02:34:28 +00:00
fix: remove optional chaining, change TS version
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// Project: https://github.com/react-bootstrap-table/react-bootstrap-table2#readme
|
||||
// Definitions by: Wlad Meixner <https://github.com/gosticks>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.7
|
||||
// TypeScript Version: 3.0
|
||||
|
||||
// documentation taken from https://react-bootstrap-table.github.io/react-bootstrap-table2/docs/table-props.html
|
||||
|
||||
|
||||
@@ -211,7 +211,10 @@ const selectColumns = [
|
||||
{
|
||||
dataField: 'quality',
|
||||
text: 'Product Quailty',
|
||||
formatter: (cell: number) => selectOptionsList.find(val => val.value === cell)?.value ?? '',
|
||||
formatter: (cell: number) => {
|
||||
const found = selectOptionsList.find(val => val.value === cell);
|
||||
return found ? found.value : '';
|
||||
},
|
||||
filter: selectFilter({
|
||||
options: selectOptionsList,
|
||||
className: 'test-classname',
|
||||
@@ -226,24 +229,6 @@ const selectColumns = [
|
||||
onFilter: filterValue => {},
|
||||
}),
|
||||
},
|
||||
{
|
||||
dataField: 'quality',
|
||||
text: 'Product Quailty',
|
||||
formatter: (cell: number) => selectOptionsList.find(val => val.value === cell)?.value ?? '',
|
||||
filter: selectFilter({
|
||||
options: selectOptionsCreator,
|
||||
className: 'test-classname',
|
||||
withoutEmptyOption: true,
|
||||
defaultValue: 2,
|
||||
comparator: Comparator.LIKE, // default is Comparator.EQ
|
||||
style: { backgroundColor: 'pink' },
|
||||
getFilter: filter => {
|
||||
// qualityFilter was assigned once the component has been mounted.
|
||||
qualityFilter = filter;
|
||||
},
|
||||
onFilter: filterValue => {},
|
||||
}),
|
||||
},
|
||||
];
|
||||
render(
|
||||
<BootstrapTable keyField="id" data={products} columns={selectColumns} filter={filterFactory()} />,
|
||||
|
||||
Reference in New Issue
Block a user