@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/Calendar/Calendar.js
CHANGED
|
@@ -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
|
|
285
|
-
if (
|
|
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 = (
|
|
318
|
+
const onTransition = (element_0, status) => {
|
|
328
319
|
refs.inProgressTransition.current = !['entered', 'exited', 'removed'].includes(status);
|
|
329
320
|
};
|
|
330
321
|
const calendarMonthProps = _objectSpread({
|