@elliemae/ds-date-range-picker 2.3.1 → 3.0.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.
- package/dist/cjs/DSDateRangePicker.js +226 -0
- package/dist/cjs/DSDateRangePicker.js.map +7 -0
- package/dist/cjs/components/DSDateRangePickerImpl.js +293 -0
- package/dist/cjs/components/DSDateRangePickerImpl.js.map +7 -0
- package/dist/cjs/components/DatePickerLabel/DatePickerLabel.js +39 -0
- package/dist/cjs/components/DatePickerLabel/DatePickerLabel.js.map +7 -0
- package/dist/cjs/components/DatePickerRangeHeader/DatePickerRangeHeader.js +112 -0
- package/dist/cjs/components/DatePickerRangeHeader/DatePickerRangeHeader.js.map +7 -0
- package/dist/cjs/components/DayPickerRangeController.js +203 -0
- package/dist/cjs/components/DayPickerRangeController.js.map +7 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +7 -0
- package/dist/cjs/isMaxDiffSafe.js +46 -0
- package/dist/cjs/isMaxDiffSafe.js.map +7 -0
- package/dist/esm/DSDateRangePicker.js +202 -0
- package/dist/esm/DSDateRangePicker.js.map +7 -0
- package/dist/esm/components/DSDateRangePickerImpl.js +264 -0
- package/dist/esm/components/DSDateRangePickerImpl.js.map +7 -0
- package/dist/esm/components/DatePickerLabel/DatePickerLabel.js +10 -0
- package/dist/esm/components/DatePickerLabel/DatePickerLabel.js.map +7 -0
- package/{esm → dist/esm}/components/DatePickerRangeHeader/DatePickerRangeHeader.js +36 -45
- package/dist/esm/components/DatePickerRangeHeader/DatePickerRangeHeader.js.map +7 -0
- package/dist/esm/components/DayPickerRangeController.js +176 -0
- package/dist/esm/components/DayPickerRangeController.js.map +7 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +7 -0
- package/dist/esm/isMaxDiffSafe.js +17 -0
- package/dist/esm/isMaxDiffSafe.js.map +7 -0
- package/package.json +41 -32
- package/cjs/DSDateRangePicker.js +0 -204
- package/cjs/components/DSDateRangePickerImpl.js +0 -343
- package/cjs/components/DatePickerLabel/DatePickerLabel.js +0 -20
- package/cjs/components/DatePickerRangeHeader/DatePickerRangeHeader.js +0 -100
- package/cjs/components/DayPickerRangeController.js +0 -147
- package/cjs/index.js +0 -15
- package/cjs/isMaxDiffSafe.js +0 -20
- package/esm/DSDateRangePicker.js +0 -191
- package/esm/components/DSDateRangePickerImpl.js +0 -330
- package/esm/components/DatePickerLabel/DatePickerLabel.js +0 -14
- package/esm/components/DayPickerRangeController.js +0 -139
- package/esm/index.js +0 -3
- package/esm/isMaxDiffSafe.js +0 -15
- package/types/DSDateRangePicker.d.ts +0 -243
- package/types/components/DSDateRangePickerImpl.d.ts +0 -24
- package/types/components/DatePickerLabel/DatePickerLabel.d.ts +0 -6
- package/types/components/DatePickerRangeHeader/DatePickerRangeHeader.d.ts +0 -10
- package/types/components/DayPickerRangeController.d.ts +0 -36
- package/types/index.d.ts +0 -2
- package/types/isMaxDiffSafe.d.ts +0 -2
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __defProps = Object.defineProperties;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
9
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
+
var __spreadValues = (a, b) => {
|
|
13
|
+
for (var prop in b || (b = {}))
|
|
14
|
+
if (__hasOwnProp.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
if (__getOwnPropSymbols)
|
|
17
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
+
if (__propIsEnum.call(b, prop))
|
|
19
|
+
__defNormalProp(a, prop, b[prop]);
|
|
20
|
+
}
|
|
21
|
+
return a;
|
|
22
|
+
};
|
|
23
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
+
var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
|
|
25
|
+
var __export = (target, all) => {
|
|
26
|
+
for (var name in all)
|
|
27
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
28
|
+
};
|
|
29
|
+
var __reExport = (target, module2, copyDefault, desc) => {
|
|
30
|
+
if (module2 && typeof module2 === "object" || typeof module2 === "function") {
|
|
31
|
+
for (let key of __getOwnPropNames(module2))
|
|
32
|
+
if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default"))
|
|
33
|
+
__defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable });
|
|
34
|
+
}
|
|
35
|
+
return target;
|
|
36
|
+
};
|
|
37
|
+
var __toESM = (module2, isNodeMode) => {
|
|
38
|
+
return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2);
|
|
39
|
+
};
|
|
40
|
+
var __toCommonJS = /* @__PURE__ */ ((cache) => {
|
|
41
|
+
return (module2, temp) => {
|
|
42
|
+
return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp);
|
|
43
|
+
};
|
|
44
|
+
})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
|
|
45
|
+
var DSDateRangePicker_exports = {};
|
|
46
|
+
__export(DSDateRangePicker_exports, {
|
|
47
|
+
DateRangePickerWithSchema: () => DateRangePickerWithSchema,
|
|
48
|
+
DayPickerRangeController: () => import_DayPickerRangeController.default,
|
|
49
|
+
END_DATE: () => import_DSDateRangePickerImpl.END_DATE,
|
|
50
|
+
START_DATE: () => import_DSDateRangePickerImpl.START_DATE,
|
|
51
|
+
default: () => DSDateRangePicker_default
|
|
52
|
+
});
|
|
53
|
+
var React = __toESM(require("react"));
|
|
54
|
+
var import_react = __toESM(require("react"));
|
|
55
|
+
var import_react_desc = require("react-desc");
|
|
56
|
+
var import_ds_classnames = require("@elliemae/ds-classnames");
|
|
57
|
+
var import_moment = __toESM(require("moment"));
|
|
58
|
+
var import_initialize = require("react-dates/initialize");
|
|
59
|
+
var import_defaultPhrases = require("react-dates/lib/defaultPhrases");
|
|
60
|
+
var import_DayPickerRangeController = __toESM(require("./components/DayPickerRangeController"));
|
|
61
|
+
var import_DSDateRangePickerImpl = __toESM(require("./components/DSDateRangePickerImpl"));
|
|
62
|
+
const DSDateRangePicker = ({
|
|
63
|
+
containerProps = {},
|
|
64
|
+
className = "",
|
|
65
|
+
disabled = false,
|
|
66
|
+
required = false,
|
|
67
|
+
startDateRequired = false,
|
|
68
|
+
endDateRequired = false,
|
|
69
|
+
id,
|
|
70
|
+
hasError = false,
|
|
71
|
+
validationMessage = "",
|
|
72
|
+
readOnly = false,
|
|
73
|
+
screenReaderInputMessage = "Select date",
|
|
74
|
+
initialVisibleMonth = (0, import_moment.default)(),
|
|
75
|
+
firstDayOfWeek = 0,
|
|
76
|
+
keepOpenOnDateSelect = true,
|
|
77
|
+
reopenPickerOnClearDates = false,
|
|
78
|
+
hideKeyboardShortcutsPanel = true,
|
|
79
|
+
onPrevMonthClick = () => null,
|
|
80
|
+
onNextMonthClick = () => null,
|
|
81
|
+
onClose = () => null,
|
|
82
|
+
onOutsideClick = () => null,
|
|
83
|
+
transitionDuration = 0,
|
|
84
|
+
verticalSpacing = 0,
|
|
85
|
+
minimumNights = 0,
|
|
86
|
+
isDayBlocked = () => false,
|
|
87
|
+
isOutsideRange = () => false,
|
|
88
|
+
isDayHighlighted = () => false,
|
|
89
|
+
displayFormat = "L",
|
|
90
|
+
displayFormatDay = "D",
|
|
91
|
+
phrases = import_defaultPhrases.DateRangePickerPhrases,
|
|
92
|
+
startDate,
|
|
93
|
+
endDate,
|
|
94
|
+
startDateId = "startDateId",
|
|
95
|
+
endDateId = "endDateId",
|
|
96
|
+
labelFrom = "From",
|
|
97
|
+
labelTo = "To",
|
|
98
|
+
enableOutsideDays = true,
|
|
99
|
+
onChangeStartInput = () => null,
|
|
100
|
+
onChangeEndInput = () => null,
|
|
101
|
+
onDatesChange = () => null
|
|
102
|
+
}) => {
|
|
103
|
+
const { cssClassName, prefixBlockName } = (0, import_ds_classnames.convertPropToCssClassName)("datepicker", className, {
|
|
104
|
+
hasError,
|
|
105
|
+
readOnly,
|
|
106
|
+
disabled,
|
|
107
|
+
id
|
|
108
|
+
});
|
|
109
|
+
return /* @__PURE__ */ import_react.default.createElement("div", __spreadProps(__spreadValues({}, containerProps), {
|
|
110
|
+
className: `${prefixBlockName}-range ${cssClassName} ${prefixBlockName}-range`
|
|
111
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_DSDateRangePickerImpl.default, {
|
|
112
|
+
appendToBody: true,
|
|
113
|
+
disabled,
|
|
114
|
+
displayFormat,
|
|
115
|
+
displayFormatDay,
|
|
116
|
+
enableOutsideDays,
|
|
117
|
+
endDate,
|
|
118
|
+
endDateId,
|
|
119
|
+
firstDayOfWeek,
|
|
120
|
+
hideKeyboardShortcutsPanel,
|
|
121
|
+
initialVisibleMonth: () => initialVisibleMonth ? (0, import_moment.default)(initialVisibleMonth) : (0, import_moment.default)(startDate),
|
|
122
|
+
isDayBlocked,
|
|
123
|
+
isDayHighlighted,
|
|
124
|
+
isOutsideRange: isOutsideRange === true || isOutsideRange === false ? () => isOutsideRange : isOutsideRange,
|
|
125
|
+
keepOpenOnDateSelect,
|
|
126
|
+
labelFrom,
|
|
127
|
+
labelTo,
|
|
128
|
+
minimumNights,
|
|
129
|
+
onDatesChange,
|
|
130
|
+
onChangeStartInput,
|
|
131
|
+
onChangeEndInput,
|
|
132
|
+
onClose,
|
|
133
|
+
onNextMonthClick,
|
|
134
|
+
onPrevMonthClick,
|
|
135
|
+
onOutsideClick,
|
|
136
|
+
phrases,
|
|
137
|
+
readOnly,
|
|
138
|
+
reopenPickerOnClearDates,
|
|
139
|
+
required,
|
|
140
|
+
startDateRequired,
|
|
141
|
+
endDateRequired,
|
|
142
|
+
screenReaderInputMessage,
|
|
143
|
+
startDate,
|
|
144
|
+
startDateId,
|
|
145
|
+
transitionDuration,
|
|
146
|
+
verticalSpacing,
|
|
147
|
+
hasError,
|
|
148
|
+
validationMessage
|
|
149
|
+
}));
|
|
150
|
+
};
|
|
151
|
+
const dateRangePickerProps = {
|
|
152
|
+
containerProps: import_react_desc.PropTypes.shape({}).description("Set of Properties attached to the main container"),
|
|
153
|
+
className: import_react_desc.PropTypes.string.description("html class attribute"),
|
|
154
|
+
disabled: import_react_desc.PropTypes.bool.description("disable component or not").defaultValue(false),
|
|
155
|
+
required: import_react_desc.PropTypes.bool.description("input is required or not").defaultValue(false),
|
|
156
|
+
startDateRequired: import_react_desc.PropTypes.bool.description("start date is required or not").defaultValue(false),
|
|
157
|
+
endDateRequired: import_react_desc.PropTypes.bool.description("end date is required or not").defaultValue(false),
|
|
158
|
+
id: import_react_desc.PropTypes.string.description("components id"),
|
|
159
|
+
hasError: import_react_desc.PropTypes.bool.description("set error state").defaultValue(false),
|
|
160
|
+
validationMessage: import_react_desc.PropTypes.string.description("validation message"),
|
|
161
|
+
readOnly: import_react_desc.PropTypes.bool.description("component is read only or not").description(false),
|
|
162
|
+
screenReaderInputMessage: import_react_desc.PropTypes.string.description("message to be anounced by screen reader").defaultValue("select date"),
|
|
163
|
+
initialVisibleMonth: import_react_desc.PropTypes.instanceOf(Date, import_moment.default).description("initial visible month"),
|
|
164
|
+
firstDayOfWeek: import_react_desc.PropTypes.number.description("first day of week").defaultValue(0),
|
|
165
|
+
keepOpenOnDateSelect: import_react_desc.PropTypes.bool.description("keep picker open when a date is selected").defaultValue(true),
|
|
166
|
+
reopenPickerOnClearDates: import_react_desc.PropTypes.bool.description("reopen picker when clearing dates").defaultValue(false),
|
|
167
|
+
hideKeyboardShortcutsPanel: import_react_desc.PropTypes.bool.description("hide keyabord shortcut panel or not"),
|
|
168
|
+
onPrevMonthClick: import_react_desc.PropTypes.func.description("function executed when clicking on prev month button"),
|
|
169
|
+
onNextMonthClick: import_react_desc.PropTypes.func.description("function executed when clicking on next month button"),
|
|
170
|
+
onClose: import_react_desc.PropTypes.func.description("function executed when component closes"),
|
|
171
|
+
transitionDuration: import_react_desc.PropTypes.number.description("transition duration").defaultValue(0),
|
|
172
|
+
verticalSpacing: import_react_desc.PropTypes.number.description("vertical spacing"),
|
|
173
|
+
isDayBlocked: import_react_desc.PropTypes.func.description("function that returns each day and disables desired dates"),
|
|
174
|
+
isOutsideRange: import_react_desc.PropTypes.func.description("function that returns each day and disables outisde range dates"),
|
|
175
|
+
isDayHighlighted: import_react_desc.PropTypes.func.description("function that returns each day and higlights desired dates"),
|
|
176
|
+
minimumNights: 0,
|
|
177
|
+
displayFormat: import_react_desc.PropTypes.string.description("display format").defaultValue("L"),
|
|
178
|
+
displayFormatDay: import_react_desc.PropTypes.string.description("display format day").defaultValue("D"),
|
|
179
|
+
phrases: import_react_desc.PropTypes.shape({
|
|
180
|
+
calendarLabel: import_react_desc.PropTypes.string,
|
|
181
|
+
closeDatePicker: import_react_desc.PropTypes.string,
|
|
182
|
+
clearDates: import_react_desc.PropTypes.string,
|
|
183
|
+
focusStartDate: import_react_desc.PropTypes.string,
|
|
184
|
+
jumpToPrevMonth: import_react_desc.PropTypes.string,
|
|
185
|
+
jumpToNextMonth: import_react_desc.PropTypes.string,
|
|
186
|
+
keyboardShortcuts: import_react_desc.PropTypes.string,
|
|
187
|
+
showKeyboardShortcutsPanel: import_react_desc.PropTypes.string,
|
|
188
|
+
hideKeyboardShortcutsPanel: import_react_desc.PropTypes.string,
|
|
189
|
+
openThisPanel: import_react_desc.PropTypes.string,
|
|
190
|
+
enterKey: import_react_desc.PropTypes.string,
|
|
191
|
+
leftArrowRightArrow: import_react_desc.PropTypes.string,
|
|
192
|
+
upArrowDownArrow: import_react_desc.PropTypes.string,
|
|
193
|
+
pageUpPageDown: import_react_desc.PropTypes.string,
|
|
194
|
+
homeEnd: import_react_desc.PropTypes.string,
|
|
195
|
+
escape: import_react_desc.PropTypes.string,
|
|
196
|
+
questionMark: import_react_desc.PropTypes.string,
|
|
197
|
+
selectFocusedDate: import_react_desc.PropTypes.string,
|
|
198
|
+
moveFocusByOneDay: import_react_desc.PropTypes.string,
|
|
199
|
+
moveFocusByOneWeek: import_react_desc.PropTypes.string,
|
|
200
|
+
moveFocusByOneMonth: import_react_desc.PropTypes.string,
|
|
201
|
+
moveFocustoStartAndEndOfWeek: import_react_desc.PropTypes.string,
|
|
202
|
+
returnFocusToInput: import_react_desc.PropTypes.string,
|
|
203
|
+
keyboardNavigationInstructions: import_react_desc.PropTypes.string,
|
|
204
|
+
chooseAvailableStartDate: import_react_desc.PropTypes.func,
|
|
205
|
+
chooseAvailableEndDate: import_react_desc.PropTypes.func,
|
|
206
|
+
dateIsUnavailable: import_react_desc.PropTypes.func,
|
|
207
|
+
dateIsSelected: import_react_desc.PropTypes.func
|
|
208
|
+
}).description("react-dates phrases"),
|
|
209
|
+
startDate: import_react_desc.PropTypes.instanceOf(Date, import_moment.default).description("start date value"),
|
|
210
|
+
endDate: import_react_desc.PropTypes.instanceOf(Date, import_moment.default).description("end date value"),
|
|
211
|
+
startDateId: import_react_desc.PropTypes.string.description("start date id"),
|
|
212
|
+
endDateId: import_react_desc.PropTypes.string.description("end date id"),
|
|
213
|
+
labelFrom: import_react_desc.PropTypes.string.description("label of start date input"),
|
|
214
|
+
labelTo: import_react_desc.PropTypes.string.description("label of end date input"),
|
|
215
|
+
enableOutsideDays: import_react_desc.PropTypes.bool.description("enable days outside current month").defaultValue("true"),
|
|
216
|
+
onDatesChange: import_react_desc.PropTypes.func.description("function executed when dates change"),
|
|
217
|
+
onChangeStartInput: import_react_desc.PropTypes.func.description("function executed when start date input changes"),
|
|
218
|
+
onChangeEndInput: import_react_desc.PropTypes.func.description("function executed when end date input changes"),
|
|
219
|
+
onOutsideClick: import_react_desc.PropTypes.func.description("function executed when clicking outside component")
|
|
220
|
+
};
|
|
221
|
+
DSDateRangePicker.propTypes = dateRangePickerProps;
|
|
222
|
+
const DateRangePickerWithSchema = (0, import_react_desc.describe)(DSDateRangePicker);
|
|
223
|
+
DateRangePickerWithSchema.propTypes = dateRangePickerProps;
|
|
224
|
+
var DSDateRangePicker_default = DSDateRangePicker;
|
|
225
|
+
module.exports = __toCommonJS(DSDateRangePicker_exports);
|
|
226
|
+
//# sourceMappingURL=DSDateRangePicker.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/DSDateRangePicker.tsx", "../../../../scripts/build/transpile/react-shim.js"],
|
|
4
|
+
"sourcesContent": ["/* eslint-disable max-lines */\nimport React from 'react';\nimport { PropTypes, describe } from 'react-desc';\nimport { convertPropToCssClassName } from '@elliemae/ds-classnames';\nimport moment from 'moment';\nimport 'react-dates/initialize';\nimport { DateRangePickerPhrases } from 'react-dates/lib/defaultPhrases';\nimport DayPickerRangeController from './components/DayPickerRangeController';\nimport DSDateRangePickerImpl, {\n START_DATE,\n END_DATE,\n} from './components/DSDateRangePickerImpl';\n\nconst DSDateRangePicker = ({\n containerProps = {},\n className = '',\n disabled = false,\n required = false,\n startDateRequired = false,\n endDateRequired = false,\n id,\n hasError = false,\n validationMessage = '',\n readOnly = false,\n screenReaderInputMessage = 'Select date',\n initialVisibleMonth = moment(),\n firstDayOfWeek = 0,\n keepOpenOnDateSelect = true,\n reopenPickerOnClearDates = false,\n hideKeyboardShortcutsPanel = true,\n onPrevMonthClick = () => null,\n onNextMonthClick = () => null,\n onClose = () => null,\n onOutsideClick = () => null,\n transitionDuration = 0,\n verticalSpacing = 0,\n minimumNights = 0,\n isDayBlocked = () => false,\n isOutsideRange = () => false,\n isDayHighlighted = () => false,\n displayFormat = 'L',\n displayFormatDay = 'D',\n phrases = DateRangePickerPhrases,\n startDate,\n endDate,\n startDateId = 'startDateId',\n endDateId = 'endDateId',\n labelFrom = 'From',\n labelTo = 'To',\n enableOutsideDays = true,\n onChangeStartInput = () => null,\n onChangeEndInput = () => null,\n onDatesChange = () => null,\n}) => {\n const { cssClassName, prefixBlockName } = convertPropToCssClassName(\n 'datepicker',\n className,\n {\n hasError,\n readOnly,\n disabled,\n id,\n },\n );\n return (\n <div\n {...containerProps}\n className={`${prefixBlockName}-range ${cssClassName} ${prefixBlockName}-range`}\n >\n <DSDateRangePickerImpl\n appendToBody\n disabled={disabled}\n displayFormat={displayFormat}\n displayFormatDay={displayFormatDay}\n enableOutsideDays={enableOutsideDays}\n endDate={endDate}\n endDateId={endDateId}\n firstDayOfWeek={firstDayOfWeek}\n hideKeyboardShortcutsPanel={hideKeyboardShortcutsPanel}\n initialVisibleMonth={() =>\n initialVisibleMonth ? moment(initialVisibleMonth) : moment(startDate)\n }\n isDayBlocked={isDayBlocked}\n isDayHighlighted={isDayHighlighted}\n isOutsideRange={\n isOutsideRange === true || isOutsideRange === false\n ? () => isOutsideRange\n : isOutsideRange\n }\n keepOpenOnDateSelect={keepOpenOnDateSelect}\n labelFrom={labelFrom}\n labelTo={labelTo}\n minimumNights={minimumNights}\n onDatesChange={onDatesChange}\n onChangeStartInput={onChangeStartInput}\n onChangeEndInput={onChangeEndInput}\n onClose={onClose}\n onNextMonthClick={onNextMonthClick}\n onPrevMonthClick={onPrevMonthClick}\n onOutsideClick={onOutsideClick}\n phrases={phrases}\n readOnly={readOnly}\n reopenPickerOnClearDates={reopenPickerOnClearDates}\n required={required}\n startDateRequired={startDateRequired}\n endDateRequired={endDateRequired}\n screenReaderInputMessage={screenReaderInputMessage}\n startDate={startDate}\n startDateId={startDateId}\n transitionDuration={transitionDuration}\n verticalSpacing={verticalSpacing}\n hasError={hasError}\n validationMessage={validationMessage}\n />\n </div>\n );\n};\n\nconst dateRangePickerProps = {\n containerProps: PropTypes.shape({}).description(\n 'Set of Properties attached to the main container',\n ),\n className: PropTypes.string.description('html class attribute'),\n disabled: PropTypes.bool\n .description('disable component or not')\n .defaultValue(false),\n required: PropTypes.bool\n .description('input is required or not')\n .defaultValue(false),\n startDateRequired: PropTypes.bool\n .description('start date is required or not')\n .defaultValue(false),\n endDateRequired: PropTypes.bool\n .description('end date is required or not')\n .defaultValue(false),\n id: PropTypes.string.description('components id'),\n hasError: PropTypes.bool.description('set error state').defaultValue(false),\n validationMessage: PropTypes.string.description('validation message'),\n readOnly: PropTypes.bool\n .description('component is read only or not')\n .description(false),\n screenReaderInputMessage: PropTypes.string\n .description('message to be anounced by screen reader')\n .defaultValue('select date'),\n initialVisibleMonth: PropTypes.instanceOf(Date, moment).description(\n 'initial visible month',\n ),\n firstDayOfWeek: PropTypes.number\n .description('first day of week')\n .defaultValue(0),\n keepOpenOnDateSelect: PropTypes.bool\n .description('keep picker open when a date is selected')\n .defaultValue(true),\n reopenPickerOnClearDates: PropTypes.bool\n .description('reopen picker when clearing dates')\n .defaultValue(false),\n hideKeyboardShortcutsPanel: PropTypes.bool.description(\n 'hide keyabord shortcut panel or not',\n ),\n onPrevMonthClick: PropTypes.func.description(\n 'function executed when clicking on prev month button',\n ),\n onNextMonthClick: PropTypes.func.description(\n 'function executed when clicking on next month button',\n ),\n onClose: PropTypes.func.description(\n 'function executed when component closes',\n ),\n transitionDuration: PropTypes.number\n .description('transition duration')\n .defaultValue(0),\n verticalSpacing: PropTypes.number.description('vertical spacing'),\n isDayBlocked: PropTypes.func.description(\n 'function that returns each day and disables desired dates',\n ),\n isOutsideRange: PropTypes.func.description(\n 'function that returns each day and disables outisde range dates',\n ),\n isDayHighlighted: PropTypes.func.description(\n 'function that returns each day and higlights desired dates',\n ),\n minimumNights: 0,\n displayFormat: PropTypes.string\n .description('display format')\n .defaultValue('L'),\n displayFormatDay: PropTypes.string\n .description('display format day')\n .defaultValue('D'),\n phrases: PropTypes.shape({\n calendarLabel: PropTypes.string,\n closeDatePicker: PropTypes.string,\n clearDates: PropTypes.string,\n focusStartDate: PropTypes.string,\n jumpToPrevMonth: PropTypes.string,\n jumpToNextMonth: PropTypes.string,\n keyboardShortcuts: PropTypes.string,\n showKeyboardShortcutsPanel: PropTypes.string,\n hideKeyboardShortcutsPanel: PropTypes.string,\n openThisPanel: PropTypes.string,\n enterKey: PropTypes.string,\n leftArrowRightArrow: PropTypes.string,\n upArrowDownArrow: PropTypes.string,\n pageUpPageDown: PropTypes.string,\n homeEnd: PropTypes.string,\n escape: PropTypes.string,\n questionMark: PropTypes.string,\n selectFocusedDate: PropTypes.string,\n moveFocusByOneDay: PropTypes.string,\n moveFocusByOneWeek: PropTypes.string,\n moveFocusByOneMonth: PropTypes.string,\n moveFocustoStartAndEndOfWeek: PropTypes.string,\n returnFocusToInput: PropTypes.string,\n keyboardNavigationInstructions: PropTypes.string,\n chooseAvailableStartDate: PropTypes.func,\n chooseAvailableEndDate: PropTypes.func,\n dateIsUnavailable: PropTypes.func,\n dateIsSelected: PropTypes.func,\n }).description('react-dates phrases'),\n startDate: PropTypes.instanceOf(Date, moment).description('start date value'),\n endDate: PropTypes.instanceOf(Date, moment).description('end date value'),\n startDateId: PropTypes.string.description('start date id'),\n endDateId: PropTypes.string.description('end date id'),\n labelFrom: PropTypes.string.description('label of start date input'),\n labelTo: PropTypes.string.description('label of end date input'),\n enableOutsideDays: PropTypes.bool\n .description('enable days outside current month')\n .defaultValue('true'),\n onDatesChange: PropTypes.func.description(\n 'function executed when dates change',\n ),\n onChangeStartInput: PropTypes.func.description(\n 'function executed when start date input changes',\n ),\n onChangeEndInput: PropTypes.func.description(\n 'function executed when end date input changes',\n ),\n onOutsideClick: PropTypes.func.description(\n 'function executed when clicking outside component',\n ),\n};\n\nDSDateRangePicker.propTypes = dateRangePickerProps;\nconst DateRangePickerWithSchema = describe(DSDateRangePicker);\nDateRangePickerWithSchema.propTypes = dateRangePickerProps;\n\nexport {\n DayPickerRangeController,\n START_DATE,\n END_DATE,\n DateRangePickerWithSchema,\n};\n\nexport default DSDateRangePicker;\n", "import * as React from 'react';\nexport { React };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;ACAA,YAAuB;ADCvB,mBAAkB;AAClB,wBAAoC;AACpC,2BAA0C;AAC1C,oBAAmB;AACnB,wBAAO;AACP,4BAAuC;AACvC,sCAAqC;AACrC,mCAGO;AAEP,MAAM,oBAAoB,CAAC;AAAA,EACzB,iBAAiB;AAAA,EACjB,YAAY;AAAA,EACZ,WAAW;AAAA,EACX,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,kBAAkB;AAAA,EAClB;AAAA,EACA,WAAW;AAAA,EACX,oBAAoB;AAAA,EACpB,WAAW;AAAA,EACX,2BAA2B;AAAA,EAC3B,sBAAsB;AAAA,EACtB,iBAAiB;AAAA,EACjB,uBAAuB;AAAA,EACvB,2BAA2B;AAAA,EAC3B,6BAA6B;AAAA,EAC7B,mBAAmB,MAAM;AAAA,EACzB,mBAAmB,MAAM;AAAA,EACzB,UAAU,MAAM;AAAA,EAChB,iBAAiB,MAAM;AAAA,EACvB,qBAAqB;AAAA,EACrB,kBAAkB;AAAA,EAClB,gBAAgB;AAAA,EAChB,eAAe,MAAM;AAAA,EACrB,iBAAiB,MAAM;AAAA,EACvB,mBAAmB,MAAM;AAAA,EACzB,gBAAgB;AAAA,EAChB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV;AAAA,EACA;AAAA,EACA,cAAc;AAAA,EACd,YAAY;AAAA,EACZ,YAAY;AAAA,EACZ,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,qBA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BAAU;AAAA,IAC1B,SAAS,4BAAU;AAAA,IACnB,QAAQ,4BAAU;AAAA,IAClB,cAAc,4BAAU;AAAA,IACxB,mBAAmB,4BAAU;AAAA,IAC7B,mBAAmB,4BAAU;AAAA,IAC7B,oBAAoB,4BAAU;AAAA,IAC9B,qBAAqB,4BAAU;AAAA,IAC/B,8BAA8B,4BAAU;AAAA,IACxC,oBAAoB,4BAAU;AAAA,IAC9B,gCAAgC,4BAAU;AAAA,IAC1C,0BAA0B,4BAAU;AAAA,IACpC,wBAAwB,4BAAU;AAAA,IAClC,mBAAmB,4BAAU;AAAA,IAC7B,gBAAgB,4BAAU;AAAA,KACzB,YAAY;AAAA,EACf,WAAW,4BAAU,WAAW,MAAM,uBAAQ,YAAY;AAAA,EAC1D,SAAS,4BAAU,WAAW,MAAM,uBAAQ,YAAY;AAAA,EACxD,aAAa,4BAAU,OAAO,YAAY;AAAA,EAC1C,WAAW,4BAAU,OAAO,YAAY;AAAA,EACxC,WAAW,4BAAU,OAAO,YAAY;AAAA,EACxC,SAAS,4BAAU,OAAO,YAAY;AAAA,EACtC,mBAAmB,4BAAU,KAC1B,YAAY,qCACZ,aAAa;AAAA,EAChB,eAAe,4BAAU,KAAK,YAC5B;AAAA,EAEF,oBAAoB,4BAAU,KAAK,YACjC;AAAA,EAEF,kBAAkB,4BAAU,KAAK,YAC/B;AAAA,EAEF,gBAAgB,4BAAU,KAAK,YAC7B;AAAA;AAIJ,kBAAkB,YAAY;AAC9B,MAAM,4BAA4B,gCAAS;AAC3C,0BAA0B,YAAY;AAStC,IAAO,4BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,293 @@
|
|
|
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 {
|
|
48
|
+
constructor(props) {
|
|
49
|
+
super(props);
|
|
50
|
+
this.onDatesChange = ({ startDate, endDate }) => {
|
|
51
|
+
const { onDatesChange } = this.props;
|
|
52
|
+
onDatesChange(startDate, endDate);
|
|
53
|
+
const safe = (0, import_isMaxDiffSafe.isMaxDiffSafe)(startDate, endDate, this.state.startDate, this.state.endDate);
|
|
54
|
+
if (!safe) {
|
|
55
|
+
this.setState({ showPicker: false });
|
|
56
|
+
}
|
|
57
|
+
this.setState({
|
|
58
|
+
startDate,
|
|
59
|
+
endDate,
|
|
60
|
+
primaryStartInput: false,
|
|
61
|
+
primaryEndInput: false
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
this.onFocusChange = () => {
|
|
65
|
+
this.setState(({ focusedInput }) => ({
|
|
66
|
+
focusedInput: focusedInput === START_DATE ? END_DATE : START_DATE
|
|
67
|
+
}));
|
|
68
|
+
};
|
|
69
|
+
this.handleKeyDown = (event) => {
|
|
70
|
+
if (event.key === "Escape")
|
|
71
|
+
this.setState({ showPicker: false });
|
|
72
|
+
};
|
|
73
|
+
this.getSafeStartInputValue = () => {
|
|
74
|
+
const { startInput, primaryStartInput, startDate } = this.state;
|
|
75
|
+
if (primaryStartInput && startInput)
|
|
76
|
+
return startInput;
|
|
77
|
+
if (!startDate)
|
|
78
|
+
return "";
|
|
79
|
+
return startDate.format("MMDDYYYY");
|
|
80
|
+
};
|
|
81
|
+
this.getSafeEndInputValue = () => {
|
|
82
|
+
const { endInput, primaryEndInput, endDate } = this.state;
|
|
83
|
+
if (primaryEndInput && endInput)
|
|
84
|
+
return endInput;
|
|
85
|
+
if (!endDate)
|
|
86
|
+
return "";
|
|
87
|
+
return endDate.format("MMDDYYYY");
|
|
88
|
+
};
|
|
89
|
+
this.changeFocus = () => {
|
|
90
|
+
const { disabled } = this.props;
|
|
91
|
+
if (!disabled) {
|
|
92
|
+
this.setState(() => ({ focusedInput: "startDate" }));
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
this.handleChangeStart = (e) => {
|
|
96
|
+
const { onChangeStartInput, isDayBlocked, minimumNights } = this.props;
|
|
97
|
+
const { endDate } = this.state;
|
|
98
|
+
const startInputVal = e.target.value;
|
|
99
|
+
let momentValue = null;
|
|
100
|
+
if (startInputVal && (0, import_moment.default)(startInputVal, "MM/DD/YYYY", true).isValid()) {
|
|
101
|
+
momentValue = (0, import_moment.default)(startInputVal);
|
|
102
|
+
}
|
|
103
|
+
const startDateBlocked = isDayBlocked(momentValue);
|
|
104
|
+
const isStartDateAcceptable = !startDateBlocked && momentValue && startInputVal !== "";
|
|
105
|
+
const areDatesValid = endDate && momentValue && endDate?.isValid() && momentValue?.isValid();
|
|
106
|
+
const canEndBeSameAsStart = minimumNights === 0;
|
|
107
|
+
const isStartAcceptableWithSelectedEnd = !endDate || areDatesValid && (canEndBeSameAsStart && momentValue.diff(endDate, "days") <= 0 || !canEndBeSameAsStart && momentValue.diff(endDate, "days") < 0);
|
|
108
|
+
const invalidDate = !isStartDateAcceptable || !isStartAcceptableWithSelectedEnd;
|
|
109
|
+
if (startDateBlocked)
|
|
110
|
+
momentValue = null;
|
|
111
|
+
onChangeStartInput(momentValue);
|
|
112
|
+
this.setState((prevState) => ({
|
|
113
|
+
startDate: momentValue,
|
|
114
|
+
startInput: startInputVal,
|
|
115
|
+
primaryStartInput: true,
|
|
116
|
+
startDateError: invalidDate,
|
|
117
|
+
endDateError: !isStartDateAcceptable || !prevState.endDateError ? prevState.endDateError : !isStartAcceptableWithSelectedEnd
|
|
118
|
+
}));
|
|
119
|
+
};
|
|
120
|
+
this.handleChangeEnd = (e) => {
|
|
121
|
+
const { onChangeEndInput, isDayBlocked, minimumNights } = this.props;
|
|
122
|
+
const { startDate } = this.state;
|
|
123
|
+
const endInputValue = e.target.value;
|
|
124
|
+
let momentValue = null;
|
|
125
|
+
if (endInputValue && (0, import_moment.default)(endInputValue, "MM/DD/YYYY", true).isValid()) {
|
|
126
|
+
momentValue = (0, import_moment.default)(endInputValue);
|
|
127
|
+
}
|
|
128
|
+
const endDateBlocked = isDayBlocked(momentValue);
|
|
129
|
+
const isEndDateAcceptable = !endDateBlocked && momentValue && endInputValue !== "";
|
|
130
|
+
const areDatesValid = startDate && momentValue && startDate?.isValid() && momentValue?.isValid();
|
|
131
|
+
const canEndBeSameAsStart = minimumNights === 0;
|
|
132
|
+
const isEndAcceptableWithSelectedStart = !startDate || areDatesValid && (canEndBeSameAsStart && momentValue.diff(startDate, "days") >= 0 || !canEndBeSameAsStart && momentValue.diff(startDate, "days") > 0);
|
|
133
|
+
const invalidDate = !isEndDateAcceptable || !isEndAcceptableWithSelectedStart;
|
|
134
|
+
if (endDateBlocked)
|
|
135
|
+
momentValue = null;
|
|
136
|
+
onChangeEndInput(momentValue);
|
|
137
|
+
this.setState((prevState) => ({
|
|
138
|
+
endDate: momentValue,
|
|
139
|
+
endInput: endInputValue,
|
|
140
|
+
primaryEndInput: true,
|
|
141
|
+
startDateError: !isEndDateAcceptable || !prevState.startDateError ? prevState.startDateError : !isEndAcceptableWithSelectedStart,
|
|
142
|
+
endDateError: invalidDate
|
|
143
|
+
}));
|
|
144
|
+
};
|
|
145
|
+
this.handleChangeDate = ({ startDate: _start, endDate }) => {
|
|
146
|
+
if (_start && endDate) {
|
|
147
|
+
this.setState({
|
|
148
|
+
startDate: (0, import_moment.default)(_start),
|
|
149
|
+
endDate,
|
|
150
|
+
primaryStartInput: false,
|
|
151
|
+
primaryEndInput: false
|
|
152
|
+
});
|
|
153
|
+
} else if (_start) {
|
|
154
|
+
this.setState({ startDate: (0, import_moment.default)(_start), primaryStartInput: false });
|
|
155
|
+
} else if (endDate) {
|
|
156
|
+
this.setState({ endDate, primaryEndInput: false });
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
this.state = {
|
|
160
|
+
startDate: props.startDate ? (0, import_moment.default)(props.startDate) : null,
|
|
161
|
+
endDate: props.endDate ? (0, import_moment.default)(props.endDate) : null,
|
|
162
|
+
focusedInput: START_DATE,
|
|
163
|
+
showPicker: false,
|
|
164
|
+
startDateError: false,
|
|
165
|
+
endDateError: false
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
componentDidMount() {
|
|
169
|
+
document.addEventListener("keydown", this.handleKeyDown, false);
|
|
170
|
+
}
|
|
171
|
+
componentWillUnmount() {
|
|
172
|
+
document.removeEventListener("keydown", this.handleKeyDown, false);
|
|
173
|
+
}
|
|
174
|
+
render() {
|
|
175
|
+
const { startDate, endDate, focusedInput, showPicker, startDateError, endDateError } = this.state;
|
|
176
|
+
const {
|
|
177
|
+
disabled,
|
|
178
|
+
displayFormatDay,
|
|
179
|
+
minimumNights,
|
|
180
|
+
labelFrom,
|
|
181
|
+
labelTo,
|
|
182
|
+
isDayBlocked,
|
|
183
|
+
isDayHighlighted,
|
|
184
|
+
isOutsideRange,
|
|
185
|
+
enableOutsideDays,
|
|
186
|
+
startDateRequired,
|
|
187
|
+
endDateRequired,
|
|
188
|
+
onOutsideClick,
|
|
189
|
+
onNextMonthClick,
|
|
190
|
+
onPrevMonthClick,
|
|
191
|
+
onClose,
|
|
192
|
+
hasError,
|
|
193
|
+
validationMessage
|
|
194
|
+
} = this.props;
|
|
195
|
+
const inputClass = classNameBlock("inputs", "range-picker");
|
|
196
|
+
const inputClassModifier = "";
|
|
197
|
+
const safeStartInputValue = this.getSafeStartInputValue();
|
|
198
|
+
const safeEndInputValue = this.getSafeEndInputValue();
|
|
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, {
|
|
204
|
+
floatingLabel: true,
|
|
205
|
+
inputComponent: import_ds_form.DSInputMask,
|
|
206
|
+
labelText: labelFrom,
|
|
207
|
+
mask: import_ds_form.MASK_TYPES.DATE,
|
|
208
|
+
onChange: this.handleChangeStart,
|
|
209
|
+
onFocus: () => this.setState({ showPicker: false }),
|
|
210
|
+
pipe: import_ds_form.MASK_PIPES.AUTO_CORRECT_DATE,
|
|
211
|
+
value: safeStartInputValue,
|
|
212
|
+
required: startDateRequired,
|
|
213
|
+
hasError: hasError || startDateError,
|
|
214
|
+
placeholder: "MM/DD/YYYY"
|
|
215
|
+
}), /* @__PURE__ */ import_react.default.createElement(import_ds_form.DSFormItemLayout, {
|
|
216
|
+
floatingLabel: true,
|
|
217
|
+
inputComponent: import_ds_form.DSInputMask,
|
|
218
|
+
labelText: labelTo,
|
|
219
|
+
mask: import_ds_form.MASK_TYPES.DATE,
|
|
220
|
+
onChange: this.handleChangeEnd,
|
|
221
|
+
onFocus: () => this.setState({ showPicker: false }),
|
|
222
|
+
pipe: import_ds_form.MASK_PIPES.AUTO_CORRECT_DATE,
|
|
223
|
+
value: safeEndInputValue,
|
|
224
|
+
required: endDateRequired,
|
|
225
|
+
hasError: hasError || endDateError,
|
|
226
|
+
validationMessage,
|
|
227
|
+
placeholder: "MM/DD/YYYY"
|
|
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,
|
|
239
|
+
hideKeyboardShortcutsPanel: true,
|
|
240
|
+
minimumNights,
|
|
241
|
+
onDatesChange: this.onDatesChange,
|
|
242
|
+
onFocusChange: this.onFocusChange,
|
|
243
|
+
onOutsideClick: (e) => {
|
|
244
|
+
onOutsideClick(e);
|
|
245
|
+
this.setState({ showPicker: false });
|
|
246
|
+
},
|
|
247
|
+
onNextMonthClick,
|
|
248
|
+
onPrevMonthClick,
|
|
249
|
+
startDate,
|
|
250
|
+
renderMonthElement: import_ds_date_picker.renderMonthElement
|
|
251
|
+
})),
|
|
252
|
+
isOpen: showPicker && !startDateError && !endDateError,
|
|
253
|
+
onClose,
|
|
254
|
+
placement: "bottom-end",
|
|
255
|
+
showArrow: false,
|
|
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 }
|
|
264
|
+
}))
|
|
265
|
+
})));
|
|
266
|
+
}
|
|
267
|
+
}
|
|
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;AAC1D,UAAI,qBAAqB;AAAY,eAAO;AAC5C,UAAI,CAAC;AAAW,eAAO;AACvB,aAAO,UAAU,OAAO;AAAA;AAG1B,gCAAuB,MAAM;AAC3B,YAAM,EAAE,UAAU,iBAAiB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AAU,0BAAU;AAAA,EACpB,mBAAmB,0BAAU;AAAA;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
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 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
|
+
}
|