Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release rc.10 #457

Merged
merged 70 commits into from
Jun 13, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
d3289d0
Merge pull request #1 from dmtrKovalenko/develop
LastDreamer Apr 10, 2018
b6462d8
parseFormats and commitUpdates on blur
LastDreamer Apr 10, 2018
460b82d
fix
LastDreamer Apr 10, 2018
75e3c45
fix
LastDreamer Apr 10, 2018
d6b2c3a
typescript for parseFormats
LastDreamer Apr 11, 2018
46aea12
f
LastDreamer Apr 11, 2018
64fd636
lint
LastDreamer Apr 12, 2018
d14e347
parseFormats removed
LastDreamer May 22, 2018
7d0571a
Merge branch 'master' into develop
cherniavskii May 23, 2018
2bca407
Add seconds clock type.
baig May 29, 2018
a3333aa
Add seconds related functions in utils.
baig May 29, 2018
7c10f0d
Add types for seconds related functions in utils.
baig May 29, 2018
8ff0514
Add SecondsView.
baig May 29, 2018
491affb
Add SecondsView types.
baig May 29, 2018
1509ba5
Add SecondsView tests.
baig May 29, 2018
675baeb
Update TimePicker to display SecondsView.
baig May 29, 2018
3a0a576
Add TimePicker with seconds example in basic usage.
baig May 29, 2018
98525a8
Use an object notation for handleChange params.
baig May 30, 2018
c5413a1
Update docs to use @material-ui/core
dmtrKovalenko May 31, 2018
31b6731
Update material-ui-logo
dmtrKovalenko May 31, 2018
9e781a7
Commit new material-ui-logo
dmtrKovalenko May 31, 2018
591cad0
Update codesandbox to actual version of pickers and material-ui
dmtrKovalenko May 31, 2018
d039442
Merge pull request #350 from LastDreamer/develop
dmtrKovalenko May 31, 2018
cae271d
[#432] Add autofocus on calendar
dmtrKovalenko Jun 1, 2018
1365b72
[#422] Migrate to new React lifecycle methods
dmtrKovalenko Jun 1, 2018
a29423e
[#351] Make input display error onChange
dmtrKovalenko Jun 1, 2018
53a4166
[#170] Migrate to hocs from inheritance
dmtrKovalenko Jun 1, 2018
c931941
Add BaseDatePicker HOC component that manage date state, redo datepic…
dmtrKovalenko Jun 1, 2018
ef76950
Redo DateTimePicker with BasePickerHoc
dmtrKovalenko Jun 2, 2018
689c039
Redo TimePickerWrapper with BasePicker HOC
dmtrKovalenko Jun 2, 2018
65897b0
Add typings for BasePicker, fix existed typings
dmtrKovalenko Jun 2, 2018
5d29745
Redo getting default format for 12h | 24h base handler
dmtrKovalenko Jun 2, 2018
f6b31db
add missing types
Jun 4, 2018
9cdfeda
Merge branch 'develop' of https://github.com/Ilaiwi/material-ui-picke…
Jun 4, 2018
7597842
Merge pull request #444 from Ilaiwi/ModalDialog-missing-types
dmtrKovalenko Jun 5, 2018
b5066fb
Merge pull request #439 from dmtrKovalenko/432_autook-breakes-keyboard
dmtrKovalenko Jun 5, 2018
b4659c7
Use getDerivedStateFromProps for Calendar component
dmtrKovalenko Jun 6, 2018
e992c9c
Remove unused pickerRef prop forwarding
dmtrKovalenko Jun 6, 2018
51148e5
Merge pull request #440 from dmtrKovalenko/feature/422_get-derived-st…
dmtrKovalenko Jun 6, 2018
8c4fc96
[#412] Add new prop allowKeyboardControl which allow to disable keybo…
dmtrKovalenko Jun 8, 2018
4ca7d7d
Install @types/react-event-listener for testing typescript
dmtrKovalenko Jun 8, 2018
34475fa
Update deps
dmtrKovalenko Jun 8, 2018
c326a07
[#387] Make messages accept react components
dmtrKovalenko Jun 8, 2018
ea192a8
[#387] Make modal labels be components
dmtrKovalenko Jun 8, 2018
e9154c1
Remove unnecessary props forwarding
dmtrKovalenko Jun 8, 2018
08dba80
Adjust typescript typings
dmtrKovalenko Jun 8, 2018
d15fcda
Merge pull request #455 from dmtrKovalenko/feature/event-listener-on-…
dmtrKovalenko Jun 8, 2018
bba5ad1
Merge conflicts
dmtrKovalenko Jun 8, 2018
abd7bfe
Merge pull request #456 from dmtrKovalenko/feature/labels-components
dmtrKovalenko Jun 8, 2018
a90e082
Merge branch 'develop' into add-seconds-in-time-picker
dmtrKovalenko Jun 8, 2018
61314f1
Merge pull request #437 from baig/add-seconds-in-time-picker
dmtrKovalenko Jun 8, 2018
fe201b4
Fix eslint errors
dmtrKovalenko Jun 8, 2018
ba0bbbf
Fix eslint errors
dmtrKovalenko Jun 8, 2018
6eb2151
Update docs for seconds timepicker
dmtrKovalenko Jun 8, 2018
0fa0723
[docs] Add guide how to use static components
dmtrKovalenko Jun 8, 2018
f98f607
Fix open hidden seconds view when seconds is disabled
dmtrKovalenko Jun 8, 2018
b151e6e
Update version
dmtrKovalenko Jun 8, 2018
2bd656e
[#452] Fix missing disabled effect on keyboard button if text field i…
dmtrKovalenko Jun 8, 2018
76c10cf
Fix DateTextField unit tests
dmtrKovalenko Jun 8, 2018
3471993
[integration] Fix missing forwarded props to DatePicker component
dmtrKovalenko Jun 8, 2018
5c3f17f
pass isFinish false on mount
mcMickJuice Jun 8, 2018
12c23ae
Always pass false to onChange handle. Use newDate in handleChange
mcMickJuice Jun 11, 2018
15551ec
Add todayLabel and showTodayButton to TS type definitions
tjaskula Jun 11, 2018
bd8fbb7
Make showTodayButton optional in typescript definitions
tjaskula Jun 11, 2018
7d5cc2e
Merge pull request #462 from tjaskula/showTodayButton-460
dmtrKovalenko Jun 11, 2018
9162f9c
Merge pull request #459 from mcMickJuice/fix/auto-set-on-click
dmtrKovalenko Jun 11, 2018
c5612af
Fix now working autoOk prop
dmtrKovalenko Jun 12, 2018
7c261f5
Fix immediate close of modal, if autoOK = true and current date is di…
dmtrKovalenko Jun 12, 2018
724f11c
Fix eslint errors
dmtrKovalenko Jun 12, 2018
49ac903
Update package.lock to include new version of eslint for travis
dmtrKovalenko Jun 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/src/Examples/Demo/BasicDatePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export default class BasicDatePicker extends PureComponent {

<div className="picker">
<DatePicker
autoOk
label="Clearable"
clearable
disableFuture
Expand Down
1 change: 1 addition & 0 deletions docs/src/Examples/Demo/TimePickerBasic.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class BasicUsage extends PureComponent {
<Fragment>
<div className="picker">
<TimePicker
autoOk
label="12 hours"
value={selectedDate}
onChange={this.handleDateChange}
Expand Down
10 changes: 5 additions & 5 deletions lib/src/DatePicker/Calendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export class Calendar extends Component {
shouldDisableDate: () => false,
};

state = {
currentMonth: this.props.utils.getStartOfMonth(this.props.date),
};

static getDerivedStateFromProps(nextProps, state) {
if (!nextProps.utils.isEqual(nextProps.date, state.lastDate)) {
return {
Expand All @@ -53,10 +57,6 @@ export class Calendar extends Component {
return null;
}

state = {
currentMonth: this.props.utils.getStartOfMonth(this.props.date),
};

componentDidMount() {
const {
date, minDate, maxDate, utils, disableFuture, disablePast,
Expand All @@ -81,7 +81,7 @@ export class Calendar extends Component {
const withHours = utils.setHours(day, utils.getHours(date));
const withMinutes = utils.setMinutes(withHours, utils.getMinutes(date));

this.props.onChange(withMinutes, false);
this.props.onChange(withMinutes);
};

handleChangeMonth = (newMonth) => {
Expand Down
2 changes: 2 additions & 0 deletions lib/src/DatePicker/DatePickerWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export const DatePickerWrapper = (props) => {
handleDismiss,
handleSetTodayDate,
handleTextFieldChange,
isAccepted,
}) => (
<ModalWrapper
disableFuture={disableFuture}
Expand All @@ -54,6 +55,7 @@ export const DatePickerWrapper = (props) => {
onSetToday={handleSetTodayDate}
ref={forwardedRef}
value={value}
isAccepted={isAccepted}
{...other}
>
<DatePicker
Expand Down
2 changes: 2 additions & 0 deletions lib/src/DateTimePicker/DateTimePickerWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export const DateTimePickerWrapper = (props) => {
handleDismiss,
handleSetTodayDate,
handleTextFieldChange,
isAccepted,
pick12hOr24hFormat,
}) => (
<ModalWrapper
Expand All @@ -61,6 +62,7 @@ export const DateTimePickerWrapper = (props) => {
onDismiss={handleDismiss}
onSetToday={handleSetTodayDate}
value={value}
isAccepted={isAccepted}
{...other}
>
<DateTimePicker
Expand Down
2 changes: 2 additions & 0 deletions lib/src/TimePicker/TimePickerWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export const TimePickerWrapper = (props) => {
handleDismiss,
handleSetTodayDate,
handleTextFieldChange,
isAccepted,
pick12hOr24hFormat,
}) => (
<ModalWrapper
Expand All @@ -33,6 +34,7 @@ export const TimePickerWrapper = (props) => {
onChange={handleTextFieldChange}
onDismiss={handleDismiss}
onSetToday={handleSetTodayDate}
isAccepted={isAccepted}
{...other}
>
<TimePicker
Expand Down
4 changes: 4 additions & 0 deletions lib/src/_shared/BasePicker.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export const BasePickerHoc = compose(
withUtils(),
setDisplayName('BasePicker'),
withState('date', 'changeDate', getValidDateOrCurrent),
withState('isAccepted', 'handleAcceptedChange', false),
lifecycle({
componentDidUpdate(prevProps) {
if (prevProps.value !== this.props.value) {
Expand Down Expand Up @@ -46,10 +47,13 @@ export const BasePickerHoc = compose(
autoOk,
changeDate,
onChange,
handleAcceptedChange,
}) => (newDate, isFinish = true) => {
changeDate(newDate, () => {
if (isFinish && autoOk) {
onChange(newDate);
// pass down accept true, and make it false in the next tick
handleAcceptedChange(true, () => handleAcceptedChange(false));
}
});
},
Expand Down
13 changes: 13 additions & 0 deletions lib/src/wrappers/ModalWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export default class ModalWrapper extends PureComponent {
onSetToday: PropTypes.func,
children: PropTypes.node.isRequired,
dialogContentClassName: PropTypes.string,
isAccepted: PropTypes.bool.isRequired,
}

static defaultProps = {
Expand All @@ -66,6 +67,17 @@ export default class ModalWrapper extends PureComponent {
open: false,
}

static getDerivedStateFromProps(nextProps) {
// only if accept = true close the dialog
if (nextProps.isAccepted) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you're handling opening/closing of Modal declaratively, using isAccepted as the signal to close, correct? As opposed to imperatively using a ref to ModalWrapper?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mcMickJuice you are exactly right

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool! thanks

return {
open: false,
};
}

return null;
}

handleKeyDown = (event) => {
switch (keycode(event)) {
case 'enter':
Expand Down Expand Up @@ -140,6 +152,7 @@ export default class ModalWrapper extends PureComponent {
onOpen,
onClose,
onSetToday,
isAccepted,
...other
} = this.props;

Expand Down