add example for rich cell editor

This commit is contained in:
AllenFang
2018-05-05 18:18:52 +08:00
parent 607202b4e9
commit 03f51c36ac
7 changed files with 476 additions and 3 deletions
+26 -2
View File
@@ -1,3 +1,5 @@
/* eslint no-mixed-operators: 0 */
/**
* products generator for stories
*
@@ -27,12 +29,34 @@ export const productsQualityGenerator = (quantity = 5) =>
quality: index % 3
}));
const jobType = ['A', 'B', 'C', 'D', 'E'];
const jobOwner = ['Allen', 'Bob', 'Cindy'];
export const jobsGenerator = (quantity = 5) =>
Array.from({ length: quantity }, (value, index) => ({
id: index,
name: `Job name ${index}`,
owner: Math.floor(Math.random() * 3),
type: Math.floor(Math.random() * 5)
owner: jobOwner[Math.floor((Math.random() * 2) + 1)],
type: jobType[Math.floor((Math.random() * 4) + 1)]
}));
export const todosGenerator = (quantity = 5) =>
Array.from({ length: quantity }, (value, index) => ({
id: index,
todo: `Todo item ${index}`,
done: Math.random() > 0.4 ? 'Y' : 'N'
}));
const startDate = new Date(2017, 0, 1);
const endDate = new Date();
export const stockGenerator = (quantity = 5) =>
Array.from({ length: quantity }, (value, index) => ({
id: index,
name: `Todo item ${index}`,
inStockDate:
new Date(startDate.getTime() + Math.random() * (endDate.getTime() - startDate.getTime()))
}));
export const sleep = ms => new Promise(resolve => setTimeout(resolve, ms));