@happeouikit/form-elements 2.3.5 → 2.3.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.3.6
4
+
5
+ - [Added] Added data-testids for datepicker components
6
+
3
7
  ## 2.3.5
4
8
 
5
9
  - [Added] Added the option to pass dayPickerProps
@@ -148,7 +148,7 @@ var DatePicker = function DatePicker(_ref) {
148
148
 
149
149
  DatePicker.defaultProps = {
150
150
  type: "to",
151
- fromMonth: new Date(),
151
+ fromMonth: new Date() || "",
152
152
  date: {
153
153
  from: "",
154
154
  to: ""
@@ -161,7 +161,7 @@ DatePicker.defaultProps = {
161
161
  disabledDays: []
162
162
  };
163
163
  DatePicker.propTypes = {
164
- fromMonth: PropTypes.instanceOf(Date),
164
+ fromMonth: PropTypes.oneOfType([PropTypes.instanceOf(Date), PropTypes.string]),
165
165
  label: PropTypes.oneOfType([PropTypes.object, PropTypes.string]),
166
166
  locale: PropTypes.string,
167
167
  width: PropTypes.string,
@@ -218,7 +218,8 @@ var CustomNavbar = function CustomNavbar(_ref3) {
218
218
  },
219
219
  "aria-label": intl.formatMessage(messages.pickerPrevMonth),
220
220
  "data-tip": true,
221
- "data-for": "datepicker-prev-month"
221
+ "data-for": "datepicker-prev-month",
222
+ "data-testid": "datepicker-select-prev-month"
222
223
  }), /*#__PURE__*/_jsx(ButtonSecondary, {
223
224
  onClick: function onClick() {
224
225
  return setShowYearMonthPicker(true);
@@ -226,6 +227,7 @@ var CustomNavbar = function CustomNavbar(_ref3) {
226
227
  "aria-label": intl.formatMessage(messages.pickerSelectYear),
227
228
  "data-tip": true,
228
229
  "data-for": "datepicker-select-year",
230
+ "data-testid": "datepicker-select-year",
229
231
  text: moment(month).format("MMMM YYYY")
230
232
  }), /*#__PURE__*/_jsx(IconButton, {
231
233
  icon: IconChevronRight,
@@ -235,7 +237,8 @@ var CustomNavbar = function CustomNavbar(_ref3) {
235
237
  },
236
238
  "aria-label": intl.formatMessage(messages.pickerNextMonth),
237
239
  "data-tip": true,
238
- "data-for": "datepicker-next-month"
240
+ "data-for": "datepicker-next-month",
241
+ "data-testid": "datepicker-select-next-month"
239
242
  }), /*#__PURE__*/_jsx(Tooltip, {
240
243
  id: "datepicker-prev-month",
241
244
  content: intl.formatMessage(messages.pickerPrevMonth)
@@ -315,6 +318,7 @@ var MonthPicker = function MonthPicker(_ref4) {
315
318
 
316
319
  return /*#__PURE__*/_jsxs(YearMonthSelectContainer, {
317
320
  children: [/*#__PURE__*/_jsx(YearSelectContainer, {
321
+ "data-testid": "yearmonth-dropdown-select",
318
322
  children: /*#__PURE__*/_jsx(Dropdown, {
319
323
  "aria-label": intl.formatMessage(messages.selectYearDropdown),
320
324
  options: getYears(),
@@ -334,6 +338,7 @@ var MonthPicker = function MonthPicker(_ref4) {
334
338
  return /*#__PURE__*/_jsx("li", {
335
339
  value: i,
336
340
  children: /*#__PURE__*/_jsx(MonthSelectButton2, {
341
+ "data-testid": "select-month-".concat(month),
337
342
  "data-for": "datepicker-select-month-button",
338
343
  $isActive: i === selectedMonth,
339
344
  onClick: function onClick() {
@@ -355,7 +360,8 @@ var MonthPicker = function MonthPicker(_ref4) {
355
360
  });
356
361
  },
357
362
  "data-tip": true,
358
- "data-for": "datepicker-year-month-done"
363
+ "data-for": "datepicker-year-month-done",
364
+ "data-testid": "datepicker-year-month-done"
359
365
  }), /*#__PURE__*/_jsx(Tooltip, {
360
366
  id: "datepicker-year-month-done",
361
367
  content: intl.formatMessage(messages.closeYearMonthPicker)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happeouikit/form-elements",
3
- "version": "2.3.5",
3
+ "version": "2.3.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "src/index.js",