@elliemae/ds-date-time-picker 2.0.0-next.0 → 2.0.0-next.12
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/DSDateTimePicker.js +45 -39
- package/cjs/components/DateTimePickerImpl.js +60 -58
- package/esm/DSDateTimePicker.js +45 -39
- package/esm/components/DateTimePickerImpl.js +54 -50
- package/package.json +6 -6
- package/cjs/package.json +0 -7
- package/esm/package.json +0 -7
package/cjs/DSDateTimePicker.js
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
6
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
7
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
5
10
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
6
11
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
7
12
|
require('react');
|
|
@@ -28,45 +33,46 @@ const {
|
|
|
28
33
|
id: idDefault
|
|
29
34
|
} = english;
|
|
30
35
|
|
|
31
|
-
const DSDateTimePicker =
|
|
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
|
-
}
|
|
36
|
+
const DSDateTimePicker = _ref => {
|
|
37
|
+
let {
|
|
38
|
+
containerProps = {},
|
|
39
|
+
className = classNameDefault,
|
|
40
|
+
id = idDefault,
|
|
41
|
+
placeholder = placeholderDefault,
|
|
42
|
+
date,
|
|
43
|
+
clearable = false,
|
|
44
|
+
onBlur = () => null,
|
|
45
|
+
datePickerProps = {
|
|
46
|
+
disabled: false,
|
|
47
|
+
numberOfMonths: 1,
|
|
48
|
+
readOnly: false,
|
|
49
|
+
enableOutsideDays: false,
|
|
50
|
+
transitionDuration: 0,
|
|
51
|
+
firstDayOfWeek: 0,
|
|
52
|
+
keepOpenOnDateSelect: true,
|
|
53
|
+
hideKeyboardShortcutsPanel: true,
|
|
54
|
+
onPrevMonthClick: () => null,
|
|
55
|
+
onNextMonthClick: () => null,
|
|
56
|
+
onClose: () => null,
|
|
57
|
+
onchange: () => null,
|
|
58
|
+
onDateChange: () => null,
|
|
59
|
+
phrases: dsDatePicker.SingleDatePickerPhrases,
|
|
60
|
+
displayFormatDay: 'D',
|
|
61
|
+
isDayBlocked: () => false,
|
|
62
|
+
isOutsideRange: () => false,
|
|
63
|
+
isDayHighlighted: () => false,
|
|
64
|
+
zIndex: 11
|
|
65
|
+
},
|
|
66
|
+
timePickerProps = {
|
|
67
|
+
format: 'hh:mm A',
|
|
68
|
+
onChange: () => null,
|
|
69
|
+
disabledTimes: undefined,
|
|
70
|
+
minutesInterval: 1
|
|
71
|
+
},
|
|
72
|
+
dateInputProps = {
|
|
73
|
+
onDateInputDateChange: () => null
|
|
74
|
+
}
|
|
75
|
+
} = _ref;
|
|
70
76
|
const {
|
|
71
77
|
cssClassName
|
|
72
78
|
} = dsClassnames.convertPropToCssClassName('datetimepicker', className, {
|
|
@@ -3,16 +3,19 @@
|
|
|
3
3
|
var _objectWithoutProperties = require('@babel/runtime/helpers/objectWithoutProperties');
|
|
4
4
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
5
5
|
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
6
|
+
require('core-js/modules/web.dom-collections.iterator.js');
|
|
7
|
+
require('core-js/modules/esnext.async-iterator.filter.js');
|
|
8
|
+
require('core-js/modules/esnext.iterator.constructor.js');
|
|
9
|
+
require('core-js/modules/esnext.iterator.filter.js');
|
|
10
|
+
require('core-js/modules/esnext.async-iterator.for-each.js');
|
|
11
|
+
require('core-js/modules/esnext.iterator.for-each.js');
|
|
6
12
|
var react = require('react');
|
|
7
13
|
var moment = require('moment');
|
|
8
14
|
var dsClassnames = require('@elliemae/ds-classnames');
|
|
9
15
|
var dsDatePicker = require('@elliemae/ds-date-picker');
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var TimeInput = require('@elliemae/ds-basic/form/TimeInput');
|
|
14
|
-
var timeUtils = require('@elliemae/ds-utilities/timeUtils');
|
|
15
|
-
var TimePicker$1 = require('@elliemae/ds-basic/TimePicker');
|
|
16
|
+
var dsForm = require('@elliemae/ds-form');
|
|
17
|
+
var dsUtilities = require('@elliemae/ds-utilities');
|
|
18
|
+
var dsTimePicker = require('@elliemae/ds-time-picker');
|
|
16
19
|
var utils = require('../utils.js');
|
|
17
20
|
var jsxRuntime = require('react/jsx-runtime');
|
|
18
21
|
|
|
@@ -22,8 +25,6 @@ var _objectWithoutProperties__default = /*#__PURE__*/_interopDefaultLegacy(_obje
|
|
|
22
25
|
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
23
26
|
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
24
27
|
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
25
|
-
var DSInputGroup__default = /*#__PURE__*/_interopDefaultLegacy(DSInputGroup);
|
|
26
|
-
var DSInput__default = /*#__PURE__*/_interopDefaultLegacy(DSInput);
|
|
27
28
|
|
|
28
29
|
const _excluded = ["onChange"];
|
|
29
30
|
|
|
@@ -32,64 +33,65 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
32
33
|
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__default["default"](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; }
|
|
33
34
|
const blockName = 'date-time-picker';
|
|
34
35
|
const DateTimePickerWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'wrapper');
|
|
35
|
-
const TimePicker = dsClassnames.aggregatedClasses(
|
|
36
|
+
const TimePicker = dsClassnames.aggregatedClasses(dsTimePicker.DSTimePickerMenu)(blockName, 'time-picker');
|
|
36
37
|
const TimePickerWrapper = dsClassnames.aggregatedClasses('div')(blockName, 'time-picker-wrapper'); // const DateInput = aggregatedClasses(DateInputsV2Impl)(blockName, 'date-input');
|
|
37
38
|
|
|
38
39
|
const formatDate = 'MMDDYYYY';
|
|
39
40
|
|
|
40
|
-
const DSDateTimePickerImpl =
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
}
|
|
41
|
+
const DSDateTimePickerImpl = _ref => {
|
|
42
|
+
let {
|
|
43
|
+
onBlur = () => null,
|
|
44
|
+
placeholder,
|
|
45
|
+
date,
|
|
46
|
+
clearable,
|
|
47
|
+
datePickerProps: {
|
|
48
|
+
disabled = false,
|
|
49
|
+
numberOfMonths = 1,
|
|
50
|
+
readOnly = false,
|
|
51
|
+
enableOutsideDays = false,
|
|
52
|
+
transitionDuration = 0,
|
|
53
|
+
firstDayOfWeek = 0,
|
|
54
|
+
keepOpenOnDateSelect = true,
|
|
55
|
+
hideKeyboardShortcutsPanel = true,
|
|
56
|
+
onPrevMonthClick = () => null,
|
|
57
|
+
onNextMonthClick = () => null,
|
|
58
|
+
onClose = () => null,
|
|
59
|
+
onChange: onDatePickerChange = () => null,
|
|
60
|
+
onDateChange = () => null,
|
|
61
|
+
onError: onErrorDate = () => null,
|
|
62
|
+
phrases = dsDatePicker.SingleDatePickerPhrases,
|
|
63
|
+
displayFormatDay = 'D',
|
|
64
|
+
isDayBlocked = () => false,
|
|
65
|
+
isOutsideRange = () => false,
|
|
66
|
+
isDayHighlighted = () => false,
|
|
67
|
+
zIndex = 11
|
|
68
|
+
},
|
|
69
|
+
timePickerProps: {
|
|
70
|
+
format = 'hh:mm A',
|
|
71
|
+
onChange: onChangeTimePicker = () => null,
|
|
72
|
+
disabledTimes = undefined,
|
|
73
|
+
onError: onErrorTime = () => null,
|
|
74
|
+
minutesInterval = 1
|
|
75
|
+
},
|
|
76
|
+
dateInputProps: {
|
|
77
|
+
onDateInputDateChange = () => null
|
|
78
|
+
}
|
|
79
|
+
} = _ref;
|
|
78
80
|
const [selectedDate, setSelectedDate] = react.useState(undefined);
|
|
79
81
|
const [incompleteInput, setIncompleteInput] = react.useState(undefined);
|
|
80
82
|
const [isOpen, setIsOpen] = react.useState(false);
|
|
81
83
|
const disabledTimeRange = disabledTimes && {
|
|
82
|
-
from:
|
|
83
|
-
to:
|
|
84
|
+
from: dsTimePicker.convertTimeString(disabledTimes.from),
|
|
85
|
+
to: dsTimePicker.convertTimeString(disabledTimes.to)
|
|
84
86
|
};
|
|
85
87
|
const dateTimePickerWrapperRef = react.useRef();
|
|
86
|
-
const fullFormat =
|
|
88
|
+
const fullFormat = "".concat(formatDate, " ").concat(format);
|
|
87
89
|
react.useEffect(() => {
|
|
88
90
|
if (date) {
|
|
89
91
|
setSelectedDate(moment__default["default"](date));
|
|
90
92
|
} else if (date === null) setSelectedDate(undefined);
|
|
91
93
|
}, [date]);
|
|
92
|
-
const visiblePanels = react.useMemo(() =>
|
|
94
|
+
const visiblePanels = react.useMemo(() => dsUtilities.getVisibleTimeByFormat(format), []);
|
|
93
95
|
const currentYear = moment__default["default"]().year();
|
|
94
96
|
|
|
95
97
|
const handleDatePickerChange = dateSelected => {
|
|
@@ -197,7 +199,7 @@ const DSDateTimePickerImpl = ({
|
|
|
197
199
|
});
|
|
198
200
|
}, [isOpen]);
|
|
199
201
|
const hasSelectedDate = !!selectedDate;
|
|
200
|
-
return /*#__PURE__*/_jsx__default["default"](
|
|
202
|
+
return /*#__PURE__*/_jsx__default["default"](dsForm.DSInputGroup, {
|
|
201
203
|
containerProps: {
|
|
202
204
|
onBlur: handleContainerBlur
|
|
203
205
|
},
|
|
@@ -245,19 +247,19 @@ const DSDateTimePickerImpl = ({
|
|
|
245
247
|
onClick: handleOpen,
|
|
246
248
|
readOnly: readOnly
|
|
247
249
|
})
|
|
248
|
-
}, void 0, /*#__PURE__*/_jsx__default["default"](
|
|
249
|
-
customInputType:
|
|
250
|
+
}, void 0, /*#__PURE__*/_jsx__default["default"](dsForm.DSInput, {
|
|
251
|
+
customInputType: _ref2 => {
|
|
250
252
|
let {
|
|
251
253
|
onChange: handleChange
|
|
252
|
-
} =
|
|
253
|
-
restInputProps = _objectWithoutProperties__default["default"](
|
|
254
|
+
} = _ref2,
|
|
255
|
+
restInputProps = _objectWithoutProperties__default["default"](_ref2, _excluded);
|
|
254
256
|
|
|
255
257
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
256
258
|
children: [/*#__PURE__*/_jsx__default["default"]("div", {
|
|
257
259
|
style: {
|
|
258
260
|
display: 'flex'
|
|
259
261
|
}
|
|
260
|
-
}, void 0, /*#__PURE__*/jsxRuntime.jsx(
|
|
262
|
+
}, void 0, /*#__PURE__*/jsxRuntime.jsx(dsForm.DateInputsV2Impl, _objectSpread(_objectSpread({
|
|
261
263
|
disabled: disabled,
|
|
262
264
|
onChange: input => handleChange(input, 'date')
|
|
263
265
|
}, restInputProps), {}, {
|
|
@@ -265,7 +267,7 @@ const DSDateTimePickerImpl = ({
|
|
|
265
267
|
yearMaxRange: currentYear + 100,
|
|
266
268
|
yearMinRange: currentYear - 100,
|
|
267
269
|
time: restInputProps.value && restInputProps.value.hour && restInputProps.value.isValid() ? restInputProps.value.format(formatDate) : restInputProps.value
|
|
268
|
-
}))), /*#__PURE__*/jsxRuntime.jsx(
|
|
270
|
+
}))), /*#__PURE__*/jsxRuntime.jsx(dsForm.TimeInputImpl, _objectSpread({
|
|
269
271
|
disabled: disabled,
|
|
270
272
|
format: format,
|
|
271
273
|
onChange: time => handleChange(time, 'time')
|
package/esm/DSDateTimePicker.js
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
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';
|
|
3
8
|
import 'react';
|
|
@@ -18,45 +23,46 @@ const {
|
|
|
18
23
|
id: idDefault
|
|
19
24
|
} = english;
|
|
20
25
|
|
|
21
|
-
const DSDateTimePicker =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
}
|
|
26
|
+
const DSDateTimePicker = _ref => {
|
|
27
|
+
let {
|
|
28
|
+
containerProps = {},
|
|
29
|
+
className = classNameDefault,
|
|
30
|
+
id = idDefault,
|
|
31
|
+
placeholder = placeholderDefault,
|
|
32
|
+
date,
|
|
33
|
+
clearable = false,
|
|
34
|
+
onBlur = () => null,
|
|
35
|
+
datePickerProps = {
|
|
36
|
+
disabled: false,
|
|
37
|
+
numberOfMonths: 1,
|
|
38
|
+
readOnly: false,
|
|
39
|
+
enableOutsideDays: false,
|
|
40
|
+
transitionDuration: 0,
|
|
41
|
+
firstDayOfWeek: 0,
|
|
42
|
+
keepOpenOnDateSelect: true,
|
|
43
|
+
hideKeyboardShortcutsPanel: true,
|
|
44
|
+
onPrevMonthClick: () => null,
|
|
45
|
+
onNextMonthClick: () => null,
|
|
46
|
+
onClose: () => null,
|
|
47
|
+
onchange: () => null,
|
|
48
|
+
onDateChange: () => null,
|
|
49
|
+
phrases: SingleDatePickerPhrases,
|
|
50
|
+
displayFormatDay: 'D',
|
|
51
|
+
isDayBlocked: () => false,
|
|
52
|
+
isOutsideRange: () => false,
|
|
53
|
+
isDayHighlighted: () => false,
|
|
54
|
+
zIndex: 11
|
|
55
|
+
},
|
|
56
|
+
timePickerProps = {
|
|
57
|
+
format: 'hh:mm A',
|
|
58
|
+
onChange: () => null,
|
|
59
|
+
disabledTimes: undefined,
|
|
60
|
+
minutesInterval: 1
|
|
61
|
+
},
|
|
62
|
+
dateInputProps = {
|
|
63
|
+
onDateInputDateChange: () => null
|
|
64
|
+
}
|
|
65
|
+
} = _ref;
|
|
60
66
|
const {
|
|
61
67
|
cssClassName
|
|
62
68
|
} = convertPropToCssClassName('datetimepicker', className, {
|
|
@@ -1,16 +1,19 @@
|
|
|
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 _objectWithoutProperties from '@babel/runtime/helpers/esm/objectWithoutProperties';
|
|
2
7
|
import _defineProperty from '@babel/runtime/helpers/esm/defineProperty';
|
|
3
8
|
import _jsx from '@babel/runtime/helpers/esm/jsx';
|
|
9
|
+
import 'core-js/modules/web.dom-collections.iterator.js';
|
|
4
10
|
import { useState, useRef, useEffect, useMemo } from 'react';
|
|
5
11
|
import moment from 'moment';
|
|
6
12
|
import { aggregatedClasses } from '@elliemae/ds-classnames';
|
|
7
|
-
import {
|
|
8
|
-
import DSInputGroup from '@elliemae/ds-
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import { TimeInputImpl } from '@elliemae/ds-basic/form/TimeInput';
|
|
12
|
-
import { getVisibleTimeByFormat } from '@elliemae/ds-utilities/timeUtils';
|
|
13
|
-
import { Menu, convertTimeString } from '@elliemae/ds-basic/TimePicker';
|
|
13
|
+
import { DatePickerDropdown, DSDatePickerController, SingleDatePickerPhrases } from '@elliemae/ds-date-picker';
|
|
14
|
+
import { DSInputGroup, DSInput, DateInputsV2Impl, TimeInputImpl } from '@elliemae/ds-form';
|
|
15
|
+
import { getVisibleTimeByFormat } from '@elliemae/ds-utilities';
|
|
16
|
+
import { DSTimePickerMenu, convertTimeString } from '@elliemae/ds-time-picker';
|
|
14
17
|
import { updateDateAndTime } from '../utils.js';
|
|
15
18
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
16
19
|
|
|
@@ -21,49 +24,50 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
21
24
|
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; }
|
|
22
25
|
const blockName = 'date-time-picker';
|
|
23
26
|
const DateTimePickerWrapper = aggregatedClasses('div')(blockName, 'wrapper');
|
|
24
|
-
const TimePicker = aggregatedClasses(
|
|
27
|
+
const TimePicker = aggregatedClasses(DSTimePickerMenu)(blockName, 'time-picker');
|
|
25
28
|
const TimePickerWrapper = aggregatedClasses('div')(blockName, 'time-picker-wrapper'); // const DateInput = aggregatedClasses(DateInputsV2Impl)(blockName, 'date-input');
|
|
26
29
|
|
|
27
30
|
const formatDate = 'MMDDYYYY';
|
|
28
31
|
|
|
29
|
-
const DSDateTimePickerImpl =
|
|
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
|
-
}
|
|
32
|
+
const DSDateTimePickerImpl = _ref => {
|
|
33
|
+
let {
|
|
34
|
+
onBlur = () => null,
|
|
35
|
+
placeholder,
|
|
36
|
+
date,
|
|
37
|
+
clearable,
|
|
38
|
+
datePickerProps: {
|
|
39
|
+
disabled = false,
|
|
40
|
+
numberOfMonths = 1,
|
|
41
|
+
readOnly = false,
|
|
42
|
+
enableOutsideDays = false,
|
|
43
|
+
transitionDuration = 0,
|
|
44
|
+
firstDayOfWeek = 0,
|
|
45
|
+
keepOpenOnDateSelect = true,
|
|
46
|
+
hideKeyboardShortcutsPanel = true,
|
|
47
|
+
onPrevMonthClick = () => null,
|
|
48
|
+
onNextMonthClick = () => null,
|
|
49
|
+
onClose = () => null,
|
|
50
|
+
onChange: onDatePickerChange = () => null,
|
|
51
|
+
onDateChange = () => null,
|
|
52
|
+
onError: onErrorDate = () => null,
|
|
53
|
+
phrases = SingleDatePickerPhrases,
|
|
54
|
+
displayFormatDay = 'D',
|
|
55
|
+
isDayBlocked = () => false,
|
|
56
|
+
isOutsideRange = () => false,
|
|
57
|
+
isDayHighlighted = () => false,
|
|
58
|
+
zIndex = 11
|
|
59
|
+
},
|
|
60
|
+
timePickerProps: {
|
|
61
|
+
format = 'hh:mm A',
|
|
62
|
+
onChange: onChangeTimePicker = () => null,
|
|
63
|
+
disabledTimes = undefined,
|
|
64
|
+
onError: onErrorTime = () => null,
|
|
65
|
+
minutesInterval = 1
|
|
66
|
+
},
|
|
67
|
+
dateInputProps: {
|
|
68
|
+
onDateInputDateChange = () => null
|
|
69
|
+
}
|
|
70
|
+
} = _ref;
|
|
67
71
|
const [selectedDate, setSelectedDate] = useState(undefined);
|
|
68
72
|
const [incompleteInput, setIncompleteInput] = useState(undefined);
|
|
69
73
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -72,7 +76,7 @@ const DSDateTimePickerImpl = ({
|
|
|
72
76
|
to: convertTimeString(disabledTimes.to)
|
|
73
77
|
};
|
|
74
78
|
const dateTimePickerWrapperRef = useRef();
|
|
75
|
-
const fullFormat =
|
|
79
|
+
const fullFormat = "".concat(formatDate, " ").concat(format);
|
|
76
80
|
useEffect(() => {
|
|
77
81
|
if (date) {
|
|
78
82
|
setSelectedDate(moment(date));
|
|
@@ -235,11 +239,11 @@ const DSDateTimePickerImpl = ({
|
|
|
235
239
|
readOnly: readOnly
|
|
236
240
|
})
|
|
237
241
|
}, void 0, /*#__PURE__*/_jsx(DSInput, {
|
|
238
|
-
customInputType:
|
|
242
|
+
customInputType: _ref2 => {
|
|
239
243
|
let {
|
|
240
244
|
onChange: handleChange
|
|
241
|
-
} =
|
|
242
|
-
restInputProps = _objectWithoutProperties(
|
|
245
|
+
} = _ref2,
|
|
246
|
+
restInputProps = _objectWithoutProperties(_ref2, _excluded);
|
|
243
247
|
|
|
244
248
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
245
249
|
children: [/*#__PURE__*/_jsx("div", {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elliemae/ds-date-time-picker",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.12",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "ICE MT - Dimsum - Date Time Picker",
|
|
6
6
|
"module": "./esm/index.js",
|
|
@@ -52,11 +52,11 @@
|
|
|
52
52
|
"build": "node ../../scripts/build/build.js"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@elliemae/ds-basic": "2.0.0-next.
|
|
56
|
-
"@elliemae/ds-classnames": "2.0.0-next.
|
|
57
|
-
"@elliemae/ds-date-picker": "2.0.0-next.
|
|
58
|
-
"@elliemae/ds-form": "2.0.0-next.
|
|
59
|
-
"@elliemae/ds-utilities": "2.0.0-next.
|
|
55
|
+
"@elliemae/ds-basic": "2.0.0-next.12",
|
|
56
|
+
"@elliemae/ds-classnames": "2.0.0-next.12",
|
|
57
|
+
"@elliemae/ds-date-picker": "2.0.0-next.12",
|
|
58
|
+
"@elliemae/ds-form": "2.0.0-next.12",
|
|
59
|
+
"@elliemae/ds-utilities": "2.0.0-next.12",
|
|
60
60
|
"lodash": "~4.17.21",
|
|
61
61
|
"moment": "~2.29.1",
|
|
62
62
|
"prop-types": "~15.7.2",
|
package/cjs/package.json
DELETED