@elliemae/ds-date-range-picker 2.0.0-next.1 → 2.0.0-next.6
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 +5 -2
- package/cjs/components/DatePickerRangeHeader/DatePickerRangeHeader.js +1 -0
- package/cjs/components/DayPickerRangeController.js +1 -0
- package/esm/DSDateRangePicker.js +1 -1
- package/esm/components/DSDateRangePickerImpl.js +5 -2
- package/esm/components/DatePickerRangeHeader/DatePickerRangeHeader.js +1 -0
- package/esm/components/DayPickerRangeController.js +1 -0
- package/package.json +4 -4
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
package/cjs/DSDateRangePicker.js
CHANGED
|
@@ -75,7 +75,7 @@ const DSDateRangePicker = ({
|
|
|
75
75
|
id
|
|
76
76
|
});
|
|
77
77
|
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
78
|
-
className:
|
|
78
|
+
className: "".concat(prefixBlockName, "-range ").concat(cssClassName, " ").concat(prefixBlockName, "-range"),
|
|
79
79
|
children: /*#__PURE__*/_jsx__default["default"](DSDateRangePickerImpl["default"], {
|
|
80
80
|
appendToBody: true,
|
|
81
81
|
disabled: disabled,
|
|
@@ -163,7 +163,10 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
|
|
|
163
163
|
const isEndDateAcceptable = !endDateBlocked && momentValue && endInputValue !== '';
|
|
164
164
|
const areDatesValid = startDate && momentValue && (startDate === null || startDate === void 0 ? void 0 : startDate.isValid()) && ((_momentValue2 = momentValue) === null || _momentValue2 === void 0 ? void 0 : _momentValue2.isValid());
|
|
165
165
|
const canEndBeSameAsStart = minimumNights === 0;
|
|
166
|
-
const isEndAcceptableWithSelectedStart = !startDate ||
|
|
166
|
+
const isEndAcceptableWithSelectedStart = !startDate || // we can't compare with start date because it's not yet set
|
|
167
|
+
areDatesValid && ( // it's set and both are valid
|
|
168
|
+
canEndBeSameAsStart && momentValue.diff(startDate, 'days') >= 0 || // >= is valid
|
|
169
|
+
!canEndBeSameAsStart && momentValue.diff(startDate, 'days') > 0); // only > is valid
|
|
167
170
|
|
|
168
171
|
const invalidDate = !isEndDateAcceptable || !isEndAcceptableWithSelectedStart;
|
|
169
172
|
if (endDateBlocked) momentValue = null;
|
|
@@ -252,7 +255,7 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
|
|
|
252
255
|
const safeStartInputValue = this.getSafeStartInputValue();
|
|
253
256
|
const safeEndInputValue = this.getSafeEndInputValue();
|
|
254
257
|
return /*#__PURE__*/_jsx__default["default"]("div", {
|
|
255
|
-
className:
|
|
258
|
+
className: "".concat(inputClass, " ").concat(inputClassModifier)
|
|
256
259
|
}, void 0, /*#__PURE__*/_jsx__default["default"]("div", {
|
|
257
260
|
className: classNameBlock('wrapper-input-date-range-picker-controller')
|
|
258
261
|
}, void 0, /*#__PURE__*/_jsx__default["default"](DSFormItemLayout__default["default"], {
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
5
5
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
var reactDates = require('react-dates');
|
|
8
9
|
var dsDatePicker = require('@elliemae/ds-date-picker');
|
package/esm/DSDateRangePicker.js
CHANGED
|
@@ -66,7 +66,7 @@ const DSDateRangePicker = ({
|
|
|
66
66
|
id
|
|
67
67
|
});
|
|
68
68
|
return /*#__PURE__*/jsx("div", _objectSpread(_objectSpread({}, containerProps), {}, {
|
|
69
|
-
className:
|
|
69
|
+
className: "".concat(prefixBlockName, "-range ").concat(cssClassName, " ").concat(prefixBlockName, "-range"),
|
|
70
70
|
children: /*#__PURE__*/_jsx(DSDateRangePickerImpl, {
|
|
71
71
|
appendToBody: true,
|
|
72
72
|
disabled: disabled,
|
|
@@ -149,7 +149,10 @@ class DSDateRangePickerImpl extends React.Component {
|
|
|
149
149
|
const isEndDateAcceptable = !endDateBlocked && momentValue && endInputValue !== '';
|
|
150
150
|
const areDatesValid = startDate && momentValue && (startDate === null || startDate === void 0 ? void 0 : startDate.isValid()) && ((_momentValue2 = momentValue) === null || _momentValue2 === void 0 ? void 0 : _momentValue2.isValid());
|
|
151
151
|
const canEndBeSameAsStart = minimumNights === 0;
|
|
152
|
-
const isEndAcceptableWithSelectedStart = !startDate ||
|
|
152
|
+
const isEndAcceptableWithSelectedStart = !startDate || // we can't compare with start date because it's not yet set
|
|
153
|
+
areDatesValid && ( // it's set and both are valid
|
|
154
|
+
canEndBeSameAsStart && momentValue.diff(startDate, 'days') >= 0 || // >= is valid
|
|
155
|
+
!canEndBeSameAsStart && momentValue.diff(startDate, 'days') > 0); // only > is valid
|
|
153
156
|
|
|
154
157
|
const invalidDate = !isEndDateAcceptable || !isEndAcceptableWithSelectedStart;
|
|
155
158
|
if (endDateBlocked) momentValue = null;
|
|
@@ -238,7 +241,7 @@ class DSDateRangePickerImpl extends React.Component {
|
|
|
238
241
|
const safeStartInputValue = this.getSafeStartInputValue();
|
|
239
242
|
const safeEndInputValue = this.getSafeEndInputValue();
|
|
240
243
|
return /*#__PURE__*/_jsx("div", {
|
|
241
|
-
className:
|
|
244
|
+
className: "".concat(inputClass, " ").concat(inputClassModifier)
|
|
242
245
|
}, void 0, /*#__PURE__*/_jsx("div", {
|
|
243
246
|
className: classNameBlock('wrapper-input-date-range-picker-controller')
|
|
244
247
|
}, void 0, /*#__PURE__*/_jsx(DSFormItemLayout, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
2
3
|
import { useState, useEffect } from 'react';
|
|
3
4
|
import moment from 'moment';
|
|
4
5
|
import DSInputMask, { MASK_TYPES, MASK_PIPES } from '@elliemae/ds-basic/form/InputMask';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
2
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
3
|
import _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
4
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
5
|
import { useRef, useEffect } from 'react';
|
|
5
6
|
import { DayPickerRangeController as DayPickerRangeController$1 } from 'react-dates';
|
|
6
7
|
import { DatePickerNavigation, DatePickerDay, renderMonthElement } from '@elliemae/ds-date-picker';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-date-range-picker",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Date Range Picker",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -56,9 +56,9 @@
|
|
|
56
56
|
"build": "node ../../scripts/build/build.js"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@elliemae/ds-basic": "2.0.0-next.
|
|
60
|
-
"@elliemae/ds-classnames": "2.0.0-next.
|
|
61
|
-
"@elliemae/ds-date-picker": "2.0.0-next.
|
|
59
|
+
"@elliemae/ds-basic": "2.0.0-next.6",
|
|
60
|
+
"@elliemae/ds-classnames": "2.0.0-next.6",
|
|
61
|
+
"@elliemae/ds-date-picker": "2.0.0-next.6",
|
|
62
62
|
"moment": "~2.29.1",
|
|
63
63
|
"prop-types": "~15.7.2",
|
|
64
64
|
"react-dates": "~21.8.0",
|
package/cjs/package.json
DELETED