[react-flatpickr]: Allow extra properties in DateTimePickerProps (#34979)

* Allow extra properties in DateTimePickerProps

* Tests for extra properties in DateTimePickerProps

* Add myself to authors

* Update index.d.ts

* Partially extend HTMLInputElement

* Update index.d.ts

* Update index.d.ts
This commit is contained in:
Rigoberto Molina
2019-04-26 13:00:34 -07:00
committed by Pranav Senthilnathan
parent 8a86268b66
commit caaf192478
2 changed files with 6 additions and 1 deletions
+4 -1
View File
@@ -2,13 +2,16 @@
// Project: https://github.com/coderhaoxin/react-flatpickr
// Definitions by: begincalendar <https://github.com/begincalendar>
// snaveevans <https://github.com/snaveevans>
// rigothedev <https://github.com/rigothedev>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
import { Component } from "react";
import flatpickr from "flatpickr";
export interface DateTimePickerProps {
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export interface DateTimePickerProps extends Omit<Partial<HTMLInputElement>, 'value'> {
defaultValue?: string;
options?: flatpickr.Options.Options;
onChange?: flatpickr.Options.Hook;
@@ -42,3 +42,5 @@ const valueDateArrayElement = (
const valueNumberArrayElement = (
<DatePicker value={[1543516477474, 1544549477474]} />
);
const extraInputPropertiesElement = <DatePicker placeholder="Enter a date..." id="datepicker-1" />;