@luminati-io/uikit 6.3.113 → 6.3.114

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.
@@ -47234,7 +47234,7 @@ __webpack_require__.r(__webpack_exports__);
47234
47234
  /*jslint react:true*/
47235
47235
  var _excluded = ["onChange", "disabledDays", "isRange", "defaultMonth", "month", "onMonthChange", "renderPopover", "format", "size", "value", "popoverPlacement", "captionLayout", "hideOnChange", "isOpen", "pickerProps"],
47236
47236
  _excluded2 = ["popoverPlacement", "popoverProps", "size", "placeholder", "onOpenChange", "isOpen", "inputEditable", "onChange"],
47237
- _excluded3 = ["mode", "selected", "onChange", "renderPopover", "hidePopover", "captionLayout", "hideOnChange", "isOpen", "pickerProps"],
47237
+ _excluded3 = ["mode", "selected", "onChange", "renderPopover", "hidePopover", "captionLayout", "hideOnChange", "isOpen", "pickerProps", "onMonthChange"],
47238
47238
  _excluded4 = ["options"],
47239
47239
  _excluded5 = ["modifiers", "tabIndex"];
47240
47240
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
@@ -47473,6 +47473,11 @@ var PickerField = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().forw
47473
47473
  })));
47474
47474
  });
47475
47475
  PickerField.displayName = 'PickerField';
47476
+ function clampToMonthDay(day, year, monthIndex) {
47477
+ var daysInMonth = new Date(year, monthIndex + 1, 0).getDate();
47478
+ var d = Math.min(day, daysInMonth);
47479
+ return new Date(year, monthIndex, d);
47480
+ }
47476
47481
  var PickerPopover = function PickerPopover(_ref) {
47477
47482
  var mode = _ref.mode,
47478
47483
  selected = _ref.selected,
@@ -47483,6 +47488,7 @@ var PickerPopover = function PickerPopover(_ref) {
47483
47488
  hideOnChange = _ref.hideOnChange,
47484
47489
  isOpen = _ref.isOpen,
47485
47490
  pickerProps = _ref.pickerProps,
47491
+ onMonthChange = _ref.onMonthChange,
47486
47492
  rest = _objectWithoutProperties(_ref, _excluded3);
47487
47493
  var onSelect = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (_, day, modifiers) {
47488
47494
  if (modifiers.disabled) return;
@@ -47504,6 +47510,13 @@ var PickerPopover = function PickerPopover(_ref) {
47504
47510
  onChange(value);
47505
47511
  if (hideOnChange && (mode != 'range' || value.from && value.to)) hidePopover();
47506
47512
  }, [mode, selected]);
47513
+ var _onMonthChange = (0,react__WEBPACK_IMPORTED_MODULE_1__.useCallback)(function (_m) {
47514
+ onMonthChange === null || onMonthChange === void 0 || onMonthChange(_m);
47515
+ if (mode == 'range') return;
47516
+ if (selected) {
47517
+ onChange(clampToMonthDay(selected.getDate(), _m.getFullYear(), _m.getMonth()));
47518
+ }
47519
+ }, [onMonthChange, selected, mode, onChange]);
47507
47520
  var render = typeof renderPopover == 'function' ? renderPopover : function (_ref2) {
47508
47521
  var picker = _ref2.picker;
47509
47522
  return picker;
@@ -47516,6 +47529,7 @@ var PickerPopover = function PickerPopover(_ref) {
47516
47529
  }, render({
47517
47530
  picker: /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default().createElement(StyledDayPicker, _extends({}, rest, pickerProps, {
47518
47531
  captionLayout: captionLayout,
47532
+ onMonthChange: _onMonthChange,
47519
47533
  onSelect: onSelect,
47520
47534
  mode: mode,
47521
47535
  selected: selected