@spothero/ui 17.1.0-beta.0 → 17.1.0-beta.5
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/components/{DatepickerRange → Datepicker/Range}/DatepickerRange.js +7 -4
- package/dist/components/{DatepickerRange → Datepicker/Range}/DatepickerRange.stories.js +26 -10
- package/dist/components/{DatepickerRange → Datepicker/Range}/components/DateRow.js +30 -29
- package/dist/components/{DatepickerRange → Datepicker/Range/components}/DatepickerRangeContainer.js +110 -41
- package/dist/components/{DatepickerRange → Datepicker/Range}/components/DatepickerRangeControls.js +7 -4
- package/dist/components/Datepicker/Range/components/index.js +31 -0
- package/dist/components/Datepicker/Range/utils/propTypes.js +158 -0
- package/dist/components/Datepicker/{Datepicker.stories.js → Single/Datepicker.stories.js} +49 -30
- package/dist/components/Datepicker/{DatepickerContext.js → Single/DatepickerContext.js} +4 -4
- package/dist/components/Datepicker/{DatepickerSingle.js → Single/DatepickerSingle.js} +7 -4
- package/dist/components/Datepicker/{components → Single/components}/DateRow.js +19 -18
- package/dist/components/Datepicker/{DatepickerContainer.js → Single/components/DatepickerContainer.js} +84 -31
- package/dist/components/Datepicker/Single/components/DatepickerControl.js +51 -0
- package/dist/components/Datepicker/Single/components/index.js +31 -0
- package/dist/components/Datepicker/Single/utils/propTypes.js +88 -0
- package/dist/components/Datepicker/{components → common/components}/DatepickerDays.js +19 -16
- package/dist/components/Datepicker/{components → common/components}/DatepickerHeader.js +28 -23
- package/dist/components/Datepicker/common/components/DatepickerInput.js +126 -0
- package/dist/components/{DatepickerRange → Datepicker/common}/components/WithPopoverAnchor.js +3 -1
- package/dist/components/Datepicker/common/components/WithPortal.js +26 -0
- package/dist/components/Datepicker/common/components/index.js +39 -0
- package/dist/components/Datepicker/common/utils/constants.js +43 -0
- package/dist/components/{DatepickerRange/utils/dateRowArithmentic.js → Datepicker/common/utils/dateRowCalculations.js} +14 -15
- package/dist/components/Datepicker/{utils/propTypes.js → common/utils/sharedPropTypes.js} +8 -62
- package/dist/components/Datepicker/index.js +23 -0
- package/dist/components/index.js +7 -9
- package/package.json +1 -1
- package/dist/components/Datepicker/components/DatepickerControl.js +0 -83
- package/dist/components/Datepicker/constants.js +0 -31
- package/dist/components/Datepicker/utils/dateRowArithmentic.js +0 -58
- package/dist/components/DatepickerRange/components/DatepickerDays.js +0 -108
- package/dist/components/DatepickerRange/components/DatepickerHeader.js +0 -116
- package/dist/components/DatepickerRange/components/DatepickerRangeInput.js +0 -90
- package/dist/components/DatepickerRange/constants.js +0 -31
- package/dist/components/DatepickerRange/utils/generalCalculations.js +0 -71
- package/dist/components/DatepickerRange/utils/getWeeksOfMonth.js +0 -51
- package/dist/components/DatepickerRange/utils/propTypes.js +0 -245
- /package/dist/components/{DatepickerRange → Datepicker/Range}/DatepickerRangeContext.js +0 -0
- /package/dist/components/Datepicker/{utils → common/utils}/generalCalculations.js +0 -0
- /package/dist/components/Datepicker/{utils → common/utils}/getWeeksOfMonth.js +0 -0
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/extends"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _react2 = require("@chakra-ui/react");
|
|
15
|
-
|
|
16
|
-
var _calendar = _interopRequireDefault(require("@spothero/icons/calendar"));
|
|
17
|
-
|
|
18
|
-
var _propTypes = require("../utils/propTypes");
|
|
19
|
-
|
|
20
|
-
var _generalCalculations = require("../utils/generalCalculations");
|
|
21
|
-
|
|
22
|
-
var _WithPopoverAnchor = _interopRequireDefault(require("./WithPopoverAnchor"));
|
|
23
|
-
|
|
24
|
-
var _DatepickerRangeContext = require("../DatepickerRangeContext");
|
|
25
|
-
|
|
26
|
-
var formLabelStyleProps = {
|
|
27
|
-
as: 'label',
|
|
28
|
-
fontSize: 'sm',
|
|
29
|
-
fontWeight: 'semibold',
|
|
30
|
-
color: 'text.secondary.light',
|
|
31
|
-
marginBottom: 1
|
|
32
|
-
};
|
|
33
|
-
var formErrorMessageStyleProps = {
|
|
34
|
-
color: 'error',
|
|
35
|
-
fontSize: 'xs',
|
|
36
|
-
marginTop: 1
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
var DatepickerRangeInput = function DatepickerRangeInput(_ref) {
|
|
40
|
-
var isSelected = _ref.isSelected,
|
|
41
|
-
onClick = _ref.onClick,
|
|
42
|
-
selectionPosition = _ref.selectionPosition,
|
|
43
|
-
value = _ref.value,
|
|
44
|
-
useInputIcons = _ref.useInputIcons,
|
|
45
|
-
isInputInvalid = _ref.isInputInvalid,
|
|
46
|
-
inputLabelText = _ref.inputLabelText,
|
|
47
|
-
placeholderText = _ref.placeholderText,
|
|
48
|
-
errorText = _ref.errorText,
|
|
49
|
-
inputComponentOverrides = _ref.inputComponentOverrides;
|
|
50
|
-
|
|
51
|
-
var _useDatepickerRange = (0, _DatepickerRangeContext.useDatepickerRange)(),
|
|
52
|
-
_useDatepickerRange$d = _useDatepickerRange.disclosure,
|
|
53
|
-
onOpen = _useDatepickerRange$d.onOpen,
|
|
54
|
-
onClose = _useDatepickerRange$d.onClose;
|
|
55
|
-
|
|
56
|
-
var handleKeyboardControls = function handleKeyboardControls(evt) {
|
|
57
|
-
var keyCode = evt.code;
|
|
58
|
-
|
|
59
|
-
if (keyCode === 'Enter' || keyCode === 'Space') {
|
|
60
|
-
onOpen();
|
|
61
|
-
} else if (keyCode === 'Escape') {
|
|
62
|
-
onClose();
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
return /*#__PURE__*/_react.default.createElement(_react2.Box, inputComponentOverrides === null || inputComponentOverrides === void 0 ? void 0 : inputComponentOverrides.inputGroupContainer, /*#__PURE__*/_react.default.createElement(_react2.FormControl, (0, _extends2.default)({
|
|
67
|
-
"data-testid": "DatepickerRangeInput-".concat(selectionPosition),
|
|
68
|
-
isInvalid: isInputInvalid
|
|
69
|
-
}, inputComponentOverrides === null || inputComponentOverrides === void 0 ? void 0 : inputComponentOverrides.formControl), inputLabelText && /*#__PURE__*/_react.default.createElement(_react2.FormLabel, (0, _extends2.default)({}, formLabelStyleProps, inputComponentOverrides === null || inputComponentOverrides === void 0 ? void 0 : inputComponentOverrides.formLabel), inputLabelText), /*#__PURE__*/_react.default.createElement(_WithPopoverAnchor.default, {
|
|
70
|
-
isSelected: isSelected
|
|
71
|
-
}, /*#__PURE__*/_react.default.createElement(_react2.InputGroup, inputComponentOverrides === null || inputComponentOverrides === void 0 ? void 0 : inputComponentOverrides.inputGroup, /*#__PURE__*/_react.default.createElement(_react2.Input, (0, _extends2.default)({
|
|
72
|
-
name: "DatepickerRangeInput-".concat(selectionPosition),
|
|
73
|
-
placeholder: placeholderText,
|
|
74
|
-
value: (0, _generalCalculations.formatValueForInputDisplay)(value),
|
|
75
|
-
onClick: onClick,
|
|
76
|
-
onKeyDown: handleKeyboardControls,
|
|
77
|
-
isReadOnly: true
|
|
78
|
-
}, inputComponentOverrides === null || inputComponentOverrides === void 0 ? void 0 : inputComponentOverrides.input)), useInputIcons && /*#__PURE__*/_react.default.createElement(_react2.InputRightElement, (0, _extends2.default)({
|
|
79
|
-
color: isInputInvalid ? 'error' : 'gray.dark',
|
|
80
|
-
zIndex: "base"
|
|
81
|
-
}, inputComponentOverrides === null || inputComponentOverrides === void 0 ? void 0 : inputComponentOverrides.inputRightElement), /*#__PURE__*/_react.default.createElement(_react2.Icon, {
|
|
82
|
-
as: _calendar.default,
|
|
83
|
-
color: "inherit",
|
|
84
|
-
height: 5,
|
|
85
|
-
width: 5
|
|
86
|
-
})))), /*#__PURE__*/_react.default.createElement(_react2.FormErrorMessage, (0, _extends2.default)({}, formErrorMessageStyleProps, inputComponentOverrides === null || inputComponentOverrides === void 0 ? void 0 : inputComponentOverrides.formErrorMessage), errorText)));
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
var _default = DatepickerRangeInput;
|
|
90
|
-
exports.default = _default;
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.FULL_MONTH_NAMES = exports.DAY_NAMES = void 0;
|
|
7
|
-
var DAY_NAMES = [{
|
|
8
|
-
abbv: 'Su',
|
|
9
|
-
full: 'Sunday'
|
|
10
|
-
}, {
|
|
11
|
-
abbv: 'Mo',
|
|
12
|
-
full: 'Monday'
|
|
13
|
-
}, {
|
|
14
|
-
abbv: 'Tu',
|
|
15
|
-
full: 'Tuesday'
|
|
16
|
-
}, {
|
|
17
|
-
abbv: 'We',
|
|
18
|
-
full: 'Wednesday'
|
|
19
|
-
}, {
|
|
20
|
-
abbv: 'Th',
|
|
21
|
-
full: 'Thursday'
|
|
22
|
-
}, {
|
|
23
|
-
abbv: 'Fr',
|
|
24
|
-
full: 'Friday'
|
|
25
|
-
}, {
|
|
26
|
-
abbv: 'Sa',
|
|
27
|
-
full: 'Saturday'
|
|
28
|
-
}];
|
|
29
|
-
exports.DAY_NAMES = DAY_NAMES;
|
|
30
|
-
var FULL_MONTH_NAMES = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
|
|
31
|
-
exports.FULL_MONTH_NAMES = FULL_MONTH_NAMES;
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.formatForDataDate = formatForDataDate;
|
|
9
|
-
exports.formatValueForInputDisplay = formatValueForInputDisplay;
|
|
10
|
-
exports.isCurrentMonthAndYearInView = isCurrentMonthAndYearInView;
|
|
11
|
-
|
|
12
|
-
var _flat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/flat"));
|
|
13
|
-
|
|
14
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
15
|
-
|
|
16
|
-
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
|
|
17
|
-
|
|
18
|
-
function isCurrentMonthAndYearInView(currentDate, arrayOfCalendarDates) {
|
|
19
|
-
/* eslint-disable func-names */
|
|
20
|
-
|
|
21
|
-
/* eslint-disable no-multi-assign */
|
|
22
|
-
function mode(arr) {
|
|
23
|
-
return arr === null || arr === void 0 ? void 0 : arr.reduce(function (current, item) {
|
|
24
|
-
var val = current.numMapping[item] = (current.numMapping[item] || 0) + 1;
|
|
25
|
-
|
|
26
|
-
if (val > current.greatestFreq) {
|
|
27
|
-
current.greatestFreq = val;
|
|
28
|
-
current.mode = item;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return current;
|
|
32
|
-
}, {
|
|
33
|
-
mode: null,
|
|
34
|
-
greatestFreq: -Infinity,
|
|
35
|
-
numMapping: {}
|
|
36
|
-
}).mode;
|
|
37
|
-
}
|
|
38
|
-
/* eslint-enable no-multi-assign */
|
|
39
|
-
|
|
40
|
-
/* eslint-enable func-names */
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var flattendCalendarArray = arrayOfCalendarDates === null || arrayOfCalendarDates === void 0 ? void 0 : (0, _flat.default)(arrayOfCalendarDates).call(arrayOfCalendarDates);
|
|
44
|
-
var yearInView = mode(flattendCalendarArray === null || flattendCalendarArray === void 0 ? void 0 : (0, _map.default)(flattendCalendarArray).call(flattendCalendarArray, function (calendarDate) {
|
|
45
|
-
return calendarDate.getFullYear();
|
|
46
|
-
}));
|
|
47
|
-
var monthInView = mode(flattendCalendarArray === null || flattendCalendarArray === void 0 ? void 0 : (0, _map.default)(flattendCalendarArray).call(flattendCalendarArray, function (calendarDate) {
|
|
48
|
-
return calendarDate.getMonth();
|
|
49
|
-
}));
|
|
50
|
-
var currentYear = currentDate.getFullYear();
|
|
51
|
-
var currentMonth = currentDate.getMonth();
|
|
52
|
-
return currentYear === yearInView && currentMonth === monthInView;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
function formatForDataDate(dateToFormat) {
|
|
56
|
-
var _context, _context2;
|
|
57
|
-
|
|
58
|
-
var year = dateToFormat.getFullYear();
|
|
59
|
-
var month = dateToFormat.getMonth() + 1;
|
|
60
|
-
var dateNumber = dateToFormat.getDate();
|
|
61
|
-
var formattedDate = (0, _concat.default)(_context = (0, _concat.default)(_context2 = "".concat(year, "-")).call(_context2, month, "-")).call(_context, dateNumber);
|
|
62
|
-
return formattedDate;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
function formatValueForInputDisplay(selectedDate) {
|
|
66
|
-
return (selectedDate === null || selectedDate === void 0 ? void 0 : selectedDate.getTime()) === 0 || !selectedDate ? '' : new Intl.DateTimeFormat('en-CA', {
|
|
67
|
-
weekday: 'long',
|
|
68
|
-
month: 'short',
|
|
69
|
-
day: 'numeric'
|
|
70
|
-
}).format(selectedDate);
|
|
71
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.getWeeksOfMonth = getWeeksOfMonth;
|
|
9
|
-
|
|
10
|
-
var _map = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/map"));
|
|
11
|
-
|
|
12
|
-
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/toConsumableArray"));
|
|
13
|
-
|
|
14
|
-
function getWeeksOfMonth(input) {
|
|
15
|
-
var date = new Date(input);
|
|
16
|
-
var year = date.getFullYear();
|
|
17
|
-
var month = date.getMonth();
|
|
18
|
-
var firstDayOfMonth = new Date(year, month, 1).getDay();
|
|
19
|
-
var lastDateOfMonth = new Date(year, month + 1, 0).getDate();
|
|
20
|
-
var lastDayOfMonth = new Date(year, month + 1, 0).getDay();
|
|
21
|
-
var lastDayOfLastMonth = new Date(year, month, 0).getDate();
|
|
22
|
-
var weeks = [];
|
|
23
|
-
var firstWeekDiff = lastDayOfLastMonth - firstDayOfMonth;
|
|
24
|
-
var daysInMonth = lastDateOfMonth + firstDayOfMonth + (7 - lastDayOfMonth);
|
|
25
|
-
var numberOfWeeks = Math.round(daysInMonth / 7);
|
|
26
|
-
(0, _toConsumableArray2.default)(new Array(numberOfWeeks)).forEach(function (_, weekIndex) {
|
|
27
|
-
var _weeks$6$getDate, _weeks, _weeks$, _weeks$$getDate, _context;
|
|
28
|
-
|
|
29
|
-
var start = (_weeks$6$getDate = weeks === null || weeks === void 0 ? void 0 : (_weeks = weeks[weekIndex - 1]) === null || _weeks === void 0 ? void 0 : (_weeks$ = _weeks[6]) === null || _weeks$ === void 0 ? void 0 : (_weeks$$getDate = _weeks$.getDate) === null || _weeks$$getDate === void 0 ? void 0 : _weeks$$getDate.call(_weeks$)) !== null && _weeks$6$getDate !== void 0 ? _weeks$6$getDate : firstWeekDiff;
|
|
30
|
-
var week = (0, _map.default)(_context = (0, _toConsumableArray2.default)(new Array(7))).call(_context, function (__, dayIndex) {
|
|
31
|
-
// First week of month
|
|
32
|
-
if (weekIndex === 0) {
|
|
33
|
-
if (dayIndex >= firstDayOfMonth) {
|
|
34
|
-
return new Date(year, month, dayIndex - firstDayOfMonth + 1);
|
|
35
|
-
} else {
|
|
36
|
-
return new Date(year, month - 1, lastDayOfLastMonth - (firstDayOfMonth - dayIndex - 1));
|
|
37
|
-
}
|
|
38
|
-
} // Last week of month
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
if (start + 1 + dayIndex > lastDateOfMonth) {
|
|
42
|
-
return new Date(year, month + 1, start + 1 + dayIndex - lastDateOfMonth);
|
|
43
|
-
} // Any other day
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
return new Date(year, month, start + 1 + dayIndex);
|
|
47
|
-
});
|
|
48
|
-
weeks.push(week);
|
|
49
|
-
});
|
|
50
|
-
return weeks;
|
|
51
|
-
}
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.inputComponentOverridesProps = exports.default = exports.datepickerRangeOverridesProps = exports.datepickerRangeHeaderOverridesProps = exports.datepickerRangeDaysOverridesProps = exports.datepickerRangeControlsOverridesProps = exports.datepickerRangeBodyOverridesProps = exports.dateRowOverridesProps = void 0;
|
|
9
|
-
|
|
10
|
-
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
|
-
|
|
12
|
-
var inputComponentOverridesProps = _propTypes.default.shape({
|
|
13
|
-
/**
|
|
14
|
-
* Overrides for the parent Box component that wraps the Inputs and Form control,
|
|
15
|
-
* see https://chakra-ui.com/docs/components/box/usage for more
|
|
16
|
-
*/
|
|
17
|
-
inputGroupContainer: _propTypes.default.object,
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Overrides for the parent FormControl component,
|
|
21
|
-
* see https://chakra-ui.com/docs/components/form-control/props for more
|
|
22
|
-
*/
|
|
23
|
-
formControl: _propTypes.default.object,
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Overrides for the FormLabel component,
|
|
27
|
-
* see https://chakra-ui.com/docs/components/form-control/props and/or https://chakra-ui.com/docs/components/form-control/usage for more
|
|
28
|
-
*/
|
|
29
|
-
formLabel: _propTypes.default.object,
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Overrides for the InputGroup component,
|
|
33
|
-
* see https://chakra-ui.com/docs/components/input/usage#left-and-right-addons for more
|
|
34
|
-
*/
|
|
35
|
-
inputGroup: _propTypes.default.object,
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Overrides for the Input component,
|
|
39
|
-
* see https://chakra-ui.com/docs/components/input/props for more
|
|
40
|
-
*/
|
|
41
|
-
input: _propTypes.default.object,
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Overrides for the InputRightElement component,
|
|
45
|
-
* see https://chakra-ui.com/docs/components/input/usage#add-elements-inside-input for more
|
|
46
|
-
*/
|
|
47
|
-
inputRightElement: _propTypes.default.object,
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Overrides for the FormControl ErrorMessage component,
|
|
51
|
-
* see https://chakra-ui.com/docs/components/form-control/usage#error-message for more
|
|
52
|
-
*/
|
|
53
|
-
formErrorMessage: _propTypes.default.object
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
exports.inputComponentOverridesProps = inputComponentOverridesProps;
|
|
57
|
-
|
|
58
|
-
var datepickerRangeControlsOverridesProps = _propTypes.default.shape({
|
|
59
|
-
/**
|
|
60
|
-
* Overrides for the Flex component that wraps the Start and End Date input fields,
|
|
61
|
-
* see https://chakra-ui.com/docs/components/flex/props for more
|
|
62
|
-
*/
|
|
63
|
-
controlsContainer: _propTypes.default.object,
|
|
64
|
-
|
|
65
|
-
/** Overrides for the Start Date Input components */
|
|
66
|
-
startDateInputComponentOverrides: inputComponentOverridesProps,
|
|
67
|
-
|
|
68
|
-
/** Overrides for the End Date Input components */
|
|
69
|
-
endDateInputComponentOverrides: inputComponentOverridesProps
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
exports.datepickerRangeControlsOverridesProps = datepickerRangeControlsOverridesProps;
|
|
73
|
-
|
|
74
|
-
var datepickerRangeHeaderOverridesProps = _propTypes.default.shape({
|
|
75
|
-
/**
|
|
76
|
-
* Overrides for the Flex component that wraps the Header Title and navigation Buttons,
|
|
77
|
-
* see https://chakra-ui.com/docs/components/flex/props for more
|
|
78
|
-
*/
|
|
79
|
-
headerContainer: _propTypes.default.object,
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Overrides for the IconButton component used as navigation for the Header,
|
|
83
|
-
* see https://chakra-ui.com/docs/components/icon-button, for more
|
|
84
|
-
*/
|
|
85
|
-
iconButton: _propTypes.default.object,
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Overrides for the Flex component that wraps the Header Title,
|
|
89
|
-
* see https://chakra-ui.com/docs/components/flex/props for more
|
|
90
|
-
*/
|
|
91
|
-
title: _propTypes.default.object
|
|
92
|
-
});
|
|
93
|
-
|
|
94
|
-
exports.datepickerRangeHeaderOverridesProps = datepickerRangeHeaderOverridesProps;
|
|
95
|
-
|
|
96
|
-
var dateRowOverridesProps = _propTypes.default.shape({
|
|
97
|
-
/**
|
|
98
|
-
* Overrides for the Tbody component that contains the Calendar display
|
|
99
|
-
* see https://chakra-ui.com/docs/components/table/props for more
|
|
100
|
-
*/
|
|
101
|
-
tbody: _propTypes.default.object,
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Overrides for the Tr component that contains the rows of the month within the Calendar display
|
|
105
|
-
* see https://chakra-ui.com/docs/components/table/props for more
|
|
106
|
-
*/
|
|
107
|
-
tr: _propTypes.default.object,
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Overrides for the Td component that contains the individual date within the Calendar display
|
|
111
|
-
* see https://chakra-ui.com/docs/components/table/props for more
|
|
112
|
-
*/
|
|
113
|
-
td: _propTypes.default.object,
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Overrides for the Button component that contains the individual date within the Calendar display
|
|
117
|
-
* see https://chakra-ui.com/docs/components/button/props for more
|
|
118
|
-
*/
|
|
119
|
-
button: _propTypes.default.object
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
exports.dateRowOverridesProps = dateRowOverridesProps;
|
|
123
|
-
|
|
124
|
-
var datepickerRangeDaysOverridesProps = _propTypes.default.shape({
|
|
125
|
-
/**
|
|
126
|
-
* Overrides for the Table component containing the Calendar display,
|
|
127
|
-
* see https://chakra-ui.com/docs/components/table/props#table for more
|
|
128
|
-
*/
|
|
129
|
-
table: _propTypes.default.object,
|
|
130
|
-
|
|
131
|
-
/**
|
|
132
|
-
* Overrides for the Thead component containing the names of the days of the week,
|
|
133
|
-
* see https://chakra-ui.com/docs/components/table/props for more
|
|
134
|
-
*/
|
|
135
|
-
thead: _propTypes.default.object,
|
|
136
|
-
|
|
137
|
-
/**
|
|
138
|
-
* Overrides for the Th component containing the name of the single day names,
|
|
139
|
-
* see https://chakra-ui.com/docs/components/table/props for more
|
|
140
|
-
*/
|
|
141
|
-
th: _propTypes.default.object,
|
|
142
|
-
|
|
143
|
-
/** An optional Object containing style and prop overrides for the DateRow component */
|
|
144
|
-
dateRowOverrides: dateRowOverridesProps
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
exports.datepickerRangeDaysOverridesProps = datepickerRangeDaysOverridesProps;
|
|
148
|
-
|
|
149
|
-
var datepickerRangeBodyOverridesProps = _propTypes.default.shape({
|
|
150
|
-
/**
|
|
151
|
-
* Overrides for the PopoverBody component,
|
|
152
|
-
* see https://chakra-ui.com/docs/components/popover/props#other-props for more
|
|
153
|
-
*/
|
|
154
|
-
popoverBody: _propTypes.default.object,
|
|
155
|
-
|
|
156
|
-
/** An optional Object containing style and prop overrides to be applied to the components that compose the Header section */
|
|
157
|
-
datepickerRangeHeaderOverrides: datepickerRangeHeaderOverridesProps,
|
|
158
|
-
|
|
159
|
-
/** An optional Object containing style and prop overrides to be applied to the components that compose the Calendar section */
|
|
160
|
-
datepickerRangeDaysOverrides: datepickerRangeDaysOverridesProps
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
exports.datepickerRangeBodyOverridesProps = datepickerRangeBodyOverridesProps;
|
|
164
|
-
|
|
165
|
-
var datepickerRangeOverridesProps = _propTypes.default.shape({
|
|
166
|
-
/**
|
|
167
|
-
* Overrides for the parent Popover component,
|
|
168
|
-
* see https://chakra-ui.com/docs/components/popover/props for more
|
|
169
|
-
*/
|
|
170
|
-
popover: _propTypes.default.object,
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Overrides for the Portal component that wraps the DatepickerRange calendar Popover, see https://chakra-ui.com/docs/components/portal/props for more
|
|
174
|
-
*/
|
|
175
|
-
portal: _propTypes.default.object,
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Overrides for the PopoverContent component,
|
|
179
|
-
* see https://chakra-ui.com/docs/components/popover/props#other-props for more
|
|
180
|
-
*/
|
|
181
|
-
popoverContent: _propTypes.default.object,
|
|
182
|
-
|
|
183
|
-
/** An optional Object containing style and prop overrides to be applied to the Form and Control components */
|
|
184
|
-
datepickerRangeControlsOverrides: datepickerRangeControlsOverridesProps,
|
|
185
|
-
|
|
186
|
-
/** An optional Object containing style and prop overrides to be applied to the Popover body, Calendar, and Header componets */
|
|
187
|
-
datepickerRangeBodyOverrides: datepickerRangeBodyOverridesProps
|
|
188
|
-
});
|
|
189
|
-
|
|
190
|
-
exports.datepickerRangeOverridesProps = datepickerRangeOverridesProps;
|
|
191
|
-
var props = {
|
|
192
|
-
/** An optional (pre-selected) Start Date to populate the Datepicker Range with */
|
|
193
|
-
initialStartDate: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.instanceOf(Date)]),
|
|
194
|
-
|
|
195
|
-
/** An optional (pre-selected) End Date to populate the Datepicker Range with */
|
|
196
|
-
initialEndDate: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object, _propTypes.default.instanceOf(Date)]),
|
|
197
|
-
|
|
198
|
-
/** A string in the format 'MM/DD/YYYY' representing the date where days before it should be disabled in the calendar */
|
|
199
|
-
disableBefore: _propTypes.default.string,
|
|
200
|
-
|
|
201
|
-
/** A string in the format 'MM/DD/YYYY' representing the date where days after it should be disabled in the calendar. */
|
|
202
|
-
disableAfter: _propTypes.default.string,
|
|
203
|
-
|
|
204
|
-
/**
|
|
205
|
-
* A callback function to execute on changes
|
|
206
|
-
*
|
|
207
|
-
* @param {string|object} startDate
|
|
208
|
-
* @param {string|object} endDate
|
|
209
|
-
* @param {boolean} startIsSelected
|
|
210
|
-
* @param {boolean} endIsSelected
|
|
211
|
-
*/
|
|
212
|
-
onChange: _propTypes.default.func,
|
|
213
|
-
|
|
214
|
-
/** Whether to display the Start Date Input as invalid or not */
|
|
215
|
-
isStartInvalid: _propTypes.default.bool,
|
|
216
|
-
|
|
217
|
-
/** Whether to display the End Date Input as invalid or not */
|
|
218
|
-
isEndInvalid: _propTypes.default.bool,
|
|
219
|
-
|
|
220
|
-
/** Whether to show the Calendar Icon in the Input field. */
|
|
221
|
-
useInputIcons: _propTypes.default.bool,
|
|
222
|
-
|
|
223
|
-
/** A string to use as the Start Input form label */
|
|
224
|
-
startDateInputLabelText: _propTypes.default.string,
|
|
225
|
-
|
|
226
|
-
/** A string to use as the Start Input placeholder text */
|
|
227
|
-
startDateInputPlaceholderText: _propTypes.default.string,
|
|
228
|
-
|
|
229
|
-
/** A string to use as the Start Input form Error text */
|
|
230
|
-
startDateInputErrorText: _propTypes.default.string,
|
|
231
|
-
|
|
232
|
-
/** A string to use as the End Input form label */
|
|
233
|
-
endDateInputLabelText: _propTypes.default.string,
|
|
234
|
-
|
|
235
|
-
/** A string to use as the End Input placeholder text */
|
|
236
|
-
endDateInputPlaceholderText: _propTypes.default.string,
|
|
237
|
-
|
|
238
|
-
/** A string to use as the End Input form Error text */
|
|
239
|
-
endDateInputErrorText: _propTypes.default.string,
|
|
240
|
-
|
|
241
|
-
/** An optional Object containing style and prop overrides to be applied to the component and child components */
|
|
242
|
-
datepickerRangeOverrides: datepickerRangeOverridesProps
|
|
243
|
-
};
|
|
244
|
-
var _default = props;
|
|
245
|
-
exports.default = _default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|