@elliemae/ds-date-range-picker 2.2.0 → 2.3.0-alpha.3

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.
Files changed (29) hide show
  1. package/cjs/DSDateRangePicker.js +199 -193
  2. package/cjs/DSDateRangePicker.js.map +7 -0
  3. package/cjs/components/DSDateRangePickerImpl.js +172 -222
  4. package/cjs/components/DSDateRangePickerImpl.js.map +7 -0
  5. package/cjs/components/DatePickerLabel/DatePickerLabel.js +38 -19
  6. package/cjs/components/DatePickerLabel/DatePickerLabel.js.map +7 -0
  7. package/cjs/components/DatePickerRangeHeader/DatePickerRangeHeader.js +74 -62
  8. package/cjs/components/DatePickerRangeHeader/DatePickerRangeHeader.js.map +7 -0
  9. package/cjs/components/DayPickerRangeController.js +123 -109
  10. package/cjs/components/DayPickerRangeController.js.map +7 -0
  11. package/cjs/index.js +36 -15
  12. package/cjs/index.js.map +7 -0
  13. package/cjs/isMaxDiffSafe.js +39 -13
  14. package/cjs/isMaxDiffSafe.js.map +7 -0
  15. package/esm/DSDateRangePicker.js +143 -150
  16. package/esm/DSDateRangePicker.js.map +7 -0
  17. package/esm/components/DSDateRangePickerImpl.js +131 -197
  18. package/esm/components/DSDateRangePickerImpl.js.map +7 -0
  19. package/esm/components/DatePickerLabel/DatePickerLabel.js +9 -13
  20. package/esm/components/DatePickerLabel/DatePickerLabel.js.map +7 -0
  21. package/esm/components/DatePickerRangeHeader/DatePickerRangeHeader.js +36 -45
  22. package/esm/components/DatePickerRangeHeader/DatePickerRangeHeader.js.map +7 -0
  23. package/esm/components/DayPickerRangeController.js +92 -99
  24. package/esm/components/DayPickerRangeController.js.map +7 -0
  25. package/esm/index.js +7 -3
  26. package/esm/index.js.map +7 -0
  27. package/esm/isMaxDiffSafe.js +10 -8
  28. package/esm/isMaxDiffSafe.js.map +7 -0
  29. package/package.json +6 -6
@@ -1,51 +1,59 @@
1
- 'use strict';
2
-
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _jsx = require('@babel/runtime/helpers/jsx');
6
- var React = require('react');
7
- var moment = require('moment');
8
- var dsClassnames = require('@elliemae/ds-classnames');
9
- var DSInputMask = require('@elliemae/ds-form');
10
- var DSPopper = require('@elliemae/ds-popper');
11
- var dsDatePicker = require('@elliemae/ds-date-picker');
12
- var DayPickerRangeController = require('./DayPickerRangeController.js');
13
- var isMaxDiffSafe = require('../isMaxDiffSafe.js');
14
-
15
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
16
-
17
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
18
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
19
- var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
20
- var DSPopper__default = /*#__PURE__*/_interopDefaultLegacy(DSPopper);
21
-
22
- const START_DATE = 'startDate';
23
- const END_DATE = 'endDate';
24
- const {
25
- classNameElement,
26
- classNameBlock
27
- } = dsClassnames.convertPropToCssClassName('datepicker');
28
- class DSDateRangePickerImpl extends React__default["default"].Component {
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var DSDateRangePickerImpl_exports = {};
29
+ __export(DSDateRangePickerImpl_exports, {
30
+ END_DATE: () => END_DATE,
31
+ START_DATE: () => START_DATE,
32
+ default: () => DSDateRangePickerImpl
33
+ });
34
+ var React = __toESM(require("react"));
35
+ var import_react = __toESM(require("react"));
36
+ var import_prop_types = __toESM(require("prop-types"));
37
+ var import_moment = __toESM(require("moment"));
38
+ var import_ds_classnames = require("@elliemae/ds-classnames");
39
+ var import_ds_form = require("@elliemae/ds-form");
40
+ var import_ds_popper = __toESM(require("@elliemae/ds-popper"));
41
+ var import_ds_date_picker = require("@elliemae/ds-date-picker");
42
+ var import_DayPickerRangeController = __toESM(require("./DayPickerRangeController"));
43
+ var import_isMaxDiffSafe = require("../isMaxDiffSafe");
44
+ const START_DATE = "startDate";
45
+ const END_DATE = "endDate";
46
+ const { classNameElement, classNameBlock } = (0, import_ds_classnames.convertPropToCssClassName)("datepicker");
47
+ class DSDateRangePickerImpl extends import_react.default.Component {
29
48
  constructor(props) {
30
49
  super(props);
31
-
32
- this.onDatesChange = _ref => {
33
- let {
34
- startDate,
35
- endDate
36
- } = _ref;
37
- const {
38
- onDatesChange
39
- } = this.props;
50
+ this.onDatesChange = ({ startDate, endDate }) => {
51
+ const { onDatesChange } = this.props;
40
52
  onDatesChange(startDate, endDate);
41
- const safe = isMaxDiffSafe.isMaxDiffSafe(startDate, endDate, this.state.startDate, this.state.endDate);
42
-
53
+ const safe = (0, import_isMaxDiffSafe.isMaxDiffSafe)(startDate, endDate, this.state.startDate, this.state.endDate);
43
54
  if (!safe) {
44
- this.setState({
45
- showPicker: false
46
- });
55
+ this.setState({ showPicker: false });
47
56
  }
48
-
49
57
  this.setState({
50
58
  startDate,
51
59
  endDate,
@@ -53,85 +61,55 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
53
61
  primaryEndInput: false
54
62
  });
55
63
  };
56
-
57
64
  this.onFocusChange = () => {
58
- this.setState(_ref2 => {
59
- let {
60
- focusedInput
61
- } = _ref2;
62
- return {
63
- focusedInput: focusedInput === START_DATE ? END_DATE : START_DATE
64
- };
65
- });
65
+ this.setState(({ focusedInput }) => ({
66
+ focusedInput: focusedInput === START_DATE ? END_DATE : START_DATE
67
+ }));
66
68
  };
67
-
68
- this.handleKeyDown = event => {
69
- if (event.key === 'Escape') this.setState({
70
- showPicker: false
71
- });
69
+ this.handleKeyDown = (event) => {
70
+ if (event.key === "Escape")
71
+ this.setState({ showPicker: false });
72
72
  };
73
-
74
73
  this.getSafeStartInputValue = () => {
75
- const {
76
- startInput,
77
- primaryStartInput,
78
- startDate
79
- } = this.state;
80
- if (primaryStartInput && startInput) return startInput;
81
- if (!startDate) return '';
82
- return startDate.format('MMDDYYYY');
74
+ const { startInput, primaryStartInput, startDate } = this.state;
75
+ if (primaryStartInput && startInput)
76
+ return startInput;
77
+ if (!startDate)
78
+ return "";
79
+ return startDate.format("MMDDYYYY");
83
80
  };
84
-
85
81
  this.getSafeEndInputValue = () => {
86
- const {
87
- endInput,
88
- primaryEndInput,
89
- endDate
90
- } = this.state;
91
- if (primaryEndInput && endInput) return endInput;
92
- if (!endDate) return '';
93
- return endDate.format('MMDDYYYY');
82
+ const { endInput, primaryEndInput, endDate } = this.state;
83
+ if (primaryEndInput && endInput)
84
+ return endInput;
85
+ if (!endDate)
86
+ return "";
87
+ return endDate.format("MMDDYYYY");
94
88
  };
95
-
96
89
  this.changeFocus = () => {
97
- const {
98
- disabled
99
- } = this.props;
100
-
90
+ const { disabled } = this.props;
101
91
  if (!disabled) {
102
- this.setState(() => ({
103
- focusedInput: 'startDate'
104
- }));
92
+ this.setState(() => ({ focusedInput: "startDate" }));
105
93
  }
106
94
  };
107
-
108
- this.handleChangeStart = e => {
109
- var _momentValue;
110
-
111
- const {
112
- onChangeStartInput,
113
- isDayBlocked,
114
- minimumNights
115
- } = this.props;
116
- const {
117
- endDate
118
- } = this.state;
95
+ this.handleChangeStart = (e) => {
96
+ const { onChangeStartInput, isDayBlocked, minimumNights } = this.props;
97
+ const { endDate } = this.state;
119
98
  const startInputVal = e.target.value;
120
99
  let momentValue = null;
121
-
122
- if (startInputVal && moment__default["default"](startInputVal, 'MM/DD/YYYY', true).isValid()) {
123
- momentValue = moment__default["default"](startInputVal);
100
+ if (startInputVal && (0, import_moment.default)(startInputVal, "MM/DD/YYYY", true).isValid()) {
101
+ momentValue = (0, import_moment.default)(startInputVal);
124
102
  }
125
-
126
103
  const startDateBlocked = isDayBlocked(momentValue);
127
- const isStartDateAcceptable = !startDateBlocked && momentValue && startInputVal !== '';
128
- const areDatesValid = endDate && momentValue && (endDate === null || endDate === void 0 ? void 0 : endDate.isValid()) && ((_momentValue = momentValue) === null || _momentValue === void 0 ? void 0 : _momentValue.isValid());
104
+ const isStartDateAcceptable = !startDateBlocked && momentValue && startInputVal !== "";
105
+ const areDatesValid = endDate && momentValue && endDate?.isValid() && momentValue?.isValid();
129
106
  const canEndBeSameAsStart = minimumNights === 0;
130
- const isStartAcceptableWithSelectedEnd = !endDate || areDatesValid && (canEndBeSameAsStart && momentValue.diff(endDate, 'days') <= 0 || !canEndBeSameAsStart && momentValue.diff(endDate, 'days') < 0);
107
+ const isStartAcceptableWithSelectedEnd = !endDate || areDatesValid && (canEndBeSameAsStart && momentValue.diff(endDate, "days") <= 0 || !canEndBeSameAsStart && momentValue.diff(endDate, "days") < 0);
131
108
  const invalidDate = !isStartDateAcceptable || !isStartAcceptableWithSelectedEnd;
132
- if (startDateBlocked) momentValue = null;
109
+ if (startDateBlocked)
110
+ momentValue = null;
133
111
  onChangeStartInput(momentValue);
134
- this.setState(prevState => ({
112
+ this.setState((prevState) => ({
135
113
  startDate: momentValue,
136
114
  startInput: startInputVal,
137
115
  primaryStartInput: true,
@@ -139,38 +117,24 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
139
117
  endDateError: !isStartDateAcceptable || !prevState.endDateError ? prevState.endDateError : !isStartAcceptableWithSelectedEnd
140
118
  }));
141
119
  };
142
-
143
- this.handleChangeEnd = e => {
144
- var _momentValue2;
145
-
146
- const {
147
- onChangeEndInput,
148
- isDayBlocked,
149
- minimumNights
150
- } = this.props;
151
- const {
152
- startDate
153
- } = this.state;
120
+ this.handleChangeEnd = (e) => {
121
+ const { onChangeEndInput, isDayBlocked, minimumNights } = this.props;
122
+ const { startDate } = this.state;
154
123
  const endInputValue = e.target.value;
155
124
  let momentValue = null;
156
-
157
- if (endInputValue && moment__default["default"](endInputValue, 'MM/DD/YYYY', true).isValid()) {
158
- momentValue = moment__default["default"](endInputValue);
125
+ if (endInputValue && (0, import_moment.default)(endInputValue, "MM/DD/YYYY", true).isValid()) {
126
+ momentValue = (0, import_moment.default)(endInputValue);
159
127
  }
160
-
161
128
  const endDateBlocked = isDayBlocked(momentValue);
162
- const isEndDateAcceptable = !endDateBlocked && momentValue && endInputValue !== '';
163
- const areDatesValid = startDate && momentValue && (startDate === null || startDate === void 0 ? void 0 : startDate.isValid()) && ((_momentValue2 = momentValue) === null || _momentValue2 === void 0 ? void 0 : _momentValue2.isValid());
129
+ const isEndDateAcceptable = !endDateBlocked && momentValue && endInputValue !== "";
130
+ const areDatesValid = startDate && momentValue && startDate?.isValid() && momentValue?.isValid();
164
131
  const canEndBeSameAsStart = minimumNights === 0;
165
- const isEndAcceptableWithSelectedStart = !startDate || // we can't compare with start date because it's not yet set
166
- areDatesValid && ( // it's set and both are valid
167
- canEndBeSameAsStart && momentValue.diff(startDate, 'days') >= 0 || // >= is valid
168
- !canEndBeSameAsStart && momentValue.diff(startDate, 'days') > 0); // only > is valid
169
-
132
+ const isEndAcceptableWithSelectedStart = !startDate || areDatesValid && (canEndBeSameAsStart && momentValue.diff(startDate, "days") >= 0 || !canEndBeSameAsStart && momentValue.diff(startDate, "days") > 0);
170
133
  const invalidDate = !isEndDateAcceptable || !isEndAcceptableWithSelectedStart;
171
- if (endDateBlocked) momentValue = null;
134
+ if (endDateBlocked)
135
+ momentValue = null;
172
136
  onChangeEndInput(momentValue);
173
- this.setState(prevState => ({
137
+ this.setState((prevState) => ({
174
138
  endDate: momentValue,
175
139
  endInput: endInputValue,
176
140
  primaryEndInput: true,
@@ -178,60 +142,37 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
178
142
  endDateError: invalidDate
179
143
  }));
180
144
  };
181
-
182
- this.handleChangeDate = _ref3 => {
183
- let {
184
- startDate: _start,
185
- endDate
186
- } = _ref3;
187
-
145
+ this.handleChangeDate = ({ startDate: _start, endDate }) => {
188
146
  if (_start && endDate) {
189
147
  this.setState({
190
- startDate: moment__default["default"](_start),
148
+ startDate: (0, import_moment.default)(_start),
191
149
  endDate,
192
150
  primaryStartInput: false,
193
151
  primaryEndInput: false
194
152
  });
195
153
  } else if (_start) {
196
- this.setState({
197
- startDate: moment__default["default"](_start),
198
- primaryStartInput: false
199
- });
154
+ this.setState({ startDate: (0, import_moment.default)(_start), primaryStartInput: false });
200
155
  } else if (endDate) {
201
- this.setState({
202
- endDate,
203
- primaryEndInput: false
204
- });
156
+ this.setState({ endDate, primaryEndInput: false });
205
157
  }
206
158
  };
207
-
208
159
  this.state = {
209
- startDate: props.startDate ? moment__default["default"](props.startDate) : null,
210
- endDate: props.endDate ? moment__default["default"](props.endDate) : null,
160
+ startDate: props.startDate ? (0, import_moment.default)(props.startDate) : null,
161
+ endDate: props.endDate ? (0, import_moment.default)(props.endDate) : null,
211
162
  focusedInput: START_DATE,
212
163
  showPicker: false,
213
164
  startDateError: false,
214
165
  endDateError: false
215
166
  };
216
167
  }
217
-
218
168
  componentDidMount() {
219
- document.addEventListener('keydown', this.handleKeyDown, false);
169
+ document.addEventListener("keydown", this.handleKeyDown, false);
220
170
  }
221
-
222
171
  componentWillUnmount() {
223
- document.removeEventListener('keydown', this.handleKeyDown, false);
172
+ document.removeEventListener("keydown", this.handleKeyDown, false);
224
173
  }
225
-
226
174
  render() {
227
- const {
228
- startDate,
229
- endDate,
230
- focusedInput,
231
- showPicker,
232
- startDateError,
233
- endDateError
234
- } = this.state;
175
+ const { startDate, endDate, focusedInput, showPicker, startDateError, endDateError } = this.state;
235
176
  const {
236
177
  disabled,
237
178
  displayFormatDay,
@@ -251,93 +192,102 @@ class DSDateRangePickerImpl extends React__default["default"].Component {
251
192
  hasError,
252
193
  validationMessage
253
194
  } = this.props;
254
- const inputClass = classNameBlock('inputs', 'range-picker');
255
- const inputClassModifier = '';
195
+ const inputClass = classNameBlock("inputs", "range-picker");
196
+ const inputClassModifier = "";
256
197
  const safeStartInputValue = this.getSafeStartInputValue();
257
198
  const safeEndInputValue = this.getSafeEndInputValue();
258
- return /*#__PURE__*/_jsx__default["default"]("div", {
259
- className: "".concat(inputClass, " ").concat(inputClassModifier)
260
- }, void 0, /*#__PURE__*/_jsx__default["default"]("div", {
261
- className: classNameBlock('wrapper-input-date-range-picker-controller')
262
- }, void 0, /*#__PURE__*/_jsx__default["default"](DSInputMask.DSFormItemLayout, {
199
+ return /* @__PURE__ */ import_react.default.createElement("div", {
200
+ className: `${inputClass} ${inputClassModifier}`
201
+ }, /* @__PURE__ */ import_react.default.createElement("div", {
202
+ className: classNameBlock("wrapper-input-date-range-picker-controller")
203
+ }, /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSFormItemLayout, {
263
204
  floatingLabel: true,
264
- inputComponent: DSInputMask.DSInputMask,
205
+ inputComponent: import_ds_form.DSInputMask,
265
206
  labelText: labelFrom,
266
- mask: DSInputMask.MASK_TYPES.DATE,
207
+ mask: import_ds_form.MASK_TYPES.DATE,
267
208
  onChange: this.handleChangeStart,
268
- onFocus: () => this.setState({
269
- showPicker: false
270
- }),
271
- pipe: DSInputMask.MASK_PIPES.AUTO_CORRECT_DATE,
209
+ onFocus: () => this.setState({ showPicker: false }),
210
+ pipe: import_ds_form.MASK_PIPES.AUTO_CORRECT_DATE,
272
211
  value: safeStartInputValue,
273
212
  required: startDateRequired,
274
213
  hasError: hasError || startDateError,
275
214
  placeholder: "MM/DD/YYYY"
276
- }), /*#__PURE__*/_jsx__default["default"](DSInputMask.DSFormItemLayout, {
215
+ }), /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSFormItemLayout, {
277
216
  floatingLabel: true,
278
- inputComponent: DSInputMask.DSInputMask,
217
+ inputComponent: import_ds_form.DSInputMask,
279
218
  labelText: labelTo,
280
- mask: DSInputMask.MASK_TYPES.DATE,
219
+ mask: import_ds_form.MASK_TYPES.DATE,
281
220
  onChange: this.handleChangeEnd,
282
- onFocus: () => this.setState({
283
- showPicker: false
284
- }),
285
- pipe: DSInputMask.MASK_PIPES.AUTO_CORRECT_DATE,
221
+ onFocus: () => this.setState({ showPicker: false }),
222
+ pipe: import_ds_form.MASK_PIPES.AUTO_CORRECT_DATE,
286
223
  value: safeEndInputValue,
287
224
  required: endDateRequired,
288
225
  hasError: hasError || endDateError,
289
- validationMessage: validationMessage,
226
+ validationMessage,
290
227
  placeholder: "MM/DD/YYYY"
291
- })), /*#__PURE__*/_jsx__default["default"]("div", {
292
- className: classNameBlock('wrapper-button-date-range-picker-controller')
293
- }, void 0, /*#__PURE__*/_jsx__default["default"](DSPopper__default["default"], {
294
- contentComponent: /*#__PURE__*/_jsx__default["default"]("div", {}, void 0, showPicker && /*#__PURE__*/_jsx__default["default"](DayPickerRangeController, {
295
- enableOutsideDays: enableOutsideDays,
296
- isDayBlocked: isDayBlocked,
297
- isDayHighlighted: isDayHighlighted,
298
- isOutsideRange: isOutsideRange,
299
- displayFormatDay: displayFormatDay,
300
- endDate: endDate,
301
- focusedInput: focusedInput,
228
+ })), /* @__PURE__ */ import_react.default.createElement("div", {
229
+ className: classNameBlock("wrapper-button-date-range-picker-controller")
230
+ }, /* @__PURE__ */ import_react.default.createElement(import_ds_popper.default, {
231
+ contentComponent: /* @__PURE__ */ import_react.default.createElement("div", null, showPicker && /* @__PURE__ */ import_react.default.createElement(import_DayPickerRangeController.default, {
232
+ enableOutsideDays,
233
+ isDayBlocked,
234
+ isDayHighlighted,
235
+ isOutsideRange,
236
+ displayFormatDay,
237
+ endDate,
238
+ focusedInput,
302
239
  hideKeyboardShortcutsPanel: true,
303
- minimumNights: minimumNights,
240
+ minimumNights,
304
241
  onDatesChange: this.onDatesChange,
305
242
  onFocusChange: this.onFocusChange,
306
- onOutsideClick: e => {
243
+ onOutsideClick: (e) => {
307
244
  onOutsideClick(e);
308
- this.setState({
309
- showPicker: false
310
- });
245
+ this.setState({ showPicker: false });
311
246
  },
312
- onNextMonthClick: onNextMonthClick,
313
- onPrevMonthClick: onPrevMonthClick,
314
- startDate: startDate,
315
- renderMonthElement: dsDatePicker.renderMonthElement
247
+ onNextMonthClick,
248
+ onPrevMonthClick,
249
+ startDate,
250
+ renderMonthElement: import_ds_date_picker.renderMonthElement
316
251
  })),
317
252
  isOpen: showPicker && !startDateError && !endDateError,
318
- onClose: onClose,
253
+ onClose,
319
254
  placement: "bottom-end",
320
255
  showArrow: false,
321
- triggerComponent: /*#__PURE__*/_jsx__default["default"]("div", {
322
- onFocus: () => this.setState({
323
- showPicker: true
324
- })
325
- }, void 0, /*#__PURE__*/_jsx__default["default"](dsDatePicker.DatePickerPicker, {
326
- className: classNameElement('picker'),
327
- disabled: disabled,
328
- onClick: () => this.setState({
329
- showPicker: true
330
- })
331
- }), hasError && validationMessage && /*#__PURE__*/_jsx__default["default"]("div", {
332
- style: {
333
- height: 15
334
- }
256
+ triggerComponent: /* @__PURE__ */ import_react.default.createElement("div", {
257
+ onFocus: () => this.setState({ showPicker: true })
258
+ }, /* @__PURE__ */ import_react.default.createElement(import_ds_date_picker.DatePickerPicker, {
259
+ className: classNameElement("picker"),
260
+ disabled,
261
+ onClick: () => this.setState({ showPicker: true })
262
+ }), hasError && validationMessage && /* @__PURE__ */ import_react.default.createElement("div", {
263
+ style: { height: 15 }
335
264
  }))
336
265
  })));
337
266
  }
338
-
339
267
  }
340
-
341
- exports.END_DATE = END_DATE;
342
- exports.START_DATE = START_DATE;
343
- exports["default"] = DSDateRangePickerImpl;
268
+ DSDateRangePickerImpl.propTypes = {
269
+ startDate: import_prop_types.default.instanceOf(Date, import_moment.default),
270
+ endDate: import_prop_types.default.instanceOf(Date, import_moment.default),
271
+ onDatesChange: import_prop_types.default.func,
272
+ onChangeStartInput: import_prop_types.default.func,
273
+ onChangeEndInput: import_prop_types.default.func,
274
+ onNextMonthClick: import_prop_types.default.func,
275
+ onPrevMonthClick: import_prop_types.default.func,
276
+ onClose: import_prop_types.default.func,
277
+ onOutsideClick: import_prop_types.default.func,
278
+ disabled: import_prop_types.default.bool,
279
+ displayFormatDay: import_prop_types.default.string,
280
+ minimumNights: import_prop_types.default.number,
281
+ labelTo: import_prop_types.default.string,
282
+ labelFrom: import_prop_types.default.string,
283
+ isDayBlocked: import_prop_types.default.func,
284
+ isDayHighlighted: import_prop_types.default.func,
285
+ isOutsideRange: import_prop_types.default.func,
286
+ enableOutsideDays: import_prop_types.default.bool,
287
+ startDateRequired: import_prop_types.default.bool,
288
+ endDateRequired: import_prop_types.default.bool,
289
+ hasError: import_prop_types.default.bool,
290
+ validationMessage: import_prop_types.default.string
291
+ };
292
+ module.exports = __toCommonJS(DSDateRangePickerImpl_exports);
293
+ //# sourceMappingURL=DSDateRangePickerImpl.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/DSDateRangePickerImpl.tsx", "../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["/* eslint-disable complexity */\n/* eslint-disable import/no-unresolved */\n/* eslint-disable max-lines */\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport moment from 'moment';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport { MASK_TYPES, MASK_PIPES, DSFormItemLayout, DSInputMask } from '@elliemae/ds-form';\nimport DSPopper from '@elliemae/ds-popper';\nimport { DatePickerPicker, renderMonthElement } from '@elliemae/ds-date-picker';\nimport DayPickerRangeController from './DayPickerRangeController';\nimport { isMaxDiffSafe } from '../isMaxDiffSafe';\n\nexport const START_DATE = 'startDate';\nexport const END_DATE = 'endDate';\n\nconst { classNameElement, classNameBlock } = convertPropToCssClassName('datepicker');\n\nexport default class DSDateRangePickerImpl extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n startDate: props.startDate ? moment(props.startDate) : null,\n endDate: props.endDate ? moment(props.endDate) : null,\n focusedInput: START_DATE,\n showPicker: false,\n startDateError: false,\n endDateError: false,\n };\n }\n\n componentDidMount() {\n document.addEventListener('keydown', this.handleKeyDown, false);\n }\n\n componentWillUnmount() {\n document.removeEventListener('keydown', this.handleKeyDown, false);\n }\n\n onDatesChange = ({ startDate, endDate }) => {\n const { onDatesChange } = this.props;\n onDatesChange(startDate, endDate);\n const safe = isMaxDiffSafe(startDate, endDate, this.state.startDate, this.state.endDate);\n if (!safe) {\n this.setState({ showPicker: false });\n }\n this.setState({\n startDate,\n endDate,\n primaryStartInput: false,\n primaryEndInput: false,\n });\n };\n\n onFocusChange = () => {\n this.setState(({ focusedInput }) => ({\n focusedInput: focusedInput === START_DATE ? END_DATE : START_DATE,\n }));\n };\n\n handleKeyDown = (event) => {\n if (event.key === 'Escape') this.setState({ showPicker: false });\n };\n\n getSafeStartInputValue = () => {\n const { startInput, primaryStartInput, startDate } = this.state;\n if (primaryStartInput && startInput) return startInput;\n if (!startDate) return '';\n return startDate.format('MMDDYYYY');\n };\n\n getSafeEndInputValue = () => {\n const { endInput, primaryEndInput, endDate } = this.state;\n if (primaryEndInput && endInput) return endInput;\n if (!endDate) return '';\n return endDate.format('MMDDYYYY');\n };\n\n changeFocus = () => {\n const { disabled } = this.props;\n if (!disabled) {\n this.setState(() => ({ focusedInput: 'startDate' }));\n }\n };\n\n handleChangeStart = (e) => {\n const { onChangeStartInput, isDayBlocked, minimumNights } = this.props;\n const { endDate } = this.state;\n const startInputVal = e.target.value;\n let momentValue = null;\n if (startInputVal && moment(startInputVal, 'MM/DD/YYYY', true).isValid()) {\n momentValue = moment(startInputVal);\n }\n\n const startDateBlocked = isDayBlocked(momentValue);\n\n const isStartDateAcceptable = !startDateBlocked && momentValue && startInputVal !== '';\n const areDatesValid = endDate && momentValue && endDate?.isValid() && momentValue?.isValid();\n\n const canEndBeSameAsStart = minimumNights === 0;\n const isStartAcceptableWithSelectedEnd =\n !endDate ||\n (areDatesValid &&\n ((canEndBeSameAsStart && momentValue.diff(endDate, 'days') <= 0) ||\n (!canEndBeSameAsStart && momentValue.diff(endDate, 'days') < 0)));\n\n const invalidDate = !isStartDateAcceptable || !isStartAcceptableWithSelectedEnd;\n if (startDateBlocked) momentValue = null;\n onChangeStartInput(momentValue);\n this.setState((prevState: { endDateError: boolean }) => ({\n startDate: momentValue,\n startInput: startInputVal,\n primaryStartInput: true,\n startDateError: invalidDate,\n endDateError:\n !isStartDateAcceptable || !prevState.endDateError ? prevState.endDateError : !isStartAcceptableWithSelectedEnd,\n }));\n };\n\n handleChangeEnd = (e) => {\n const { onChangeEndInput, isDayBlocked, minimumNights } = this.props;\n const { startDate } = this.state;\n const endInputValue = e.target.value;\n let momentValue = null;\n if (endInputValue && moment(endInputValue, 'MM/DD/YYYY', true).isValid()) {\n momentValue = moment(endInputValue);\n }\n const endDateBlocked = isDayBlocked(momentValue);\n\n const isEndDateAcceptable = !endDateBlocked && momentValue && endInputValue !== '';\n const areDatesValid = startDate && momentValue && startDate?.isValid() && momentValue?.isValid();\n\n const canEndBeSameAsStart = minimumNights === 0;\n const isEndAcceptableWithSelectedStart =\n !startDate || // we can't compare with start date because it's not yet set\n (areDatesValid && // it's set and both are valid\n ((canEndBeSameAsStart && momentValue.diff(startDate, 'days') >= 0) || // >= is valid\n (!canEndBeSameAsStart && momentValue.diff(startDate, 'days') > 0))); // only > is valid\n\n const invalidDate = !isEndDateAcceptable || !isEndAcceptableWithSelectedStart;\n\n if (endDateBlocked) momentValue = null;\n onChangeEndInput(momentValue);\n this.setState((prevState: { startDateError: boolean }) => ({\n endDate: momentValue,\n endInput: endInputValue,\n primaryEndInput: true,\n startDateError:\n !isEndDateAcceptable || !prevState.startDateError\n ? prevState.startDateError\n : !isEndAcceptableWithSelectedStart,\n endDateError: invalidDate,\n }));\n };\n\n handleChangeDate = ({ startDate: _start, endDate }) => {\n if (_start && endDate) {\n this.setState({\n startDate: moment(_start),\n endDate,\n primaryStartInput: false,\n primaryEndInput: false,\n });\n } else if (_start) {\n this.setState({ startDate: moment(_start), primaryStartInput: false });\n } else if (endDate) {\n this.setState({ endDate, primaryEndInput: false });\n }\n };\n\n render() {\n const { startDate, endDate, focusedInput, showPicker, startDateError, endDateError } = this.state;\n\n const {\n disabled,\n displayFormatDay,\n minimumNights,\n labelFrom,\n labelTo,\n isDayBlocked,\n isDayHighlighted,\n isOutsideRange,\n enableOutsideDays,\n startDateRequired,\n endDateRequired,\n onOutsideClick,\n onNextMonthClick,\n onPrevMonthClick,\n onClose,\n hasError,\n validationMessage,\n } = this.props;\n\n const inputClass = classNameBlock('inputs', 'range-picker');\n const inputClassModifier = '';\n\n const safeStartInputValue = this.getSafeStartInputValue();\n const safeEndInputValue = this.getSafeEndInputValue();\n\n return (\n <div className={`${inputClass} ${inputClassModifier}`}>\n <div className={classNameBlock('wrapper-input-date-range-picker-controller')}>\n <DSFormItemLayout\n floatingLabel\n inputComponent={DSInputMask}\n labelText={labelFrom}\n mask={MASK_TYPES.DATE}\n onChange={this.handleChangeStart}\n onFocus={() => this.setState({ showPicker: false })}\n pipe={MASK_PIPES.AUTO_CORRECT_DATE}\n value={safeStartInputValue}\n required={startDateRequired}\n hasError={hasError || startDateError}\n placeholder=\"MM/DD/YYYY\"\n />\n <DSFormItemLayout\n floatingLabel\n inputComponent={DSInputMask}\n labelText={labelTo}\n mask={MASK_TYPES.DATE}\n onChange={this.handleChangeEnd}\n onFocus={() => this.setState({ showPicker: false })}\n pipe={MASK_PIPES.AUTO_CORRECT_DATE}\n value={safeEndInputValue}\n required={endDateRequired}\n hasError={hasError || endDateError}\n validationMessage={validationMessage}\n placeholder=\"MM/DD/YYYY\"\n />\n </div>\n <div className={classNameBlock('wrapper-button-date-range-picker-controller')}>\n <DSPopper\n contentComponent={\n <div>\n {showPicker && (\n <DayPickerRangeController\n enableOutsideDays={enableOutsideDays}\n isDayBlocked={isDayBlocked}\n isDayHighlighted={isDayHighlighted}\n isOutsideRange={isOutsideRange}\n displayFormatDay={displayFormatDay}\n endDate={endDate}\n focusedInput={focusedInput}\n hideKeyboardShortcutsPanel\n minimumNights={minimumNights}\n onDatesChange={this.onDatesChange}\n onFocusChange={this.onFocusChange}\n onOutsideClick={(e) => {\n onOutsideClick(e);\n this.setState({ showPicker: false });\n }}\n onNextMonthClick={onNextMonthClick}\n onPrevMonthClick={onPrevMonthClick}\n startDate={startDate}\n renderMonthElement={renderMonthElement}\n />\n )}\n </div>\n }\n isOpen={showPicker && !startDateError && !endDateError}\n onClose={onClose}\n placement=\"bottom-end\"\n showArrow={false}\n triggerComponent={\n <div onFocus={() => this.setState({ showPicker: true })}>\n <DatePickerPicker\n className={classNameElement('picker')}\n disabled={disabled}\n onClick={() => this.setState({ showPicker: true })}\n />\n {hasError && validationMessage && <div style={{ height: 15 }} />}\n </div>\n }\n />\n </div>\n </div>\n );\n }\n}\n\nDSDateRangePickerImpl.propTypes = {\n startDate: PropTypes.instanceOf(Date, moment),\n endDate: PropTypes.instanceOf(Date, moment),\n onDatesChange: PropTypes.func,\n onChangeStartInput: PropTypes.func,\n onChangeEndInput: PropTypes.func,\n onNextMonthClick: PropTypes.func,\n onPrevMonthClick: PropTypes.func,\n onClose: PropTypes.func,\n onOutsideClick: PropTypes.func,\n disabled: PropTypes.bool,\n displayFormatDay: PropTypes.string,\n minimumNights: PropTypes.number,\n labelTo: PropTypes.string,\n labelFrom: PropTypes.string,\n isDayBlocked: PropTypes.func,\n isDayHighlighted: PropTypes.func,\n isOutsideRange: PropTypes.func,\n enableOutsideDays: PropTypes.bool,\n startDateRequired: PropTypes.bool,\n endDateRequired: PropTypes.bool,\n hasError: PropTypes.bool,\n validationMessage: PropTypes.string,\n};\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADGvB,mBAAkB;AAClB,wBAAsB;AACtB,oBAAmB;AACnB,2BAA0C;AAC1C,qBAAsE;AACtE,uBAAqB;AACrB,4BAAqD;AACrD,sCAAqC;AACrC,2BAA8B;AAEvB,MAAM,aAAa;AACnB,MAAM,WAAW;AAExB,MAAM,EAAE,kBAAkB,mBAAmB,oDAA0B;AAEvE,oCAAmD,qBAAM,UAAU;AAAA,EACjE,YAAY,OAAO;AACjB,UAAM;AAmBR,yBAAgB,CAAC,EAAE,WAAW,cAAc;AAC1C,YAAM,EAAE,kBAAkB,KAAK;AAC/B,oBAAc,WAAW;AACzB,YAAM,OAAO,wCAAc,WAAW,SAAS,KAAK,MAAM,WAAW,KAAK,MAAM;AAChF,UAAI,CAAC,MAAM;AACT,aAAK,SAAS,EAAE,YAAY;AAAA;AAE9B,WAAK,SAAS;AAAA,QACZ;AAAA,QACA;AAAA,QACA,mBAAmB;AAAA,QACnB,iBAAiB;AAAA;AAAA;AAIrB,yBAAgB,MAAM;AACpB,WAAK,SAAS,CAAC,EAAE,mBAAoB;AAAA,QACnC,cAAc,iBAAiB,aAAa,WAAW;AAAA;AAAA;AAI3D,yBAAgB,CAAC,UAAU;AACzB,UAAI,MAAM,QAAQ;AAAU,aAAK,SAAS,EAAE,YAAY;AAAA;AAG1D,kCAAyB,MAAM;AAC7B,YAAM,EAAE,YAAY,mBAAmB,cAAc,KAAK;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xB,kBAAkB,0BAAU;AAAA,EAC5B,gBAAgB,0BAAU;AAAA,EAC1B,mBAAmB,0BAAU;AAAA,EAC7B,mBAAmB,0BAAU;AAAA,EAC7B,iBAAiB,0BAAU;AAAA,EAC3B,UAAU,0BAAU;AAAA,EACpB,mBAAmB,0BAAU;AAAA;",
6
+ "names": []
7
+ }
@@ -1,20 +1,39 @@
1
- 'use strict';
2
-
3
- var _jsx = require('@babel/runtime/helpers/jsx');
4
- require('react');
5
-
6
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
7
-
8
- var _jsx__default = /*#__PURE__*/_interopDefaultLegacy(_jsx);
9
-
10
- const Label = _ref => {
11
- let {
12
- className = 'date-picker-label',
13
- label = ''
14
- } = _ref;
15
- return /*#__PURE__*/_jsx__default["default"]("div", {
16
- className: className
17
- }, void 0, /*#__PURE__*/_jsx__default["default"]("span", {}, void 0, label));
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
18
11
  };
19
-
20
- module.exports = Label;
12
+ var __reExport = (target, module2, copyDefault, desc) => {
13
+ if (module2 && typeof module2 === "object" || typeof module2 === "function") {
14
+ for (let key of __getOwnPropNames(module2))
15
+ if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
16
+ __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
17
+ }
18
+ return target;
19
+ };
20
+ var __toESM = (module2, isNodeMode) => {
21
+ return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
22
+ };
23
+ var __toCommonJS = /* @__PURE__ */ ((cache) => {
24
+ return (module2, temp) => {
25
+ return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
26
+ };
27
+ })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
28
+ var DatePickerLabel_exports = {};
29
+ __export(DatePickerLabel_exports, {
30
+ default: () => DatePickerLabel_default
31
+ });
32
+ var React = __toESM(require("react"));
33
+ var import_react = __toESM(require("react"));
34
+ const Label = ({ className = "date-picker-label", label = "" }) => /* @__PURE__ */ import_react.default.createElement("div", {
35
+ className
36
+ }, /* @__PURE__ */ import_react.default.createElement("span", null, label));
37
+ var DatePickerLabel_default = Label;
38
+ module.exports = __toCommonJS(DatePickerLabel_exports);
39
+ //# sourceMappingURL=DatePickerLabel.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/DatePickerLabel/DatePickerLabel.tsx", "../../../../../../scripts/build/transpile/react-shim.js"],
4
+ "sourcesContent": ["import React from 'react';\n\nconst Label = ({ className = 'date-picker-label', label = '' }) => (\n <div className={className}>\n <span>{label}</span>\n </div>\n);\n\nexport default Label;\n", "import * as React from 'react';\nexport { React };\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADAvB,mBAAkB;AAElB,MAAM,QAAQ,CAAC,EAAE,YAAY,qBAAqB,QAAQ,SACxD,mDAAC,OAAD;AAAA,EAAK;AAAA,GACH,mDAAC,QAAD,MAAO;AAIX,IAAO,0BAAQ;",
6
+ "names": []
7
+ }