@onesy/ui-react 1.0.190 → 1.0.192

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.
@@ -4,7 +4,7 @@ const _excluded = ["ref", "tonal", "color", "version", "size", "value", "valueDe
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
6
  import React from 'react';
7
- import { clamp, is, isEnvironment, Try } from '@onesy/utils';
7
+ import { is, isEnvironment, Try } from '@onesy/utils';
8
8
  import { classNames, style, useOnesyTheme } from '@onesy/style-react';
9
9
  import { OnesyDate, add, remove, format, set } from '@onesy/date';
10
10
  import IconMaterialNavigateBefore from '@onesy/icons-material-rounded-react/IconMaterialNavigateBeforeW100';
@@ -23,7 +23,7 @@ import TypeElement from '../Type';
23
23
  import CarouselElement from '../Carousel';
24
24
  import PaginationItemElement from '../PaginationItem';
25
25
  import { IconDoneAnimated } from '../Buttons/Buttons';
26
- import { iconFontSize, staticClassName } from '../utils';
26
+ import { iconFontSize, scrollToMiddleOfParent, staticClassName } from '../utils';
27
27
  import { jsxs as _jsxs, jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
28
28
  const useStyle = style(theme => ({
29
29
  root: {
@@ -264,10 +264,7 @@ const Calendar = props__ => {
264
264
  const valueData = valueNew_4 === 'month' ? calendar.month - 1 : calendar.year;
265
265
  Try(() => {
266
266
  const element = list.querySelector(`[data-value="${valueData}"]`);
267
- if (element) list.scrollTo({
268
- top: clamp(element.offsetTop - element.parentElement.offsetTop + (menu === 'month' ? -104 : 51), 0),
269
- behavior: 'smooth'
270
- });
267
+ if (element) scrollToMiddleOfParent(element);
271
268
  });
272
269
  }
273
270
  });