@elliemae/ds-date-picker 2.0.0-alpha.1 → 2.0.0-alpha.13
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/DSDatePicker.js +59 -55
- package/cjs/components/DSDatePickerImpl.js +54 -53
- package/cjs/components/DatePickerController/DatePickerController.js +73 -70
- package/cjs/components/DatePickerDay/DatePickerDay.js +13 -10
- package/cjs/components/DatePickerDropdown.js +20 -14
- package/cjs/components/DatePickerHeader/DatePickerHeader.js +10 -11
- package/cjs/components/DatePickerNavigation/DatePickerNavigation.js +18 -15
- package/cjs/components/DatePickerPicker/DatePickerPicker.js +17 -17
- package/cjs/components/DatePickerRange/DatePickerRange.js +31 -22
- package/cjs/components/DatePickerRangeHeader/DatePickerRangeHeader.js +31 -29
- package/cjs/components/DatePickerRenderMonth/DatePickerRenderMonth.js +32 -32
- package/cjs/components/DatePickerSingleDate/DatePickerSingleDate.js +13 -11
- package/cjs/components/SingleRangeDateSwitcher/SingleRangeDateSwitcher.js +23 -21
- package/cjs/defaultPhrases.js +43 -22
- package/cjs/index.js +1 -1
- package/esm/DSDatePicker.js +52 -48
- package/esm/components/DSDatePickerImpl.js +36 -33
- package/esm/components/DatePickerController/DatePickerController.js +26 -22
- package/esm/components/DatePickerDay/DatePickerDay.js +13 -10
- package/esm/components/DatePickerDropdown.js +17 -11
- package/esm/components/DatePickerHeader/DatePickerHeader.js +9 -8
- package/esm/components/DatePickerNavigation/DatePickerNavigation.js +18 -15
- package/esm/components/DatePickerPicker/DatePickerPicker.js +1 -1
- package/esm/components/DatePickerRange/DatePickerRange.js +26 -16
- package/esm/components/DatePickerRangeHeader/DatePickerRangeHeader.js +23 -19
- package/esm/components/DatePickerRenderMonth/DatePickerRenderMonth.js +32 -30
- package/esm/components/DatePickerSingleDate/DatePickerSingleDate.js +8 -5
- package/esm/components/SingleRangeDateSwitcher/SingleRangeDateSwitcher.js +19 -16
- package/esm/defaultPhrases.js +42 -21
- package/package.json +15 -5
- package/types/components/DatePickerDropdown.d.ts +1 -1
- package/types/components/DatePickerHeader/DatePickerHeader.d.ts +1 -1
- package/types/components/DatePickerPicker/DatePickerPicker.d.ts +2 -2
- package/types/components/DatePickerRange/DatePickerRange.d.ts +1 -1
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
package/esm/DSDatePicker.js
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
7
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
8
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
9
|
import 'react';
|
|
4
10
|
import { PropTypes, describe } from 'react-desc';
|
|
5
11
|
import 'react-dates/initialize';
|
|
@@ -25,48 +31,49 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
25
31
|
|
|
26
32
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
27
33
|
|
|
28
|
-
const DSDatePicker =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
34
|
+
const DSDatePicker = _ref => {
|
|
35
|
+
let {
|
|
36
|
+
containerProps = {},
|
|
37
|
+
id = '',
|
|
38
|
+
appendToBody = true,
|
|
39
|
+
className = '',
|
|
40
|
+
date,
|
|
41
|
+
value,
|
|
42
|
+
placeholder = '',
|
|
43
|
+
disabled = false,
|
|
44
|
+
required = false,
|
|
45
|
+
readOnly = false,
|
|
46
|
+
hasError = false,
|
|
47
|
+
screenReaderInputMessage = 'Select date',
|
|
48
|
+
enableOutsideDays = true,
|
|
49
|
+
initialVisibleMonth = moment(),
|
|
50
|
+
firstDayOfWeek = 0,
|
|
51
|
+
keepOpenOnDateSelect = false,
|
|
52
|
+
hideKeyboardShortcutsPanel = true,
|
|
53
|
+
onChange = () => null,
|
|
54
|
+
onDateChange = undefined,
|
|
55
|
+
onPrevMonthClick = () => null,
|
|
56
|
+
onNextMonthClick = () => null,
|
|
57
|
+
onClose = () => null,
|
|
58
|
+
onFocus = () => null,
|
|
59
|
+
onBlur = () => null,
|
|
60
|
+
phrases = SingleDatePickerPhrases,
|
|
61
|
+
displayFormat = 'L',
|
|
62
|
+
displayFormatDay = 'D',
|
|
63
|
+
transitionDuration = 0,
|
|
64
|
+
verticalSpacing = 0,
|
|
65
|
+
isDayBlocked = () => false,
|
|
66
|
+
isOutsideRange = () => false,
|
|
67
|
+
isDayHighlighted = () => false,
|
|
68
|
+
numberOfMonths = 1,
|
|
69
|
+
openDirection = 'down',
|
|
70
|
+
tabIndex = '',
|
|
71
|
+
zIndex = 1,
|
|
72
|
+
pickerProps = {},
|
|
73
|
+
calendarProps = {},
|
|
74
|
+
autoClear = false,
|
|
75
|
+
focusCurrentDate = false
|
|
76
|
+
} = _ref;
|
|
70
77
|
const {
|
|
71
78
|
cssClassName
|
|
72
79
|
} = convertPropToCssClassName('datepicker', className, {
|
|
@@ -101,8 +108,8 @@ const DSDatePicker = ({
|
|
|
101
108
|
onBlur: onBlur,
|
|
102
109
|
onClose: onClose,
|
|
103
110
|
onChange: onChange,
|
|
104
|
-
onDateChange: (
|
|
105
|
-
if (onDateChange) onDateChange(...
|
|
111
|
+
onDateChange: function () {
|
|
112
|
+
if (onDateChange) onDateChange(...arguments);
|
|
106
113
|
},
|
|
107
114
|
onFocus: onFocus,
|
|
108
115
|
onNextMonthClick: onNextMonthClick,
|
|
@@ -144,10 +151,7 @@ const datePickerProps = {
|
|
|
144
151
|
firstDayOfWeek: PropTypes.number.description('first day of week').defaultValue(0),
|
|
145
152
|
keepOpenOnDateSelect: PropTypes.bool.description('keep picker open when a date is selected').defaultValue(false),
|
|
146
153
|
hideKeyboardShortcutsPanel: PropTypes.bool.description('hide keyabord shortcut panel or not').defaultValue(true),
|
|
147
|
-
onChange: PropTypes.func.description(
|
|
148
|
-
function executed when input changes. This could trigger with invalid dates. It returns a string and a moment
|
|
149
|
-
if the date is valid.
|
|
150
|
-
`),
|
|
154
|
+
onChange: PropTypes.func.description("\n function executed when input changes. This could trigger with invalid dates. It returns a string and a moment\n if the date is valid.\n "),
|
|
151
155
|
onDateChange: PropTypes.func.description('function executed when date changes. This doesnt trigger with invalid dates. It returns a moment object'),
|
|
152
156
|
onPrevMonthClick: PropTypes.func.description('function executed when clicking on prev month button'),
|
|
153
157
|
onNextMonthClick: PropTypes.func.description('function executed when clicking on next month button'),
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
|
-
import
|
|
2
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import moment from 'moment';
|
|
5
|
-
import DSInputGroup from '@elliemae/ds-
|
|
6
|
-
import { DSDateInputV2 } from '@elliemae/ds-basic/form/DateInputV2';
|
|
5
|
+
import { DSInputGroup, DSDateInputV2 } from '@elliemae/ds-form';
|
|
7
6
|
import DSDatePickerController from './DatePickerController/DatePickerController.js';
|
|
8
7
|
import DatePickerDropdown from './DatePickerDropdown.js';
|
|
9
8
|
|
|
@@ -12,13 +11,13 @@ class DSdatePickerImpl extends React.Component {
|
|
|
12
11
|
constructor(props) {
|
|
13
12
|
super(props);
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
this.onClickPicker = () => {
|
|
16
15
|
this.setState({
|
|
17
16
|
inputFocused: true
|
|
18
17
|
});
|
|
19
|
-
}
|
|
18
|
+
};
|
|
20
19
|
|
|
21
|
-
|
|
20
|
+
this.getSafeValue = () => {
|
|
22
21
|
const {
|
|
23
22
|
value,
|
|
24
23
|
date,
|
|
@@ -45,9 +44,9 @@ class DSdatePickerImpl extends React.Component {
|
|
|
45
44
|
}
|
|
46
45
|
|
|
47
46
|
return null;
|
|
48
|
-
}
|
|
47
|
+
};
|
|
49
48
|
|
|
50
|
-
|
|
49
|
+
this.getSafeInputValue = () => {
|
|
51
50
|
const safeValue = this.getSafeValue();
|
|
52
51
|
|
|
53
52
|
if (safeValue && safeValue.isValid()) {
|
|
@@ -58,17 +57,17 @@ class DSdatePickerImpl extends React.Component {
|
|
|
58
57
|
dataInput
|
|
59
58
|
} = this.state;
|
|
60
59
|
return dataInput;
|
|
61
|
-
}
|
|
60
|
+
};
|
|
62
61
|
|
|
63
|
-
|
|
62
|
+
this.isControlled = () => {
|
|
64
63
|
const {
|
|
65
64
|
value,
|
|
66
65
|
date
|
|
67
66
|
} = this.props;
|
|
68
67
|
return Boolean(value) || Boolean(date);
|
|
69
|
-
}
|
|
68
|
+
};
|
|
70
69
|
|
|
71
|
-
|
|
70
|
+
this.handleDateChange = (date, event) => {
|
|
72
71
|
const {
|
|
73
72
|
readOnly,
|
|
74
73
|
onDateChange,
|
|
@@ -95,9 +94,9 @@ class DSdatePickerImpl extends React.Component {
|
|
|
95
94
|
onBlur(date.format(FORMAT), date);
|
|
96
95
|
}
|
|
97
96
|
}
|
|
98
|
-
}
|
|
97
|
+
};
|
|
99
98
|
|
|
100
|
-
|
|
99
|
+
this.handleInputChange = (dataInput, newDate) => {
|
|
101
100
|
const {
|
|
102
101
|
onChange
|
|
103
102
|
} = this.props;
|
|
@@ -107,9 +106,9 @@ class DSdatePickerImpl extends React.Component {
|
|
|
107
106
|
};
|
|
108
107
|
this.setState(() => newState);
|
|
109
108
|
onChange(dataInput, newDate);
|
|
110
|
-
}
|
|
109
|
+
};
|
|
111
110
|
|
|
112
|
-
|
|
111
|
+
this.handleChange = newDate => {
|
|
113
112
|
if (!newDate) return;
|
|
114
113
|
const {
|
|
115
114
|
onDateChange
|
|
@@ -120,17 +119,18 @@ class DSdatePickerImpl extends React.Component {
|
|
|
120
119
|
selectedDate: momentValue
|
|
121
120
|
});
|
|
122
121
|
onDateChange(momentValue);
|
|
123
|
-
}
|
|
122
|
+
};
|
|
124
123
|
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
this.handleFocus = _ref => {
|
|
125
|
+
let {
|
|
126
|
+
focused
|
|
127
|
+
} = _ref;
|
|
128
128
|
this.setState({
|
|
129
129
|
inputFocused: focused
|
|
130
130
|
});
|
|
131
|
-
}
|
|
131
|
+
};
|
|
132
132
|
|
|
133
|
-
|
|
133
|
+
this.handleCalendarClose = () => {
|
|
134
134
|
const {
|
|
135
135
|
onClose
|
|
136
136
|
} = this.props;
|
|
@@ -139,9 +139,9 @@ class DSdatePickerImpl extends React.Component {
|
|
|
139
139
|
});
|
|
140
140
|
this.handleOnBlur();
|
|
141
141
|
onClose();
|
|
142
|
-
}
|
|
142
|
+
};
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
this.handleClickEscape = () => {
|
|
145
145
|
const {
|
|
146
146
|
onClose
|
|
147
147
|
} = this.props;
|
|
@@ -150,9 +150,9 @@ class DSdatePickerImpl extends React.Component {
|
|
|
150
150
|
});
|
|
151
151
|
this.handleOnBlur();
|
|
152
152
|
onClose();
|
|
153
|
-
}
|
|
153
|
+
};
|
|
154
154
|
|
|
155
|
-
|
|
155
|
+
this.handleOnBlur = () => {
|
|
156
156
|
setTimeout(() => {
|
|
157
157
|
const {
|
|
158
158
|
onBlur,
|
|
@@ -175,14 +175,14 @@ class DSdatePickerImpl extends React.Component {
|
|
|
175
175
|
onBlur(dataInput, null);
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
|
-
}
|
|
178
|
+
};
|
|
179
179
|
|
|
180
|
-
|
|
180
|
+
this.handleInputFocus = dataInput => {
|
|
181
181
|
const {
|
|
182
182
|
onFocus
|
|
183
183
|
} = this.props;
|
|
184
184
|
onFocus(dataInput);
|
|
185
|
-
}
|
|
185
|
+
};
|
|
186
186
|
|
|
187
187
|
this.state = {
|
|
188
188
|
pickerRef: /*#__PURE__*/React.createRef(),
|
|
@@ -248,6 +248,8 @@ class DSdatePickerImpl extends React.Component {
|
|
|
248
248
|
}
|
|
249
249
|
|
|
250
250
|
render() {
|
|
251
|
+
var _this = this;
|
|
252
|
+
|
|
251
253
|
const {
|
|
252
254
|
inputFocused
|
|
253
255
|
} = this.state;
|
|
@@ -302,10 +304,11 @@ class DSdatePickerImpl extends React.Component {
|
|
|
302
304
|
keepOpenOnDateSelect: keepOpenOnDateSelect,
|
|
303
305
|
numberOfMonths: numberOfMonths,
|
|
304
306
|
onClickEscape: this.handleClickEscape,
|
|
305
|
-
onClose: (
|
|
306
|
-
if (
|
|
307
|
-
onClose(...
|
|
308
|
-
|
|
307
|
+
onClose: function () {
|
|
308
|
+
if (_this.state.pickerRef.current) _this.state.pickerRef.current.focus();
|
|
309
|
+
onClose(...arguments);
|
|
310
|
+
|
|
311
|
+
_this.setState({
|
|
309
312
|
inputFocused: false
|
|
310
313
|
});
|
|
311
314
|
},
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
1
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
2
|
+
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
3
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
6
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
7
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
8
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
3
9
|
import React from 'react';
|
|
4
10
|
import { debounce } from 'lodash';
|
|
5
11
|
import PropTypes from 'prop-types';
|
|
@@ -7,7 +13,7 @@ import moment from 'moment';
|
|
|
7
13
|
import 'react-dates/initialize';
|
|
8
14
|
import { DayPickerSingleDateController } from 'react-dates';
|
|
9
15
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
10
|
-
import ChevronLeft from '@elliemae/ds-icons
|
|
16
|
+
import { ChevronLeft } from '@elliemae/ds-icons';
|
|
11
17
|
import { SingleDatePickerPhrases } from '../../defaultPhrases.js';
|
|
12
18
|
import { renderMonthElement } from '../DatePickerRenderMonth/DatePickerRenderMonth.js';
|
|
13
19
|
import Navigation from '../DatePickerNavigation/DatePickerNavigation.js';
|
|
@@ -43,14 +49,14 @@ class DSDatePickerController extends React.Component {
|
|
|
43
49
|
constructor(props) {
|
|
44
50
|
super(props);
|
|
45
51
|
|
|
46
|
-
|
|
52
|
+
this.handleMouseUp = () => {
|
|
47
53
|
var _focusedElement$blur;
|
|
48
54
|
|
|
49
55
|
const focusedElement = document.activeElement;
|
|
50
56
|
focusedElement === null || focusedElement === void 0 ? void 0 : (_focusedElement$blur = focusedElement.blur) === null || _focusedElement$blur === void 0 ? void 0 : _focusedElement$blur.call(focusedElement);
|
|
51
|
-
}
|
|
57
|
+
};
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
this.handleKeyDown = event => {
|
|
54
60
|
const [firstDay, ...restOfDays] = document.getElementsByClassName('CalendarMonthGrid_month__horizontal')[1].getElementsByClassName('CalendarDay');
|
|
55
61
|
const [lastDay] = restOfDays.slice(-1);
|
|
56
62
|
const {
|
|
@@ -70,9 +76,9 @@ class DSDatePickerController extends React.Component {
|
|
|
70
76
|
onClickEscape();
|
|
71
77
|
break;
|
|
72
78
|
}
|
|
73
|
-
}
|
|
79
|
+
};
|
|
74
80
|
|
|
75
|
-
|
|
81
|
+
this.getSafeValue = () => {
|
|
76
82
|
const {
|
|
77
83
|
value,
|
|
78
84
|
date,
|
|
@@ -86,17 +92,17 @@ class DSDatePickerController extends React.Component {
|
|
|
86
92
|
if (defaultValue) return moment(defaultValue);
|
|
87
93
|
if (selectedDate) return moment(selectedDate);
|
|
88
94
|
return null;
|
|
89
|
-
}
|
|
95
|
+
};
|
|
90
96
|
|
|
91
|
-
|
|
97
|
+
this.isControlled = () => {
|
|
92
98
|
const {
|
|
93
99
|
value,
|
|
94
100
|
date
|
|
95
101
|
} = this.props;
|
|
96
102
|
return Boolean(value) || Boolean(date);
|
|
97
|
-
}
|
|
103
|
+
};
|
|
98
104
|
|
|
99
|
-
|
|
105
|
+
this.handleDateChange = date => {
|
|
100
106
|
const {
|
|
101
107
|
readOnly,
|
|
102
108
|
onDateChange,
|
|
@@ -113,9 +119,9 @@ class DSDatePickerController extends React.Component {
|
|
|
113
119
|
onDateChange(date);
|
|
114
120
|
onChange(date);
|
|
115
121
|
}
|
|
116
|
-
}
|
|
122
|
+
};
|
|
117
123
|
|
|
118
|
-
|
|
124
|
+
this.handleChange = dataInput => {
|
|
119
125
|
const {
|
|
120
126
|
onDateChange,
|
|
121
127
|
onChange
|
|
@@ -126,9 +132,9 @@ class DSDatePickerController extends React.Component {
|
|
|
126
132
|
});
|
|
127
133
|
onDateChange(momentvalue);
|
|
128
134
|
onChange(momentvalue);
|
|
129
|
-
}
|
|
135
|
+
};
|
|
130
136
|
|
|
131
|
-
|
|
137
|
+
this.handleNavClick = (date, nav) => {
|
|
132
138
|
const [prev, next] = document.getElementsByClassName('DayPickerNavigation_button');
|
|
133
139
|
const {
|
|
134
140
|
onPrevMonthClick,
|
|
@@ -146,9 +152,9 @@ class DSDatePickerController extends React.Component {
|
|
|
146
152
|
next === null || next === void 0 ? void 0 : (_next$focus = next.focus) === null || _next$focus === void 0 ? void 0 : _next$focus.call(next);
|
|
147
153
|
onNextMonthClick(date);
|
|
148
154
|
}
|
|
149
|
-
}
|
|
155
|
+
};
|
|
150
156
|
|
|
151
|
-
|
|
157
|
+
this.insideBlur = event => {
|
|
152
158
|
const {
|
|
153
159
|
datePicker
|
|
154
160
|
} = this.state;
|
|
@@ -156,7 +162,7 @@ class DSDatePickerController extends React.Component {
|
|
|
156
162
|
if (!datePicker.current.contains(event.currentTarget)) {
|
|
157
163
|
this.props.onClose();
|
|
158
164
|
}
|
|
159
|
-
}
|
|
165
|
+
};
|
|
160
166
|
|
|
161
167
|
this.state = {
|
|
162
168
|
selectedDate: null,
|
|
@@ -263,8 +269,7 @@ class DSDatePickerController extends React.Component {
|
|
|
263
269
|
}
|
|
264
270
|
|
|
265
271
|
}
|
|
266
|
-
|
|
267
|
-
_defineProperty(DSDatePickerController, "defaultProps", {
|
|
272
|
+
DSDatePickerController.defaultProps = {
|
|
268
273
|
date: '',
|
|
269
274
|
value: '',
|
|
270
275
|
enableOutsideDays: false,
|
|
@@ -287,8 +292,7 @@ _defineProperty(DSDatePickerController, "defaultProps", {
|
|
|
287
292
|
isOutsideRange: () => false,
|
|
288
293
|
isDayHighlighted: () => false,
|
|
289
294
|
numberOfMonths: 1
|
|
290
|
-
}
|
|
291
|
-
|
|
295
|
+
};
|
|
292
296
|
DSDatePickerController.defaultProps = {
|
|
293
297
|
date: '',
|
|
294
298
|
value: '',
|
|
@@ -1,15 +1,18 @@
|
|
|
1
1
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
2
|
import 'react';
|
|
3
3
|
|
|
4
|
-
const Day =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
4
|
+
const Day = _ref => {
|
|
5
|
+
let {
|
|
6
|
+
className = 'date-picker-content-day',
|
|
7
|
+
date = ''
|
|
8
|
+
} = _ref;
|
|
9
|
+
return /*#__PURE__*/_jsx("div", {
|
|
10
|
+
className: className,
|
|
11
|
+
"data-testid": "datepicker-day-".concat(date)
|
|
12
|
+
}, void 0, /*#__PURE__*/_jsx("div", {
|
|
13
|
+
className: "".concat(className, "-half"),
|
|
14
|
+
"data-testid": "datepicker-day"
|
|
15
|
+
}, void 0, date));
|
|
16
|
+
};
|
|
14
17
|
|
|
15
18
|
export { Day as default };
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import 'core-js/modules/esnext.async-iterator.filter.js';
|
|
2
|
+
import 'core-js/modules/esnext.iterator.constructor.js';
|
|
3
|
+
import 'core-js/modules/esnext.iterator.filter.js';
|
|
4
|
+
import 'core-js/modules/esnext.async-iterator.for-each.js';
|
|
5
|
+
import 'core-js/modules/esnext.iterator.for-each.js';
|
|
1
6
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
8
|
import 'react';
|
|
4
9
|
import { convertPropToCssClassName } from '@elliemae/ds-classnames';
|
|
5
|
-
import DSPopper from '@elliemae/ds-
|
|
10
|
+
import DSPopper from '@elliemae/ds-popper';
|
|
6
11
|
import { Picker } from './DatePickerPicker/DatePickerPicker.js';
|
|
7
12
|
import { jsx } from 'react/jsx-runtime';
|
|
8
13
|
|
|
@@ -15,16 +20,17 @@ const {
|
|
|
15
20
|
|
|
16
21
|
const noop = () => null;
|
|
17
22
|
|
|
18
|
-
function DatePickerDropdown({
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
function DatePickerDropdown(_ref) {
|
|
24
|
+
let {
|
|
25
|
+
disabled = false,
|
|
26
|
+
readOnly,
|
|
27
|
+
onClick = noop,
|
|
28
|
+
isOpen,
|
|
29
|
+
menu,
|
|
30
|
+
zIndex = 1,
|
|
31
|
+
pickerProps,
|
|
32
|
+
pickerRef
|
|
33
|
+
} = _ref;
|
|
28
34
|
return /*#__PURE__*/_jsx(DSPopper, {
|
|
29
35
|
contentComponent: menu,
|
|
30
36
|
isOpen: isOpen,
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
-
import
|
|
5
|
-
import DSInputGroup from '@elliemae/ds-basic/form/InputGroup';
|
|
5
|
+
import { DSInputGroup, DSDateInputV2 } from '@elliemae/ds-form';
|
|
6
6
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
7
7
|
|
|
8
8
|
const DATE_FORMAT = 'MMDDYYYY';
|
|
@@ -11,11 +11,12 @@ const Header = aggregatedClasses('div')(blockname);
|
|
|
11
11
|
|
|
12
12
|
const isFn = variable => typeof variable === 'function';
|
|
13
13
|
|
|
14
|
-
const DatePickerHeader =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const DatePickerHeader = _ref => {
|
|
15
|
+
let {
|
|
16
|
+
onInputChange = () => null,
|
|
17
|
+
selectedDate,
|
|
18
|
+
updateKeyDate
|
|
19
|
+
} = _ref;
|
|
19
20
|
const [value, setValue] = useState(isFn(selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.format) ? selectedDate.format(DATE_FORMAT) : '');
|
|
20
21
|
useEffect(() => {
|
|
21
22
|
if (isFn(selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.format)) {
|
|
@@ -35,7 +36,7 @@ const DatePickerHeader = ({
|
|
|
35
36
|
}
|
|
36
37
|
};
|
|
37
38
|
|
|
38
|
-
return /*#__PURE__*/_jsx(Header, {}, void 0, /*#__PURE__*/_jsx(DSInputGroup, {}, void 0, /*#__PURE__*/_jsx(
|
|
39
|
+
return /*#__PURE__*/_jsx(Header, {}, void 0, /*#__PURE__*/_jsx(DSInputGroup, {}, void 0, /*#__PURE__*/_jsx(DSDateInputV2, {
|
|
39
40
|
onChange: handleOnChange,
|
|
40
41
|
onKeyDown: handleOnKeyDown,
|
|
41
42
|
value: value,
|
|
@@ -3,20 +3,23 @@ import 'react';
|
|
|
3
3
|
import ChevronRight from '@elliemae/ds-icons/ChevronRight';
|
|
4
4
|
import { DSIconColors, DSIconSizes } from '@elliemae/ds-basic/Icon';
|
|
5
5
|
|
|
6
|
-
const Navigation =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
6
|
+
const Navigation = _ref => {
|
|
7
|
+
let {
|
|
8
|
+
className = 'date-picker-navigation',
|
|
9
|
+
icon: Icon = ChevronRight,
|
|
10
|
+
color = DSIconColors.NEUTRAL,
|
|
11
|
+
size = DSIconSizes.S,
|
|
12
|
+
innerRef
|
|
13
|
+
} = _ref;
|
|
14
|
+
return /*#__PURE__*/_jsx("div", {
|
|
15
|
+
tabIndex: 0,
|
|
16
|
+
"data-testid": "date-picker-nav"
|
|
17
|
+
}, void 0, /*#__PURE__*/_jsx(Icon, {
|
|
18
|
+
className: className,
|
|
19
|
+
color: color,
|
|
20
|
+
innerRef: innerRef,
|
|
21
|
+
size: size
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
21
24
|
|
|
22
25
|
export { Navigation as default };
|
|
@@ -4,7 +4,7 @@ import 'react';
|
|
|
4
4
|
import PropTypes from 'prop-types';
|
|
5
5
|
import { DSIconSizes, DSIconColors } from '@elliemae/ds-basic/Icon';
|
|
6
6
|
import DatePicker from '@elliemae/ds-icons/DatePicker';
|
|
7
|
-
import DSButton, { buttonTypes } from '@elliemae/ds-
|
|
7
|
+
import DSButton, { buttonTypes } from '@elliemae/ds-button';
|
|
8
8
|
import { iconSizes } from '@elliemae/ds-shared/prop-types';
|
|
9
9
|
|
|
10
10
|
var _DatePicker;
|