@elliemae/ds-date-time-picker 2.2.0-alpha.3 → 3.0.0-next.0
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 +181 -160
- package/cjs/components/DateTimePickerImpl.js +218 -187
- package/cjs/index.js +10 -37
- package/cjs/lang/english.js +9 -39
- package/cjs/utils.js +19 -42
- package/esm/DSDateTimePicker.js +116 -77
- package/esm/components/DateTimePickerImpl.js +194 -143
- package/esm/index.js +1 -8
- package/esm/lang/english.js +6 -9
- package/esm/utils.js +10 -12
- package/package.json +7 -7
- package/types/DSDateTimePicker.d.ts +1 -1
- package/types/components/DateTimePickerImpl.d.ts +0 -1
- package/types/index.d.ts +1 -1
- package/cjs/DSDateTimePicker.js.map +0 -7
- package/cjs/components/DateTimePickerImpl.js.map +0 -7
- package/cjs/index.js.map +0 -7
- package/cjs/lang/english.js.map +0 -7
- package/cjs/tests/utils.js +0 -42
- package/cjs/tests/utils.js.map +0 -7
- package/cjs/utils.js.map +0 -7
- package/esm/DSDateTimePicker.js.map +0 -7
- package/esm/components/DateTimePickerImpl.js.map +0 -7
- package/esm/index.js.map +0 -7
- package/esm/lang/english.js.map +0 -7
- package/esm/tests/utils.js +0 -13
- package/esm/tests/utils.js.map +0 -7
- package/esm/utils.js.map +0 -7
package/cjs/DSDateTimePicker.js
CHANGED
|
@@ -1,172 +1,193 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
DSDateTimePicker: () => DSDateTimePicker,
|
|
31
|
-
DateTimePickerWithSchema: () => DateTimePickerWithSchema,
|
|
32
|
-
default: () => DSDateTimePicker_default
|
|
33
|
-
});
|
|
34
|
-
var React = __toESM(require("react"));
|
|
35
|
-
var import_react = __toESM(require("react"));
|
|
36
|
-
var import_react_desc = __toESM(require("react-desc"));
|
|
37
|
-
var import_moment = __toESM(require("moment"));
|
|
38
|
-
var import_ds_classnames = __toESM(require("@elliemae/ds-classnames"));
|
|
39
|
-
var import_ds_date_picker = __toESM(require("@elliemae/ds-date-picker"));
|
|
40
|
-
var import_DateTimePickerImpl = __toESM(require("./components/DateTimePickerImpl"));
|
|
41
|
-
var import_english = __toESM(require("./lang/english"));
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
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');
|
|
10
|
+
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
11
|
+
var _jsx = require('@babel/runtime/helpers/jsx');
|
|
12
|
+
require('react');
|
|
13
|
+
var reactDesc = require('react-desc');
|
|
14
|
+
var moment = require('moment');
|
|
15
|
+
var dsClassnames = require('@elliemae/ds-classnames');
|
|
16
|
+
var dsDatePicker = require('@elliemae/ds-date-picker');
|
|
17
|
+
var DateTimePickerImpl = require('./components/DateTimePickerImpl.js');
|
|
18
|
+
var english = require('./lang/english.js');
|
|
19
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
20
|
+
|
|
21
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
22
|
+
|
|
23
|
+
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
24
|
+
var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
|
|
25
|
+
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
26
|
+
|
|
27
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
28
|
+
|
|
29
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty__default["default"](target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
42
30
|
const {
|
|
43
31
|
placeholder: placeholderDefault,
|
|
44
32
|
className: classNameDefault,
|
|
45
33
|
id: idDefault
|
|
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
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
34
|
+
} = english;
|
|
35
|
+
|
|
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;
|
|
76
|
+
const {
|
|
77
|
+
cssClassName
|
|
78
|
+
} = dsClassnames.convertPropToCssClassName('datetimepicker', className, {
|
|
87
79
|
id
|
|
88
80
|
});
|
|
89
|
-
return
|
|
90
|
-
className: cssClassName
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
81
|
+
return /*#__PURE__*/jsxRuntime.jsx("div", _objectSpread(_objectSpread({
|
|
82
|
+
className: cssClassName
|
|
83
|
+
}, containerProps), {}, {
|
|
84
|
+
children: /*#__PURE__*/_jsx__default["default"](DateTimePickerImpl, {
|
|
85
|
+
clearable: clearable,
|
|
86
|
+
date: date,
|
|
87
|
+
datePickerProps: datePickerProps,
|
|
88
|
+
onBlur: onBlur,
|
|
89
|
+
placeholder: placeholder,
|
|
90
|
+
timePickerProps: timePickerProps,
|
|
91
|
+
dateInputProps: dateInputProps
|
|
92
|
+
})
|
|
100
93
|
}));
|
|
101
94
|
};
|
|
95
|
+
|
|
102
96
|
const dateTimePickerProps = {
|
|
103
|
-
containerProps:
|
|
104
|
-
className:
|
|
105
|
-
id:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
97
|
+
containerProps: reactDesc.PropTypes.object.description('Set of Properties attached to the main container'),
|
|
98
|
+
className: reactDesc.PropTypes.string.description('html class attribute'),
|
|
99
|
+
id: reactDesc.PropTypes.string.description('components id'),
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* on blur callback
|
|
103
|
+
*/
|
|
104
|
+
onBlur: reactDesc.PropTypes.func.description('on blur callback'),
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Initial date, by default current date
|
|
108
|
+
*/
|
|
109
|
+
date: reactDesc.PropTypes.instanceOf(Date, moment__default["default"]).description('Initial date, by default current date'),
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Flag to trigger onDateChange on error
|
|
113
|
+
*/
|
|
114
|
+
clearable: reactDesc.PropTypes.bool.description('Flag to trigger onDateChange on error'),
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* DatePicker properties
|
|
118
|
+
*/
|
|
119
|
+
datePickerProps: reactDesc.PropTypes.shape({
|
|
120
|
+
disabled: reactDesc.PropTypes.bool,
|
|
121
|
+
numberOfMonths: reactDesc.PropTypes.number,
|
|
122
|
+
readOnly: reactDesc.PropTypes.bool,
|
|
123
|
+
enableOutsideDays: reactDesc.PropTypes.bool,
|
|
124
|
+
transitionDuration: reactDesc.PropTypes.number,
|
|
125
|
+
firstDayOfWeek: reactDesc.PropTypes.number,
|
|
126
|
+
keepOpenOnDateSelect: reactDesc.PropTypes.bool,
|
|
127
|
+
hideKeyboardShortcutsPanel: reactDesc.PropTypes.bool,
|
|
128
|
+
onPrevMonthClick: reactDesc.PropTypes.func,
|
|
129
|
+
onNextMonthClick: reactDesc.PropTypes.func,
|
|
130
|
+
onClose: reactDesc.PropTypes.func,
|
|
131
|
+
onDateChange: reactDesc.PropTypes.func,
|
|
132
|
+
phrases: reactDesc.PropTypes.shape({
|
|
133
|
+
calendarLabel: reactDesc.PropTypes.string,
|
|
134
|
+
closeDatePicker: reactDesc.PropTypes.string,
|
|
135
|
+
clearDates: reactDesc.PropTypes.string,
|
|
136
|
+
focusStartDate: reactDesc.PropTypes.string,
|
|
137
|
+
jumpToPrevMonth: reactDesc.PropTypes.string,
|
|
138
|
+
jumpToNextMonth: reactDesc.PropTypes.string,
|
|
139
|
+
keyboardShortcuts: reactDesc.PropTypes.string,
|
|
140
|
+
showKeyboardShortcutsPanel: reactDesc.PropTypes.string,
|
|
141
|
+
hideKeyboardShortcutsPanel: reactDesc.PropTypes.string,
|
|
142
|
+
openThisPanel: reactDesc.PropTypes.string,
|
|
143
|
+
enterKey: reactDesc.PropTypes.string,
|
|
144
|
+
leftArrowRightArrow: reactDesc.PropTypes.string,
|
|
145
|
+
upArrowDownArrow: reactDesc.PropTypes.string,
|
|
146
|
+
pageUpPageDown: reactDesc.PropTypes.string,
|
|
147
|
+
homeEnd: reactDesc.PropTypes.string,
|
|
148
|
+
escape: reactDesc.PropTypes.string,
|
|
149
|
+
questionMark: reactDesc.PropTypes.string,
|
|
150
|
+
selectFocusedDate: reactDesc.PropTypes.string,
|
|
151
|
+
moveFocusByOneDay: reactDesc.PropTypes.string,
|
|
152
|
+
moveFocusByOneWeek: reactDesc.PropTypes.string,
|
|
153
|
+
moveFocusByOneMonth: reactDesc.PropTypes.string,
|
|
154
|
+
moveFocustoStartAndEndOfWeek: reactDesc.PropTypes.string,
|
|
155
|
+
returnFocusToInput: reactDesc.PropTypes.string,
|
|
156
|
+
keyboardNavigationInstructions: reactDesc.PropTypes.string,
|
|
157
|
+
chooseAvailableStartDate: reactDesc.PropTypes.func,
|
|
158
|
+
chooseAvailableEndDate: reactDesc.PropTypes.func,
|
|
159
|
+
dateIsUnavailable: reactDesc.PropTypes.func,
|
|
160
|
+
dateIsSelected: reactDesc.PropTypes.func,
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* ZIndex for the picker popup
|
|
164
|
+
*/
|
|
165
|
+
zIndex: reactDesc.PropTypes.number
|
|
152
166
|
}),
|
|
153
|
-
displayFormatDay:
|
|
154
|
-
isDayBlocked:
|
|
155
|
-
isOutsideRange:
|
|
156
|
-
isDayHighlighted:
|
|
157
|
-
}).description(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
displayFormatDay: reactDesc.PropTypes.string,
|
|
168
|
+
isDayBlocked: reactDesc.PropTypes.func,
|
|
169
|
+
isOutsideRange: reactDesc.PropTypes.func,
|
|
170
|
+
isDayHighlighted: reactDesc.PropTypes.func
|
|
171
|
+
}).description('DatePicker properties'),
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Input placeholder
|
|
175
|
+
*/
|
|
176
|
+
placeholder: reactDesc.PropTypes.string.description('Input placeholder'),
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* TimePicker properties
|
|
180
|
+
*/
|
|
181
|
+
timePickerProps: reactDesc.PropTypes.shape({
|
|
182
|
+
format: reactDesc.PropTypes.string,
|
|
183
|
+
onChange: reactDesc.PropTypes.func
|
|
184
|
+
}).description('TimePicker properties'),
|
|
185
|
+
dateInputProps: reactDesc.PropTypes.shape({
|
|
186
|
+
onDateInputDateChange: reactDesc.PropTypes.func
|
|
187
|
+
}).description('DateInputProperties')
|
|
166
188
|
};
|
|
167
|
-
|
|
168
|
-
const DateTimePickerWithSchema = (0, import_react_desc.describe)(DSDateTimePicker);
|
|
189
|
+
const DateTimePickerWithSchema = reactDesc.describe(DSDateTimePicker);
|
|
169
190
|
DateTimePickerWithSchema.propTypes = dateTimePickerProps;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
191
|
+
|
|
192
|
+
exports.DateTimePickerWithSchema = DateTimePickerWithSchema;
|
|
193
|
+
exports["default"] = DSDateTimePicker;
|