@onesy/ui-react 1.0.191 → 1.0.193

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.
@@ -261,15 +261,6 @@ const Calendar = props__ => {
261
261
  if (refs.inProgressTransition.current) return;
262
262
  onUpdateCalendar((next ? _date.add : _date.remove)(1, unit, calendar));
263
263
  };
264
- const scrollToMiddleOfParent = element => {
265
- const parent = element.parentElement;
266
- if (!parent) return;
267
- const top = element.offsetTop - parent.clientHeight / 2 + element.offsetHeight / 2;
268
- parent.scrollTo({
269
- top,
270
- behavior: 'smooth'
271
- });
272
- };
273
264
  const onOpen = (valueUpdate = 'month') => {
274
265
  const valueNew_4 = open === valueUpdate ? null : valueUpdate;
275
266
  setOpen(valueNew_4);
@@ -281,8 +272,8 @@ const Calendar = props__ => {
281
272
  if (list) {
282
273
  const valueData = valueNew_4 === 'month' ? calendar.month - 1 : calendar.year;
283
274
  (0, _utils.Try)(() => {
284
- const element_0 = list.querySelector(`[data-value="${valueData}"]`);
285
- if (element_0) scrollToMiddleOfParent(element_0);
275
+ const element = list.querySelector(`[data-value="${valueData}"]`);
276
+ if (element) (0, _utils2.scrollToMiddleOfParent)(element);
286
277
  });
287
278
  }
288
279
  });
@@ -324,7 +315,7 @@ const Calendar = props__ => {
324
315
 
325
316
  // Prevent multiple moves of the calendar
326
317
  // before the previous transition is done
327
- const onTransition = (element_1, status) => {
318
+ const onTransition = (element_0, status) => {
328
319
  refs.inProgressTransition.current = !['entered', 'exited', 'removed'].includes(status);
329
320
  };
330
321
  const calendarMonthProps = _objectSpread({
@@ -712,9 +703,11 @@ const Calendar = props__ => {
712
703
  const yearValue_0 = (0, _date.format)(onesyDate_1, 'YYYY');
713
704
  const selected_1 = calendar.year === onesyDate_1.year;
714
705
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(PaginationItem, _objectSpread(_objectSpread({
715
- tonal: tonal,
716
- color: "inherit",
706
+ tonal: tonal !== undefined ? tonal : false,
707
+ version: selected_1 ? 'filled' : 'text',
708
+ color: selected_1 ? color : 'inherit',
717
709
  size: size,
710
+ selected: selected_1,
718
711
  InteractionProps: {
719
712
  background: false
720
713
  },
@@ -727,10 +720,7 @@ const Calendar = props__ => {
727
720
  disabled: !valid(onesyDate_1, 'year')
728
721
  }, PaginationItemsProps), {}, {
729
722
  className: (0, _styleReact.classNames)([(0, _utils2.staticClassName)('Calendar', theme) && ['onesy-Calendar-day-version-year'], PaginationItemsProps === null || PaginationItemsProps === void 0 ? void 0 : PaginationItemsProps.className, classes.day_version_year]),
730
- style: _objectSpread(_objectSpread({}, selected_1 ? {
731
- color: theme.methods.palette.color.value(undefined, 90, true, palette),
732
- backgroundColor: theme.methods.palette.color.value(undefined, 40, true, palette)
733
- } : undefined), PaginationItemsProps === null || PaginationItemsProps === void 0 ? void 0 : PaginationItemsProps.style),
723
+ style: _objectSpread({}, PaginationItemsProps === null || PaginationItemsProps === void 0 ? void 0 : PaginationItemsProps.style),
734
724
  children: yearValue_0
735
725
  }), index_5);
736
726
  })
@@ -0,0 +1,10 @@
1
+ declare const _default: {
2
+ symbol: string;
3
+ name: string;
4
+ symbol_native: string;
5
+ decimal_digits: number;
6
+ rounding: number;
7
+ code: string;
8
+ name_plural: string;
9
+ }[];
10
+ export default _default;