@onesy/ui-react 1.0.191 → 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.
- package/Calendar/Calendar.js +3 -12
- package/currencies.d.ts +10 -0
- package/currencies.js +951 -0
- package/esm/Calendar/Calendar.js +4 -13
- package/esm/currencies.js +945 -0
- package/esm/index.js +1 -1
- package/esm/utils.js +15 -945
- package/index.js +1 -1
- package/package.json +1 -1
- package/utils.d.ts +2 -9
- package/utils.js +27 -948
package/esm/Calendar/Calendar.js
CHANGED
|
@@ -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: {
|
|
@@ -253,15 +253,6 @@ const Calendar = props__ => {
|
|
|
253
253
|
if (refs.inProgressTransition.current) return;
|
|
254
254
|
onUpdateCalendar((next ? add : remove)(1, unit, calendar));
|
|
255
255
|
};
|
|
256
|
-
const scrollToMiddleOfParent = element => {
|
|
257
|
-
const parent = element.parentElement;
|
|
258
|
-
if (!parent) return;
|
|
259
|
-
const top = element.offsetTop - parent.clientHeight / 2 + element.offsetHeight / 2;
|
|
260
|
-
parent.scrollTo({
|
|
261
|
-
top,
|
|
262
|
-
behavior: 'smooth'
|
|
263
|
-
});
|
|
264
|
-
};
|
|
265
256
|
const onOpen = (valueUpdate = 'month') => {
|
|
266
257
|
const valueNew_4 = open === valueUpdate ? null : valueUpdate;
|
|
267
258
|
setOpen(valueNew_4);
|
|
@@ -272,8 +263,8 @@ const Calendar = props__ => {
|
|
|
272
263
|
if (list) {
|
|
273
264
|
const valueData = valueNew_4 === 'month' ? calendar.month - 1 : calendar.year;
|
|
274
265
|
Try(() => {
|
|
275
|
-
const
|
|
276
|
-
if (
|
|
266
|
+
const element = list.querySelector(`[data-value="${valueData}"]`);
|
|
267
|
+
if (element) scrollToMiddleOfParent(element);
|
|
277
268
|
});
|
|
278
269
|
}
|
|
279
270
|
});
|
|
@@ -314,7 +305,7 @@ const Calendar = props__ => {
|
|
|
314
305
|
|
|
315
306
|
// Prevent multiple moves of the calendar
|
|
316
307
|
// before the previous transition is done
|
|
317
|
-
const onTransition = (
|
|
308
|
+
const onTransition = (element_0, status) => {
|
|
318
309
|
refs.inProgressTransition.current = !['entered', 'exited', 'removed'].includes(status);
|
|
319
310
|
};
|
|
320
311
|
const calendarMonthProps = _objectSpread({
|