Skip to content

Commit

Permalink
2018
Browse files Browse the repository at this point in the history
  • Loading branch information
martijnrusschen committed Nov 3, 2018
1 parent 385e3f4 commit 27b1507
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 38 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,4 @@ The examples are hosted within the docs folder and are ran in the simple app tha

## License

Copyright (c) 2017 HackerOne Inc. and individual contributors. Licensed under MIT license, see [LICENSE](LICENSE) for the full license.
Copyright (c) 2018 HackerOne Inc. and individual contributors. Licensed under MIT license, see [LICENSE](LICENSE) for the full license.
116 changes: 79 additions & 37 deletions docs-site/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -24384,8 +24384,7 @@
},
/* 416 */
/***/ function(module, exports) {
module.exports = function(hljs) {
// TODO support filter tags like :javascript, support inline HTML
module.exports = function(hljs) { // TODO support filter tags like :javascript, support inline HTML
return {
case_insensitive: true,
contains: [
Expand Down Expand Up @@ -30325,8 +30324,7 @@
},
/* 475 */
/***/ function(module, exports) {
module.exports = function(hljs) {
// Base deafult colors in PB IDE: background: #FFFFDF; foreground: #000000;
module.exports = function(hljs) { // Base deafult colors in PB IDE: background: #FFFFDF; foreground: #000000;
var STRINGS = {
// PB IDE color: #0080FF (Azure Radiance)
className: "string",
Expand Down Expand Up @@ -35220,6 +35218,7 @@
/**
* General datepicker component.
*/
var INPUT_ERR_1 = "Date input not valid.";

var DatePicker = (function(_React$Component) {
_inherits(DatePicker, _React$Component);
Expand Down Expand Up @@ -35247,6 +35246,7 @@

preventOpenOnFocus: false,
onYearChange: function onYearChange() {},
onInputError: function onInputError() {},

monthsShown: 1,
readOnly: false,
Expand All @@ -35256,7 +35256,10 @@
timeIntervals: 30,
timeCaption: "Time",
previousMonthButtonLabel: "Previous Month",
nextMonthButtonLabel: "Next month"
nextMonthButtonLabel: "Next month",
renderDayContents: function renderDayContents(date) {
return date;
}
};
}
}
Expand Down Expand Up @@ -35356,14 +35359,21 @@
function() {
!skipSetBlur && _this.setBlur();

_this.setState({ inputValue: null, preSelection: null });
_this.setState({ inputValue: null });
}
);
}
}
);
};

_this.inputOk = function() {
return (
(0, _date_utils.isMoment)(_this.state.preSelection) ||
(0, _date_utils.isDate)(_this.state.preSelection)
);
};

_this.isCalendarOpen = function() {
return _this.props.open === undefined
? _this.state.open &&
Expand Down Expand Up @@ -35554,7 +35564,9 @@
});

_this.props.onChange(changedDate);
_this.setOpen(false);
if (_this.props.shouldCloseOnSelect) {
_this.setOpen(false);
}
_this.setState({ inputValue: null });
};

Expand Down Expand Up @@ -35583,8 +35595,7 @@
if (eventKey === "Enter") {
event.preventDefault();
if (
((0, _date_utils.isMoment)(_this.state.preSelection) ||
(0, _date_utils.isDate)(_this.state.preSelection)) &&
_this.inputOk() &&
_this.state.lastPreSelectChange ===
PRESELECT_CHANGE_VIA_NAVIGATE
) {
Expand All @@ -35597,6 +35608,9 @@
event.preventDefault();

_this.setOpen(false);
if (!_this.inputOk()) {
_this.props.onInputError({ code: 1, msg: INPUT_ERR_1 });
}
} else if (eventKey === "Tab") {
_this.setOpen(false, true);
} else if (!_this.props.disabledKeyboardNavigation) {
Expand Down Expand Up @@ -35627,7 +35641,12 @@
newSelection = (0, _date_utils.addYears)(copy, 1);
break;
}
if (!newSelection) return; // Let the input component handle this keydown
if (!newSelection) {
if (_this.props.onInputError) {
_this.props.onInputError({ code: 1, msg: INPUT_ERR_1 });
}
return; // Let the input component handle this keydown
}
event.preventDefault();
_this.setState({
lastPreSelectChange: PRESELECT_CHANGE_VIA_NAVIGATE
Expand Down Expand Up @@ -35729,7 +35748,9 @@
nextMonthButtonLabel: _this.props.nextMonthButtonLabel,
disabledKeyboardNavigation:
_this.props.disabledKeyboardNavigation,
renderCustomHeader: _this.props.renderCustomHeader
renderCustomHeader: _this.props.renderCustomHeader,
popperProps: _this.props.popperProps,
renderDayContents: _this.props.renderDayContents
},
_this.props.children
);
Expand Down Expand Up @@ -35874,7 +35895,8 @@
),
popperContainer: this.props.popperContainer,
popperComponent: calendar,
popperPlacement: this.props.popperPlacement
popperPlacement: this.props.popperPlacement,
popperProps: this.props.popperProps
});
};

Expand Down Expand Up @@ -35931,6 +35953,7 @@
onKeyDown: _propTypes2.default.func,
onMonthChange: _propTypes2.default.func,
onYearChange: _propTypes2.default.func,
onInputError: _propTypes2.default.func,
open: _propTypes2.default.bool,
openToDate: _propTypes2.default.object,
peekNextMonth: _propTypes2.default.bool,
Expand All @@ -35941,6 +35964,7 @@
popperPlacement: _propTypes2.default.oneOf(
_popper_component.popperPlacementPositions
), // <PopperComponent/> props
popperProps: _propTypes2.default.object,
preventOpenOnFocus: _propTypes2.default.bool,
readOnly: _propTypes2.default.bool,
required: _propTypes2.default.bool,
Expand Down Expand Up @@ -35983,7 +36007,8 @@
clearButtonTitle: _propTypes2.default.string,
previousMonthButtonLabel: _propTypes2.default.string,
nextMonthButtonLabel: _propTypes2.default.string,
renderCustomHeader: _propTypes2.default.func
renderCustomHeader: _propTypes2.default.func,
renderDayContents: _propTypes2.default.func
};
exports.default = DatePicker;

Expand Down Expand Up @@ -36836,6 +36861,7 @@
endDate: _this.props.endDate,
peekNextMonth: _this.props.peekNextMonth,
utcOffset: _this.props.utcOffset,
renderDayContents: _this.props.renderDayContents,
disabledKeyboardNavigation:
_this.props.disabledKeyboardNavigation
})
Expand Down Expand Up @@ -37015,7 +37041,8 @@
showDisabledMonthNavigation: _propTypes2.default.bool,
previousMonthButtonLabel: _propTypes2.default.string,
nextMonthButtonLabel: _propTypes2.default.string,
renderCustomHeader: _propTypes2.default.func
renderCustomHeader: _propTypes2.default.func,
renderDayContents: _propTypes2.default.func
};
exports.default = Calendar;

Expand Down Expand Up @@ -57925,7 +57952,8 @@
dayClassName: _this.props.dayClassName,
utcOffset: _this.props.utcOffset,
disabledKeyboardNavigation:
_this.props.disabledKeyboardNavigation
_this.props.disabledKeyboardNavigation,
renderDayContents: _this.props.renderDayContents
})
);

Expand Down Expand Up @@ -58016,7 +58044,8 @@
utcOffset: _propTypes2.default.oneOfType([
_propTypes2.default.number,
_propTypes2.default.string
])
]),
renderDayContents: _propTypes2.default.func
};
exports.default = Month;

Expand Down Expand Up @@ -58192,6 +58221,7 @@
endDate: _this.props.endDate,
dayClassName: _this.props.dayClassName,
utcOffset: _this.props.utcOffset,
renderDayContents: _this.props.renderDayContents,
disabledKeyboardNavigation:
_this.props.disabledKeyboardNavigation
});
Expand Down Expand Up @@ -58241,7 +58271,8 @@
utcOffset: _propTypes2.default.oneOfType([
_propTypes2.default.number,
_propTypes2.default.string
])
]),
renderDayContents: _propTypes2.default.func
};
exports.default = Week;

Expand Down Expand Up @@ -58536,7 +58567,11 @@
"aria-label": "day-" + (0, _date_utils.getDate)(this.props.day),
role: "option"
},
(0, _date_utils.getDate)(this.props.day)
this.props.renderDayContents
? this.props.renderDayContents(
(0, _date_utils.getDate)(this.props.day)
)
: (0, _date_utils.getDate)(this.props.day)
);
};

Expand All @@ -58562,7 +58597,8 @@
utcOffset: _propTypes2.default.oneOfType([
_propTypes2.default.number,
_propTypes2.default.string
])
]),
renderDayContents: _propTypes2.default.func
};
exports.default = Day;

Expand Down Expand Up @@ -59141,6 +59177,7 @@
popperComponent = _props.popperComponent,
popperModifiers = _props.popperModifiers,
popperPlacement = _props.popperPlacement,
popperProps = _props.popperProps,
targetComponent = _props.targetComponent;

var popper = void 0;
Expand All @@ -59152,7 +59189,13 @@
);
popper = _react2.default.createElement(
_reactPopper.Popper,
{ modifiers: popperModifiers, placement: popperPlacement },
_extends(
{
modifiers: popperModifiers,
placement: popperPlacement
},
popperProps
),
function(_ref) {
var ref = _ref.ref,
style = _ref.style,
Expand Down Expand Up @@ -59184,25 +59227,21 @@
}

return _react2.default.createElement(
"div",
_reactPopper.Manager,
null,
_react2.default.createElement(
_reactPopper.Manager,
_reactPopper.Reference,
null,
_react2.default.createElement(
_reactPopper.Reference,
null,
function(_ref2) {
var ref = _ref2.ref;
return _react2.default.createElement(
"div",
{ ref: ref, className: "react-datepicker-wrapper" },
targetComponent
);
}
),
popper
)
function(_ref2) {
var ref = _ref2.ref;
return _react2.default.createElement(
"div",
{ ref: ref, className: "react-datepicker-wrapper" },
targetComponent
);
}
),
popper
);
};

Expand All @@ -59219,6 +59258,7 @@
boundariesElement: "viewport"
}
},
popperProps: {},
popperPlacement: "bottom-start"
};
}
Expand All @@ -59235,6 +59275,7 @@
popperModifiers: _propTypes2.default.object, // <datepicker/> props
popperPlacement: _propTypes2.default.oneOf(popperPlacementPositions), // <datepicker/> props
popperContainer: _propTypes2.default.func,
popperProps: _propTypes2.default.object,
targetComponent: _propTypes2.default.element
};
exports.default = PopperComponent;
Expand Down Expand Up @@ -71509,7 +71550,8 @@
});

for (
var es6Symbols = "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split( // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
var es6Symbols = // 19.4.2.2, 19.4.2.3, 19.4.2.4, 19.4.2.6, 19.4.2.8, 19.4.2.9, 19.4.2.10, 19.4.2.11, 19.4.2.12, 19.4.2.13, 19.4.2.14
"hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(
","
),
j = 0;
Expand Down
9 changes: 9 additions & 0 deletions docs-site/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -970,6 +970,15 @@ github.com style (c) Vasily Polovnyov <[email protected]>
}
}

@supports (position: sticky) {
.examples__navigation {
overflow-y: scroll;
max-height: 100vh;
position: sticky;
top: 0;
}
}

.examples__navigation-item {
border-bottom: 1px solid #e4e4e4;
}
Expand Down

0 comments on commit 27b1507

Please sign in to comment.