Socket
Socket
Sign inDemoInstall

@blueprintjs/datetime

Package Overview
Dependencies
Maintainers
1
Versions
253
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blueprintjs/datetime - npm Package Compare versions

Comparing version 1.15.0 to 1.16.0

2

dist/common/errors.js

@@ -19,3 +19,3 @@ /*

exports.DATERANGEPICKER_PREFERRED_BOUNDARY_TO_MODIFY_INVALID = "<DateRangePicker> preferredBoundaryToModify must be a valid DateRangeBoundary if defined.";
exports.DATEINPUT_WARN_DEPRECATED_POPOVER_POSITION = ns + " DEPRECATION: <DateInput> popoverProps is deprecated. Use popoverProps.position.";
exports.DATEINPUT_WARN_DEPRECATED_POPOVER_POSITION = ns + " DEPRECATION: <DateInput> popoverPosition is deprecated. Use popoverProps.position.";
exports.DATEINPUT_WARN_DEPRECATED_OPEN_ON_FOCUS = ns + " DEPRECATION: <DateInput> openOnFocus is deprecated. This feature will be removed in the next major version.";

@@ -22,0 +22,0 @@ exports.DATERANGEINPUT_NULL_VALUE = ns + " <DateRangeInput> value cannot be null. Pass undefined to clear the value and operate in " +

@@ -110,2 +110,5 @@ import * as moment from "moment";

private handleDateChange;
private shouldCheckForDateChanges(prevMomentDate, nextMomentDate);
private hasMonthChanged(prevMomentDate, nextMomentDate);
private hasTimeChanged(prevMomentDate, nextMomentDate);
private handleInputFocus;

@@ -112,0 +115,0 @@ private handleInputClick;

@@ -44,6 +44,11 @@ /*

_this.handleDateChange = function (date, hasUserManuallySelectedDate) {
var prevMomentDate = _this.state.value;
var momentDate = dateUtils_1.fromDateToMoment(date);
var hasMonthChanged = date !== null && !dateUtils_1.isMomentNull(_this.state.value) && _this.state.value.isValid() &&
momentDate.month() !== _this.state.value.month();
var isOpen = !(_this.props.closeOnSelection && hasUserManuallySelectedDate && !hasMonthChanged);
// this change handler was triggered by a change in month, day, or (if enabled) time. for UX
// purposes, we want to close the popover only if the user explicitly clicked a day within
// the current month.
var isOpen = (!hasUserManuallySelectedDate
|| _this.hasMonthChanged(prevMomentDate, momentDate)
|| _this.hasTimeChanged(prevMomentDate, momentDate)
|| !_this.props.closeOnSelection);
if (_this.props.value === undefined) {

@@ -155,3 +160,3 @@ _this.setState({ isInputFocused: false, isOpen: isOpen, value: momentDate });

return (React.createElement(core_1.Popover, tslib_1.__assign({ inline: true, isOpen: this.state.isOpen && !this.props.disabled, position: this.props.popoverPosition }, popoverProps, { autoFocus: false, enforceFocus: false, content: popoverContent, onClose: this.handleClosePopover, popoverClassName: classNames("pt-dateinput-popover", popoverProps.popoverClassName) }),
React.createElement(core_1.InputGroup, tslib_1.__assign({ placeholder: this.props.format, rightElement: this.props.rightElement }, htmlInputProps, { className: inputClasses, disabled: this.props.disabled, inputRef: this.setInputRef, type: "text", onBlur: this.handleInputBlur, onChange: this.handleInputChange, onClick: this.handleInputClick, onFocus: this.handleInputFocus, value: dateString }))));
React.createElement(core_1.InputGroup, tslib_1.__assign({ autoComplete: "off", placeholder: this.props.format, rightElement: this.props.rightElement }, htmlInputProps, { className: inputClasses, disabled: this.props.disabled, inputRef: this.setInputRef, type: "text", onBlur: this.handleInputBlur, onChange: this.handleInputChange, onClick: this.handleInputClick, onFocus: this.handleInputFocus, value: dateString }))));
};

@@ -178,2 +183,17 @@ DateInput.prototype.componentWillReceiveProps = function (nextProps) {

};
DateInput.prototype.shouldCheckForDateChanges = function (prevMomentDate, nextMomentDate) {
return nextMomentDate != null && !dateUtils_1.isMomentNull(prevMomentDate) && prevMomentDate.isValid();
};
DateInput.prototype.hasMonthChanged = function (prevMomentDate, nextMomentDate) {
return this.shouldCheckForDateChanges(prevMomentDate, nextMomentDate)
&& nextMomentDate.month() !== prevMomentDate.month();
};
DateInput.prototype.hasTimeChanged = function (prevMomentDate, nextMomentDate) {
return this.shouldCheckForDateChanges(prevMomentDate, nextMomentDate)
&& this.props.timePrecision != null
&& (nextMomentDate.hours() !== prevMomentDate.hours()
|| nextMomentDate.minutes() !== prevMomentDate.minutes()
|| nextMomentDate.seconds() !== prevMomentDate.seconds()
|| nextMomentDate.milliseconds() !== prevMomentDate.milliseconds());
};
/** safe wrapper around invoking input props event handler (prop defaults to undefined) */

@@ -180,0 +200,0 @@ DateInput.prototype.safeInvokeInputProp = function (name, e) {

@@ -45,3 +45,3 @@ /*

_a), inputProps.className);
return (React.createElement(core_1.InputGroup, tslib_1.__assign({}, htmlProps, { className: classes, disabled: _this.props.disabled, inputRef: _this.getInputRef(boundary), onBlur: handleInputEvent, onChange: handleInputEvent, onClick: handleInputEvent, onFocus: handleInputEvent, onKeyDown: handleInputEvent, onMouseDown: handleInputEvent, placeholder: _this.getInputPlaceholderString(boundary), value: _this.getInputDisplayString(boundary) })));
return (React.createElement(core_1.InputGroup, tslib_1.__assign({ autoComplete: "off" }, htmlProps, { className: classes, disabled: _this.props.disabled, inputRef: _this.getInputRef(boundary), onBlur: handleInputEvent, onChange: handleInputEvent, onClick: handleInputEvent, onFocus: handleInputEvent, onKeyDown: handleInputEvent, onMouseDown: handleInputEvent, placeholder: _this.getInputPlaceholderString(boundary), value: _this.getInputDisplayString(boundary) })));
var _a;

@@ -48,0 +48,0 @@ };

{
"name": "@blueprintjs/datetime",
"version": "1.15.0",
"version": "1.16.0",
"description": "Components for interacting with dates and times",

@@ -19,5 +19,5 @@ "main": "dist/index.js",

"react": "15.5.1",
"react-addons-test-utils": "15.5.1",
"react-addons-css-transition-group": "15.5.1",
"react-dom": "15.5.1",
"react-transition-group": "1.1.3"
"react-test-renderer": "15.5.4"
},

@@ -24,0 +24,0 @@ "repository": {

@@ -29,3 +29,3 @@ /*

export const DATEINPUT_WARN_DEPRECATED_POPOVER_POSITION =
`${ns} DEPRECATION: <DateInput> popoverProps is deprecated. Use popoverProps.position.`;
`${ns} DEPRECATION: <DateInput> popoverPosition is deprecated. Use popoverProps.position.`;
export const DATEINPUT_WARN_DEPRECATED_OPEN_ON_FOCUS =

@@ -32,0 +32,0 @@ `${ns} DEPRECATION: <DateInput> openOnFocus is deprecated. This feature will be removed in the next major version.`;

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc