pcm-shared-components 0.0.140 → 0.0.143

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
- numberOfMonthsMobile,
23
- numberOfMonthsDesktop,
22
+ numberOfMonthsVisible,
24
23
  dateFormat,
25
24
  minBookingDays,
26
25
  onDayRender,
@@ -30,7 +29,9 @@ export const DateRangeCalendar = props => {
30
29
  onFocusChange,
31
30
  startDate,
32
31
  endDate,
33
- variant
32
+ variant,
33
+ vertical,
34
+ zIndex
34
35
  } = props;
35
36
 
36
37
  const handleOnDayRender = date => {
@@ -92,7 +93,10 @@ export const DateRangeCalendar = props => {
92
93
  selectDateDateFontSize: 18,
93
94
  dateRangeArrowIconColor: orange[700],
94
95
  inputLabelBorder: variant === 'outlined' ? undefined : 'none',
95
- datepickerBorderRadius: 5
96
+ datepickerBorderRadius: 5,
97
+ datepickerZIndex: zIndex,
98
+ dateRangeZIndex: zIndex,
99
+ dateSingleZIndex: zIndex
96
100
  }
97
101
  }
98
102
  }, /*#__PURE__*/React.createElement(DateRangeInput, {
@@ -115,8 +119,8 @@ export const DateRangeCalendar = props => {
115
119
  firstDayOfWeek: 0,
116
120
  minBookingDays: minBookingDays,
117
121
  minBookingDate: minBookingDate,
118
- vertical: window.innerWidth < 800 ? true : false,
119
- numberOfMonths: window.innerWidth < 800 ? numberOfMonthsMobile : numberOfMonthsDesktop,
122
+ vertical: vertical,
123
+ numberOfMonths: numberOfMonthsVisible,
120
124
  onDatesChange: handleOnDatesChange,
121
125
  onFocusChange: handleOnFocusChange,
122
126
  startDate: startDate // Date or null
@@ -130,8 +134,7 @@ export const DateRangeCalendar = props => {
130
134
  export default DateRangeCalendar;
131
135
  DateRangeCalendar.defaultProps = {
132
136
  minBookingDate: new Date(new Date().setDate(new Date().getDate() + 1)),
133
- numberOfMonthsMobile: 1,
134
- numberOfMonthsDesktop: 2,
137
+ numberOfMonthsVisible: 2,
135
138
  dateFormat: 'MMM d, yyyy',
136
139
  minBookingDays: 1,
137
140
  onDayRender: undefined,
@@ -141,17 +144,16 @@ DateRangeCalendar.defaultProps = {
141
144
  startDate: null,
142
145
  endDate: null,
143
146
  focusedInput: null,
144
- variant: 'standard'
147
+ variant: 'standard',
148
+ vertical: false,
149
+ zIndex: 1000
145
150
  };
146
151
  DateRangeCalendar.propTypes = {
147
152
  /** 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
153
  minBookingDate: PropTypes.instanceOf(Date),
149
154
 
150
- /** Number of calendar months to display when we are in mobile view.*/
151
- numberOfMonthsMobile: PropTypes.number,
152
-
153
- /** Number of calendar months to display when we are in desktop view.*/
154
- numberOfMonthsDesktop: PropTypes.number,
155
+ /** Number of calendar months to display.*/
156
+ numberOfMonthsVisible: PropTypes.number,
155
157
 
156
158
  /** Date format to use when displaying the selected dates in the text boxes.*/
157
159
  dateFormat: PropTypes.string,
@@ -181,5 +183,11 @@ DateRangeCalendar.propTypes = {
181
183
  focusedInput: PropTypes.oneOf(['startDate', 'endDate', null]),
182
184
 
183
185
  /** Controls the type of border to display around the date input boxes*/
184
- variant: PropTypes.oneOf(['outlined', 'standard', 'none'])
186
+ variant: PropTypes.oneOf(['outlined', 'standard', 'none']),
187
+
188
+ /** Controls the orientation of the calendar */
189
+ vertical: PropTypes.bool,
190
+
191
+ /** Controls the z-index of the calendar dropdown date selection */
192
+ zIndex: PropTypes.number
185
193
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pcm-shared-components",
3
- "version": "0.0.140",
3
+ "version": "0.0.143",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "babel": {
@@ -54,8 +54,8 @@
54
54
  "dependencies": {
55
55
  "@babel/polyfill": "^7.12.1",
56
56
  "@datepicker-react/styled": "^2.8.4",
57
- "@emotion/react": "^11.8.1",
58
- "@emotion/styled": "^11.8.1",
57
+ "@emotion/react": "^11.9.3",
58
+ "@emotion/styled": "^11.9.3",
59
59
  "@mdi/js": "^6.5.95",
60
60
  "@mdi/react": "^1.5.0",
61
61
  "@mdx-js/loader": "^2.0.0",