mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2026-08-11 19:50:17 +00:00
add stories for expand row
This commit is contained in:
@@ -68,3 +68,17 @@ export const stockGenerator = (quantity = 5) =>
|
||||
}));
|
||||
|
||||
export const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));
|
||||
|
||||
export const productsExpandRowsGenerator = (quantity = 5, callback) => {
|
||||
if (callback) return Array.from({ length: quantity }, callback);
|
||||
|
||||
// if no given callback, retrun default product format.
|
||||
return (
|
||||
Array.from({ length: quantity }, (value, index) => ({
|
||||
id: index,
|
||||
name: `Item name ${index}`,
|
||||
price: 2100 + index,
|
||||
expand: productsQualityGenerator(index)
|
||||
}))
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user