pcm-shared-components 2.0.185 → 2.0.187

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.
@@ -29,11 +29,11 @@ export const DateCalendar = props => {
29
29
  isDateBlocked,
30
30
  focusedInput,
31
31
  onDatesChange,
32
- onFocusChange,
33
32
  startDate,
34
33
  endDate,
35
34
  variant,
36
35
  vertical,
36
+ showSelectedDates,
37
37
  zIndex,
38
38
  i18next,
39
39
  daySize,
@@ -63,15 +63,6 @@ export const DateCalendar = props => {
63
63
  console.error(error);
64
64
  }
65
65
  };
66
- const handleOnFocusChange = data => {
67
- try {
68
- if (typeof onFocusChange === 'function') {
69
- onFocusChange(data);
70
- }
71
- } catch (error) {
72
- console.error(error);
73
- }
74
- };
75
66
  const overrideCalendarTheme = {};
76
67
  return /*#__PURE__*/React.createElement("div", {
77
68
  className: `m-auto pt-0 md:pt-0 ${variant === 'standard' ? 'bottom_border' : undefined}`,
@@ -106,7 +97,7 @@ export const DateCalendar = props => {
106
97
  startDatePlaceholder: i18next.t('common.app.arrival_date'),
107
98
  endDatePlaceholder: i18next.t('common.app.departure_date')
108
99
  },
109
- showSelectedDates: false,
100
+ showSelectedDates: showSelectedDates,
110
101
  showResetDates: false,
111
102
  showClose: false,
112
103
  onDayRender: handleOnDayRender,
@@ -117,7 +108,6 @@ export const DateCalendar = props => {
117
108
  vertical: vertical,
118
109
  numberOfMonths: numberOfMonthsVisible,
119
110
  onDatesChange: handleOnDatesChange,
120
- onFocusChange: handleOnFocusChange,
121
111
  startDate: startDate // Date or null
122
112
  ,
123
113
  endDate: endDate // Date or null
@@ -135,7 +125,6 @@ DateCalendar.defaultProps = {
135
125
  onDayRender: undefined,
136
126
  isDateBlocked: undefined,
137
127
  onDatesChange: undefined,
138
- onFocusChange: undefined,
139
128
  startDate: null,
140
129
  endDate: null,
141
130
  focusedInput: null,
@@ -144,7 +133,8 @@ DateCalendar.defaultProps = {
144
133
  zIndex: 1000,
145
134
  i18next: undefined,
146
135
  daySize: 40,
147
- datepickerPadding: 25
136
+ datepickerPadding: 25,
137
+ showSelectedDates: false
148
138
  };
149
139
  DateCalendar.propTypes = {
150
140
  /** 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')' */
@@ -161,8 +151,6 @@ DateCalendar.propTypes = {
161
151
  isDateBlocked: PropTypes.func,
162
152
  /** Provides a (data) props to the function and doesn't expect any return value*/
163
153
  onDatesChange: PropTypes.func,
164
- /** Provides a instance of focusedInput ('START_DATE','END_DATE',null) prop to the function and doesn't expect any return value*/
165
- onFocusChange: PropTypes.func,
166
154
  /** The stat date of the calendar */
167
155
  startDate: PropTypes.instanceOf(Date),
168
156
  /** The end date of the calendar */
@@ -180,5 +168,7 @@ DateCalendar.propTypes = {
180
168
  /** Controls the size of the day in the calendar */
181
169
  daySize: PropTypes.number,
182
170
  /** Controls the padding of the datepicker */
183
- datepickerPadding: PropTypes.number
171
+ datepickerPadding: PropTypes.number,
172
+ /** Controls the visibility of the selected dates in the calendar */
173
+ showSelectedDates: PropTypes.bool
184
174
  };
@@ -39,19 +39,10 @@ const DateCalendarComp = props => {
39
39
  const handleOnDatesChange = data => {
40
40
  setState(data);
41
41
  };
42
- const handleOnFocusChange = data => {
43
- setState(previousState => {
44
- return {
45
- ...previousState,
46
- focusedInput: data
47
- };
48
- });
49
- };
50
42
  return /*#__PURE__*/React.createElement(DateCalendar, _extends({
51
43
  onDayRender: date => handleOnDayRender(date),
52
44
  isDateBlocked: handleIsDateBlocked,
53
45
  onDatesChange: handleOnDatesChange,
54
- onFocusChange: handleOnFocusChange,
55
46
  startDate: state.startDate,
56
47
  endDate: state.endDate,
57
48
  focusedInput: state.focusedInput,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pcm-shared-components",
3
- "version": "2.0.185",
3
+ "version": "2.0.187",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "babel": {