pcm-shared-components 0.0.140 → 0.0.141
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.
|
@@ -19,8 +19,7 @@ import './css/style.css';
|
|
|
19
19
|
export const DateRangeCalendar = props => {
|
|
20
20
|
const {
|
|
21
21
|
minBookingDate,
|
|
22
|
-
|
|
23
|
-
numberOfMonthsDesktop,
|
|
22
|
+
numberOfMonthsVisible,
|
|
24
23
|
dateFormat,
|
|
25
24
|
minBookingDays,
|
|
26
25
|
onDayRender,
|
|
@@ -30,7 +29,8 @@ export const DateRangeCalendar = props => {
|
|
|
30
29
|
onFocusChange,
|
|
31
30
|
startDate,
|
|
32
31
|
endDate,
|
|
33
|
-
variant
|
|
32
|
+
variant,
|
|
33
|
+
zIndex
|
|
34
34
|
} = props;
|
|
35
35
|
|
|
36
36
|
const handleOnDayRender = date => {
|
|
@@ -92,7 +92,10 @@ export const DateRangeCalendar = props => {
|
|
|
92
92
|
selectDateDateFontSize: 18,
|
|
93
93
|
dateRangeArrowIconColor: orange[700],
|
|
94
94
|
inputLabelBorder: variant === 'outlined' ? undefined : 'none',
|
|
95
|
-
datepickerBorderRadius: 5
|
|
95
|
+
datepickerBorderRadius: 5,
|
|
96
|
+
datepickerZIndex: zIndex,
|
|
97
|
+
dateRangeZIndex: zIndex,
|
|
98
|
+
dateSingleZIndex: zIndex
|
|
96
99
|
}
|
|
97
100
|
}
|
|
98
101
|
}, /*#__PURE__*/React.createElement(DateRangeInput, {
|
|
@@ -115,8 +118,8 @@ export const DateRangeCalendar = props => {
|
|
|
115
118
|
firstDayOfWeek: 0,
|
|
116
119
|
minBookingDays: minBookingDays,
|
|
117
120
|
minBookingDate: minBookingDate,
|
|
118
|
-
vertical:
|
|
119
|
-
numberOfMonths:
|
|
121
|
+
vertical: vertical,
|
|
122
|
+
numberOfMonths: numberOfMonthsVisible,
|
|
120
123
|
onDatesChange: handleOnDatesChange,
|
|
121
124
|
onFocusChange: handleOnFocusChange,
|
|
122
125
|
startDate: startDate // Date or null
|
|
@@ -130,8 +133,7 @@ export const DateRangeCalendar = props => {
|
|
|
130
133
|
export default DateRangeCalendar;
|
|
131
134
|
DateRangeCalendar.defaultProps = {
|
|
132
135
|
minBookingDate: new Date(new Date().setDate(new Date().getDate() + 1)),
|
|
133
|
-
|
|
134
|
-
numberOfMonthsDesktop: 2,
|
|
136
|
+
numberOfMonthsVisible: 2,
|
|
135
137
|
dateFormat: 'MMM d, yyyy',
|
|
136
138
|
minBookingDays: 1,
|
|
137
139
|
onDayRender: undefined,
|
|
@@ -141,17 +143,16 @@ DateRangeCalendar.defaultProps = {
|
|
|
141
143
|
startDate: null,
|
|
142
144
|
endDate: null,
|
|
143
145
|
focusedInput: null,
|
|
144
|
-
variant: 'standard'
|
|
146
|
+
variant: 'standard',
|
|
147
|
+
vertical: false,
|
|
148
|
+
zIndex: 1000
|
|
145
149
|
};
|
|
146
150
|
DateRangeCalendar.propTypes = {
|
|
147
151
|
/** Used to provide the minimum booking date. To allow date selection past todays date simply pas it an old past date example 'new Date('1999-10-02')' */
|
|
148
152
|
minBookingDate: PropTypes.instanceOf(Date),
|
|
149
153
|
|
|
150
|
-
/** Number of calendar months to display
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
/** Number of calendar months to display when we are in desktop view.*/
|
|
154
|
-
numberOfMonthsDesktop: PropTypes.number,
|
|
154
|
+
/** Number of calendar months to display.*/
|
|
155
|
+
numberOfMonthsVisible: PropTypes.number,
|
|
155
156
|
|
|
156
157
|
/** Date format to use when displaying the selected dates in the text boxes.*/
|
|
157
158
|
dateFormat: PropTypes.string,
|
|
@@ -181,5 +182,11 @@ DateRangeCalendar.propTypes = {
|
|
|
181
182
|
focusedInput: PropTypes.oneOf(['startDate', 'endDate', null]),
|
|
182
183
|
|
|
183
184
|
/** Controls the type of border to display around the date input boxes*/
|
|
184
|
-
variant: PropTypes.oneOf(['outlined', 'standard', 'none'])
|
|
185
|
+
variant: PropTypes.oneOf(['outlined', 'standard', 'none']),
|
|
186
|
+
|
|
187
|
+
/** Controls the orientation of the calendar */
|
|
188
|
+
vertical: PropTypes.bool,
|
|
189
|
+
|
|
190
|
+
/** Controls the z-index of the calendar dropdown date selection */
|
|
191
|
+
zIndex: PropTypes.number
|
|
185
192
|
};
|