@elliemae/ds-date-range-picker 2.4.2-rc.9 → 2.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/DSDateRangePicker.js +1 -1
- package/cjs/components/DSDateRangePickerImpl.js +3 -7
- package/cjs/components/DatePickerRangeHeader/DatePickerRangeHeader.js +0 -1
- package/cjs/components/DayPickerRangeController.js +4 -5
- package/esm/DSDateRangePicker.js +1 -1
- package/esm/components/DSDateRangePickerImpl.js +3 -7
- package/esm/components/DatePickerRangeHeader/DatePickerRangeHeader.js +0 -1
- package/esm/components/DayPickerRangeController.js +4 -5
- package/package.json +6 -6
package/cjs/DSDateRangePicker.js
CHANGED
|
@@ -81,7 +81,7 @@ const DSDateRangePicker = _ref => {
|
|
|
81
81
|
id
|
|
82
82
|
});
|
|
83
83
|
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
84
|
-
className:
|
|
84
|
+
className: `${prefixBlockName}-range ${cssClassName} ${prefixBlockName}-range`,
|
|
85
85
|
children: /*#__PURE__*/_jsx__default["default"](DSDateRangePickerImpl["default"], {
|
|
86
86
|
appendToBody: true,
|
|
87
87
|
disabled: disabled,
|
|
@@ -106,8 +106,6 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
|
|
|
106
106
|
};
|
|
107
107
|
|
|
108
108
|
this.handleChangeStart = e => {
|
|
109
|
-
var _momentValue;
|
|
110
|
-
|
|
111
109
|
const {
|
|
112
110
|
onChangeStartInput,
|
|
113
111
|
isDayBlocked,
|
|
@@ -125,7 +123,7 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
|
|
|
125
123
|
|
|
126
124
|
const startDateBlocked = isDayBlocked(momentValue);
|
|
127
125
|
const isStartDateAcceptable = !startDateBlocked && momentValue && startInputVal !== '';
|
|
128
|
-
const areDatesValid = endDate && momentValue &&
|
|
126
|
+
const areDatesValid = endDate && momentValue && endDate?.isValid() && momentValue?.isValid();
|
|
129
127
|
const canEndBeSameAsStart = minimumNights === 0;
|
|
130
128
|
const isStartAcceptableWithSelectedEnd = !endDate || areDatesValid && (canEndBeSameAsStart && momentValue.diff(endDate, 'days') <= 0 || !canEndBeSameAsStart && momentValue.diff(endDate, 'days') < 0);
|
|
131
129
|
const invalidDate = !isStartDateAcceptable || !isStartAcceptableWithSelectedEnd;
|
|
@@ -141,8 +139,6 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
|
|
|
141
139
|
};
|
|
142
140
|
|
|
143
141
|
this.handleChangeEnd = e => {
|
|
144
|
-
var _momentValue2;
|
|
145
|
-
|
|
146
142
|
const {
|
|
147
143
|
onChangeEndInput,
|
|
148
144
|
isDayBlocked,
|
|
@@ -160,7 +156,7 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
|
|
|
160
156
|
|
|
161
157
|
const endDateBlocked = isDayBlocked(momentValue);
|
|
162
158
|
const isEndDateAcceptable = !endDateBlocked && momentValue && endInputValue !== '';
|
|
163
|
-
const areDatesValid = startDate && momentValue &&
|
|
159
|
+
const areDatesValid = startDate && momentValue && startDate?.isValid() && momentValue?.isValid();
|
|
164
160
|
const canEndBeSameAsStart = minimumNights === 0;
|
|
165
161
|
const isEndAcceptableWithSelectedStart = !startDate || // we can't compare with start date because it's not yet set
|
|
166
162
|
areDatesValid && ( // it's set and both are valid
|
|
@@ -256,7 +252,7 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
|
|
|
256
252
|
const safeStartInputValue = this.getSafeStartInputValue();
|
|
257
253
|
const safeEndInputValue = this.getSafeEndInputValue();
|
|
258
254
|
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
259
|
-
className:
|
|
255
|
+
className: `${inputClass} ${inputClassModifier}`
|
|
260
256
|
}, void 0, /*#__PURE__*/_jsx__default["default"]("div", {
|
|
261
257
|
className: classNameBlock('wrapper-input-date-range-picker-controller')
|
|
262
258
|
}, void 0, /*#__PURE__*/_jsx__default["default"](DSInputMask.DSFormItemLayout, {
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
|
-
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
5
|
-
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
|
-
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
3
|
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
8
4
|
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
5
|
require('core-js/modules/esnext.iterator.filter.js');
|
|
10
6
|
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
11
7
|
require('core-js/modules/esnext.iterator.for-each.js');
|
|
8
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
9
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
10
|
+
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
12
11
|
var React = require('react');
|
|
13
12
|
var reactDates = require('react-dates');
|
|
14
13
|
var dsDatePicker = require('@elliemae/ds-date-picker');
|
|
@@ -84,7 +83,7 @@ const DayPickerRangeController = _ref => {
|
|
|
84
83
|
} else if (focusedElement === next) {
|
|
85
84
|
event.stopPropagation();
|
|
86
85
|
setTimeout(() => {
|
|
87
|
-
next
|
|
86
|
+
next?.focus();
|
|
88
87
|
}, 240);
|
|
89
88
|
}
|
|
90
89
|
|
package/esm/DSDateRangePicker.js
CHANGED
|
@@ -72,7 +72,7 @@ const DSDateRangePicker = _ref => {
|
|
|
72
72
|
id
|
|
73
73
|
});
|
|
74
74
|
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
75
|
-
className:
|
|
75
|
+
className: `${prefixBlockName}-range ${cssClassName} ${prefixBlockName}-range`,
|
|
76
76
|
children: /*#__PURE__*/_jsx(DSDateRangePickerImpl, {
|
|
77
77
|
appendToBody: true,
|
|
78
78
|
disabled: disabled,
|
|
@@ -95,8 +95,6 @@ class DSDateRangePickerImpl extends React.Component {
|
|
|
95
95
|
};
|
|
96
96
|
|
|
97
97
|
this.handleChangeStart = e => {
|
|
98
|
-
var _momentValue;
|
|
99
|
-
|
|
100
98
|
const {
|
|
101
99
|
onChangeStartInput,
|
|
102
100
|
isDayBlocked,
|
|
@@ -114,7 +112,7 @@ class DSDateRangePickerImpl extends React.Component {
|
|
|
114
112
|
|
|
115
113
|
const startDateBlocked = isDayBlocked(momentValue);
|
|
116
114
|
const isStartDateAcceptable = !startDateBlocked && momentValue && startInputVal !== '';
|
|
117
|
-
const areDatesValid = endDate && momentValue &&
|
|
115
|
+
const areDatesValid = endDate && momentValue && endDate?.isValid() && momentValue?.isValid();
|
|
118
116
|
const canEndBeSameAsStart = minimumNights === 0;
|
|
119
117
|
const isStartAcceptableWithSelectedEnd = !endDate || areDatesValid && (canEndBeSameAsStart && momentValue.diff(endDate, 'days') <= 0 || !canEndBeSameAsStart && momentValue.diff(endDate, 'days') < 0);
|
|
120
118
|
const invalidDate = !isStartDateAcceptable || !isStartAcceptableWithSelectedEnd;
|
|
@@ -130,8 +128,6 @@ class DSDateRangePickerImpl extends React.Component {
|
|
|
130
128
|
};
|
|
131
129
|
|
|
132
130
|
this.handleChangeEnd = e => {
|
|
133
|
-
var _momentValue2;
|
|
134
|
-
|
|
135
131
|
const {
|
|
136
132
|
onChangeEndInput,
|
|
137
133
|
isDayBlocked,
|
|
@@ -149,7 +145,7 @@ class DSDateRangePickerImpl extends React.Component {
|
|
|
149
145
|
|
|
150
146
|
const endDateBlocked = isDayBlocked(momentValue);
|
|
151
147
|
const isEndDateAcceptable = !endDateBlocked && momentValue && endInputValue !== '';
|
|
152
|
-
const areDatesValid = startDate && momentValue &&
|
|
148
|
+
const areDatesValid = startDate && momentValue && startDate?.isValid() && momentValue?.isValid();
|
|
153
149
|
const canEndBeSameAsStart = minimumNights === 0;
|
|
154
150
|
const isEndAcceptableWithSelectedStart = !startDate || // we can't compare with start date because it's not yet set
|
|
155
151
|
areDatesValid && ( // it's set and both are valid
|
|
@@ -245,7 +241,7 @@ class DSDateRangePickerImpl extends React.Component {
|
|
|
245
241
|
const safeStartInputValue = this.getSafeStartInputValue();
|
|
246
242
|
const safeEndInputValue = this.getSafeEndInputValue();
|
|
247
243
|
return /*#__PURE__*/_jsx("div", {
|
|
248
|
-
className:
|
|
244
|
+
className: `${inputClass} ${inputClassModifier}`
|
|
249
245
|
}, void 0, /*#__PURE__*/_jsx("div", {
|
|
250
246
|
className: classNameBlock('wrapper-input-date-range-picker-controller')
|
|
251
247
|
}, void 0, /*#__PURE__*/_jsx(DSFormItemLayout, {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
2
|
import { useState, useEffect } from 'react';
|
|
4
3
|
import moment from 'moment';
|
|
5
4
|
import DSInputMask, { DSInputGroup, MASK_TYPES, MASK_PIPES } from '@elliemae/ds-form';
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
-
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
-
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
5
1
|
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
6
2
|
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
7
3
|
import 'core-js/modules/esnext.iterator.filter.js';
|
|
8
4
|
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
9
5
|
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
6
|
+
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
7
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
10
9
|
import { useRef, useEffect } from 'react';
|
|
11
10
|
import { DayPickerRangeController as DayPickerRangeController$1 } from 'react-dates';
|
|
12
11
|
import { DatePickerNavigation, DatePickerDay, renderMonthElement } from '@elliemae/ds-date-picker';
|
|
@@ -76,7 +75,7 @@ const DayPickerRangeController = _ref => {
|
|
|
76
75
|
} else if (focusedElement === next) {
|
|
77
76
|
event.stopPropagation();
|
|
78
77
|
setTimeout(() => {
|
|
79
|
-
next
|
|
78
|
+
next?.focus();
|
|
80
79
|
}, 240);
|
|
81
80
|
}
|
|
82
81
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-date-range-picker",
|
|
3
|
-
"version": "2.4.2
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Date Range Picker",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
"build": "node ../../scripts/build/build.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@elliemae/ds-classnames": "2.4.2
|
|
60
|
-
"@elliemae/ds-date-picker": "2.4.2
|
|
61
|
-
"@elliemae/ds-form": "2.4.2
|
|
62
|
-
"@elliemae/ds-icons": "2.4.2
|
|
63
|
-
"@elliemae/ds-popper": "2.4.2
|
|
59
|
+
"@elliemae/ds-classnames": "2.4.2",
|
|
60
|
+
"@elliemae/ds-date-picker": "2.4.2",
|
|
61
|
+
"@elliemae/ds-form": "2.4.2",
|
|
62
|
+
"@elliemae/ds-icons": "2.4.2",
|
|
63
|
+
"@elliemae/ds-popper": "2.4.2",
|
|
64
64
|
"moment": "~2.29.1",
|
|
65
65
|
"prop-types": "~15.7.2",
|
|
66
66
|
"react-dates": "~21.8.0",
|