diff --git a/.eslintrc b/.eslintrc index 514a8137e..e48fa5d9d 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,7 +7,8 @@ "react/no-find-dom-node": 0, "no-param-reassign": 0, "import/no-named-as-default": 0, - "import/no-extraneous-dependencies": 0 + "import/no-extraneous-dependencies": 0, + "class-methods-use-this": 0 }, "globals": { "document": true diff --git a/README.md b/README.md index 3d5173be2..ff4e7194e 100644 --- a/README.md +++ b/README.md @@ -10,22 +10,35 @@ Changelog available [here](https://github.com/dmtrKovalenko/material-ui-pickers/releases) ### Installation -Available as npm package. Please note that we are using moment as a peer dependency +Available as npm package. ```sh -npm install moment material-ui-pickers -S +npm install material-ui-pickers -S ``` +Now choose the library that pickers will use to work with date. We are providing interfaces for [moment](https://momentjs.com/) and [date-fns](https://date-fns.org/). If you are not using moment in the project (or dont have it in the bundle already) we suggest using date-fns, because it much more lightweight and will be correctly tree-shaked from the bundle. -We are using material-ui-icons font to display icons. Just add this to your html +Teach pickers how to use one of that library using `MuiPickersUtilsProvider`. This component takes an utils property, and makes it available down the React tree thanks to React context. It should preferably be used at the root of your component tree. + +```jsx +import { MuiPickersUtilsProvider } from 'material-ui-pickers'; +import MomentUtils from 'material-ui-pickers/utils/moment-utils'; +import DateFnsUtils from 'material-ui-picker/utils/date-fns-utils' + +function App() { + return ( + + + + ); +} + +render(, document.querySelector('#app')); +``` + +We are using material-ui-icons icon font to display icons. Just add this to your html ```html ``` - -If you dont want to use icon font, or you are already use `material-ui-icons` you can pass any icon to the components with the following props -* leftArrowIcon - arrow left for datepicker -* rightArrowIcon - arrow right for datepicker -* dateRangeIcon - date tab icon for datetimepicker -* timeIcon - time tab icon for datetimepicker -* keyboardIcon - icon for keyboard end adornmentic +If you dont want to use icon font, or you are already use `material-ui-icons` you can pass any icon to the components with [corresponding props](https://github.com/dmtrKovalenko/material-ui-pickers#props-documentation) ### Usage Here is a quick example of how to use this package @@ -83,12 +96,12 @@ Here is a list of available props **Note:** Any prop not recognized by the pickers and their sub-components are passed down to material-ui [TextField](https://material-ui-next.com/api/text-field/#props) component. #### Datepicker -* date - string, number, Date object, Moment object ([anything](https://momentjs.com/docs/#/parsing/), that can be parsed by moment) +* date - string, number, Date object or Moment object (if you are using moment utils) Prop | Type | Default | Definition ------------ | ------------- | ------------- | ------------- value | date | new Date() | Datepicker value -format | string | 'MMMM Do' | Moment format string for input +format | string | 'MMMM Do' | Format string for input autoOk | boolean | false | Auto accept date on selection disablePast | boolean | false | Disable past dates disableFuture | boolean | false | Disable future dates @@ -97,7 +110,6 @@ openToYearSelection | boolean | false | Open datepicker from year selection minDate | date | '1900-01-01' | Minimum selectable date maxDate | date | '2100-01-01' | Maximum selectable date onChange | func | required | Callback firing when date accepted -returnMoment | boolean | true | Will return moment object in onChange invalidLabel | string | 'Unknown' | Displayed string if date cant be parsed emptyLabel | string | '' | Displayed string if date is `null` (e.g. after clear) okLabel | string | 'OK' | The label for the ok button @@ -112,9 +124,12 @@ keyboard | boolean | false | Allow to manual input date to the text field keyboardIcon | react node | `event` | Keyboard adornment icon maxDateMessage | string | 'Date should not be after maximal date' | Maximum date error message for keyboard input minDateMessage | string | 'Date should not be before minimal date' | Minimum date error message for keyboard input -mask | text mask (read more [here](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme)) | undefined | Text mask +mask | text mask (read more [here](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme)) | undefined | Text mask for keyboard-mode clearable | boolean | false | If `true`, clear button will be displayed TextFieldComponent | func, string | undefined | Component that should replace the default Material-UI TextField +InputAdornmentProps | object | {} | Props to pass to keyboard input adornment +inputAdornmentPosition | enum 'start', 'end' | 'end' | Specifies position of keyboard adornment + #### Timepicker Prop | Type | Default | Definition @@ -123,7 +138,6 @@ value | date | new Date() | Timepicker value format | string | 'MMMM Do' | Moment format string for input autoOk | boolean | false | Auto accept time on selection onChange | func | required | Callback firing when date accepted -returnMoment | boolean | true | Will return moment object in onChange invalidLabel | string | 'Unknown' | Displayed string if date cant be parsed emptyLabel | string | '' | Displayed string if date is `null` (e.g. after clear) okLabel | string | 'OK' | The label for the ok button @@ -133,9 +147,11 @@ labelFunc | func | null | Allow to specify dynamic label for text field `labelFu ampm | boolean | true | 12h/24h view for hour selection clock keyboard | boolean | false | Allow to manual input date to the text field keyboardIcon | react node | `event` | Keyboard adornment icon -mask | text mask (read more [here](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme)) | undefined | Text mask +mask | text mask (read more [here](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme)) | undefined | Text mask for keyboard-mode clearable | boolean | false | If `true`, clear button will be displayed TextFieldComponent | func, string | undefined | Component that should replace the default Material-UI TextField +InputAdornmentProps | object | {} | Props to pass to keyboard input adornment +inputAdornmentPosition | enum 'start', 'end' | 'end' | Specifies position of keyboard adornment #### DateTimepicker Prop | Type | Default | Definition @@ -152,7 +168,6 @@ animateYearScrolling | boolean | false | Will animate year selection minDate | date | '1900-01-01' | Minimum selectable date maxDate | date | '2100-01-01' | Maximum selectable date onChange | func | required | Callback firing when date accepted -returnMoment | boolean | true | Will return moment object in onChangeg invalidLabel | string | 'Unknown' | Displayed string if date cant be parsed emptyLabel | string | '' | Displayed string if date is `null` (e.g. after clear) okLabel | string | 'OK' | The label for the ok button @@ -165,25 +180,20 @@ rightArrowIcon | react node | `keyboard_arrow_right`| Right arrow i dateRangeIcon | react node | `date_range`| Date tab icon timeIcon | react node | `access_time`| Time tab icon ampm | boolean | true | 12h/24h view for hour selection clock -shouldDisableDate | (date: Moment) => boolean | () => false | Allow to disable custom date in calendar +shouldDisableDate | (date: Moment | Date) => boolean | () => false | Allow to disable custom date in calendar keyboard | boolean | false | Allow to manual input date to the text field keyboardIcon | react node | `event` | Keyboard adornment icon maxDateMessage | string | 'Date should not be after maximal date' | Maximum date error message for keyboard input minDateMessage | string | 'Date should not be before minimal date' | Minimum date error message for keyboard input invalidDateMessage | string | 'Invalid Date Format' | Message, appearing when date cannot be parsed -mask | text mask (read more [here](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme)) | undefined | Text mask +mask | text mask (read more [here](https://github.com/text-mask/text-mask/blob/master/componentDocumentation.md#readme)) | undefined | Text mask for keyboard-mode clearable | boolean | false | If `true`, clear button will be displayed TextFieldComponent | func, string | undefined | Component that should replace the default Material-UI TextField +InputAdornmentProps | object | {} | Props to pass to keyboard input adornment +inputAdornmentPosition | enum 'start', 'end' | 'end' | Specifies position of keyboard adornment -### l10n -For l10n texts we're currently relying on moment which is stateful. To change the locale you have to import your langauge specific files an change the locale manually via `moment.locale(language)`. -``` -import moment from 'moment' -import 'moment/locale/fr'; - -moment.locale('fr') -``` + ### Contributing For information about how to contribute, see the [CONTRIBUTING](https://github.com/dmtrKovalenko/material-ui-pickers/blob/master/CONTRIBUTING.md) file. diff --git a/docs/package-lock.json b/docs/package-lock.json index 667e6e77f..9d378cfd6 100644 --- a/docs/package-lock.json +++ b/docs/package-lock.json @@ -2371,6 +2371,11 @@ "assert-plus": "1.0.0" } }, + "date-fns": { + "version": "2.0.0-alpha.7", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.0.0-alpha.7.tgz", + "integrity": "sha1-JFrRb5V2Tqur+ywKQf1dAzwg5Xo=" + }, "date-now": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", diff --git a/docs/package.json b/docs/package.json index 35de38385..004f193e0 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,6 +4,7 @@ "private": true, "dependencies": { "classnames": "^2.2.5", + "date-fns": "^2.0.0-alpha.7", "eslint-config-react-app": "^2.1.0", "jss": "^9.8.0", "jss-preset-default": "^4.3.0", diff --git a/docs/src/App.js b/docs/src/App.js index 76c307c4b..8ba7dc03d 100644 --- a/docs/src/App.js +++ b/docs/src/App.js @@ -1,8 +1,7 @@ import React, { Component } from 'react'; +import PropTypes from 'prop-types'; import { MuiThemeProvider, createMuiTheme } from 'material-ui'; - -import Demo from './Demo/Demo'; -import { setPrismTheme } from './utils/prism'; +import { MuiPickersUtilsProvider, dateFnsUtils, momentUtils } from 'material-ui-pickers'; import { create } from 'jss'; import preset from 'jss-preset-default'; @@ -10,10 +9,17 @@ import rtl from 'jss-rtl'; import JssProvider from 'react-jss/lib/JssProvider'; import createGenerateClassName from 'material-ui/styles/createGenerateClassName'; +import Demo from './Demo/Demo'; +import { setPrismTheme } from './utils/prism'; + const jss = create({ plugins: [...preset().plugins, rtl()] }); jss.options.createGenerateClassName = createGenerateClassName; export default class App extends Component { + static propTypes = { + toggleFrench: PropTypes.func.isRequired, + } + state = { type: 'light', direction: 'ltr', @@ -50,11 +56,13 @@ export default class App extends Component {
- + + +
diff --git a/docs/src/Demo/Demo.jsx b/docs/src/Demo/Demo.jsx index 30099f277..5c30e5d4c 100644 --- a/docs/src/Demo/Demo.jsx +++ b/docs/src/Demo/Demo.jsx @@ -7,7 +7,7 @@ import SourcablePanel from './components/SourcablePanel'; import BasicUsage from './Examples/BasicUsage'; import CustomElements from './Examples/CustomElements'; import DateTimePickers from './Examples/DateTimePickers'; -import PersianPickers from './Examples/PersianPickers'; +// import PersianPickers from './Examples/PersianPickers'; import './Demo.css'; class Demo extends Component { @@ -111,7 +111,7 @@ class Demo extends Component { - @@ -123,7 +123,7 @@ class Demo extends Component { sourceFile="PersianPickers.jsx" > - + */} ); diff --git a/docs/src/Demo/Examples/BasicUsage.jsx b/docs/src/Demo/Examples/BasicUsage.jsx index 382382aa0..5da9afe94 100644 --- a/docs/src/Demo/Examples/BasicUsage.jsx +++ b/docs/src/Demo/Examples/BasicUsage.jsx @@ -1,11 +1,10 @@ import React, { Fragment, Component } from 'react'; -import moment from 'moment'; import { Typography } from 'material-ui'; import { TimePicker, DatePicker } from 'material-ui-pickers'; export default class BasicUsage extends Component { state = { - selectedDate: moment(), + selectedDate: new Date(), } handleDateChange = (date) => { diff --git a/docs/src/Demo/Examples/CustomElements.jsx b/docs/src/Demo/Examples/CustomElements.jsx index cdc4e01a6..b9ffa82d5 100644 --- a/docs/src/Demo/Examples/CustomElements.jsx +++ b/docs/src/Demo/Examples/CustomElements.jsx @@ -3,6 +3,14 @@ import PropTypes from 'prop-types'; import { IconButton, Typography, withStyles } from 'material-ui'; import classNames from 'classnames'; import { DateTimePicker, DatePicker } from 'material-ui-pickers'; +import moment from 'moment'; + +import isValid from 'date-fns/isValid'; +import format from 'date-fns/format'; +import isSameDay from 'date-fns/isSameDay'; +import startOfWeek from 'date-fns/startOfWeek'; +import endOfWeek from 'date-fns/endOfWeek'; +import isWithinInterval from 'date-fns/isWithinInterval'; class CustomElements extends Component { static propTypes = { @@ -26,17 +34,20 @@ class CustomElements extends Component { return ''; } - return date && date.isValid() ? - `Week of ${date.clone().startOf('week').format('MMM Do')}` - : - invalidLabel; + if (date instanceof moment) { + date = date.toDate(); + } + + return date && isValid(date) + ? `Week of ${format(startOfWeek(date), 'MMM Do')}` + : invalidLabel; } renderCustomDayForDateTime = (date, selectedDate, dayInCurrentMonth, dayComponent) => { const { classes } = this.props; const dayClassName = classNames({ - [classes.customDayHighlight]: date.isSame(selectedDate, 'day'), + [classes.customDayHighlight]: isSameDay(date, selectedDate), }); return ( @@ -50,22 +61,21 @@ class CustomElements extends Component { renderWrappedDefaultDay = (date, selectedDate, dayInCurrentMonth) => { const { classes } = this.props; - const startDate = selectedDate.clone().day(0).startOf('day'); - const endDate = selectedDate.clone().day(6).endOf('day'); + if (date instanceof moment) { + date = date.toDate(); + } - const dayIsBetween = ( - date.isSame(startDate) || - date.isSame(endDate) || - (date.isAfter(startDate) && date.isBefore(endDate)) - ); + const start = startOfWeek(selectedDate); + const end = endOfWeek(selectedDate); - const firstDay = date.isSame(startDate, 'day'); - const lastDay = date.isSame(endDate, 'day'); + const dayIsBetween = isWithinInterval(date, { start, end }); + const isFirstDay = isSameDay(date, start); + const isLastDay = isSameDay(date, end); const wrapperClassName = classNames({ [classes.highlight]: dayIsBetween, - [classes.firstHighlight]: firstDay, - [classes.endHighlight]: lastDay, + [classes.firstHighlight]: isFirstDay, + [classes.endHighlight]: isLastDay, }); const dayClassName = classNames(classes.day, { @@ -76,7 +86,7 @@ class CustomElements extends Component { return (
- { date.format('D')} + { format(date, 'D')}
); @@ -134,7 +144,7 @@ const styles = theme => ({ bottom: 0, left: '2px', right: '2px', - border: `2px solid ${theme.palette.primary[100]}`, + border: `1px solid ${theme.palette.secondary.main}`, borderRadius: '50%', }, nonCurrentMonthDay: { diff --git a/docs/src/Demo/Examples/DateTimePickers.jsx b/docs/src/Demo/Examples/DateTimePickers.jsx index 5ad9db726..03b6b6e0b 100644 --- a/docs/src/Demo/Examples/DateTimePickers.jsx +++ b/docs/src/Demo/Examples/DateTimePickers.jsx @@ -1,7 +1,6 @@ import React, { Fragment, Component } from 'react'; import { DateTimePicker } from 'material-ui-pickers'; import { IconButton, Typography, Icon, InputAdornment } from 'material-ui'; -import moment from 'moment'; export default class BasicUsage extends Component { state = { diff --git a/lib/.babelrc b/lib/.babelrc index c798781b8..4105f4388 100644 --- a/lib/.babelrc +++ b/lib/.babelrc @@ -13,7 +13,7 @@ "plugins": [ "transform-object-rest-spread", "transform-react-jsx", - "transform-class-properties", + "transform-class-properties" ] }, "production": { @@ -21,7 +21,7 @@ "plugins": [ "transform-object-rest-spread", "transform-react-jsx", - "transform-class-properties", + "transform-class-properties" ] } } diff --git a/lib/__tests__/DatePicker/Calendar.test.js b/lib/__tests__/DatePicker/Calendar.test.js index afe954f4d..72163e7dd 100644 --- a/lib/__tests__/DatePicker/Calendar.test.js +++ b/lib/__tests__/DatePicker/Calendar.test.js @@ -1,6 +1,6 @@ import React from 'react'; import moment from 'moment'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { Calendar } from '../../src/DatePicker/Calendar'; describe('Calendar', () => { @@ -11,7 +11,7 @@ describe('Calendar', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/DatePicker/CalendarHeader.test.js b/lib/__tests__/DatePicker/CalendarHeader.test.js index e0b788929..fcda52ce9 100644 --- a/lib/__tests__/DatePicker/CalendarHeader.test.js +++ b/lib/__tests__/DatePicker/CalendarHeader.test.js @@ -1,6 +1,6 @@ import React from 'react'; import moment from 'moment'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { CalendarHeader } from '../../src/DatePicker/CalendarHeader'; describe('CalendarHeader', () => { @@ -11,7 +11,7 @@ describe('CalendarHeader', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/DatePicker/DatePicker.test.js b/lib/__tests__/DatePicker/DatePicker.test.js index 35f89d48e..3946ecb44 100644 --- a/lib/__tests__/DatePicker/DatePicker.test.js +++ b/lib/__tests__/DatePicker/DatePicker.test.js @@ -1,6 +1,6 @@ import React from 'react'; import moment from 'moment'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { DatePicker } from '../../src/DatePicker/DatePicker'; describe('DatePicker', () => { @@ -11,7 +11,7 @@ describe('DatePicker', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/DatePicker/DatePickerWrapper.test.js b/lib/__tests__/DatePicker/DatePickerWrapper.test.js index 0531d1869..2ae2b1a6b 100644 --- a/lib/__tests__/DatePicker/DatePickerWrapper.test.js +++ b/lib/__tests__/DatePicker/DatePickerWrapper.test.js @@ -1,7 +1,7 @@ import React from 'react'; -import { mount } from 'enzyme'; import moment from 'moment'; -import DatePickerWrapper from '../../src/DatePicker/DatePickerWrapper'; +import { shallow } from '../test-utils'; +import { DatePickerWrapper } from '../../src/DatePicker'; const spy = jest.fn(); @@ -16,30 +16,32 @@ describe('DatePickerWrapper', () => { let component; beforeEach(() => { - component = mount(); + component = shallow(); }); it('Should renders', () => { - // console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); - it('Should support keyboard input', () => { - const input = component.find('input'); - input.simulate('change', { target: { value: '2019' } }); + // 20.02.2018 -> TODO Move keyboard input tests to the text field - expect(spy).toHaveBeenCalled(); - expect(component.state().date.format()).toEqual(moment('2019', 'YYYY').format()); - }); + // it('Should support keyboard input', () => { + // const input = component.find('input'); + // input.simulate('change', { target: { value: '2019' } }); - it('Should not pass disabled dates', () => { - component.setProps({ - disableFuture: true, - }); - const input = component.find('input'); - input.simulate('change', { target: { value: '4000' } }); + // expect(spy).toHaveBeenCalled(); + // expect(component.state().date.format()).toEqual(moment('2019', 'YYYY').format()); + // }); - expect(spy).toHaveBeenCalled(); - expect(component.state().date.format()).toEqual(moment(new Date().getFullYear(), 'YYYY').format()); - }); + // it('Should not pass disabled dates', () => { + // component.setProps({ + // disableFuture: true, + // }); + // const input = component.find('input'); + // input.simulate('change', { target: { value: '4000' } }); + + // expect(spy).toHaveBeenCalled(); + // expect(component.state().date.format()).toEqual(moment(new Date().getFullYear(), 'YYYY').format()); + // }); }); diff --git a/lib/__tests__/DatePicker/DatePickerWrapper.usage.tsx b/lib/__tests__/DatePicker/DatePickerWrapper.usage.tsx index 4c36b0c37..a9dd6fcd6 100644 --- a/lib/__tests__/DatePicker/DatePickerWrapper.usage.tsx +++ b/lib/__tests__/DatePicker/DatePickerWrapper.usage.tsx @@ -1,11 +1,13 @@ import * as React from 'react' import * as PropTypes from 'prop-types'; import { Fragment, Component } from 'react'; -import DatePickerWrapper from '../../src/DatePicker/DatePickerWrapper'; +import DatePickerWrapper from '../../src/DatePicker'; import { IconButton } from 'material-ui' import * as classNames from 'classnames'; import { Moment } from 'moment' import { DayComponent } from '../../src/DatePicker/Calendar' +import { utilsToUse } from '../test-utils'; +import MuiUtilsProvider from '../../src/utils/MuiPickersUtilsProvider' // initially from the docs site export default class BasicUsage extends Component<{}, {selectedDate: Date}> { @@ -21,7 +23,7 @@ export default class BasicUsage extends Component<{}, {selectedDate: Date}> { const { selectedDate } = this.state; return ( - + { onChange={this.handleChange} animateYearScrolling={false} /> - + ); } } @@ -102,7 +104,6 @@ class CustomElements extends Component<{classes: any}, {selectedDate: Date}> { onChange={this.handleDateChange} renderDay={this.renderWrappedDefaultDay} labelFunc={this.formatWeekSelectLabel} - returnMoment /> ); diff --git a/lib/__tests__/DatePicker/YearSelection.test.js b/lib/__tests__/DatePicker/YearSelection.test.js index bfd5b9deb..4aebf6995 100644 --- a/lib/__tests__/DatePicker/YearSelection.test.js +++ b/lib/__tests__/DatePicker/YearSelection.test.js @@ -1,6 +1,6 @@ import React from 'react'; -import { shallow } from 'enzyme'; import moment from 'moment'; +import { shallow } from '../test-utils'; import { YearSelection } from '../../src/DatePicker/YearSelection'; describe('YearSelection', () => { @@ -11,7 +11,7 @@ describe('YearSelection', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/DateTimePicker/DateTimePicker.test.js b/lib/__tests__/DateTimePicker/DateTimePicker.test.js index e0bc3e593..ad5c6254c 100644 --- a/lib/__tests__/DateTimePicker/DateTimePicker.test.js +++ b/lib/__tests__/DateTimePicker/DateTimePicker.test.js @@ -1,6 +1,6 @@ import React from 'react'; import moment from 'moment'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { DateTimePicker } from '../../src/DateTimePicker/DateTimePicker'; describe('DateTimePicker', () => { @@ -14,7 +14,7 @@ describe('DateTimePicker', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/DateTimePicker/DateTimePickerHeader.test.js b/lib/__tests__/DateTimePicker/DateTimePickerHeader.test.js index db85631e1..3cba99ed6 100644 --- a/lib/__tests__/DateTimePicker/DateTimePickerHeader.test.js +++ b/lib/__tests__/DateTimePicker/DateTimePickerHeader.test.js @@ -1,6 +1,6 @@ import React from 'react'; import moment from 'moment'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { DateTimePickerHeader } from '../../src/DateTimePicker/DateTimePickerHeader'; describe('DateTimePickerHeader', () => { @@ -16,7 +16,7 @@ describe('DateTimePickerHeader', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/DateTimePicker/DateTimePickerTabs.test.js b/lib/__tests__/DateTimePicker/DateTimePickerTabs.test.js index 23c5c29d6..2930c4dce 100644 --- a/lib/__tests__/DateTimePicker/DateTimePickerTabs.test.js +++ b/lib/__tests__/DateTimePicker/DateTimePickerTabs.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { DateTimePickerTabs } from '../../src/DateTimePicker/DateTimePickerTabs'; describe('DateTimePickerTabs', () => { @@ -13,7 +13,7 @@ describe('DateTimePickerTabs', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/DateTimePicker/DateTimePickerView.test.js b/lib/__tests__/DateTimePicker/DateTimePickerView.test.js index 10fa9b985..a5a4b1f5d 100644 --- a/lib/__tests__/DateTimePicker/DateTimePickerView.test.js +++ b/lib/__tests__/DateTimePicker/DateTimePickerView.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { DateTimePickerView } from '../../src/DateTimePicker/DateTimePickerView'; describe('DateTimePickerView', () => { @@ -10,7 +10,7 @@ describe('DateTimePickerView', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/DateTimePicker/DateTimePickerWrapper.test.js b/lib/__tests__/DateTimePicker/DateTimePickerWrapper.test.js index ea9dee89f..03a0498da 100644 --- a/lib/__tests__/DateTimePicker/DateTimePickerWrapper.test.js +++ b/lib/__tests__/DateTimePicker/DateTimePickerWrapper.test.js @@ -1,6 +1,6 @@ import React from 'react'; -import { shallow } from 'enzyme'; -import { DateTimePickerWrapper } from '../../src/DateTimePicker/DateTimePickerWrapper'; +import { shallow } from '../test-utils'; +import { DateTimePickerWrapper } from '../../src/DateTimePicker'; describe('DateTimePickerWrapper', () => { let component; @@ -10,7 +10,7 @@ describe('DateTimePickerWrapper', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/DateTimePicker/DateTimePickerWrapper.usage.tsx b/lib/__tests__/DateTimePicker/DateTimePickerWrapper.usage.tsx index 82b9d66bb..40a489e2b 100644 --- a/lib/__tests__/DateTimePicker/DateTimePickerWrapper.usage.tsx +++ b/lib/__tests__/DateTimePicker/DateTimePickerWrapper.usage.tsx @@ -2,16 +2,14 @@ import * as React from 'react' import { Fragment, Component } from 'react'; import { IconButton, Typography, Icon } from 'material-ui'; import InputAdornment from 'material-ui/Input/InputAdornment'; -import DateTimePickerWrapper from '../../src/DateTimePicker/DateTimePickerWrapper'; +import DateTimePickerWrapper from '../../src/DateTimePicker'; import * as classNames from 'classnames' import { Moment } from 'moment' import * as PropTypes from 'prop-types' -import {DayComponent} from '../../src/DatePicker/Calendar' +import { DayComponent } from '../../src/DatePicker/Calendar' +import { utilsToUse } from '../test-utils'; +import MuiUtilsProvider from '../../src/utils/MuiPickersUtilsProvider' -// FIXME: src vs exported component names a source of confusion -// FIXME https://github.com/dmtrKovalenko/material-ui-pickers/issues/169 - -// initially from the docs site export default class BasicUsage extends Component<{}, {selectedDate: Date}> { state = { selectedDate: new Date(), @@ -25,7 +23,7 @@ export default class BasicUsage extends Component<{}, {selectedDate: Date}> { const { selectedDate } = this.state; return ( - + { ), }} /> - + ); } } @@ -90,15 +88,15 @@ class CustomElements extends Component<{classes: any}, {selectedDate: Date}> { const { selectedDate } = this.state; return ( - + - + ); } } \ No newline at end of file diff --git a/lib/__tests__/TimePicker/Clock.test.js b/lib/__tests__/TimePicker/Clock.test.js index 058a2bcc0..ce756a3fe 100644 --- a/lib/__tests__/TimePicker/Clock.test.js +++ b/lib/__tests__/TimePicker/Clock.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { Clock } from '../../src/TimePicker/Clock'; describe('Clock', () => { @@ -10,7 +10,7 @@ describe('Clock', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/TimePicker/ClockNumber.test.js b/lib/__tests__/TimePicker/ClockNumber.test.js index e694aa84c..6f94bf52e 100644 --- a/lib/__tests__/TimePicker/ClockNumber.test.js +++ b/lib/__tests__/TimePicker/ClockNumber.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { ClockNumber } from '../../src/TimePicker/ClockNumber'; describe('ClockNumber', () => { @@ -10,7 +10,7 @@ describe('ClockNumber', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/TimePicker/ClockPointer.test.js b/lib/__tests__/TimePicker/ClockPointer.test.js index 0e920afec..c4ed96541 100644 --- a/lib/__tests__/TimePicker/ClockPointer.test.js +++ b/lib/__tests__/TimePicker/ClockPointer.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { ClockPointer } from '../../src/TimePicker/ClockPointer'; describe('ClockPointer', () => { @@ -10,7 +10,7 @@ describe('ClockPointer', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/TimePicker/HourView.test.js b/lib/__tests__/TimePicker/HourView.test.js index 8bce4fcad..387c53e50 100644 --- a/lib/__tests__/TimePicker/HourView.test.js +++ b/lib/__tests__/TimePicker/HourView.test.js @@ -1,8 +1,8 @@ import React from 'react'; import moment from 'moment'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; -import HourView from '../../src/TimePicker/HourView'; +import { HourView } from '../../src/TimePicker/HourView'; const date = moment(); describe('HourView', () => { @@ -13,7 +13,7 @@ describe('HourView', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/TimePicker/MinutesView.test.js b/lib/__tests__/TimePicker/MinutesView.test.js index 8b168ae12..d62d60ba6 100644 --- a/lib/__tests__/TimePicker/MinutesView.test.js +++ b/lib/__tests__/TimePicker/MinutesView.test.js @@ -1,10 +1,10 @@ import React from 'react'; import moment from 'moment'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; -import MinutesView from '../../src/TimePicker/MinutesView'; +import { MinutesView } from '../../src/TimePicker/MinutesView'; -const date = moment(); +const date = process.env.UTILS === 'moment' ? moment() : new Date(); describe('MinutesView', () => { let component; @@ -14,7 +14,7 @@ describe('MinutesView', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/TimePicker/TimePicker.test.js b/lib/__tests__/TimePicker/TimePicker.test.js index ee9331d98..1a92ad970 100644 --- a/lib/__tests__/TimePicker/TimePicker.test.js +++ b/lib/__tests__/TimePicker/TimePicker.test.js @@ -1,6 +1,6 @@ import React from 'react'; import moment from 'moment'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import { TimePicker } from '../../src/TimePicker/TimePicker'; describe('TimePicker', () => { @@ -15,7 +15,7 @@ describe('TimePicker', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/TimePicker/TimePickerWrapper.test.js b/lib/__tests__/TimePicker/TimePickerWrapper.test.js index c1058f39d..d096ce216 100644 --- a/lib/__tests__/TimePicker/TimePickerWrapper.test.js +++ b/lib/__tests__/TimePicker/TimePickerWrapper.test.js @@ -1,6 +1,6 @@ import React from 'react'; -import { shallow } from 'enzyme'; -import TimePickerWrapper from '../../src/TimePicker/TimePickerWrapper'; +import { shallow } from '../test-utils'; +import { TimePickerWrapper } from '../../src/TimePicker'; describe('TimePickerWrapper', () => { let component; @@ -10,7 +10,7 @@ describe('TimePickerWrapper', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/TimePicker/TimePickerWrapper.usage.tsx b/lib/__tests__/TimePicker/TimePickerWrapper.usage.tsx index 475c3763d..2c4e9bcc7 100644 --- a/lib/__tests__/TimePicker/TimePickerWrapper.usage.tsx +++ b/lib/__tests__/TimePicker/TimePickerWrapper.usage.tsx @@ -1,7 +1,9 @@ import * as React from 'react' import { Fragment, Component } from 'react'; -import TimePickerWrapper from '../../src/TimePicker/TimePickerWrapper'; +import TimePickerWrapper from '../../src/TimePicker'; import { Moment } from 'moment' +import { utilsToUse } from '../test-utils'; +import MuiUtilsProvider from '../../src/utils/MuiPickersUtilsProvider' // initially from the docs site export default class BasicUsage extends Component<{}, {selectedDate: Date}> { @@ -17,7 +19,7 @@ export default class BasicUsage extends Component<{}, {selectedDate: Date}> { const { selectedDate } = this.state; return ( - + { value={selectedDate} onChange={this.handleChange} /> - + ); } } \ No newline at end of file diff --git a/lib/__tests__/_shared/DateTextField.test.js b/lib/__tests__/_shared/DateTextField.test.js index fc545c50c..1ebc45dc9 100644 --- a/lib/__tests__/_shared/DateTextField.test.js +++ b/lib/__tests__/_shared/DateTextField.test.js @@ -1,27 +1,22 @@ import React from 'react'; -import { createShallow, createMount } from 'material-ui/test-utils'; -import DateTextField from '../../src/_shared/DateTextField'; +import { createMount } from 'material-ui/test-utils'; +import { shallow, utilsToUse } from '../test-utils'; +import { DateTextField } from '../../src/_shared/DateTextField'; describe('DateTextField', () => { let component; beforeEach(() => { - const shallow = createShallow({ dive: true }); - component = shallow(); + component = shallow(); }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); describe('DateTextField with custom TextField', () => { - let shallow; - beforeEach(() => { - shallow = createShallow({ dive: true }); - }); - it('Should handle a component function', () => { function CustomTextField(props) { return ( @@ -29,24 +24,30 @@ describe('DateTextField with custom TextField', () => { ); } - const component = shallow(); + const component = shallow( + + ); // Check InputProps to make sure DateTextField is passing props to the custom component - expect(component.prop('InputProps')).toBeTruthy(); + expect(component.props('InputProps')).toBeTruthy(); expect(component.find('li')).toBeTruthy(); }); it('Should handle a component string', () => { - const component = shallow(); + const component = shallow(); - expect(component.prop('InputProps')).toBeTruthy(); + expect(component.props('InputProps')).toBeTruthy(); expect(component.find('li')).toBeTruthy(); }); it('Should not handle a node', () => { const mount = createMount(); expect(() => { - mount(} />); + mount(} />); }).toThrow(); }); }); diff --git a/lib/__tests__/_shared/ModalDialog.test.js b/lib/__tests__/_shared/ModalDialog.test.js index a5e3e7447..563ca39f4 100644 --- a/lib/__tests__/_shared/ModalDialog.test.js +++ b/lib/__tests__/_shared/ModalDialog.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import ModalDialog from '../../src/_shared/ModalDialog'; describe('ModalDialog', () => { @@ -10,7 +10,7 @@ describe('ModalDialog', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/_shared/PickerToolbar.test.js b/lib/__tests__/_shared/PickerToolbar.test.js index d88505b98..4d6edbb16 100644 --- a/lib/__tests__/_shared/PickerToolbar.test.js +++ b/lib/__tests__/_shared/PickerToolbar.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import PickerToolbar from '../../src/_shared/PickerToolbar'; describe('PickerToolbar', () => { @@ -10,7 +10,7 @@ describe('PickerToolbar', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/_shared/ToolbarButton.test.js b/lib/__tests__/_shared/ToolbarButton.test.js index e50fa0cd8..a85c11f11 100644 --- a/lib/__tests__/_shared/ToolbarButton.test.js +++ b/lib/__tests__/_shared/ToolbarButton.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import ToolbarButton from '../../src/_shared/ToolbarButton'; describe('ToolbarButton', () => { @@ -10,7 +10,7 @@ describe('ToolbarButton', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/__tests__/test-utils.d.ts b/lib/__tests__/test-utils.d.ts new file mode 100644 index 000000000..169b449d6 --- /dev/null +++ b/lib/__tests__/test-utils.d.ts @@ -0,0 +1,3 @@ +import { Utils } from '../typings/utils' + +export const utilsToUse: Utils; \ No newline at end of file diff --git a/lib/__tests__/test-utils.js b/lib/__tests__/test-utils.js new file mode 100644 index 000000000..3c2ffab0b --- /dev/null +++ b/lib/__tests__/test-utils.js @@ -0,0 +1,14 @@ +import React from 'react'; +import * as enzyme from 'enzyme'; +import dateFnsUtils from '../src/utils/date-fns-utils'; +import momentUtils from '../src/utils/moment-utils'; + +export const utilsToUse = process.env.UTILS === 'moment' + ? momentUtils + : dateFnsUtils; + +const getComponentWithUtils = Component => React.cloneElement(Component, { utils: utilsToUse }); + +export const shallow = Component => enzyme.shallow(getComponentWithUtils(Component)); + +export const mount = Component => enzyme.mount(getComponentWithUtils(Component)); diff --git a/lib/__tests__/utils/time-utils.test.js b/lib/__tests__/utils/time-utils.test.js index 881457979..505d9b237 100644 --- a/lib/__tests__/utils/time-utils.test.js +++ b/lib/__tests__/utils/time-utils.test.js @@ -1,5 +1,6 @@ import moment from 'moment'; -import { getHours, getMinutes, convertToMeridiem } from '../../src/utils/time-utils'; +import { utilsToUse } from '../test-utils'; +import { getHours, getMinutes, convertToMeridiem } from '../../src/_helpers/time-utils'; describe('Time utils', () => { it('Should properly calculate hours', () => { @@ -11,8 +12,8 @@ describe('Time utils', () => { }); it('Should convert time to meridiem', () => { - const time = convertToMeridiem(moment('2017-01-01T16:00'), 'am', true); - expect(time.hours()).toBe(4); + const time = convertToMeridiem(moment('2017-01-01T16:00'), 'am', true, utilsToUse); + expect(utilsToUse.getHours(time)).toBe(4); }); }); diff --git a/lib/__tests__/wrappers/ModalWrapper.test.js b/lib/__tests__/wrappers/ModalWrapper.test.js index a94327a06..d6864706c 100644 --- a/lib/__tests__/wrappers/ModalWrapper.test.js +++ b/lib/__tests__/wrappers/ModalWrapper.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { shallow } from 'enzyme'; +import { shallow } from '../test-utils'; import ModalWrapper from '../../src/wrappers/ModalWrapper'; describe('ModalWrapper', () => { @@ -10,7 +10,7 @@ describe('ModalWrapper', () => { }); it('Should renders', () => { - console.log(component.debug()); // TODO REMOVE ME + // console.log(component.debug()); expect(component).toBeTruthy(); }); }); diff --git a/lib/copy.js b/lib/copy.js index 5c01853fb..5a95d076a 100644 --- a/lib/copy.js +++ b/lib/copy.js @@ -27,7 +27,7 @@ function createPackageFile() { const newPackage = { ...packageData, main: './dist/material-ui-pickers.cjs.js', - module: './src/index.js', + module: './index.js', private: false, }; @@ -44,5 +44,5 @@ function createPackageFile() { } createPackageFile() - .then(() => copyTypings(path.resolve(__dirname, 'src'), path.resolve(__dirname, 'build/src'))) + .then(() => copyTypings(path.resolve(__dirname, 'src'), path.resolve(__dirname, 'build'))) .then(() => copyReadme()); diff --git a/lib/package-lock.json b/lib/package-lock.json index f771955b6..a9545831b 100644 --- a/lib/package-lock.json +++ b/lib/package-lock.json @@ -1,16 +1,66 @@ { "name": "material-ui-pickers", - "version": "1.0.0-beta.15.1", + "version": "1.0.0-rc.1", "lockfileVersion": 1, "requires": true, "dependencies": { "@babel/code-frame": { - "version": "7.0.0-beta.31", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.31.tgz", - "integrity": "sha512-yd7CkUughvHQoEahQqcMdrZw6o/6PwUxiRkfZuVDVHCDe77mysD/suoNyk5mK6phTnRW1kyIbPHyCJgxw++LXg==", + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.40.tgz", + "integrity": "sha512-eVXQSbu/RimU6OKcK2/gDJVTFcxXJI4sHbIqw2mhwMZeQ2as/8AhS9DGkEDoHMBBNJZ5B0US63lF56x+KDcxiA==", "dev": true, "requires": { - "chalk": "2.3.0", + "@babel/highlight": "7.0.0-beta.40" + } + }, + "@babel/generator": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.40.tgz", + "integrity": "sha512-c91BQcXyTq/5aFV4afgOionxZS1dxWt8OghEx5Q52SKssdGRFSiMKnk9tGkev1pYULPJBqjSDZU2Pcuc58ffZw==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.40", + "jsesc": "2.5.1", + "lodash": "4.17.4", + "source-map": "0.5.7", + "trim-right": "1.0.1" + }, + "dependencies": { + "jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.40.tgz", + "integrity": "sha512-cK9BVLtOfisSISTTHXKGvBc2OBh65tjEk4PgXhsSnnH0i8RP2v+5RCxoSlh2y/i+l2fxQqKqv++Qo5RMiwmRCA==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0-beta.40", + "@babel/template": "7.0.0-beta.40", + "@babel/types": "7.0.0-beta.40" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.40.tgz", + "integrity": "sha512-MwquaPznI4cUoZEgHC/XGkddOXtqKqD4DvZDOyJK2LR9Qi6TbMbAhc6IaFoRX7CRTFCmtGeu8gdXW2dBotBBTA==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.40" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.40.tgz", + "integrity": "sha512-mOhhTrzieV6VO7odgzFGFapiwRK0ei8RZRhfzHhb6cpX3QM8XXuCLXWjN8qBB7JReDdUR80V3LFfFrGUYevhNg==", + "dev": true, + "requires": { + "chalk": "2.3.1", "esutils": "2.0.2", "js-tokens": "3.0.2" }, @@ -25,88 +75,74 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } }, - "@babel/helper-function-name": { - "version": "7.0.0-beta.31", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.31.tgz", - "integrity": "sha512-c+DAyp8LMm2nzSs2uXEuxp4LYGSUYEyHtU3fU57avFChjsnTmmpWmXj2dv0yUxHTEydgVAv5fIzA+4KJwoqWDA==", - "dev": true, - "requires": { - "@babel/helper-get-function-arity": "7.0.0-beta.31", - "@babel/template": "7.0.0-beta.31", - "@babel/traverse": "7.0.0-beta.31", - "@babel/types": "7.0.0-beta.31" - } - }, - "@babel/helper-get-function-arity": { - "version": "7.0.0-beta.31", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.31.tgz", - "integrity": "sha512-m7rVVX/dMLbbB9NCzKYRrrFb0qZxgpmQ4Wv6y7zEsB6skoJHRuXVeb/hAFze79vXBbuD63ci7AVHXzAdZSk9KQ==", - "dev": true, - "requires": { - "@babel/types": "7.0.0-beta.31" - } - }, "@babel/template": { - "version": "7.0.0-beta.31", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.31.tgz", - "integrity": "sha512-97IRmLvoDhIDSQkqklVt3UCxJsv0LUEVb/0DzXWtc8Lgiyxj567qZkmTG9aR21CmcJVVIvq2Y/moZj4oEpl5AA==", + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.40.tgz", + "integrity": "sha512-RlQiVB7eL7fxsKN6JvnCCwEwEL28CBYalXSgWWULuFlEHjtMoXBqQanSie3bNyhrANJx67sb+Sd/vuGivoMwLQ==", "dev": true, "requires": { - "@babel/code-frame": "7.0.0-beta.31", - "@babel/types": "7.0.0-beta.31", - "babylon": "7.0.0-beta.31", + "@babel/code-frame": "7.0.0-beta.40", + "@babel/types": "7.0.0-beta.40", + "babylon": "7.0.0-beta.40", "lodash": "4.17.4" }, "dependencies": { "babylon": { - "version": "7.0.0-beta.31", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.31.tgz", - "integrity": "sha512-6lm2mV3S51yEnKmQQNnswoABL1U1H1KHoCCVwdwI3hvIv+W7ya4ki7Aw4o4KxtUHjNKkK5WpZb22rrMMOcJXJQ==", + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.40.tgz", + "integrity": "sha512-AVxF2EcxvGD5hhOuLTOLAXBb0VhwWpEX0HyHdAI2zU+AAP4qEwtQj8voz1JR3uclGai0rfcE+dCTHnNMOnimFg==", "dev": true } } }, "@babel/traverse": { - "version": "7.0.0-beta.31", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.31.tgz", - "integrity": "sha512-3N+VJW+KlezEjFBG7WSYeMyC5kIqVLPb/PGSzCDPFcJrnArluD1GIl7Y3xC7cjKiTq2/JohaLWHVPjJWHlo9Gg==", + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.40.tgz", + "integrity": "sha512-h96SQorjvdSuxQ6hHFIuAa3oxnad1TA5bU1Zz88+XqzwmM5QM0/k2D+heXGGy/76gT5ajl7xYLKGiPA/KTyVhQ==", "dev": true, "requires": { - "@babel/code-frame": "7.0.0-beta.31", - "@babel/helper-function-name": "7.0.0-beta.31", - "@babel/types": "7.0.0-beta.31", - "babylon": "7.0.0-beta.31", + "@babel/code-frame": "7.0.0-beta.40", + "@babel/generator": "7.0.0-beta.40", + "@babel/helper-function-name": "7.0.0-beta.40", + "@babel/types": "7.0.0-beta.40", + "babylon": "7.0.0-beta.40", "debug": "3.1.0", - "globals": "10.4.0", + "globals": "11.3.0", "invariant": "2.2.2", "lodash": "4.17.4" }, "dependencies": { "babylon": { - "version": "7.0.0-beta.31", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.31.tgz", - "integrity": "sha512-6lm2mV3S51yEnKmQQNnswoABL1U1H1KHoCCVwdwI3hvIv+W7ya4ki7Aw4o4KxtUHjNKkK5WpZb22rrMMOcJXJQ==", + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.40.tgz", + "integrity": "sha512-AVxF2EcxvGD5hhOuLTOLAXBb0VhwWpEX0HyHdAI2zU+AAP4qEwtQj8voz1JR3uclGai0rfcE+dCTHnNMOnimFg==", "dev": true }, "debug": { @@ -119,17 +155,17 @@ } }, "globals": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-10.4.0.tgz", - "integrity": "sha512-uNUtxIZpGyuaq+5BqGGQHsL4wUlJAXRqOm6g3Y48/CWNGTLONgBibI0lh6lGxjR2HljFYUfszb+mk4WkgMntsA==", + "version": "11.3.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", + "integrity": "sha512-kkpcKNlmQan9Z5ZmgqKH/SMbSmjxQ7QjyNqfXVc8VJcoBV2UEg+sxQD15GQofGRh2hfpwUb70VC31DR7Rq5Hdw==", "dev": true } } }, "@babel/types": { - "version": "7.0.0-beta.31", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.31.tgz", - "integrity": "sha512-exAHB+NeFGxkfQ5dSUD03xl3zYGneeSk2Mw2ldTt/nTvYxuDiuSp3DlxgUBgzbdTFG4fbwPk0WtKWOoTXCmNGg==", + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.40.tgz", + "integrity": "sha512-uXCGCzTgMZxcSUzutCPtZmXbVC+cvENgS2e0tRuhn+Y1hZnMb8IHP0Trq7Q2MB/eFmG5pKrAeTIUfQIe5kA4Tg==", "dev": true, "requires": { "esutils": "2.0.2", @@ -179,18 +215,18 @@ "dev": true }, "@types/react": { - "version": "16.0.36", - "resolved": "https://registry.npmjs.org/@types/react/-/react-16.0.36.tgz", - "integrity": "sha512-q33EVfy4i+fwhM31PL6/c6Job/DyjOiExHuR163bJK3rEMRf2ENkBrN4thQH5cwA+TiiN1vWDZU6D5H1AvQTlA==", + "version": "16.0.39", + "resolved": "https://registry.npmjs.org/@types/react/-/react-16.0.39.tgz", + "integrity": "sha512-EdW+v2cqQHHOKOc5s7sCKE8TpP/vVlCnLwLl4JMkzasC9ZNwNMiwAitSi7OhjBarVGoRTygLff+EzfexAFxljw==", "dev": true }, "@types/react-transition-group": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-2.0.6.tgz", - "integrity": "sha512-mVhRv+d0MIoLWl6hEFA7Nnd/obW2RQpZViTAKhM37mltuTDWCdoj8xAZv94ntB8wgAc6DDiDCXxFXPgClGnsfQ==", + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-2.0.7.tgz", + "integrity": "sha512-aTbd37E2XJ5Zi/lRrXo74RMhZikS/r5a06EStXEdapy4pqzvPrdY9BpWGNSpnyp8oNaggL0duljNdC8T0dRIUA==", "dev": true, "requires": { - "@types/react": "16.0.36" + "@types/react": "16.0.39" } }, "abab": { @@ -200,9 +236,9 @@ "dev": true }, "acorn": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.2.1.tgz", - "integrity": "sha512-jG0u7c4Ly+3QkkW18V+NRDN+4bWHdln30NL1ZL2AvFZZmQe/BfopYCtghCKKVBUSetZ4QKcyA0pY6/4Gw8Pv8w==", + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.0.tgz", + "integrity": "sha512-arn53F07VXmls4o4pUhSzBa4fvaagPRe7AVZ8l7NHxFWUie2DsuFSBMMNAkgzRlOhEhzAnxeKyaWVzOH4xqp/g==", "dev": true }, "acorn-globals": { @@ -252,9 +288,9 @@ } }, "ajv-keywords": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-2.1.1.tgz", - "integrity": "sha1-YXmX/F9gV2iUxDX5QNgZ4TW4B2I=", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.1.0.tgz", + "integrity": "sha1-rCsnk5xUPpXSwG5/f1wnvkqlQ74=", "dev": true }, "align-text": { @@ -542,21 +578,23 @@ } }, "babel-eslint": { - "version": "8.0.3", - "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.0.3.tgz", - "integrity": "sha512-7D4iUpylEiKJPGbeSAlNddGcmA41PadgZ6UAb6JVyh003h3d0EbZusYFBR/+nBgqtaVJM2J2zUVa3N0hrpMH6g==", + "version": "8.2.2", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.2.tgz", + "integrity": "sha512-Qt2lz2egBxNYWqN9JIO2z4NOOf8i4b5JS6CFoYrOZZTDssueiV1jH/jsefyg+86SeNY3rB361/mi3kE1WK2WYQ==", "dev": true, "requires": { - "@babel/code-frame": "7.0.0-beta.31", - "@babel/traverse": "7.0.0-beta.31", - "@babel/types": "7.0.0-beta.31", - "babylon": "7.0.0-beta.31" + "@babel/code-frame": "7.0.0-beta.40", + "@babel/traverse": "7.0.0-beta.40", + "@babel/types": "7.0.0-beta.40", + "babylon": "7.0.0-beta.40", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0" }, "dependencies": { "babylon": { - "version": "7.0.0-beta.31", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.31.tgz", - "integrity": "sha512-6lm2mV3S51yEnKmQQNnswoABL1U1H1KHoCCVwdwI3hvIv+W7ya4ki7Aw4o4KxtUHjNKkK5WpZb22rrMMOcJXJQ==", + "version": "7.0.0-beta.40", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.40.tgz", + "integrity": "sha512-AVxF2EcxvGD5hhOuLTOLAXBb0VhwWpEX0HyHdAI2zU+AAP4qEwtQj8voz1JR3uclGai0rfcE+dCTHnNMOnimFg==", "dev": true } } @@ -1630,6 +1668,7 @@ "requires": { "anymatch": "1.3.2", "async-each": "1.0.1", + "fsevents": "1.1.3", "glob-parent": "2.0.0", "inherits": "2.0.3", "is-binary-path": "1.0.1", @@ -1815,7 +1854,7 @@ "requires": { "dot-prop": "4.2.0", "graceful-fs": "4.1.11", - "make-dir": "1.1.0", + "make-dir": "1.2.0", "unique-string": "1.0.0", "write-file-atomic": "2.3.0", "xdg-basedir": "3.0.0" @@ -1957,14 +1996,6 @@ "array-find-index": "1.0.2" } }, - "d": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.0.tgz", - "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", - "requires": { - "es5-ext": "0.10.37" - } - }, "damerau-levenshtein": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz", @@ -1981,9 +2012,9 @@ } }, "date-fns": { - "version": "1.29.0", - "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.29.0.tgz", - "integrity": "sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw==", + "version": "2.0.0-alpha.7", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.0.0-alpha.7.tgz", + "integrity": "sha1-JFrRb5V2Tqur+ywKQf1dAzwg5Xo=", "dev": true }, "debug": { @@ -2028,6 +2059,12 @@ "is-obj": "1.0.1" } }, + "deep-extend": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.4.2.tgz", + "integrity": "sha1-SLaZwn4zS/ifEIkr5DL25MfTSn8=", + "dev": true + }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -2102,9 +2139,9 @@ "dev": true }, "doctrine": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.0.2.tgz", - "integrity": "sha512-y0tm5Pq6ywp3qSTZ1vPgVdAnbDEoeoc5wlOHXoY1c4Wug/a7JvqHIl7BTvwodaHmejWkK/9dSb3sCYfyo/om8A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { "esutils": "2.0.2" @@ -2271,7 +2308,7 @@ "lodash": "4.17.4", "object.assign": "4.1.0", "object.values": "1.0.4", - "prop-types": "15.6.0", + "prop-types": "15.6.1", "react-reconciler": "0.7.0", "react-test-renderer": "16.2.0" } @@ -2284,7 +2321,7 @@ "requires": { "lodash": "4.17.4", "object.assign": "4.1.0", - "prop-types": "15.6.0" + "prop-types": "15.6.1" } }, "errno": { @@ -2329,34 +2366,6 @@ "is-symbol": "1.0.1" } }, - "es5-ext": { - "version": "0.10.37", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.37.tgz", - "integrity": "sha1-DudB0Ui4AGm6J9AgOTdWryV978M=", - "requires": { - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1" - } - }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.37", - "es6-symbol": "3.1.1" - } - }, - "es6-symbol": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.1.tgz", - "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", - "requires": { - "d": "1.0.0", - "es5-ext": "0.10.37" - } - }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -2385,9 +2394,9 @@ } }, "eslint": { - "version": "4.17.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.17.0.tgz", - "integrity": "sha512-AyxBUCANU/o/xC0ijGMKavo5Ls3oK6xykiOITlMdjFjrKOsqLrA7Nf5cnrDgcKrHzBirclAZt63XO7YZlVUPwA==", + "version": "4.18.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-4.18.1.tgz", + "integrity": "sha512-gPSfpSRCHre1GLxGmO68tZNxOlL2y7xBd95VcLD+Eo4S2js31YoMum3CAQIOaxY24hqYOMksMvW38xuuWKQTgw==", "dev": true, "requires": { "ajv": "5.5.2", @@ -2399,7 +2408,7 @@ "doctrine": "2.1.0", "eslint-scope": "3.7.1", "eslint-visitor-keys": "1.0.0", - "espree": "3.5.2", + "espree": "3.5.3", "esquery": "1.0.0", "esutils": "2.0.2", "file-entry-cache": "2.0.0", @@ -2409,7 +2418,7 @@ "ignore": "3.3.7", "imurmurhash": "0.1.4", "inquirer": "3.3.0", - "is-resolvable": "1.0.1", + "is-resolvable": "1.1.0", "js-yaml": "3.10.0", "json-stable-stringify-without-jsonify": "1.0.1", "levn": "0.3.0", @@ -2425,7 +2434,7 @@ "semver": "5.4.1", "strip-ansi": "4.0.0", "strip-json-comments": "2.0.1", - "table": "4.0.2", + "table": "4.0.3", "text-table": "0.2.0" }, "dependencies": { @@ -2464,15 +2473,6 @@ "ms": "2.0.0" } }, - "doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "requires": { - "esutils": "2.0.2" - } - }, "globals": { "version": "11.3.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.3.0.tgz", @@ -2524,9 +2524,9 @@ } }, "eslint-import-resolver-node": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.1.tgz", - "integrity": "sha512-yUtXS15gIcij68NmXmP9Ni77AQuCN0itXbCc/jWd8C6/yKZaSNXicpC8cgvjnxVdmfsosIXrjpzFq7GcDryb6A==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", "dev": true, "requires": { "debug": "2.6.9", @@ -2544,19 +2544,19 @@ } }, "eslint-plugin-import": { - "version": "2.8.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.8.0.tgz", - "integrity": "sha512-Rf7dfKJxZ16QuTgVv1OYNxkZcsu/hULFnC+e+w0Gzi6jMC3guQoWQgxYxc54IDRinlb6/0v5z/PxxIKmVctN+g==", + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.9.0.tgz", + "integrity": "sha1-JgAu+/ylmJtyiKwEdQi9JPIXsWk=", "dev": true, "requires": { "builtin-modules": "1.1.1", "contains-path": "0.1.0", "debug": "2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "0.3.1", + "eslint-import-resolver-node": "0.3.2", "eslint-module-utils": "2.1.1", "has": "1.0.1", - "lodash.cond": "4.5.2", + "lodash": "4.17.4", "minimatch": "3.0.4", "read-pkg-up": "2.0.0" }, @@ -2637,15 +2637,15 @@ } }, "eslint-plugin-react": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.5.1.tgz", - "integrity": "sha512-YGSjB9Qu6QbVTroUZi66pYky3DfoIPLdHQ/wmrBGyBRnwxQsBXAov9j2rpXt/55i8nyMv6IRWJv2s4d4YnduzQ==", + "version": "7.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.7.0.tgz", + "integrity": "sha512-KC7Snr4YsWZD5flu6A5c0AcIZidzW3Exbqp7OT67OaD2AppJtlBr/GuPrW/vaQM/yfZotEvKAdrxrO+v8vwYJA==", "dev": true, "requires": { - "doctrine": "2.0.2", + "doctrine": "2.1.0", "has": "1.0.1", "jsx-ast-utils": "2.0.1", - "prop-types": "15.6.0" + "prop-types": "15.6.1" } }, "eslint-restricted-globals": { @@ -2660,7 +2660,7 @@ "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", "dev": true, "requires": { - "esrecurse": "4.2.0", + "esrecurse": "4.2.1", "estraverse": "4.2.0" } }, @@ -2671,12 +2671,12 @@ "dev": true }, "espree": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.2.tgz", - "integrity": "sha512-sadKeYwaR/aJ3stC2CdvgXu1T16TdYN+qwCpcWbMnGJ8s0zNWemzrvb2GbD4OhmJ/fwpJjudThAlLobGbWZbCQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.3.tgz", + "integrity": "sha512-Zy3tAJDORxQZLl2baguiRU1syPERAIg0L+JB2MWorORgTu/CplzvxS9WWA7Xh4+Q+eOQihNs/1o1Xep8cvCxWQ==", "dev": true, "requires": { - "acorn": "5.2.1", + "acorn": "5.5.0", "acorn-jsx": "3.0.1" } }, @@ -2696,13 +2696,12 @@ } }, "esrecurse": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.0.tgz", - "integrity": "sha1-+pVo2Y04I/mkHZHpAtyrnqblsWM=", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { - "estraverse": "4.2.0", - "object-assign": "4.1.1" + "estraverse": "4.2.0" } }, "estraverse": { @@ -2993,18 +2992,922 @@ "universalify": "0.1.1" } }, - "fs-readdir-recursive": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", - "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", - "dev": true - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "fsevents": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.1.3.tgz", + "integrity": "sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q==", + "dev": true, + "optional": true, + "requires": { + "nan": "2.8.0", + "node-pre-gyp": "0.6.39" + }, + "dependencies": { + "abbrev": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "optional": true + }, + "ajv": { + "version": "4.11.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "co": "4.6.0", + "json-stable-stringify": "1.0.1" + } + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "aproba": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "delegates": "1.0.0", + "readable-stream": "2.2.9" + } + }, + "asn1": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "assert-plus": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "asynckit": { + "version": "0.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws-sign2": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "aws4": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "balanced-match": { + "version": "0.4.2", + "bundled": true, + "dev": true + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "tweetnacl": "0.14.5" + } + }, + "block-stream": { + "version": "0.0.9", + "bundled": true, + "dev": true, + "requires": { + "inherits": "2.0.3" + } + }, + "boom": { + "version": "2.10.1", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "brace-expansion": { + "version": "1.1.7", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "0.4.2", + "concat-map": "0.0.1" + } + }, + "buffer-shims": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "caseless": { + "version": "0.12.0", + "bundled": true, + "dev": true, + "optional": true + }, + "co": { + "version": "4.6.0", + "bundled": true, + "dev": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "combined-stream": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "requires": { + "delayed-stream": "1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "cryptiles": { + "version": "2.0.5", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1" + } + }, + "dashdash": { + "version": "1.14.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "debug": { + "version": "2.6.8", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.4.2", + "bundled": true, + "dev": true, + "optional": true + }, + "delayed-stream": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "ecc-jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "extend": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "extsprintf": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "forever-agent": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + }, + "form-data": { + "version": "2.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asynckit": "0.4.0", + "combined-stream": "1.0.5", + "mime-types": "2.1.15" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "fstream": { + "version": "1.0.11", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.11", + "inherits": "2.0.3", + "mkdirp": "0.5.1", + "rimraf": "2.6.1" + } + }, + "fstream-ignore": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "fstream": "1.0.11", + "inherits": "2.0.3", + "minimatch": "3.0.4" + } + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aproba": "1.1.1", + "console-control-strings": "1.1.0", + "has-unicode": "2.0.1", + "object-assign": "4.1.1", + "signal-exit": "3.0.2", + "string-width": "1.0.2", + "strip-ansi": "3.0.1", + "wide-align": "1.1.2" + } + }, + "getpass": { + "version": "0.1.7", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.11", + "bundled": true, + "dev": true + }, + "har-schema": { + "version": "1.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "har-validator": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "ajv": "4.11.8", + "har-schema": "1.0.5" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "hawk": { + "version": "3.1.3", + "bundled": true, + "dev": true, + "requires": { + "boom": "2.10.1", + "cryptiles": "2.0.5", + "hoek": "2.16.3", + "sntp": "1.0.9" + } + }, + "hoek": { + "version": "2.16.3", + "bundled": true, + "dev": true + }, + "http-signature": { + "version": "1.1.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "0.2.0", + "jsprim": "1.4.0", + "sshpk": "1.13.0" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "ini": { + "version": "1.3.4", + "bundled": true, + "dev": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "is-typedarray": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "isstream": { + "version": "0.1.2", + "bundled": true, + "dev": true, + "optional": true + }, + "jodid25519": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsbn": "0.1.1" + } + }, + "jsbn": { + "version": "0.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "bundled": true, + "dev": true, + "optional": true + }, + "json-stable-stringify": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "jsonify": "0.0.0" + } + }, + "json-stringify-safe": { + "version": "5.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "jsonify": { + "version": "0.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "jsprim": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.0.2", + "json-schema": "0.2.3", + "verror": "1.3.6" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "mime-db": { + "version": "1.27.0", + "bundled": true, + "dev": true + }, + "mime-types": { + "version": "2.1.15", + "bundled": true, + "dev": true, + "requires": { + "mime-db": "1.27.0" + } + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "node-pre-gyp": { + "version": "0.6.39", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "detect-libc": "1.0.2", + "hawk": "3.1.3", + "mkdirp": "0.5.1", + "nopt": "4.0.1", + "npmlog": "4.1.0", + "rc": "1.2.1", + "request": "2.81.0", + "rimraf": "2.6.1", + "semver": "5.3.0", + "tar": "2.2.1", + "tar-pack": "3.4.0" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "abbrev": "1.1.0", + "osenv": "0.1.4" + } + }, + "npmlog": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "are-we-there-yet": "1.1.4", + "console-control-strings": "1.1.0", + "gauge": "2.7.4", + "set-blocking": "2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "oauth-sign": { + "version": "0.8.2", + "bundled": true, + "dev": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "osenv": { + "version": "0.1.4", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "os-homedir": "1.0.2", + "os-tmpdir": "1.0.2" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "performance-now": { + "version": "0.2.0", + "bundled": true, + "dev": true, + "optional": true + }, + "process-nextick-args": { + "version": "1.0.7", + "bundled": true, + "dev": true + }, + "punycode": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "optional": true + }, + "qs": { + "version": "6.4.0", + "bundled": true, + "dev": true, + "optional": true + }, + "rc": { + "version": "1.2.1", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "deep-extend": "0.4.2", + "ini": "1.3.4", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.2.9", + "bundled": true, + "dev": true, + "requires": { + "buffer-shims": "1.0.0", + "core-util-is": "1.0.2", + "inherits": "2.0.3", + "isarray": "1.0.0", + "process-nextick-args": "1.0.7", + "string_decoder": "1.0.1", + "util-deprecate": "1.0.2" + } + }, + "request": { + "version": "2.81.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "aws-sign2": "0.6.0", + "aws4": "1.6.0", + "caseless": "0.12.0", + "combined-stream": "1.0.5", + "extend": "3.0.1", + "forever-agent": "0.6.1", + "form-data": "2.1.4", + "har-validator": "4.2.1", + "hawk": "3.1.3", + "http-signature": "1.1.1", + "is-typedarray": "1.0.0", + "isstream": "0.1.2", + "json-stringify-safe": "5.0.1", + "mime-types": "2.1.15", + "oauth-sign": "0.8.2", + "performance-now": "0.2.0", + "qs": "6.4.0", + "safe-buffer": "5.0.1", + "stringstream": "0.0.5", + "tough-cookie": "2.3.2", + "tunnel-agent": "0.6.0", + "uuid": "3.0.1" + } + }, + "rimraf": { + "version": "2.6.1", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.2" + } + }, + "safe-buffer": { + "version": "5.0.1", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.3.0", + "bundled": true, + "dev": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "optional": true + }, + "sntp": { + "version": "1.0.9", + "bundled": true, + "dev": true, + "requires": { + "hoek": "2.16.3" + } + }, + "sshpk": { + "version": "1.13.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "asn1": "0.2.3", + "assert-plus": "1.0.0", + "bcrypt-pbkdf": "1.0.1", + "dashdash": "1.14.1", + "ecc-jsbn": "0.1.1", + "getpass": "0.1.7", + "jodid25519": "1.0.2", + "jsbn": "0.1.1", + "tweetnacl": "0.14.5" + }, + "dependencies": { + "assert-plus": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "string_decoder": { + "version": "1.0.1", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "stringstream": { + "version": "0.0.5", + "bundled": true, + "dev": true, + "optional": true + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "tar": { + "version": "2.2.1", + "bundled": true, + "dev": true, + "requires": { + "block-stream": "0.0.9", + "fstream": "1.0.11", + "inherits": "2.0.3" + } + }, + "tar-pack": { + "version": "3.4.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "debug": "2.6.8", + "fstream": "1.0.11", + "fstream-ignore": "1.0.5", + "once": "1.4.0", + "readable-stream": "2.2.9", + "rimraf": "2.6.1", + "tar": "2.2.1", + "uid-number": "0.0.6" + } + }, + "tough-cookie": { + "version": "2.3.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "punycode": "1.4.1" + } + }, + "tunnel-agent": { + "version": "0.6.0", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "bundled": true, + "dev": true, + "optional": true + }, + "uid-number": { + "version": "0.0.6", + "bundled": true, + "dev": true, + "optional": true + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "uuid": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "optional": true + }, + "verror": { + "version": "1.3.6", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "extsprintf": "1.0.2" + } + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "string-width": "1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + } + } + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -3049,6 +3952,12 @@ "assert-plus": "1.0.0" } }, + "github-url-from-git": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/github-url-from-git/-/github-url-from-git-1.5.0.tgz", + "integrity": "sha1-+YX+3MCpqledyI16/waNVcxiUaA=", + "dev": true + }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", @@ -3261,9 +4170,9 @@ "dev": true }, "hoist-non-react-statics": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.3.1.tgz", - "integrity": "sha1-ND24TGAYxlB3iJgkATWhQg7iLOA=", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.0.tgz", + "integrity": "sha512-6Bl6XsDT1ntE0lHbIhr4Kp2PGcleGZ66qu5Jqk8lc0Xc/IeG6gVLmwUGs/K0Us+L8VWoKgj0uWdPMataOsm31w==", "dev": true }, "home-or-tmp": { @@ -3316,6 +4225,12 @@ "sshpk": "1.13.1" } }, + "hyperlinker": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/hyperlinker/-/hyperlinker-1.0.0.tgz", + "integrity": "sha512-Ty8UblRWFEcfSuIaajM34LdPXIhbs1ajEX/BBPv24J+enSVaEVY63xQ6lTO9VRYS5LAoghIG0IDJ+p+IPzKUQQ==", + "dev": true + }, "hyphenate-style-name": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/hyphenate-style-name/-/hyphenate-style-name-1.0.2.tgz", @@ -3383,7 +4298,7 @@ "dev": true, "requires": { "ansi-escapes": "3.0.0", - "chalk": "2.3.0", + "chalk": "2.3.1", "cli-cursor": "2.1.0", "cli-width": "2.2.0", "external-editor": "2.1.0", @@ -3414,16 +4329,22 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -3434,12 +4355,12 @@ } }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -3704,9 +4625,9 @@ } }, "is-resolvable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.0.1.tgz", - "integrity": "sha512-y5CXYbzvB3jTnWAZH1Nl7ykUWb6T3BcTs56HUruwBf8MhF56n1HWqhDWnVFo8GHrUPDgvUUNVhrc2U8W7iqz5g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", + "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, "is-retry-allowed": { @@ -3792,6 +4713,12 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, + "issue-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/issue-regex/-/issue-regex-1.0.0.tgz", + "integrity": "sha1-VPzPYupl5PRyB1cri3jBs9neX3c=", + "dev": true + }, "istanbul-api": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-1.2.1.tgz", @@ -4720,7 +5647,7 @@ "dev": true, "requires": { "is-in-browser": "1.1.3", - "symbol-observable": "1.1.0", + "symbol-observable": "1.2.0", "warning": "3.0.0" } }, @@ -4937,9 +5864,9 @@ } }, "listr-input": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/listr-input/-/listr-input-0.1.2.tgz", - "integrity": "sha512-GQl3txLCcuKzmkYxMjZ3idiICyyjxZTfDz2k92LXU3byxY1nz249iKbfMKvSmWYUHs85TqWYZCkMJ316OKjTfA==", + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/listr-input/-/listr-input-0.1.3.tgz", + "integrity": "sha512-dvjSD1MrWGXxxPixpMQlSBmkyqhJrPxGo30un25k/vlvFOWZj70AauU+YkEh7CA8vmpkE6Wde37DJDmqYqF39g==", "dev": true, "requires": { "inquirer": "3.3.0", @@ -5034,6 +5961,12 @@ "restore-cursor": "1.0.1" } }, + "date-fns": { + "version": "1.29.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-1.29.0.tgz", + "integrity": "sha512-lbTXWZ6M20cWH8N9S6afb0SBm6tMk+uUg6z3MqHPKE9atmsY3kJkTm8vKe93izJ2B2+q5MV990sM2CHgtAZaOw==", + "dev": true + }, "figures": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", @@ -5091,12 +6024,6 @@ "integrity": "sha1-eCA6TRwyiuHYbcpkYONptX9AVa4=", "dev": true }, - "lodash.cond": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/lodash.cond/-/lodash.cond-4.5.2.tgz", - "integrity": "sha1-9HGh2khr5g9quVXRcRVSPdHSVdU=", - "dev": true - }, "lodash.flattendeep": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", @@ -5104,12 +6031,12 @@ "dev": true }, "log-symbols": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.1.0.tgz", - "integrity": "sha512-zLeLrzMA1A2vRF1e/0Mo+LNINzi6jzBylHj5WqvQ/WK/5WCZt8si9SyN4p9llr/HRYvVR1AoXHRHl4WTHyQAzQ==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", "dev": true, "requires": { - "chalk": "2.3.0" + "chalk": "2.3.1" }, "dependencies": { "ansi-styles": { @@ -5122,23 +6049,29 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -5236,9 +6169,9 @@ } }, "make-dir": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.1.0.tgz", - "integrity": "sha512-0Pkui4wLJ7rxvmfUvs87skoEaxmu0hCUApF8nonzpl7q//FWp9zu8W61Scz4sd/kUiqDxvUhtoam2efDyiBzcA==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.2.0.tgz", + "integrity": "sha512-aNUAa4UMg/UougV25bbrU4ZaaKNjJ/3/xnvg/twpmKROPdKZPZ9wGgI0opdZzO8q/zUFawoUuixuOv33eZ61Iw==", "dev": true, "requires": { "pify": "3.0.0" @@ -5268,19 +6201,19 @@ "dev": true }, "material-ui": { - "version": "1.0.0-beta.33", - "resolved": "https://registry.npmjs.org/material-ui/-/material-ui-1.0.0-beta.33.tgz", - "integrity": "sha512-9p3a6d62AQtl1pn4eXgT97Pjd/iVmzSeEmv14ZLFho29eqhoETGYnULs5t19jprf+5aJSfVP+r+Dm4SJMa0uPg==", + "version": "1.0.0-beta.35", + "resolved": "https://registry.npmjs.org/material-ui/-/material-ui-1.0.0-beta.35.tgz", + "integrity": "sha512-KqCNpe2Hhi1J1UsM4Ko8hdYi67N3Ck4T7IPk7PoAo4edYaY/ntcfB16645B3A/RVxYgRBFy7btQHtA4X7r7mIw==", "dev": true, "requires": { "@types/jss": "9.3.0", - "@types/react-transition-group": "2.0.6", + "@types/react-transition-group": "2.0.7", "babel-runtime": "6.26.0", "brcast": "3.0.1", "classnames": "2.2.5", "deepmerge": "2.0.1", "dom-helpers": "3.3.1", - "hoist-non-react-statics": "2.3.1", + "hoist-non-react-statics": "2.5.0", "jss": "9.8.0", "jss-camel-case": "6.1.0", "jss-default-unit": "8.0.2", @@ -5291,14 +6224,14 @@ "keycode": "2.1.9", "lodash": "4.17.4", "normalize-scroll-left": "0.1.2", - "prop-types": "15.6.0", + "prop-types": "15.6.1", "react-event-listener": "0.5.3", - "react-jss": "8.3.1", - "react-popper": "0.7.5", + "react-jss": "8.3.3", + "react-popper": "0.8.2", "react-scrollbar-size": "2.1.0", "react-transition-group": "2.2.1", "recompose": "0.26.0", - "scroll": "2.0.1", + "scroll": "2.0.3", "warning": "3.0.0" } }, @@ -5497,14 +6430,6 @@ "integrity": "sha512-Yh9y73JRljxW5QxN08Fner68eFLxM5ynNOAw2LbIB1YAGeQzZT8QFSUvkAz609Zf+IHhhaUxqZK8dG3W/+HEvg==", "dev": true }, - "moment-range": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/moment-range/-/moment-range-3.1.0.tgz", - "integrity": "sha1-lqsiRZObHAmR8OQSgHmEMhhBXCk=", - "requires": { - "es6-symbol": "3.1.1" - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -5517,6 +6442,13 @@ "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", "dev": true }, + "nan": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.8.0.tgz", + "integrity": "sha1-7XFfP+neArV6XmJS2QqWZ14fCFo=", + "dev": true, + "optional": true + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -5599,20 +6531,23 @@ "dev": true }, "np": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/np/-/np-2.19.0.tgz", - "integrity": "sha512-sKbIAeoYkHvtiMdMba4sQ8C17WuYtuEgtePvnro/VkGXRn2oev/OzwqF/7VkBVcuy/nKOjzHFtAiS/drO+sWnw==", + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/np/-/np-2.20.1.tgz", + "integrity": "sha512-IiCxi6SpqsVaGiQG5/XbkZ2uqfAe2G7lwS7BuaWC117MCgPs57SI+1F0chKN/abBmYZqxjqbEId6AUA+1aNblQ==", "dev": true, "requires": { "any-observable": "0.2.0", "chalk": "2.3.1", "del": "3.0.0", "execa": "0.8.0", + "github-url-from-git": "1.5.0", "has-yarn": "1.0.0", + "hyperlinker": "1.0.0", "inquirer": "3.3.0", + "issue-regex": "1.0.0", "listr": "0.12.0", - "listr-input": "0.1.2", - "log-symbols": "2.1.0", + "listr-input": "0.1.3", + "log-symbols": "2.2.0", "meow": "4.0.0", "p-tap": "1.0.0", "p-timeout": "2.0.1", @@ -5621,6 +6556,7 @@ "semver": "5.4.1", "split": "1.0.1", "stream-to-observable": "0.2.0", + "supports-hyperlinks": "1.0.1", "update-notifier": "2.3.0" }, "dependencies": { @@ -6058,7 +6994,7 @@ "dev": true, "requires": { "got": "6.7.1", - "registry-auth-token": "3.3.1", + "registry-auth-token": "3.3.2", "registry-url": "3.1.0", "semver": "5.4.1" } @@ -6281,9 +7217,9 @@ } }, "prop-types": { - "version": "15.6.0", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.0.tgz", - "integrity": "sha1-zq8IMCL8RrSjX2nhPvda7Q1jmFY=", + "version": "15.6.1", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.1.tgz", + "integrity": "sha512-4ec7bY1Y66LymSUOH/zARVYObB23AT2h8cf6e/O6ZALB/N0sqZFEx7rq6EYPX2MkOdKORuooI/H5k9TlR4q7kQ==", "requires": { "fbjs": "0.8.16", "loose-envify": "1.3.1", @@ -6396,11 +7332,12 @@ } }, "rc": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.2.tgz", - "integrity": "sha1-2M6ctX6NZNnHut2YdsfDTL48cHc=", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.5.tgz", + "integrity": "sha1-J1zWh/bjs2zHVrqibf7oCnkDAf0=", "dev": true, "requires": { + "deep-extend": "0.4.2", "ini": "1.3.5", "minimist": "1.2.0", "strip-json-comments": "2.0.1" @@ -6423,7 +7360,7 @@ "fbjs": "0.8.16", "loose-envify": "1.3.1", "object-assign": "4.1.1", - "prop-types": "15.6.0" + "prop-types": "15.6.1" } }, "react-dom": { @@ -6435,7 +7372,7 @@ "fbjs": "0.8.16", "loose-envify": "1.3.1", "object-assign": "4.1.1", - "prop-types": "15.6.0" + "prop-types": "15.6.1" } }, "react-event-listener": { @@ -6446,31 +7383,31 @@ "requires": { "babel-runtime": "6.26.0", "fbjs": "0.8.16", - "prop-types": "15.6.0", + "prop-types": "15.6.1", "warning": "3.0.0" } }, "react-jss": { - "version": "8.3.1", - "resolved": "https://registry.npmjs.org/react-jss/-/react-jss-8.3.1.tgz", - "integrity": "sha512-reKzVvaEHtzlVxJOzoeMOCCrBVCMRlIqlVXHJqgde1Pz04HNrbMaHGYC2CugK6Yk8kkDFuO6p0fTPe66ktyPMA==", + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/react-jss/-/react-jss-8.3.3.tgz", + "integrity": "sha512-4ZIDMjmC5NOREb2gWI9R14gignNiDRDy/sMwtNRXKeCv26C703Y++aYe0kqn22PGiBredaXXOsgWTVuKFhxfig==", "dev": true, "requires": { - "hoist-non-react-statics": "2.3.1", + "hoist-non-react-statics": "2.5.0", "jss": "9.8.0", "jss-preset-default": "4.3.0", - "prop-types": "15.6.0", + "prop-types": "15.6.1", "theming": "1.3.0" } }, "react-popper": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-0.7.5.tgz", - "integrity": "sha512-ya9dhhGCf74JTOB2uyksEHhIGw7w9tNZRUJF73lEq2h4H5JT6MBa4PdT4G+sx6fZwq+xKZAL/sVNAIuojPn7Dg==", + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/react-popper/-/react-popper-0.8.2.tgz", + "integrity": "sha512-sL3r9aOG8sw48Vs5EiTZV4EXhEH0eoN9718WoIsb0Lx2H/sAZbVLZrENduXCAhre6cEqSh7mMR5sI1luYkVhYQ==", "dev": true, "requires": { "popper.js": "1.12.9", - "prop-types": "15.6.0" + "prop-types": "15.6.1" } }, "react-reconciler": { @@ -6482,7 +7419,7 @@ "fbjs": "0.8.16", "loose-envify": "1.3.1", "object-assign": "4.1.1", - "prop-types": "15.6.0" + "prop-types": "15.6.1" } }, "react-scrollbar-size": { @@ -6492,7 +7429,7 @@ "dev": true, "requires": { "babel-runtime": "6.26.0", - "prop-types": "15.6.0", + "prop-types": "15.6.1", "react-event-listener": "0.5.3", "stifle": "1.0.4" } @@ -6505,15 +7442,15 @@ "requires": { "fbjs": "0.8.16", "object-assign": "4.1.1", - "prop-types": "15.6.0" + "prop-types": "15.6.1" } }, "react-text-mask": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/react-text-mask/-/react-text-mask-5.0.2.tgz", - "integrity": "sha1-Cbzj+UrCRMEZMgguQjKMtFW3OqY=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/react-text-mask/-/react-text-mask-5.1.0.tgz", + "integrity": "sha512-9YTPppMq06sbKj7WXX/pt5PE0Ck5OdckSVa7OaekH1jerW5pbfCZDzCi5bWczNKYhq7fBBDFOsfrFGSp+ufShQ==", "requires": { - "prop-types": "15.6.0" + "prop-types": "15.6.1" } }, "react-transition-group": { @@ -6526,7 +7463,7 @@ "classnames": "2.2.5", "dom-helpers": "3.3.1", "loose-envify": "1.3.1", - "prop-types": "15.6.0", + "prop-types": "15.6.1", "warning": "3.0.0" } }, @@ -6608,8 +7545,8 @@ "requires": { "change-emitter": "0.1.6", "fbjs": "0.8.16", - "hoist-non-react-statics": "2.3.1", - "symbol-observable": "1.1.0" + "hoist-non-react-statics": "2.5.0", + "symbol-observable": "1.2.0" } }, "redent": { @@ -6674,12 +7611,12 @@ } }, "registry-auth-token": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.1.tgz", - "integrity": "sha1-+w0yie4Nmtosu1KvXf5mywcNMAY=", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-3.3.2.tgz", + "integrity": "sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==", "dev": true, "requires": { - "rc": "1.2.2", + "rc": "1.2.5", "safe-buffer": "5.1.1" } }, @@ -6689,7 +7626,7 @@ "integrity": "sha1-PU74cPc93h138M+aOBQyRE4XSUI=", "dev": true, "requires": { - "rc": "1.2.2" + "rc": "1.2.5" } }, "regjsgen": { @@ -6860,12 +7797,12 @@ } }, "rollup-plugin-commonjs": { - "version": "8.2.6", - "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.2.6.tgz", - "integrity": "sha512-qK0+uhktmnAgZkHkqFuajNmPw93fjrO7+CysDaxWE5jrUR9XSlSvuao5ZJP+XizxA8weakhgYYBtbVz9SGBpjA==", + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-commonjs/-/rollup-plugin-commonjs-8.3.0.tgz", + "integrity": "sha512-PYs3OiYgENFYEmI3vOEm5nrp3eY90YZqd5vGmQqeXmhJsAWFIrFdROCvOasqJ1HgeTvqyYo9IGXnFDyoboNcgQ==", "dev": true, "requires": { - "acorn": "5.2.1", + "acorn": "5.5.0", "estree-walker": "0.5.1", "magic-string": "0.22.4", "resolve": "1.5.0", @@ -6920,12 +7857,11 @@ } }, "rollup-plugin-node-resolve": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.0.tgz", - "integrity": "sha1-i4l8TDAw1QASd7BRSyXSygloPuA=", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-3.0.3.tgz", + "integrity": "sha512-qJLXJ1aASV6p8SrEfRdQdHmb5OQmqXyIWIdVGcju8QFzftSsHcuL554Vy+n8mr0fZCC+ksO6aWJ7TAVl2F+Qwg==", "dev": true, "requires": { - "browser-resolve": "1.11.2", "builtin-modules": "1.1.1", "is-module": "1.0.0", "resolve": "1.5.0" @@ -6981,7 +7917,7 @@ "integrity": "sha512-fSNi+y+P9ss+EZuV0GcIIqPUK07DEaMRUtLJvdcvMyFjc9dizuDjere+A4V7JrLGnm9iCc+nagV/4QdMTkqC4A==", "dev": true, "requires": { - "symbol-observable": "1.1.0" + "symbol-observable": "1.2.0" } }, "safe-buffer": { @@ -6999,6 +7935,7 @@ "anymatch": "1.3.2", "exec-sh": "0.2.1", "fb-watchman": "2.0.0", + "fsevents": "1.1.3", "minimatch": "3.0.4", "minimist": "1.2.0", "walker": "1.0.7", @@ -7020,9 +7957,9 @@ "dev": true }, "scroll": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/scroll/-/scroll-2.0.1.tgz", - "integrity": "sha1-tMfSfovPOuiligQvJyaK4/VfnM0=", + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/scroll/-/scroll-2.0.3.tgz", + "integrity": "sha512-3ncZzf8gUW739h3LeS68nSssO60O+GGjT3SxzgofQmT8PIoyHzebql9HHPJopZX8iT6TKOdwaWFMqL6LzUN3DQ==", "dev": true, "requires": { "rafl": "1.2.2" @@ -7305,10 +8242,39 @@ "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, + "supports-hyperlinks": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-1.0.1.tgz", + "integrity": "sha512-HHi5kVSefKaJkGYXbDuKbUGRVxqnWGn3J2e39CYcNJEfWciGq2zYtOhXLTlvrOZW1QU7VX67w7fMmWafHX9Pfw==", + "dev": true, + "requires": { + "has-flag": "2.0.0", + "supports-color": "5.2.0" + }, + "dependencies": { + "supports-color": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", + "dev": true, + "requires": { + "has-flag": "3.0.0" + }, + "dependencies": { + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + } + } + } + } + }, "symbol-observable": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.1.0.tgz", - "integrity": "sha512-dQoid9tqQ+uotGhuTKEY11X4xhyYePVnqGSoSm3OGKh2E8LZ6RPULp1uXTctk33IeERlrRJYoVSBglsL05F5Uw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", "dev": true }, "symbol-tree": { @@ -7318,19 +8284,30 @@ "dev": true }, "table": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", - "integrity": "sha512-UUkEAPdSGxtRpiV9ozJ5cMTtYiqz7Ni1OGqLXRCynrvzdtR1p+cfOWe2RJLwvUG8hNanaSRjecIqwOjqeatDsA==", + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz", + "integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==", "dev": true, "requires": { - "ajv": "5.5.2", - "ajv-keywords": "2.1.1", - "chalk": "2.3.0", + "ajv": "6.2.0", + "ajv-keywords": "3.1.0", + "chalk": "2.3.1", "lodash": "4.17.4", "slice-ansi": "1.0.0", "string-width": "2.1.1" }, "dependencies": { + "ajv": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.2.0.tgz", + "integrity": "sha1-r6wpW7qgFSRJ5SJ0LkVHwa6TKNI=", + "dev": true, + "requires": { + "fast-deep-equal": "1.0.0", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.3.1" + } + }, "ansi-styles": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", @@ -7341,23 +8318,29 @@ } }, "chalk": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.0.tgz", - "integrity": "sha512-Az5zJR2CBujap2rqXGaJKaPHyJ0IrUimvYNX+ncCy8PJP4ltOGTrHUIo097ZaL2zMeKYpiCdqDvS6zdrTFok3Q==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", + "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", "dev": true, "requires": { "ansi-styles": "3.2.0", "escape-string-regexp": "1.0.5", - "supports-color": "4.5.0" + "supports-color": "5.2.0" } }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, "supports-color": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-4.5.0.tgz", - "integrity": "sha1-vnoN5ITexcXN34s9WRJQRJEvY1s=", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", + "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", "dev": true, "requires": { - "has-flag": "2.0.0" + "has-flag": "3.0.0" } } } @@ -7399,7 +8382,7 @@ "brcast": "3.0.1", "is-function": "1.0.1", "is-plain-object": "2.0.4", - "prop-types": "15.6.0" + "prop-types": "15.6.1" } }, "throat": { @@ -7500,9 +8483,9 @@ "dev": true }, "typescript": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.1.tgz", - "integrity": "sha512-bqB1yS6o9TNA9ZC/MJxM0FZzPnZdtHj0xWK/IZ5khzVqdpGul/R/EIiHRgFXlwTD7PSIaYVnGKq1QgMCu2mnqw==", + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.2.tgz", + "integrity": "sha512-p5TCYZDAO0m4G344hD+wx/LATebLWZNkkh2asWUFqSsD2OrDNhbAHuSjobrmsUmdzjJjEeZVU9g1h3O6vpstnw==", "dev": true }, "ua-parser-js": { diff --git a/lib/package.json b/lib/package.json index 4858f0e6f..7a1327b30 100644 --- a/lib/package.json +++ b/lib/package.json @@ -1,11 +1,11 @@ { "name": "material-ui-pickers", - "version": "1.0.0-beta.15.1", + "version": "1.0.0-rc.1", "private": true, "description": "React components, that implements material design pickers for material-ui v1", "main": "build/dist/material-ui-pickers.cjs.js", "module": "build/dist/material-ui-pickers.es.js", - "types": "./src/index.d.ts", + "types": "src/index.d.ts", "keywords": [ "material-ui", "pickers", @@ -34,40 +34,46 @@ "peerDependencies": { "classnames": "^2.2.5", "material-ui": "^1.0.0-beta.33", - "moment": "^2.19.2", "prop-types": "^15.6.0", "react": "^16.2.0", "react-dom": "^16.2.0" }, + "externalDependencies": { + "moment": "^2.19.2", + "date-fns": "^2.0.0-alpha.7" + }, "dependencies": { - "moment-range": "^3.0.3", - "react-text-mask": "^5.0.2" + "react-text-mask": "^5.1.0" }, "scripts": { - "test": "jest && npm run typescript", + "test": "npm run test:moment && npm run test:date-fns", + "all-tests": "jest && npm run typescript", + "test:moment": "UTILS=moment && npm run all-tests", + "test:date-fns": "UTILS=date-fns && npm run all-tests", "typescript": "tsc -p tsconfig.json", "start": "cross-env NODE_ENV=development rollup --config --watch", "prebuild": "rimraf build", "build:copy": "node copy.js", "build:bundle": "cross-env NODE_ENV=production rollup --config", - "build:es2015": "cross-env NODE_ENV=production babel ./src --out-dir ./build/src", + "build:es2015": "cross-env NODE_ENV=production babel ./src --out-dir ./build", "build": "npm run build:bundle && npm run build:es2015 && npm run build:copy", "ci": "npm run test && npm run lint && npm run build", "prerelease": "npm run ci", "release": "np --no-publish --any-branch", "postrelease": "npm run build && npm publish build", "lint": "eslint ./src/**/*.js*", - "lint-fix": "npm run lint -- --fix" + "lint-fix": "npm run lint -- --fix", + "postinstall": "node -e \"console.log('\\u001b[35m\\u001b[1m Did not forget to install date-fns@next or moment?')\"" }, "devDependencies": { "@types/classnames": "^2.2.3", "@types/jss": "^9.3.0", "@types/moment": "^2.13.0", "@types/prop-types": "^15.5.2", - "@types/react": "^16.0.36", + "@types/react": "^16.0.39", "babel-cli": "^6.24.1", "babel-core": "^6.24.1", - "babel-eslint": "^8.0.1", + "babel-eslint": "^8.2.2", "babel-helpers": "^6.24.1", "babel-jest": "^21.2.0", "babel-plugin-external-helpers": "^6.22.0", @@ -79,28 +85,29 @@ "babel-preset-latest": "^6.24.1", "classnames": "^2.2.5", "cross-env": "^5.1.0", + "date-fns": "^2.0.0-alpha.7", "enzyme": "^3.3.0", "enzyme-adapter-react-16": "^1.1.0", - "eslint": "^4.17.0", + "eslint": "^4.18.1", "eslint-config-airbnb": "^16.0.0", - "eslint-plugin-import": "^2.7.0", + "eslint-plugin-import": "^2.9.0", "eslint-plugin-jsx-a11y": "^6.0.2", - "eslint-plugin-react": "^7.5.1", + "eslint-plugin-react": "^7.7.0", "fs-extra": "^4.0.2", "glob": "^7.1.2", "jest": "^21.2.1", - "material-ui": "^1.0.0-beta.33", + "material-ui": "^1.0.0-beta.35", "moment": "^2.19.2", - "np": "^2.19.0", - "prop-types": "^15.6.0", + "np": "^2.20.1", + "prop-types": "^15.6.1", "react": "^16.2.0", "react-dom": "^16.2.0", "rollup": "^0.51.8", "rollup-plugin-babel": "^3.0.2", - "rollup-plugin-commonjs": "^8.2.4", + "rollup-plugin-commonjs": "^8.3.0", "rollup-plugin-filesize": "^1.5.0", - "rollup-plugin-node-resolve": "^3.0.0", - "typescript": "^2.7.1" + "rollup-plugin-node-resolve": "^3.0.3", + "typescript": "^2.7.2" }, "jest": { "setupTestFrameworkScriptFile": "/__tests__/setup.js", diff --git a/lib/rollup.config.js b/lib/rollup.config.js index 237e04e7a..89ce5af41 100644 --- a/lib/rollup.config.js +++ b/lib/rollup.config.js @@ -6,6 +6,7 @@ import pkg from './package.json'; const externalDependencies = new RegExp(`^(${[ ...Object.keys(pkg.peerDependencies || {}), + ...Object.keys(pkg.externalDependencies || {}), ].join('|')})([/]|$)`); export default { diff --git a/lib/src/DatePicker/Calendar.d.ts b/lib/src/DatePicker/Calendar.d.ts index 7e0167ad6..1b5cc12e1 100644 --- a/lib/src/DatePicker/Calendar.d.ts +++ b/lib/src/DatePicker/Calendar.d.ts @@ -1,32 +1,32 @@ import { ComponentClass, ReactElement, ReactNode } from 'react'; import { IconButtonProps } from 'material-ui/IconButton'; import { DateType } from '../constants/prop-types'; -import { Utils } from '../utils/utils'; -import { Moment } from 'moment'; +import { Utils } from '../../typings/utils'; +import { MaterialUiPickersDate } from '../../typings/date' export type DayComponent = ReactElement; export type RenderDay = ( - day: Moment, - selectedDate: Moment, + day: MaterialUiPickersDate, + selectedDate: MaterialUiPickersDate, dayInCurrentMonth: boolean, dayComponent: DayComponent, ) => ReactNode; export interface CalendarProps { - date: Moment; + date: MaterialUiPickersDate; minDate?: DateType; maxDate?: DateType; - onChange: (date: Moment) => void; + onChange: (date: MaterialUiPickersDate) => void; disablePast?: boolean; disableFuture?: boolean; leftArrowIcon?: ReactNode; rightArrowIcon?: ReactNode; renderDay?: RenderDay; utils?: Utils; - shouldDisableDate?: (day: Moment) => boolean; + shouldDisableDate?: (day: MaterialUiPickersDate) => boolean; } declare const Calendar: ComponentClass; diff --git a/lib/src/DatePicker/Calendar.jsx b/lib/src/DatePicker/Calendar.jsx index 722f9ffa2..5071f8961 100644 --- a/lib/src/DatePicker/Calendar.jsx +++ b/lib/src/DatePicker/Calendar.jsx @@ -2,18 +2,13 @@ import React, { Component, Fragment } from 'react'; import PropTypes from 'prop-types'; import withStyles from 'material-ui/styles/withStyles'; -import Moment from 'moment'; -import { extendMoment } from 'moment-range'; import EventListener from 'react-event-listener'; import keycode from 'keycode'; import CalendarHeader from './CalendarHeader'; import DomainPropTypes from '../constants/prop-types'; -import * as defaultUtils from '../utils/utils'; import DayWrapper from './DayWrapper'; import Day from './Day'; - - -const moment = extendMoment(Moment); +import withUtils from '../_shared/WithUtils'; /* eslint-disable no-unused-expressions */ export class Calendar extends Component { @@ -30,8 +25,8 @@ export class Calendar extends Component { renderDay: PropTypes.func, /** @ignore */ theme: PropTypes.object.isRequired, - utils: PropTypes.object, shouldDisableDate: PropTypes.func, + utils: PropTypes.func.isRequired, }; static defaultProps = { @@ -42,7 +37,6 @@ export class Calendar extends Component { leftArrowIcon: undefined, rightArrowIcon: undefined, renderDay: undefined, - utils: defaultUtils, shouldDisableDate: () => false, }; @@ -57,13 +51,12 @@ export class Calendar extends Component { } onDateSelect = (day) => { - const { date } = this.props; - const updatedDate = day - .clone() - .hours(date.hours()) - .minutes(date.minutes()); + const { date, utils } = this.props; - this.props.onChange(updatedDate); + const withHours = utils.setHours(day, utils.getHours(date)); + const withMinutes = utils.setMinutes(withHours, utils.getMinutes(date)); + + this.props.onChange(withMinutes); }; handleChangeMonth = (newMonth) => { @@ -71,20 +64,22 @@ export class Calendar extends Component { }; validateMinMaxDate = (day) => { - const { minDate, maxDate } = this.props; - const startOfDay = date => moment(date).startOf('day'); + const { minDate, maxDate, utils } = this.props; return ( - (minDate && day.isBefore(startOfDay(minDate))) || - (maxDate && day.isAfter(startOfDay(maxDate))) + (minDate && utils.isBeforeDay(day, utils.date(minDate))) || + (maxDate && utils.isAfterDay(day, utils.date(maxDate))) ); }; shouldDisableDate = (day) => { - const { disablePast, disableFuture, shouldDisableDate } = this.props; + const { + disablePast, disableFuture, shouldDisableDate, utils, + } = this.props; + return ( - (disableFuture && day.isAfter(moment(), 'day')) || - (disablePast && day.isBefore(moment(), 'day')) || + (disableFuture && utils.isAfterDay(day, utils.date())) || + (disablePast && utils.isBeforeDay(day, utils.date())) || this.validateMinMaxDate(day) || shouldDisableDate(day) ); @@ -97,24 +92,24 @@ export class Calendar extends Component { } handleKeyDown = (event) => { - const { theme, date } = this.props; + const { theme, date, utils } = this.props; switch (keycode(event)) { case 'up': - this.moveToDay(date.clone().subtract(7, 'days')); + this.moveToDay(utils.addDays(date, -7)); break; case 'down': - this.moveToDay(date.clone().add(7, 'days')); + this.moveToDay(utils.addDays(date, 7)); break; case 'left': theme.direction === 'ltr' - ? this.moveToDay(date.clone().subtract(1, 'day')) - : this.moveToDay(date.clone().add(1, 'day')); + ? this.moveToDay(utils.addDays(date, -1)) + : this.moveToDay(utils.addDays(date, 1)); break; case 'right': theme.direction === 'ltr' - ? this.moveToDay(date.clone().add(1, 'day')) - : this.moveToDay(date.clone().subtract(1, 'day')); + ? this.moveToDay(utils.addDays(date, 1)) + : this.moveToDay(utils.addDays(date, -1)); break; default: // if keycode is not handled, stop execution @@ -138,27 +133,25 @@ export class Calendar extends Component { {this.renderDays(week)} )); - }; - + } renderDays = (week) => { const { date, renderDay, utils } = this.props; - const selectedDate = date.clone().startOf('day'); - const currentMonthNumber = utils.getMonthNumber(this.state.currentMonth); - const now = moment(); + const selectedDate = utils.startOfDay(date); + const currentMonthNumber = utils.getMonth(this.state.currentMonth); + const now = utils.date(); return week.map((day) => { const disabled = this.shouldDisableDate(day); - const dayInCurrentMonth = - utils.getMonthNumber(day) === currentMonthNumber; + const dayInCurrentMonth = utils.getMonth(day) === currentMonthNumber; let dayComponent = ( @@ -223,4 +216,4 @@ const styles = theme => ({ export default withStyles(styles, { name: 'MuiPickersCalendar', withTheme: true, -})(Calendar); +})(withUtils()(Calendar)); diff --git a/lib/src/DatePicker/CalendarHeader.d.ts b/lib/src/DatePicker/CalendarHeader.d.ts index 0e6fe1eb1..038b2396b 100644 --- a/lib/src/DatePicker/CalendarHeader.d.ts +++ b/lib/src/DatePicker/CalendarHeader.d.ts @@ -1,10 +1,10 @@ import { ComponentClass, ReactNode } from 'react'; -import { Utils } from '../utils/utils'; -import { Moment } from 'moment'; +import { Utils } from '../../typings/utils'; +import { MaterialUiPickersDate } from '../../typings/date' export interface CalendarHeaderProps { currentMonth: object; - onMonthChange: (date: Moment) => void; + onMonthChange: (date: MaterialUiPickersDate) => void; leftArrowIcon?: ReactNode; rightArrowIcon?: ReactNode; utils?: Utils; diff --git a/lib/src/DatePicker/CalendarHeader.jsx b/lib/src/DatePicker/CalendarHeader.jsx index aca240e44..f17e372a0 100644 --- a/lib/src/DatePicker/CalendarHeader.jsx +++ b/lib/src/DatePicker/CalendarHeader.jsx @@ -4,7 +4,7 @@ import withStyles from 'material-ui/styles/withStyles'; import Typography from 'material-ui/Typography'; import IconButton from 'material-ui/IconButton'; import Icon from 'material-ui/Icon'; -import * as defaultUtils from '../utils/utils'; +import withUtils from '../_shared/WithUtils'; export const CalendarHeader = (props) => { const { @@ -61,13 +61,12 @@ CalendarHeader.propTypes = { theme: PropTypes.object.isRequired, leftArrowIcon: PropTypes.node, rightArrowIcon: PropTypes.node, - utils: PropTypes.object, + utils: PropTypes.func.isRequired, }; CalendarHeader.defaultProps = { leftArrowIcon: 'keyboard_arrow_left', rightArrowIcon: 'keyboard_arrow_right', - utils: defaultUtils, }; const styles = theme => ({ @@ -93,4 +92,4 @@ const styles = theme => ({ export default withStyles( styles, { withTheme: true, name: 'MuiPickersCalendarHeader' }, -)(CalendarHeader); +)(withUtils()(CalendarHeader)); diff --git a/lib/src/DatePicker/DatePicker.d.ts b/lib/src/DatePicker/DatePicker.d.ts index 5dcfd2d0e..1f1dcab80 100644 --- a/lib/src/DatePicker/DatePicker.d.ts +++ b/lib/src/DatePicker/DatePicker.d.ts @@ -1,14 +1,14 @@ import { ComponentClass, ReactNode } from 'react'; import { DateType } from '../constants/prop-types'; -import { Utils } from '../utils/utils'; +import { Utils } from '../../typings/utils'; import { RenderDay } from './Calendar'; -import { Moment } from 'moment'; +import { MaterialUiPickersDate } from '../../typings/date' export interface DatePickerProps { - date: Moment; + date: MaterialUiPickersDate; minDate?: DateType; maxDate?: DateType; - onChange: (date: Moment, isFinished?: boolean) => void; + onChange: (date: MaterialUiPickersDate, isFinished?: boolean) => void; disablePast?: boolean; disableFuture?: boolean; animateYearScrolling?: boolean; @@ -17,7 +17,7 @@ export interface DatePickerProps { rightArrowIcon?: ReactNode; renderDay?: RenderDay; utils?: Utils; - shouldDisableDate?: (day: Moment) => boolean; + shouldDisableDate?: (day: MaterialUiPickersDate) => boolean; } declare const DatePicker: ComponentClass; diff --git a/lib/src/DatePicker/DatePicker.jsx b/lib/src/DatePicker/DatePicker.jsx index d2c389aaf..2f0870236 100644 --- a/lib/src/DatePicker/DatePicker.jsx +++ b/lib/src/DatePicker/DatePicker.jsx @@ -1,13 +1,12 @@ import React, { PureComponent, Fragment } from 'react'; import PropTypes from 'prop-types'; -import moment from 'moment'; import Calendar from './Calendar'; import YearSelection from './YearSelection'; import PickerToolbar from '../_shared/PickerToolbar'; import ToolbarButton from '../_shared/ToolbarButton'; -import * as defaultUtils from '../utils/utils'; import DomainPropTypes from '../constants/prop-types'; +import withUtils from '../_shared/WithUtils'; export class DatePicker extends PureComponent { static propTypes = { @@ -23,7 +22,7 @@ export class DatePicker extends PureComponent { leftArrowIcon: PropTypes.node, rightArrowIcon: PropTypes.node, renderDay: PropTypes.func, - utils: PropTypes.object, + utils: PropTypes.func.isRequired, shouldDisableDate: PropTypes.func, } @@ -38,7 +37,6 @@ export class DatePicker extends PureComponent { leftArrowIcon: undefined, rightArrowIcon: undefined, renderDay: undefined, - utils: defaultUtils, shouldDisableDate: undefined, } @@ -47,15 +45,15 @@ export class DatePicker extends PureComponent { } get date() { - return this.props.date.startOf('day'); + return this.props.utils.startOfDay(this.props.date); } get minDate() { - return moment(this.props.minDate); + return this.props.utils.date(this.props.minDate); } get maxDate() { - return moment(this.props.maxDate); + return this.props.utils.date(this.props.maxDate); } handleYearSelect = (date) => { @@ -138,5 +136,5 @@ export class DatePicker extends PureComponent { } } -export default DatePicker; +export default withUtils()(DatePicker); diff --git a/lib/src/DatePicker/Year.jsx b/lib/src/DatePicker/Year.jsx index 4e0ccf271..a74246bec 100644 --- a/lib/src/DatePicker/Year.jsx +++ b/lib/src/DatePicker/Year.jsx @@ -4,7 +4,7 @@ import classnames from 'classnames'; import withStyles from 'material-ui/styles/withStyles'; import Typography from 'material-ui/Typography'; -class Year extends PureComponent { +export class Year extends PureComponent { static propTypes = { children: PropTypes.node.isRequired, classes: PropTypes.object.isRequired, diff --git a/lib/src/DatePicker/YearSelection.d.ts b/lib/src/DatePicker/YearSelection.d.ts index 34ff84b40..c9c76466c 100644 --- a/lib/src/DatePicker/YearSelection.d.ts +++ b/lib/src/DatePicker/YearSelection.d.ts @@ -1,13 +1,13 @@ import { ComponentClass, ReactNode } from 'react'; import { DateType } from '../constants/prop-types'; -import { Utils } from '../utils/utils'; -import { Moment } from 'moment'; +import { Utils } from '../../typings/utils'; +import { MaterialUiPickersDate } from '../../typings/date' export interface YearSelectionProps { - date: Moment; + date: MaterialUiPickersDate; minDate?: DateType; maxDate?: DateType; - onChange: (date: Moment) => void; + onChange: (date: MaterialUiPickersDate) => void; disablePast?: boolean; disableFuture?: boolean; animateYearScrolling?: boolean; diff --git a/lib/src/DatePicker/YearSelection.jsx b/lib/src/DatePicker/YearSelection.jsx index c42f3c0ee..bd5737a17 100644 --- a/lib/src/DatePicker/YearSelection.jsx +++ b/lib/src/DatePicker/YearSelection.jsx @@ -1,15 +1,11 @@ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { findDOMNode } from 'react-dom'; -import Moment from 'moment'; -import { extendMoment } from 'moment-range'; import withStyles from 'material-ui/styles/withStyles'; import DomainPropTypes from '../constants/prop-types'; -import * as defaultUtils from '../utils/utils'; +import withUtils from '../_shared/WithUtils'; import Year from './Year'; -const moment = extendMoment(Moment); - export class YearSelection extends PureComponent { static propTypes = { date: PropTypes.shape({}).isRequired, @@ -20,12 +16,11 @@ export class YearSelection extends PureComponent { disablePast: PropTypes.bool.isRequired, disableFuture: PropTypes.bool.isRequired, animateYearScrolling: PropTypes.bool, - utils: PropTypes.object, + utils: PropTypes.func.isRequired, } static defaultProps = { animateYearScrolling: false, - utils: defaultUtils, } componentDidMount = () => { @@ -65,7 +60,7 @@ export class YearSelection extends PureComponent { return (
{ - Array.from(moment.range(minDate, maxDate).by('year')) + utils.getYearRange(minDate, maxDate) .map((year) => { const yearNumber = utils.getYear(year); const selected = yearNumber === currentYear; @@ -74,8 +69,8 @@ export class YearSelection extends PureComponent { boolean; + shouldDisableDate?: (day: MaterialUiPickersDate) => boolean; } declare const DatePickerWrapper: ComponentClass; diff --git a/lib/src/DatePicker/DatePickerWrapper.jsx b/lib/src/DatePicker/index.jsx similarity index 92% rename from lib/src/DatePicker/DatePickerWrapper.jsx rename to lib/src/DatePicker/index.jsx index 44af8980c..50ac898af 100644 --- a/lib/src/DatePicker/DatePickerWrapper.jsx +++ b/lib/src/DatePicker/index.jsx @@ -5,9 +5,9 @@ import ModalWrapper from '../wrappers/ModalWrapper'; import DatePicker from './DatePicker'; import DomainPropTypes from '../constants/prop-types'; import PickerBase from '../_shared/PickerBase'; -import * as defaultUtils from '../utils/utils'; +import withUtils from '../_shared/WithUtils'; -export default class DatePickerWrapper extends PickerBase { +export class DatePickerWrapper extends PickerBase { static propTypes = { /* Datepicker value */ value: DomainPropTypes.date, @@ -29,8 +29,6 @@ export default class DatePickerWrapper extends PickerBase { animateYearScrolling: PropTypes.bool, /* Open datepicker from year selection */ openToYearSelection: PropTypes.bool, - /* Return moment object in onChange event */ - returnMoment: PropTypes.bool, /* Displayed string if date can`t be parsed (or null) */ invalidLabel: PropTypes.string, /* Allow to specify dynamic label for text field labelFunc(date, invalidLabel) */ @@ -42,7 +40,7 @@ export default class DatePickerWrapper extends PickerBase { /* Custom renderer for day renderDay(date, selectedDate, dayInCurrentMonth) */ renderDay: PropTypes.func, /* Date displaying utils */ - utils: PropTypes.object, + utils: PropTypes.func.isRequired, /* Disable specific date hook */ shouldDisableDate: PropTypes.func, } @@ -51,7 +49,6 @@ export default class DatePickerWrapper extends PickerBase { value: new Date(), format: 'MMMM Do', autoOk: false, - returnMoment: true, minDate: undefined, maxDate: undefined, disablePast: undefined, @@ -63,7 +60,6 @@ export default class DatePickerWrapper extends PickerBase { rightArrowIcon: undefined, renderDay: undefined, labelFunc: undefined, - utils: defaultUtils, shouldDisableDate: undefined, } @@ -76,7 +72,6 @@ export default class DatePickerWrapper extends PickerBase { onChange, animateYearScrolling, openToYearSelection, - returnMoment, invalidLabel, leftArrowIcon, rightArrowIcon, @@ -131,3 +126,6 @@ export default class DatePickerWrapper extends PickerBase { ); } } + +export default withUtils()(DatePickerWrapper); + diff --git a/lib/src/DateTimePicker/DateTimePicker.d.ts b/lib/src/DateTimePicker/DateTimePicker.d.ts index 034e879bc..2c1aa406e 100644 --- a/lib/src/DateTimePicker/DateTimePicker.d.ts +++ b/lib/src/DateTimePicker/DateTimePicker.d.ts @@ -1,15 +1,15 @@ import { ComponentClass, ReactNode } from 'react'; import { DateTimePickerView } from '../constants/date-picker-view'; import { DateType } from '../constants/prop-types'; -import { Utils } from '../utils/utils'; +import { Utils } from '../../typings/utils'; import { RenderDay } from '../DatePicker/Calendar'; -import { Moment } from 'moment'; +import { MaterialUiPickersDate } from '../../typings/date' export interface DateTimePickerProps { - date: Moment; + date: MaterialUiPickersDate; minDate?: DateType; maxDate?: DateType; - onChange: (date: Moment, isFinished: boolean, viewType?: DateTimePickerView) => void; + onChange: (date: MaterialUiPickersDate, isFinished: boolean, viewType?: DateTimePickerView) => void; disablePast?: boolean; disableFuture?: boolean; autoSubmit?: boolean; @@ -23,7 +23,7 @@ export interface DateTimePickerProps { timeIcon?: ReactNode; renderDay?: RenderDay; utils?: Utils; - shouldDisableDate?: (day: Moment) => boolean; + shouldDisableDate?: (day: MaterialUiPickersDate) => boolean; } declare const DateTimePicker: ComponentClass; diff --git a/lib/src/DateTimePicker/DateTimePicker.jsx b/lib/src/DateTimePicker/DateTimePicker.jsx index dfefef36d..9a0bb6f3f 100644 --- a/lib/src/DateTimePicker/DateTimePicker.jsx +++ b/lib/src/DateTimePicker/DateTimePicker.jsx @@ -8,11 +8,11 @@ import HourView from '../TimePicker/HourView'; import MinutesView from '../TimePicker/MinutesView'; import DateTimePickerTabs from './DateTimePickerTabs'; import DatetimePickerHeader from './DateTimePickerHeader'; -import { convertToMeridiem } from '../utils/time-utils'; +import { convertToMeridiem } from '../_helpers/time-utils'; import DomainPropTypes from '../constants/prop-types'; import * as viewType from '../constants/date-picker-view'; -import * as defaultUtils from '../utils/utils'; +import withUtils from '../_shared/WithUtils'; export class DateTimePicker extends Component { static propTypes = { @@ -30,7 +30,7 @@ export class DateTimePicker extends Component { dateRangeIcon: PropTypes.node, timeIcon: PropTypes.node, renderDay: PropTypes.func, - utils: PropTypes.object, + utils: PropTypes.func.isRequired, ampm: PropTypes.bool, shouldDisableDate: PropTypes.func, animateYearScrolling: PropTypes.bool, @@ -49,7 +49,6 @@ export class DateTimePicker extends Component { dateRangeIcon: undefined, timeIcon: undefined, renderDay: undefined, - utils: defaultUtils, ampm: true, shouldDisableDate: undefined, animateYearScrolling: false, @@ -57,7 +56,7 @@ export class DateTimePicker extends Component { state = { openView: this.props.openTo, - meridiemMode: this.props.date.hours() >= 12 ? 'pm' : 'am', + meridiemMode: this.props.utils.getHours(this.props.date) >= 12 ? 'pm' : 'am', } onChange = (time, isFinish = true, nextView) => { @@ -80,7 +79,12 @@ export class DateTimePicker extends Component { } handleChange = (time, isFinish = false) => { - const withMeridiem = convertToMeridiem(time, this.state.meridiemMode, this.props.ampm); + const withMeridiem = convertToMeridiem( + time, + this.state.meridiemMode, + this.props.ampm, + this.props.utils, + ); this.props.onChange(withMeridiem, isFinish); } @@ -189,4 +193,4 @@ export class DateTimePicker extends Component { } } -export default DateTimePicker; +export default withUtils()(DateTimePicker); diff --git a/lib/src/DateTimePicker/DateTimePickerHeader.d.ts b/lib/src/DateTimePicker/DateTimePickerHeader.d.ts index d12c876dc..3583a9406 100644 --- a/lib/src/DateTimePicker/DateTimePickerHeader.d.ts +++ b/lib/src/DateTimePicker/DateTimePickerHeader.d.ts @@ -1,12 +1,12 @@ import { ComponentClass } from 'react'; import { DateTimePickerView } from '../constants/date-picker-view'; -import { Utils } from '../utils/utils'; -import { Moment } from 'moment'; +import { Utils } from '../../typings/utils'; +import { MaterialUiPickersDate } from '../../typings/date' type MeridiemMode = 'am' | 'pm'; export interface DateTimePickerHeaderProps { - date: Moment; + date: MaterialUiPickersDate; meridiemMode: MeridiemMode; openView: DateTimePickerView; onOpenViewChange: (view: DateTimePickerView) => void; diff --git a/lib/src/DateTimePicker/DateTimePickerHeader.jsx b/lib/src/DateTimePicker/DateTimePickerHeader.jsx index 14fad49ca..f4dc09dfb 100644 --- a/lib/src/DateTimePicker/DateTimePickerHeader.jsx +++ b/lib/src/DateTimePicker/DateTimePickerHeader.jsx @@ -3,8 +3,8 @@ import PropTypes from 'prop-types'; import withStyles from 'material-ui/styles/withStyles'; import PickerToolbar from '../_shared/PickerToolbar'; import ToolbarButton from '../_shared/ToolbarButton'; +import withUtils from '../_shared/WithUtils'; import * as viewType from '../constants/date-picker-view'; -import * as defaultUtils from '../utils/utils'; export const DateTimePickerHeader = (props) => { const { @@ -15,7 +15,7 @@ export const DateTimePickerHeader = (props) => { const changeOpenView = view => () => onOpenViewChange(view); const rtl = theme.direction === 'rtl'; - const hourMinuteClassname = rtl + const hourMinuteClassName = rtl ? classes.hourMinuteLabelReverse : classes.hourMinuteLabel; @@ -38,7 +38,7 @@ export const DateTimePickerHeader = (props) => {
-
+
({ alignItems: 'center', paddingLeft: 16, paddingRight: 16, + justifyContent: 'space-around', }, separator: { margin: '0 4px 0 2px', @@ -132,7 +132,6 @@ const styles = () => ({ flexDirection: 'row-reverse', }, dateHeader: { - width: '42%', height: 65, }, timeHeader: { @@ -143,4 +142,4 @@ const styles = () => ({ }, }); -export default withStyles(styles, { withTheme: true })(DateTimePickerHeader); +export default withStyles(styles, { withTheme: true })(withUtils()(DateTimePickerHeader)); diff --git a/lib/src/DateTimePicker/DateTimePickerWrapper.d.ts b/lib/src/DateTimePicker/index.d.ts similarity index 85% rename from lib/src/DateTimePicker/DateTimePickerWrapper.d.ts rename to lib/src/DateTimePicker/index.d.ts index 36d669df1..53f201f62 100644 --- a/lib/src/DateTimePicker/DateTimePickerWrapper.d.ts +++ b/lib/src/DateTimePicker/index.d.ts @@ -1,10 +1,10 @@ import { ComponentClass, ReactNode } from 'react'; import { DateTimePickerView } from '../constants/date-picker-view'; import { DateType } from '../constants/prop-types'; -import { Utils } from '../utils/utils'; +import { Utils } from '../../typings/utils'; import { RenderDay } from '../DatePicker/Calendar'; import { ModalWrapperProps } from '../wrappers/ModalWrapper'; -import { Moment } from 'moment'; +import { MaterialUiPickersDate } from '../../typings/date' import { PickerBaseProps } from '../_shared/PickerBase' import { Omit } from 'material-ui' @@ -24,7 +24,7 @@ export interface DateTimePickerWrapperProps extends PickerBaseProps, timeIcon?: ReactNode; renderDay?: RenderDay; utils?: Utils; - shouldDisableDate?: (day: Moment) => boolean; + shouldDisableDate?: (day: MaterialUiPickersDate) => boolean; } declare const DateTimePickerWrapper: ComponentClass; diff --git a/lib/src/DateTimePicker/DateTimePickerWrapper.jsx b/lib/src/DateTimePicker/index.jsx similarity index 94% rename from lib/src/DateTimePicker/DateTimePickerWrapper.jsx rename to lib/src/DateTimePicker/index.jsx index 4e3deb9eb..41c665524 100644 --- a/lib/src/DateTimePicker/DateTimePickerWrapper.jsx +++ b/lib/src/DateTimePicker/index.jsx @@ -7,7 +7,7 @@ import DomainPropTypes from '../constants/prop-types'; import ModalWrapper from '../wrappers/ModalWrapper'; import DateTimePicker from './DateTimePicker'; import PickerBase from '../_shared/PickerBase'; -import * as defaultUtils from '../utils/utils'; +import withUtils from '../_shared/WithUtils'; export class DateTimePickerWrapper extends PickerBase { static propTypes = { @@ -22,7 +22,6 @@ export class DateTimePickerWrapper extends PickerBase { minDate: DomainPropTypes.date, maxDate: DomainPropTypes.date, showTabs: PropTypes.bool, - returnMoment: PropTypes.bool, invalidLabel: PropTypes.string, leftArrowIcon: PropTypes.node, rightArrowIcon: PropTypes.node, @@ -30,7 +29,7 @@ export class DateTimePickerWrapper extends PickerBase { timeIcon: PropTypes.node, renderDay: PropTypes.func, labelFunc: PropTypes.func, - utils: PropTypes.object, + utils: PropTypes.func.isRequired, ampm: PropTypes.bool, shouldDisableDate: PropTypes.func, animateYearScrolling: PropTypes.bool, @@ -46,7 +45,6 @@ export class DateTimePickerWrapper extends PickerBase { minDate: undefined, maxDate: undefined, showTabs: true, - returnMoment: true, invalidLabel: undefined, leftArrowIcon: undefined, rightArrowIcon: undefined, @@ -54,7 +52,6 @@ export class DateTimePickerWrapper extends PickerBase { timeIcon: undefined, renderDay: undefined, labelFunc: undefined, - utils: defaultUtils, ampm: true, shouldDisableDate: undefined, animateYearScrolling: false, @@ -77,7 +74,6 @@ export class DateTimePickerWrapper extends PickerBase { autoSubmit, disablePast, disableFuture, - returnMoment, invalidLabel, leftArrowIcon, rightArrowIcon, @@ -141,5 +137,5 @@ const styles = { }, }; -export default withStyles(styles, { name: 'MuiPickerDTPickerModal' })(DateTimePickerWrapper); +export default withStyles(styles, { name: 'MuiPickerDTPickerModal' })(withUtils()(DateTimePickerWrapper)); diff --git a/lib/src/TimePicker/Clock.jsx b/lib/src/TimePicker/Clock.jsx index 0d7d4066b..945139557 100644 --- a/lib/src/TimePicker/Clock.jsx +++ b/lib/src/TimePicker/Clock.jsx @@ -4,7 +4,7 @@ import withStyles from 'material-ui/styles/withStyles'; import ClockPointer from './ClockPointer'; import * as clockType from '../constants/clock-types'; -import { getMinutes, getHours } from '../utils/time-utils'; +import { getMinutes, getHours } from '../_helpers/time-utils'; export class Clock extends Component { static propTypes = { diff --git a/lib/src/TimePicker/HourView.d.ts b/lib/src/TimePicker/HourView.d.ts index f3f570652..884197f18 100644 --- a/lib/src/TimePicker/HourView.d.ts +++ b/lib/src/TimePicker/HourView.d.ts @@ -1,10 +1,10 @@ import { ComponentClass } from 'react'; -import { Utils } from '../utils/utils'; -import { Moment } from 'moment'; +import { Utils } from '../../typings/utils'; +import { MaterialUiPickersDate } from '../../typings/date' export interface HourViewProps { - date: Moment; - onChange: (date: Moment, isFinished?: boolean) => void; + date: MaterialUiPickersDate; + onChange: (date: MaterialUiPickersDate, isFinished?: boolean) => void; ampm?: boolean; utils?: Utils; } diff --git a/lib/src/TimePicker/HourView.jsx b/lib/src/TimePicker/HourView.jsx index 59cbd6ad2..c280f7138 100644 --- a/lib/src/TimePicker/HourView.jsx +++ b/lib/src/TimePicker/HourView.jsx @@ -3,26 +3,23 @@ import PropTypes from 'prop-types'; import Clock from './Clock'; import { HOURS } from '../constants/clock-types'; import ClockNumber from './ClockNumber'; -import * as defaultUtils from '../utils/utils'; +import withUtils from '../_shared/WithUtils'; - -export default class HourView extends PureComponent { +export class HourView extends PureComponent { static propTypes = { date: PropTypes.object.isRequired, onChange: PropTypes.func.isRequired, - utils: PropTypes.object, + utils: PropTypes.func.isRequired, ampm: PropTypes.bool, } static defaultProps = { - utils: defaultUtils, ampm: true, } - getHourNumbers = () => { const { ampm, utils, date } = this.props; - const currentHours = date.get('hours'); + const currentHours = utils.getHours(date); const hourNumbers = []; const startHour = ampm ? 1 : 0; @@ -40,7 +37,6 @@ export default class HourView extends PureComponent { return currentHours === hour; }; - for (let hour = startHour; hour <= endHour; hour += 1) { let label = hour.toString(); @@ -62,14 +58,15 @@ export default class HourView extends PureComponent { } handleChange = (hours, isFinish) => { - const updatedTime = this.props.date.clone().hour(hours); + const { date, utils } = this.props; + const updatedTime = utils.setHours(date, hours); this.props.onChange(updatedTime, isFinish); } render() { - const { date, ampm } = this.props; - const value = date.get('hours'); + const { date, ampm, utils } = this.props; + const value = utils.getHours(date); return ( void; + date: MaterialUiPickersDate; + onChange: (date: MaterialUiPickersDate, isFinished?: boolean) => void; utils?: Utils; } diff --git a/lib/src/TimePicker/MinutesView.jsx b/lib/src/TimePicker/MinutesView.jsx index 6b066fb25..2b280fefd 100644 --- a/lib/src/TimePicker/MinutesView.jsx +++ b/lib/src/TimePicker/MinutesView.jsx @@ -3,21 +3,21 @@ import PropTypes from 'prop-types'; import Clock from './Clock'; import { MINUTES } from '../constants/clock-types'; import ClockNumber from './ClockNumber'; -import * as defaultUtils from '../utils/utils'; +import withUtils from '../_shared/WithUtils'; -export default class MinutesView extends Component { +export class MinutesView extends Component { static propTypes = { date: PropTypes.object.isRequired, onChange: PropTypes.func.isRequired, - utils: PropTypes.object, + utils: PropTypes.func.isRequired, } static defaultProps = { - utils: defaultUtils, } handleChange = (minutes, isFinish) => { - const updatedDate = this.props.date.clone().minutes(minutes); + const { date, utils } = this.props; + const updatedDate = utils.setMinutes(date, minutes); this.props.onChange(updatedDate, isFinish); } @@ -25,7 +25,7 @@ export default class MinutesView extends Component { const { date, utils } = this.props; const f = utils.formatNumber; - const value = date.get('minutes'); + const value = utils.getMinutes(date); return ( void; + date: MaterialUiPickersDate; + onChange: (date: MaterialUiPickersDate, isFinished?: boolean) => void; ampm?: boolean; utils?: Utils; } diff --git a/lib/src/TimePicker/TimePicker.jsx b/lib/src/TimePicker/TimePicker.jsx index 07fb52126..eb44b51de 100644 --- a/lib/src/TimePicker/TimePicker.jsx +++ b/lib/src/TimePicker/TimePicker.jsx @@ -5,8 +5,8 @@ import PickerToolbar from '../_shared/PickerToolbar'; import ToolbarButton from '../_shared/ToolbarButton'; import HourView from './HourView'; import MinutesView from './MinutesView'; -import { convertToMeridiem } from '../utils/time-utils'; -import * as defaultUtils from '../utils/utils'; +import { convertToMeridiem } from '../_helpers/time-utils'; +import withUtils from '../_shared/WithUtils'; export class TimePicker extends Component { static propTypes = { @@ -15,19 +15,18 @@ export class TimePicker extends Component { classes: PropTypes.object.isRequired, theme: PropTypes.object.isRequired, children: PropTypes.node, - utils: PropTypes.object, + utils: PropTypes.func.isRequired, ampm: PropTypes.bool, } static defaultProps = { children: null, - utils: defaultUtils, ampm: true, } state = { isHourViewShown: true, - meridiemMode: this.props.date.hours() >= 12 ? 'pm' : 'am', + meridiemMode: this.props.utils.getHours(this.props.date) >= 12 ? 'pm' : 'am', } setMeridiemMode = mode => () => { @@ -38,7 +37,12 @@ export class TimePicker extends Component { } handleChange(time, isFinish, openMinutes) { - const withMeridiem = convertToMeridiem(time, this.state.meridiemMode, this.props.ampm); + const withMeridiem = convertToMeridiem( + time, + this.state.meridiemMode, + this.props.ampm, + this.props.utils, + ); if (isFinish) { if (!openMinutes) { @@ -186,4 +190,4 @@ const styles = () => ({ export default withStyles( styles, { withTheme: true, name: 'MuiPickersTimePicker' }, -)(TimePicker); +)(withUtils()(TimePicker)); diff --git a/lib/src/TimePicker/TimePickerWrapper.d.ts b/lib/src/TimePicker/index.d.ts similarity index 90% rename from lib/src/TimePicker/TimePickerWrapper.d.ts rename to lib/src/TimePicker/index.d.ts index 1e93b6edd..a2b9071d4 100644 --- a/lib/src/TimePicker/TimePickerWrapper.d.ts +++ b/lib/src/TimePicker/index.d.ts @@ -1,5 +1,5 @@ import { ComponentClass } from 'react'; -import { Utils } from '../utils/utils'; +import { Utils } from '../../typings/utils'; import { ModalWrapperProps } from '../wrappers/ModalWrapper'; import { PickerBaseProps } from '../_shared/PickerBase' import { Omit } from 'material-ui' diff --git a/lib/src/TimePicker/TimePickerWrapper.jsx b/lib/src/TimePicker/index.jsx similarity index 80% rename from lib/src/TimePicker/TimePickerWrapper.jsx rename to lib/src/TimePicker/index.jsx index 6e91555d1..0957cfbc4 100644 --- a/lib/src/TimePicker/TimePickerWrapper.jsx +++ b/lib/src/TimePicker/index.jsx @@ -4,9 +4,9 @@ import PropTypes from 'prop-types'; import ModalWrapper from '../wrappers/ModalWrapper'; import TimePicker from './TimePicker'; import PickerBase from '../_shared/PickerBase'; -import * as defaultUtils from '../utils/utils'; +import withUtils from '../_shared/WithUtils'; -export default class TimePickerWrapper extends PickerBase { +export class TimePickerWrapper extends PickerBase { static propTypes = { value: PropTypes.oneOfType([ PropTypes.object, @@ -17,9 +17,8 @@ export default class TimePickerWrapper extends PickerBase { format: PropTypes.string, onChange: PropTypes.func.isRequired, autoOk: PropTypes.bool, - returnMoment: PropTypes.bool, invalidLabel: PropTypes.string, - utils: PropTypes.object, + utils: PropTypes.func.isRequired, ampm: PropTypes.bool, } @@ -27,9 +26,7 @@ export default class TimePickerWrapper extends PickerBase { value: new Date(), format: undefined, autoOk: false, - returnMoment: true, invalidLabel: undefined, - utils: defaultUtils, ampm: true, } @@ -39,8 +36,7 @@ export default class TimePickerWrapper extends PickerBase { render() { const { date } = this.state; const { - value, format, autoOk, onChange, returnMoment, invalidLabel, - utils, ampm, ...other + value, format, autoOk, onChange, invalidLabel, utils, ampm, ...other } = this.props; return ( @@ -65,3 +61,6 @@ export default class TimePickerWrapper extends PickerBase { ); } } + +export default withUtils()(TimePickerWrapper); + diff --git a/lib/src/utils/time-utils.js b/lib/src/_helpers/time-utils.js similarity index 83% rename from lib/src/utils/time-utils.js rename to lib/src/_helpers/time-utils.js index 4dedf4552..affd5f17b 100644 --- a/lib/src/utils/time-utils.js +++ b/lib/src/_helpers/time-utils.js @@ -54,15 +54,15 @@ export const getMinutes = (offsetX, offsetY, step = 6) => { return value; }; -export const convertToMeridiem = (time, meridiem, ampm) => { +export const convertToMeridiem = (time, meridiem, ampm, utils) => { if (ampm) { - const currentMeridiem = time.hours() >= 12 ? 'pm' : 'am'; + const currentMeridiem = utils.getHours(time) >= 12 ? 'pm' : 'am'; if (currentMeridiem !== meridiem) { const hours = meridiem === 'am' - ? time.hours() - 12 - : time.hours() + 12; + ? utils.getHours(time) - 12 + : utils.getHours(time) + 12; - return time.clone().hours(hours); + return utils.setHours(time, hours); } } diff --git a/lib/src/_shared/DateTextField.jsx b/lib/src/_shared/DateTextField.jsx index 2823907d4..d0a9aaf24 100644 --- a/lib/src/_shared/DateTextField.jsx +++ b/lib/src/_shared/DateTextField.jsx @@ -1,7 +1,6 @@ /* eslint-disable react/sort-comp */ import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import moment from 'moment'; import Icon from 'material-ui/Icon'; import InputAdornment from 'material-ui/Input/InputAdornment'; import TextField from 'material-ui/TextField'; @@ -10,8 +9,9 @@ import withStyles from 'material-ui/styles/withStyles'; import DomainPropTypes from '../constants/prop-types'; import MaskedInput from './MaskedInput'; +import withUtils from '../_shared/WithUtils'; -class DateTextField extends PureComponent { +export class DateTextField extends PureComponent { static propTypes = { classes: PropTypes.shape({}).isRequired, value: PropTypes.oneOfType([ @@ -41,6 +41,9 @@ class DateTextField extends PureComponent { invalidDateMessage: PropTypes.string, clearable: PropTypes.bool, TextFieldComponent: PropTypes.oneOfType([PropTypes.string, PropTypes.func]), + utils: PropTypes.func.isRequired, + InputAdornmentProps: PropTypes.object, + adornmentPosition: PropTypes.oneOf(['start', 'end']), } static defaultProps = { @@ -64,15 +67,17 @@ class DateTextField extends PureComponent { minDateMessage: 'Date should not be before minimal date', maxDateMessage: 'Date should not be after maximal date', TextFieldComponent: TextField, + InputAdornmentProps: {}, + adornmentPosition: 'end', } getDisplayDate = (props) => { const { - value, format, invalidLabel, emptyLabel, labelFunc, + utils, value, format, invalidLabel, emptyLabel, labelFunc, } = props; const isEmpty = value === null; - const date = moment(value); + const date = utils.date(value); if (labelFunc) { return labelFunc(isEmpty ? null : date, invalidLabel); @@ -82,13 +87,14 @@ class DateTextField extends PureComponent { return emptyLabel; } - return date.isValid() - ? date.format(format) + return utils.isValid(date) + ? utils.format(date, format) : invalidLabel; } - getError = (value) => { + getError = (value, props = this.props) => { const { + utils, maxDate, minDate, disablePast, @@ -96,26 +102,26 @@ class DateTextField extends PureComponent { maxDateMessage, minDateMessage, invalidDateMessage, - } = this.props; + } = props; - if (!value.isValid()) { + if (!utils.isValid(value)) { // if null - do not show error - if (value.parsingFlags().nullInput) { + if (utils.isNull(value)) { return ''; } return invalidDateMessage; } if ( - (maxDate && value.isAfter(maxDate)) || - (disableFuture && value.isAfter(moment().endOf('day'))) + (maxDate && utils.isAfter(value, maxDate)) || + (disableFuture && utils.isAfter(value, utils.endOfDay(utils.date()))) ) { return maxDateMessage; } if ( - (minDate && value.isBefore(minDate)) || - (disablePast && value.isBefore(moment().startOf('day'))) + (minDate && utils.isBefore(value, minDate)) || + (disablePast && utils.isBefore(value, utils.startOfDay(utils.date()))) ) { return minDateMessage; } @@ -126,7 +132,7 @@ class DateTextField extends PureComponent { updateState = (props = this.props) => ({ value: props.value, displayValue: this.getDisplayDate(props), - error: this.getError(moment(props.value)), + error: this.getError(props.utils.date(props.value)), }) state = this.updateState() @@ -134,7 +140,9 @@ class DateTextField extends PureComponent { componentWillReceiveProps(nextProps) { if ( nextProps.value !== this.state.value || - nextProps.format !== this.props.format + nextProps.format !== this.props.format || + nextProps.maxDate !== this.props.maxDate || + nextProps.minDate !== this.props.minDate ) { this.setState(this.updateState(nextProps)); } @@ -147,9 +155,10 @@ class DateTextField extends PureComponent { handleChange = (e) => { const { - format, clearable, onClear, + utils, + format, } = this.props; if (clearable && e.target.value === '') { @@ -162,8 +171,9 @@ class DateTextField extends PureComponent { return; } - const oldValue = moment(this.state.value); - const newValue = moment(e.target.value, format, true); + const oldValue = utils.date(this.state.value); + const newValue = utils.parse(e.target.value, format); + const error = this.getError(newValue); this.setState({ @@ -171,8 +181,8 @@ class DateTextField extends PureComponent { value: error ? newValue : oldValue, error, }, () => { - if (!error && newValue.format('LLLL') !== oldValue.format('LLLL')) { - this.props.onChange(newValue, true); + if (!error && utils.format(newValue, 'LLLL') !== utils.format(oldValue, 'LLLL')) { + this.props.onChange(newValue); } }); } @@ -187,7 +197,6 @@ class DateTextField extends PureComponent { } e.target.blur(); - this.openPicker(e); } @@ -207,6 +216,7 @@ class DateTextField extends PureComponent { render() { const { + utils, format, classes, disabled, @@ -229,22 +239,24 @@ class DateTextField extends PureComponent { maxDateMessage, minDateMessage, TextFieldComponent, + InputAdornmentProps, + adornmentPosition, ...other } = this.props; - const { displayValue, error } = this.state; + const { displayValue, error } = this.state; const localInputProps = { inputComponent: MaskedInput, inputProps: { - mask: value === null ? null : mask, + mask: !keyboard ? null : mask, readOnly: !keyboard, }, className: classes.input, }; if (keyboard) { - localInputProps.endAdornment = ( - + localInputProps[`${adornmentPosition}Adornment`] = ( + {keyboardIcon} ); @@ -273,4 +285,4 @@ const styles = { }, }; -export default withStyles(styles)(DateTextField); +export default withStyles(styles)(withUtils()(DateTextField)); diff --git a/lib/src/_shared/ModalDialog.d.ts b/lib/src/_shared/ModalDialog.d.ts index 2fb32508b..c457e958d 100644 --- a/lib/src/_shared/ModalDialog.d.ts +++ b/lib/src/_shared/ModalDialog.d.ts @@ -1,6 +1,6 @@ import { ComponentClass, ReactNode } from 'react'; import { DateType } from '../constants/prop-types'; -import { Utils } from '../utils/utils'; +import { Utils } from '../../typings/utils'; import { DialogProps } from 'material-ui/Dialog'; import { ButtonProps } from 'material-ui/Button'; diff --git a/lib/src/_shared/PickerBase.d.ts b/lib/src/_shared/PickerBase.d.ts index b112ccec4..05944a47c 100644 --- a/lib/src/_shared/PickerBase.d.ts +++ b/lib/src/_shared/PickerBase.d.ts @@ -1,8 +1,8 @@ import {Moment} from 'moment' +import { DateTextFieldProps } from './ModalDialog'; export interface PickerBaseProps { onChange: (date: Date | Moment) => void; autoOk?: boolean; - returnMoment?: boolean; ampm?: boolean; } \ No newline at end of file diff --git a/lib/src/_shared/PickerBase.jsx b/lib/src/_shared/PickerBase.jsx index 3bfdc9b37..08160acac 100644 --- a/lib/src/_shared/PickerBase.jsx +++ b/lib/src/_shared/PickerBase.jsx @@ -1,33 +1,25 @@ import { PureComponent } from 'react'; import PropTypes from 'prop-types'; -import moment from 'moment'; import DomainPropTypes from '../constants/prop-types'; /* eslint-disable react/sort-comp */ +/* eslint-disable react/require-default-props */ export default class PickerBase extends PureComponent { static propTypes = { value: DomainPropTypes.date, onChange: PropTypes.func.isRequired, autoOk: PropTypes.bool, - returnMoment: PropTypes.bool, format: PropTypes.string, labelFunc: PropTypes.func, ampm: PropTypes.bool, + utils: PropTypes.func.isRequired, } - static defaultProps = { - value: new Date(), - autoOk: false, - returnMoment: false, - labelFunc: undefined, - format: undefined, - ampm: true, - } - - getValidDateOrCurrent = (props = this.props) => { - const date = moment(props.value); + getValidDateOrCurrent = () => { + const { utils, value } = this.props; + const date = utils.date(value); - return date.isValid() ? date : moment(); + return utils.isValid(date) ? date : utils.date(); } state = { @@ -35,7 +27,7 @@ export default class PickerBase extends PureComponent { } componentWillReceiveProps(nextProps) { - if (this.props.value !== nextProps.value) { + if (!this.props.utils.isEqual(this.state.date, nextProps.value)) { this.setState({ date: this.getValidDateOrCurrent(nextProps) }); } } @@ -57,11 +49,7 @@ export default class PickerBase extends PureComponent { } handleAccept = () => { - const dateToReturn = this.props.returnMoment - ? this.state.date - : this.state.date.toDate(); - - this.props.onChange(dateToReturn); + this.props.onChange(this.state.date); } handleDismiss = () => { diff --git a/lib/src/_shared/WithUtils.jsx b/lib/src/_shared/WithUtils.jsx new file mode 100644 index 000000000..19aa069f8 --- /dev/null +++ b/lib/src/_shared/WithUtils.jsx @@ -0,0 +1,23 @@ +import React from 'react'; +import PropTypes from 'prop-types'; + +const withUtils = () => (Component) => { + const WithUtils = (props, context) => { + if (!context.muiPickersDateUtils) { + // eslint-disable-next-line no-console + console.error('Utils should be provided'); + } + + return ; + }; + + WithUtils.contextTypes = { + muiPickersDateUtils: PropTypes.func, + }; + + WithUtils.displayName = `withUtils${Component.displayName || Component.name}`; + + return WithUtils; +}; + +export default withUtils; diff --git a/lib/src/index.d.ts b/lib/src/index.d.ts index 50298e750..b8d24c1b2 100644 --- a/lib/src/index.d.ts +++ b/lib/src/index.d.ts @@ -1,5 +1,6 @@ -export { Utils } from './utils/utils'; +export { default as dateFnsUtils } from './utils/date-fns-utils' +export { default as momentUtils } from './utils/moment-utils' -export { default as DatePicker } from './DatePicker/DatePickerWrapper'; -export { default as TimePicker } from './TimePicker/TimePickerWrapper'; -export { default as DateTimePicker } from './DateTimePicker/DateTimePickerWrapper'; +export { default as DatePicker } from './DatePicker'; +export { default as TimePicker } from './TimePicker'; +export { default as DateTimePicker } from './DateTimePicker'; diff --git a/lib/src/index.js b/lib/src/index.js index 173f5b6cc..28cf64ebe 100644 --- a/lib/src/index.js +++ b/lib/src/index.js @@ -1,5 +1,11 @@ -export { default as DatePicker } from './DatePicker/DatePickerWrapper'; +export { default as DatePicker } from './DatePicker'; -export { default as TimePicker } from './TimePicker/TimePickerWrapper'; +export { default as TimePicker } from './TimePicker'; -export { default as DateTimePicker } from './DateTimePicker/DateTimePickerWrapper'; +export { default as DateTimePicker } from './DateTimePicker'; + +export { default as MuiPickersUtilsProvider } from './utils/MuiPickersUtilsProvider'; + +export { default as dateFnsUtils } from './utils/date-fns-utils'; + +export { default as momentUtils } from './utils/moment-utils'; diff --git a/lib/src/utils/MuiPickersUtilsProvider.d.ts b/lib/src/utils/MuiPickersUtilsProvider.d.ts new file mode 100644 index 000000000..9f7d2b2af --- /dev/null +++ b/lib/src/utils/MuiPickersUtilsProvider.d.ts @@ -0,0 +1,12 @@ +import { ComponentClass, ReactNode } from 'react'; +import { DateTimePickerView } from '../constants/date-picker-view'; +import { Utils } from '../../typings/utils'; + +export interface MuiPickersUtilsProviderProps { + utils: Utils; + children: ReactNode; +} + +declare const MuiPickersUtilsProvider: ComponentClass; + +export default MuiPickersUtilsProvider; diff --git a/lib/src/utils/MuiPickersUtilsProvider.jsx b/lib/src/utils/MuiPickersUtilsProvider.jsx new file mode 100644 index 000000000..1ae3fb50b --- /dev/null +++ b/lib/src/utils/MuiPickersUtilsProvider.jsx @@ -0,0 +1,23 @@ +import { PureComponent } from 'react'; +import PropTypes from 'prop-types'; + +export default class MuiPickersUtilsProvider extends PureComponent { + static propTypes = { + utils: PropTypes.func.isRequired, + children: PropTypes.element.isRequired, + } + + static childContextTypes = { + muiPickersDateUtils: PropTypes.func, + } + + getChildContext() { + return { + muiPickersDateUtils: this.props.utils, + }; + } + + render() { + return this.props.children; + } +} diff --git a/lib/src/utils/date-fns-utils.d.ts b/lib/src/utils/date-fns-utils.d.ts new file mode 100644 index 000000000..d99f7eead --- /dev/null +++ b/lib/src/utils/date-fns-utils.d.ts @@ -0,0 +1,4 @@ +import { Utils } from '../../typings/utils' + +declare const DateFnsUtils: Utils; +export default DateFnsUtils \ No newline at end of file diff --git a/lib/src/utils/date-fns-utils.js b/lib/src/utils/date-fns-utils.js new file mode 100644 index 000000000..5b6512d06 --- /dev/null +++ b/lib/src/utils/date-fns-utils.js @@ -0,0 +1,167 @@ +import parse from 'date-fns/parse'; +import addDays from 'date-fns/addDays'; +import addMonths from 'date-fns/addMonths'; +import addYears from 'date-fns/addYears'; +import endOfDay from 'date-fns/endOfDay'; +import endOfMonth from 'date-fns/endOfMonth'; +import endOfWeek from 'date-fns/endOfWeek'; +import endOfYear from 'date-fns/endOfYear'; +import format from 'date-fns/format'; +import isAfter from 'date-fns/isAfter'; +import isBefore from 'date-fns/isBefore'; +import isSameDay from 'date-fns/isSameDay'; +import isValid from 'date-fns/isValid'; +import setDay from 'date-fns/setDay'; +import setHours from 'date-fns/setHours'; +import setMinutes from 'date-fns/setMinutes'; +import setYear from 'date-fns/setYear'; +import startOfDay from 'date-fns/startOfDay'; +import startOfMonth from 'date-fns/startOfMonth'; +import startOfWeek from 'date-fns/startOfWeek'; +import startOfYear from 'date-fns/startOfYear'; +import getHours from 'date-fns/getHours'; +import getYear from 'date-fns/getYear'; +import isEqual from 'date-fns/isEqual'; + +export default class DateFnsUtils { + static date = value => new Date(value) + + static parse = (value, formatString) => parse(value, formatString, new Date()) + + static addDays = addDays + + static isValid = isValid + + static isEqual = isEqual + + static isNull(date) { + return date == null; + } + + static isAfter = isAfter + + static isBefore = isBefore + + static isAfterDay(date, value) { + return isAfter(endOfDay(date), value); + } + + static isBeforeDay(date, value) { + return isBefore(date, startOfDay(value)); + } + + static isBeforeYear(date, value) { + return isBefore(date, startOfYear(value)); + } + + static isAfterYear(date, value) { + return isAfter(endOfYear(date), value); + } + + static startOfDay = startOfDay + + static endOfDay = endOfDay + + static format = format + + static formatNumber(num) { + return num; + } + + static getHours = getHours + + static setHours = setHours + + static getMinutes(date) { + return date.getMinutes(); + } + + static setMinutes = setMinutes + + static getMonth(date) { + return date.getMonth(); + } + + static isSameDay = isSameDay; + + static getMeridiemText(ampm) { + return ampm === 'am' ? 'AM' : 'PM'; + } + + static getStartOfMonth = startOfMonth + + static getNextMonth(date) { + return addMonths(date, 1); + } + + static getPreviousMonth(date) { + return addMonths(date, -1); + } + + static getYear = getYear + + static setYear = setYear; + + static getWeekdays() { + return [0, 1, 2, 3, 4, 5, 6].map(dayOfWeek => format(setDay(new Date(), dayOfWeek), 'dd')); + } + + static getWeekArray(date) { + const start = startOfWeek(startOfMonth(date)); + const end = endOfWeek(endOfMonth(date)); + + const nestedWeeks = []; + let count = 0; + let current = start; + while (isBefore(current, end)) { + const weekNumber = Math.floor(count / 7); + nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || []; + nestedWeeks[weekNumber].push(current); + current = addDays(current, 1); + count += 1; + } + + return nestedWeeks; + } + + static getYearRange(start, end) { + const startDate = new Date(start); + const endDate = new Date(end); + const years = []; + let current = startDate; + while (isBefore(current, endDate)) { + years.push(current); + current = addYears(current, 1); + } + return years; + } + + // displaying methpds + static getCalendarHeaderText(date) { + return format(date, 'MMMM YYYY'); + } + + static getYearText(date) { + return format(date, 'YYYY'); + } + + static getDatePickerHeaderText(date) { + return format(date, 'ddd, MMM D'); + } + + static getDateTimePickerHeaderText(date) { + return format(date, 'MMM D'); + } + + static getDayText(date) { + return format(date, 'D'); + } + + static getHourText(date, ampm) { + return format(date, ampm ? 'hh' : 'HH'); + } + + static getMinuteText(date) { + return format(date, 'mm'); + } +} diff --git a/lib/src/utils/moment-utils.d.ts b/lib/src/utils/moment-utils.d.ts new file mode 100644 index 000000000..2140e1e97 --- /dev/null +++ b/lib/src/utils/moment-utils.d.ts @@ -0,0 +1,4 @@ +import { Utils } from '../../typings/utils' + +declare const MomentUtils: Utils; +export default MomentUtils \ No newline at end of file diff --git a/lib/src/utils/moment-utils.js b/lib/src/utils/moment-utils.js new file mode 100644 index 000000000..a499e3ea0 --- /dev/null +++ b/lib/src/utils/moment-utils.js @@ -0,0 +1,180 @@ +import moment from 'moment'; + +export default class MomentUtils { + static parse = moment + + static date(value, formatString) { + return moment(value, formatString); + } + + static isValid(date) { + return date.isValid(); + } + + static isNull(date) { + return date.parsingFlags().nullInput; + } + + static isAfter(date, value) { + return date.isAfter(value); + } + + static isBefore(date, value) { + return date.isBefore(value); + } + + static isAfterDay(date, value) { + return date.isAfter(value, 'day'); + } + + static isBeforeDay(date, value) { + return date.isBefore(value, 'day'); + } + + static isBeforeYear(date, value) { + return date.isBefore(value, 'year'); + } + + static isAfterYear(date, value) { + return date.isAfter(value, 'year'); + } + + static startOfDay(date) { + return date.startOf('day'); + } + + static endOfDay(date) { + return date.endOf('day'); + } + + static format(date, formatString) { + return date.format(formatString); + } + + static formatNumber(num) { + return num; + } + + static getHours(date) { + return date.get('hours'); + } + + static addDays(date, count) { + return count < 0 + ? date.clone().subtract(Math.abs(count), 'days') + : date.clone().add(count, 'days'); + } + + static setHours(date, value) { + return date.clone().hours(value); + } + + static getMinutes(date) { + return date.get('minutes'); + } + + static setMinutes(date, value) { + return date.clone().minutes(value); + } + + static getMonth(date) { + return date.get('month'); + } + + static isSameDay(date, comparing) { + return date.isSame(comparing, 'day'); + } + + static getMeridiemText(ampm) { + return ampm === 'am' ? 'AM' : 'PM'; + } + + static getStartOfMonth(date) { + return date.clone().startOf('month'); + } + + static getNextMonth(date) { + return date.clone().add(1, 'month'); + } + + static getPreviousMonth(date) { + return date.clone().subtract(1, 'month'); + } + + static getYear(date) { + return date.get('year'); + } + + static setYear(date, year) { + return date.clone().set('year', year); + } + + static getWeekdays() { + return [0, 1, 2, 3, 4, 5, 6].map(dayOfWeek => moment().weekday(dayOfWeek).format('dd')[0]); + } + + static isEqual(value, comparing) { + return moment(value).isSame(comparing); + } + + static getWeekArray(date) { + const start = date.clone().startOf('month').startOf('week'); + const end = date.clone().endOf('month').endOf('week'); + + const nestedWeeks = []; + let count = 0; + let current = start; + while (current.isBefore(end)) { + const weekNumber = Math.floor(count / 7); + nestedWeeks[weekNumber] = nestedWeeks[weekNumber] || []; + nestedWeeks[weekNumber].push(current); + current = current.clone().add(1, 'day'); + count += 1; + } + + return nestedWeeks; + } + + static getYearRange(start, end) { + const startDate = moment(start); + const endDate = moment(end); + const years = []; + + let current = startDate; + while (current.isBefore(endDate)) { + years.push(current); + current = current.clone().add(1, 'year'); + } + + return years; + } + + // displaying methods + static getCalendarHeaderText(date) { + return date.format('MMMM YYYY'); + } + + static getYearText(date) { + return date.format('YYYY'); + } + + static getDatePickerHeaderText(date) { + return date.format('ddd, MMM D'); + } + + static getDateTimePickerHeaderText(date) { + return date.format('MMM D'); + } + + static getDayText(date) { + return date.format('D'); + } + + static getHourText(date, ampm) { + return date.format(ampm ? 'hh' : 'HH'); + } + + static getMinuteText(date) { + return date.format('mm'); + } +} diff --git a/lib/src/utils/utils.d.ts b/lib/src/utils/utils.d.ts deleted file mode 100644 index 9d008ffce..000000000 --- a/lib/src/utils/utils.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -export declare function formatNumber(num: string): string; -export declare function getCalendarHeaderText(date: any): string; -export declare function getDatePickerHeaderText(date: any): string; -export declare function getDateTimePickerHeaderText(date: any): string; -export declare function getDayText(date: any): string; -export declare function getHourText(date: any): string; -export declare function getMinuteText(date: any): string; -export declare function getMeridiemText(ampm: 'am' | 'pm'): string; -export declare function getYearText(date: any): string; -export declare function getMonthNumber(date: any): number; -export declare function getStartOfMonth(date: any): any; -export declare function getNextMonth(date: any): any; -export declare function getPreviousMonth(date: any): any; -export declare function getYear(date: any): any; -export declare function setYear(date: any, year: number): any; -export declare function getWeekdays(): string[]; -export declare function getWeekArray(date: any): any[][]; - -export interface Utils { - formatNumber: typeof formatNumber; - getCalendarHeaderText: typeof getCalendarHeaderText; - getDatePickerHeaderText: typeof getDatePickerHeaderText; - getDateTimePickerHeaderText: typeof getDateTimePickerHeaderText; - getDayText: typeof getDayText; - getHourText: typeof getHourText; - getMinuteText: typeof getMinuteText; - getMeridiemText: typeof getMeridiemText; - getYearText: typeof getYearText; - getMonthNumber: typeof getMonthNumber; - getStartOfMonth: typeof getStartOfMonth; - getNextMonth: typeof getNextMonth; - getPreviousMonth: typeof getPreviousMonth; - getYear: typeof getYear; - setYear: typeof setYear; - getWeekdays: typeof getWeekdays; - getWeekArray: typeof getWeekArray; -} diff --git a/lib/src/utils/utils.js b/lib/src/utils/utils.js deleted file mode 100644 index b29549cf6..000000000 --- a/lib/src/utils/utils.js +++ /dev/null @@ -1,84 +0,0 @@ -import Moment from 'moment'; -import { extendMoment } from 'moment-range'; - -const moment = extendMoment(Moment); - -export function formatNumber(num) { - return num; -} - -export function getCalendarHeaderText(date) { - return date.format('MMMM YYYY'); -} - -export function getDatePickerHeaderText(date) { - return date.format('ddd, MMM D'); -} - -export function getDateTimePickerHeaderText(date) { - return date.format('MMM D'); -} - -export function getDayText(date) { - return date.format('D'); -} - -export function getHourText(date, ampm) { - return date.format(ampm ? 'hh' : 'HH'); -} - -export function getMinuteText(date) { - return date.format('mm'); -} - -export function getMeridiemText(ampm) { - return ampm === 'am' ? 'AM' : 'PM'; -} - -export function getYearText(date) { - return date.format('YYYY'); -} - -export function getMonthNumber(date) { - return date.get('month'); -} - -export function getStartOfMonth(date) { - return date.clone().startOf('month'); -} - -export function getNextMonth(date) { - return date.clone().add(1, 'month'); -} - -export function getPreviousMonth(date) { - return date.clone().subtract(1, 'month'); -} - -export function getYear(date) { - return date.get('year'); -} - -export function setYear(date, year) { - return date.clone().set('year', year); -} - -export function getWeekdays() { - return [0, 1, 2, 3, 4, 5, 6].map(dayOfWeek => moment().weekday(dayOfWeek).format('dd')[0]); -} - -export function getWeekArray(date) { - const start = date.clone().startOf('month').startOf('week'); - const end = date.clone().endOf('month').endOf('week'); - - const weeks = Array.from(moment.range(start, end).by('week')); - - const nestedWeeks = []; - - weeks.forEach((week) => { - const endOfWeek = week.clone().endOf('week'); - nestedWeeks.push(Array.from(moment.range(week, endOfWeek).by('day'))); - }); - - return nestedWeeks; -} diff --git a/lib/typings/date.ts b/lib/typings/date.ts new file mode 100644 index 000000000..d60b25bab --- /dev/null +++ b/lib/typings/date.ts @@ -0,0 +1,4 @@ +import { Moment } from 'moment'; + +// 21.02.2018 - TODO type date, if there would be any way to dynamicly type Moment | Date +export type MaterialUiPickersDate = any \ No newline at end of file diff --git a/lib/typings/utils.ts b/lib/typings/utils.ts new file mode 100644 index 000000000..27daab0d9 --- /dev/null +++ b/lib/typings/utils.ts @@ -0,0 +1,42 @@ +import { MaterialUiPickersDate } from './date' + +export interface Utils { + date(value: any): MaterialUiPickersDate; + addDays(value: MaterialUiPickersDate, count: number): MaterialUiPickersDate; + isValid(value: MaterialUiPickersDate): boolean; + isEqual(value: MaterialUiPickersDate, comparing: MaterialUiPickersDate): boolean; + isNull(value: MaterialUiPickersDate): boolean; + isAfter(value: MaterialUiPickersDate, comparing: MaterialUiPickersDate): boolean; + isAfterDay(value: MaterialUiPickersDate, comparing: MaterialUiPickersDate): boolean; + isBeforeDay(value: MaterialUiPickersDate, comparing: MaterialUiPickersDate): boolean; + isBeforeYear(value: MaterialUiPickersDate, comparing: MaterialUiPickersDate): boolean; + isAfterYear(value: MaterialUiPickersDate, comparing: MaterialUiPickersDate): boolean; + startOfDay(value: MaterialUiPickersDate): MaterialUiPickersDate; + endOfDay(value: MaterialUiPickersDate): MaterialUiPickersDate; + format(value: MaterialUiPickersDate, formatString: string): string; + formatNumber(number: number): string; + getHours(value: MaterialUiPickersDate): number; + setHours(value: MaterialUiPickersDate, count: number): MaterialUiPickersDate; + getMinutes(value: MaterialUiPickersDate): number; + setMinutes(value: MaterialUiPickersDate, count: number): MaterialUiPickersDate + getMonth(value: MaterialUiPickersDate): number; + isSameDay(value: MaterialUiPickersDate, comparing: MaterialUiPickersDate): boolean + getStartOfMonth(value: MaterialUiPickersDate): MaterialUiPickersDate; + getNextMonth(value: MaterialUiPickersDate): MaterialUiPickersDate; + getPreviousMonth(value: MaterialUiPickersDate): MaterialUiPickersDate; + getYear(value: MaterialUiPickersDate): number; + setYear(value: MaterialUiPickersDate): MaterialUiPickersDate; + getWeekDays(): string[]; + getWeekArray(): MaterialUiPickersDate[]; + getYearRange(): MaterialUiPickersDate[]; + + // displaying methods + getMeridiemText(ampm: boolean): string; + getCalendarHeaderText(date: MaterialUiPickersDate): string; + getDatePickerHeaderText(date: MaterialUiPickersDate): string; + getDateTimePickerHeaderText(date: MaterialUiPickersDate): string; + getDayText(date: MaterialUiPickersDate): string; + getHourText(date: MaterialUiPickersDate, ampm: boolean): string; + getMinuteText(date: MaterialUiPickersDate): string; + getYearText(date: MaterialUiPickersDate): string; +} \ No newline at end of file