@infomaximum/ui-kit 0.13.1 → 0.13.2
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/dist/components/BaseSelect/BaseSelect.d.ts +1 -1
- package/dist/components/BaseSelect/BaseSelect.js +9 -23
- package/dist/components/BaseSelect/BaseSelect.styles.d.ts +6 -20
- package/dist/components/BaseSelect/BaseSelect.styles.js +7 -17
- package/dist/components/BaseSelect/BaseSelect.types.d.ts +0 -2
- package/dist/components/BaseTooltip/BaseTooltip.js +9 -4
- package/dist/components/BaseTooltip/BaseTooltip.types.d.ts +6 -0
- package/dist/components/BaseTooltip/BaseTooltip.utils.d.ts +1 -0
- package/dist/components/BaseTooltip/BaseTooltip.utils.js +2 -0
- package/dist/components/Dropdown/Dropdown.types.d.ts +3 -2
- package/dist/components/Popconfirm/Popconfirm.types.d.ts +1 -1
- package/dist/components/Popover/Popover.types.d.ts +1 -1
- package/dist/components/Tabs/Tabs.utils.d.ts +3 -0
- package/dist/components/Tabs/Tabs.utils.js +12 -0
- package/dist/components/Tabs/components/TabBar/TabBar.js +6 -6
- package/dist/components/Tabs/components/TabBar/TabBar.styles.d.ts +5 -2
- package/dist/components/Tabs/components/TabBar/TabBar.styles.js +5 -2
- package/dist/components/Tabs/components/TabBar/TabBar.types.d.ts +2 -0
- package/dist/components/Tabs/components/TabItem/TabItem.js +4 -4
- package/dist/components/Tabs/components/TabItem/TabItem.types.d.ts +4 -4
- package/dist/components/Tabs/hooks/useTabsDndController.d.ts +1 -1
- package/dist/components/Tabs/hooks/useTabsDndController.js +16 -3
- package/dist/components/Tooltip/Tooltip.types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TabItem } from '../components/TabItem/TabItem.types';
|
|
2
2
|
import { DragEndEvent } from '@dnd-kit/core';
|
|
3
|
-
export declare const useTabsDndController: (items: TabItem[]) => {
|
|
3
|
+
export declare const useTabsDndController: (items: TabItem[], draggable: boolean) => {
|
|
4
4
|
tabsOrder: string[];
|
|
5
5
|
isDragging: boolean;
|
|
6
6
|
dndEvents: {
|
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
import { useState, useCallback } from "react";
|
|
1
|
+
import { useState, useRef, useEffect, useCallback } from "react";
|
|
2
2
|
import { arrayMove } from "@dnd-kit/sortable";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { getTabKeysWithoutOrdering, getOrderedTabKeys } from "../Tabs.utils.js";
|
|
4
|
+
const useTabsDndController = (items, draggable) => {
|
|
5
|
+
const [tabsOrder, setTabsOrder] = useState([]);
|
|
5
6
|
const [isDragging, setIsDragging] = useState(false);
|
|
7
|
+
const isInitialMount = useRef(true);
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
const newTabKeys = getTabKeysWithoutOrdering(items);
|
|
10
|
+
if (!draggable || isInitialMount.current) {
|
|
11
|
+
isInitialMount.current = false;
|
|
12
|
+
setTabsOrder(newTabKeys);
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
setTabsOrder((prev) => {
|
|
16
|
+
return getOrderedTabKeys(prev, newTabKeys);
|
|
17
|
+
});
|
|
18
|
+
}, [draggable, items]);
|
|
6
19
|
const handleDragStart = useCallback(() => {
|
|
7
20
|
setIsDragging(true);
|
|
8
21
|
}, []);
|
|
@@ -3,7 +3,7 @@ import { BaseTooltipProps } from '../BaseTooltip/BaseTooltip.types';
|
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { Theme } from '../../themes';
|
|
5
5
|
export type TooltipTriggerType = "hover" | "focus" | "click";
|
|
6
|
-
export interface TooltipProps extends Omit<BaseTooltipProps, "floatingElement" | "arrowColor" | "trigger"> {
|
|
6
|
+
export interface TooltipProps extends Omit<BaseTooltipProps, "floatingElement" | "arrowColor" | "trigger" | "styles"> {
|
|
7
7
|
title?: ReactNode | (() => ReactNode);
|
|
8
8
|
trigger?: TooltipTriggerType;
|
|
9
9
|
styles?: {
|