@infomaximum/ui-kit 0.13.3 → 0.13.4
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.
|
@@ -5,6 +5,7 @@ import { ClassNames } from "@emotion/react";
|
|
|
5
5
|
import { getPickerTokens } from "../../tokens.js";
|
|
6
6
|
import "../../../../configure/dayjs.js";
|
|
7
7
|
import "@infomaximum/icons";
|
|
8
|
+
import "react-intersection-observer/test-utils";
|
|
8
9
|
import { getPopupStyle } from "../../styles/Popup.styles.js";
|
|
9
10
|
import { getSingleSelectorStyle } from "../../styles/SingleSelector.styles.js";
|
|
10
11
|
import dayjs from "dayjs";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useState, useRef, useCallback, useMemo } from "react";
|
|
2
2
|
import { isMenuItem } from "../../Dropdown/Dropdown.types.js";
|
|
3
|
+
import { isFunction } from "lodash-es";
|
|
3
4
|
const useMoreTabsController = (items, currentActiveKey, currentTabElement, onTabClick, onChange, changeActiveKey) => {
|
|
4
5
|
const [hiddenTabs, setHiddenTabs] = useState([]);
|
|
5
6
|
const tabsRef = useRef(null);
|
|
@@ -24,7 +25,7 @@ const useMoreTabsController = (items, currentActiveKey, currentTabElement, onTab
|
|
|
24
25
|
}, []);
|
|
25
26
|
}, [hiddenTabs, items]);
|
|
26
27
|
const scrollToTab = useCallback((element) => {
|
|
27
|
-
if (tabsRef.current && element) {
|
|
28
|
+
if (tabsRef.current && isFunction(tabsRef.current.scrollTo) && element) {
|
|
28
29
|
const leftPos = element.offsetLeft + element.offsetWidth < tabsRef.current.offsetWidth ? element.offsetLeft : element.offsetLeft - tabsRef.current.offsetWidth + element.offsetWidth;
|
|
29
30
|
tabsRef.current.scrollTo({
|
|
30
31
|
left: leftPos
|
package/dist/index.d.ts
CHANGED
|
@@ -45,3 +45,4 @@ export { type FormProps, type FormItemProps, Form } from './components/Form';
|
|
|
45
45
|
export { type PopconfirmProps, Popconfirm } from './components/Popconfirm';
|
|
46
46
|
export { TreeSelect } from './components/TreeSelect';
|
|
47
47
|
export type { TreeSelectProps } from './components/TreeSelect';
|
|
48
|
+
export * from 'react-intersection-observer/test-utils';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "./configure/dayjs.js";
|
|
2
2
|
export * from "@infomaximum/icons";
|
|
3
3
|
import { Checkbox } from "./components/Checkbox/index.js";
|
|
4
|
+
export * from "react-intersection-observer/test-utils";
|
|
4
5
|
import { themeMap } from "./themes/themes.js";
|
|
5
6
|
import { ThemeProvider } from "./providers/ThemeProvider/ThemeProvider.js";
|
|
6
7
|
import { useTheme } from "./hooks/useTheme/useTheme.js";
|