Merge pull request #21369 from 9renpoto/master

Added react-calendar-heatmap
This commit is contained in:
Daniel Rosenwasser
2017-11-10 13:32:47 -08:00
committed by GitHub
4 changed files with 74 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
// Type definitions for react-calendar-heatmap 1.6
// Project: https://github.com/patientslikeme/react-calendar-heatmap
// Definitions by: Keisuke Kan <https://github.com/9renpoto>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
import * as React from 'react';
export interface Props {
classForValue?: (value: any) => any;
endDate?: string | number | Date;
gutterSize?: number;
horizontal?: boolean;
monthLabels?: string[];
numDays?: number;
onClick?: (value: any) => void;
onMouseLeave?: (e: any, value: any) => void;
onMouseOver?: (e: any, value: any) => void;
showMonthLabels?: boolean;
showOutOfRangeDays?: boolean;
showWeekdayLabels?: boolean;
startDate?: string | number | Date;
titleForValue?: (value: any) => any;
tooltipDataAttrs?: object;
transformDayElement?: (rect: any, value: any, index: number) => any;
values: any[];
weekdayLabels?: string[];
}
export default class ReactCalendarHeatmap extends React.Component<Props> {}
@@ -0,0 +1,16 @@
import * as React from 'react';
import CalendarHeatmap from 'react-calendar-heatmap';
export default function() {
return (
<CalendarHeatmap
endDate={new Date('2016-04-01')}
numDays={100}
values={[
{date: '2016-01-01'},
{date: '2016-01-22'},
{date: '2016-01-30'}
]}
/>
);
}
@@ -0,0 +1,25 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true,
"jsx": "react"
},
"files": [
"index.d.ts",
"react-calendar-heatmap-tests.tsx"
]
}
+3
View File
@@ -0,0 +1,3 @@
{
"extends": "dtslint/dt.json"
}