tvuikit 0.8.1 → 0.8.3
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/active/active.d.ts +3 -2
- package/dist/components/modal/modal.d.ts +3 -2
- package/dist/components/notification/last-notifications.component.d.ts +18 -0
- package/dist/components/notification/notification.component.d.ts +5 -1
- package/dist/components/notification/use-notifications.hook.d.ts +17 -13
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-extended-store.hook.d.ts +17 -0
- package/dist/hooks/use-id-store.hook.d.ts +11 -0
- package/dist/hooks/use-store.hook.d.ts +10 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/tvuikit.es.js +1383 -1139
- package/dist/tvuikit.es.js.map +1 -1
- package/dist/tvuikit.umd.js +4 -4
- package/dist/tvuikit.umd.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
export type AcitveProps = {
|
|
3
|
-
actived: boolean;
|
|
4
3
|
children: ReactNode;
|
|
5
4
|
name?: string;
|
|
5
|
+
actived: boolean;
|
|
6
|
+
disableReactActivity?: boolean;
|
|
6
7
|
};
|
|
7
|
-
export declare const Active: ({ actived, children, name }: AcitveProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare const Active: ({ actived, children, name, disableReactActivity, }: AcitveProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { DetailedHTMLProps, HTMLAttributes, Key } from 'react';
|
|
1
|
+
import { DetailedHTMLProps, HTMLAttributes, Key, MouseEvent } from 'react';
|
|
2
2
|
export type ModalProps = {
|
|
3
3
|
container: Element | DocumentFragment;
|
|
4
4
|
portalKey?: Key | null;
|
|
5
5
|
zIndex?: number;
|
|
6
|
+
onModalElementClick: (event: MouseEvent<HTMLDivElement, globalThis.MouseEvent>) => void;
|
|
6
7
|
} & DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>;
|
|
7
|
-
export declare const Modal: ({ container, children, portalKey, className, zIndex, style, ...props }: ModalProps) => import('react').ReactPortal;
|
|
8
|
+
export declare const Modal: ({ container, children, portalKey, className, zIndex, style, id, onClick, onModalElementClick, ...props }: ModalProps) => import('react').ReactPortal;
|
|
8
9
|
export default Modal;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DetailedHTMLProps, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type LastNotification = {
|
|
3
|
+
id: string;
|
|
4
|
+
text: ReactNode;
|
|
5
|
+
position: number;
|
|
6
|
+
};
|
|
7
|
+
export type LastNotificationsProps = {
|
|
8
|
+
notifications: LastNotification[];
|
|
9
|
+
showed: boolean;
|
|
10
|
+
setShowed: (state: boolean) => void;
|
|
11
|
+
close: (id: string) => void;
|
|
12
|
+
closeAll: () => void;
|
|
13
|
+
heightMultipliyer?: number;
|
|
14
|
+
notificationComponentClassName?: string;
|
|
15
|
+
maxHeightTwClass?: string;
|
|
16
|
+
maxWidthTwClass?: string;
|
|
17
|
+
} & Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children">;
|
|
18
|
+
export declare const LastNotifications: ({ showed, notifications, close, setShowed, className, heightMultipliyer: multipliyer, maxHeightTwClass: maxHeight, maxWidthTwClass: maxWidth, notificationComponentClassName, ...props }: LastNotificationsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,8 +7,12 @@ export type NotificationProps = ({
|
|
|
7
7
|
closed?: false;
|
|
8
8
|
}) & {
|
|
9
9
|
close: (id: string) => void;
|
|
10
|
+
closeAll?: () => void;
|
|
11
|
+
showAll?: () => void;
|
|
10
12
|
overwriteClassName?: boolean;
|
|
11
13
|
disablePositionAndInset?: boolean;
|
|
12
14
|
id?: string;
|
|
15
|
+
count?: number;
|
|
16
|
+
openListButtonVisible?: boolean;
|
|
13
17
|
} & Omit<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "id">;
|
|
14
|
-
export declare const Notification: ({ text, closed, className, disablePositionAndInset, id, close, ...props }: NotificationProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const Notification: ({ text, closed, className, disablePositionAndInset, id, close, closeAll, showAll, openListButtonVisible, count, ...props }: NotificationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,20 +12,24 @@ type NotificateParameter = ReactNode | FunctionOfNotificationParameter;
|
|
|
12
12
|
type ExtendedNotificationType = Omit<NotificationType, "text"> & {
|
|
13
13
|
text: NotificateParameter;
|
|
14
14
|
};
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
export declare const useNotifications: ({ duration, delay, allNotificationsEnabled, }: {
|
|
16
|
+
/** duration of notification in miliseconds */
|
|
17
|
+
duration: number;
|
|
18
|
+
/** delay between notifications in miliseconds */
|
|
19
|
+
delay?: number;
|
|
20
|
+
allNotificationsEnabled?: boolean;
|
|
21
|
+
}) => {
|
|
22
|
+
readonly NotificationComponent: import('react').ReactPortal | null;
|
|
23
|
+
readonly notifications: import('react').RefObject<{
|
|
22
24
|
[key: string]: NotificationType;
|
|
23
25
|
}>;
|
|
24
|
-
notificate: (data: NotificateParameter) => void;
|
|
25
|
-
count: import('react').RefObject<number>;
|
|
26
|
-
queue: ExtendedNotificationType[];
|
|
27
|
-
current: ExtendedNotificationType | null;
|
|
28
|
-
|
|
29
|
-
|
|
26
|
+
readonly notificate: (data: NotificateParameter) => void;
|
|
27
|
+
readonly count: import('react').RefObject<number>;
|
|
28
|
+
readonly queue: ExtendedNotificationType[];
|
|
29
|
+
readonly current: ExtendedNotificationType | null;
|
|
30
|
+
readonly setLastNotificationsShowed: import('react').Dispatch<import('react').SetStateAction<boolean>>;
|
|
31
|
+
readonly closeLastNotification: (id: string) => void;
|
|
32
|
+
readonly closeAll: () => void;
|
|
33
|
+
readonly close: (id: string) => boolean | undefined;
|
|
30
34
|
};
|
|
31
35
|
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
export type BaseState<T> = [T[], Dispatch<SetStateAction<T[]>>];
|
|
3
|
+
export type StateArray<T> = [BaseState<T>, ...BaseState<T>[]];
|
|
4
|
+
export declare const useExtendedStore: <Item extends {
|
|
5
|
+
id: string;
|
|
6
|
+
}>(...states: StateArray<string>) => {
|
|
7
|
+
readonly addItemToState: (stateIndex: number, item: Item) => void;
|
|
8
|
+
readonly addNewItem: (stateIndex: number, item: Item) => void;
|
|
9
|
+
readonly removeItemFromState: (stateIndex: number, id: string) => void;
|
|
10
|
+
readonly remoteItem: (stateIndex: number, id: string) => void;
|
|
11
|
+
readonly clearState: (stateIndex: number) => void;
|
|
12
|
+
readonly clearItems: () => void;
|
|
13
|
+
readonly clearAll: () => void;
|
|
14
|
+
readonly getItem: (id: string) => Item | undefined;
|
|
15
|
+
readonly states: StateArray<string>;
|
|
16
|
+
readonly items: import('react').RefObject<Record<string, Item | undefined>>;
|
|
17
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const useIdStore: <Item>() => {
|
|
2
|
+
readonly addItem: (item: Item) => void;
|
|
3
|
+
readonly getItem: (id: string) => Item | undefined;
|
|
4
|
+
readonly remoteItem: (id: string) => void;
|
|
5
|
+
readonly clear: () => void;
|
|
6
|
+
readonly store: string[];
|
|
7
|
+
readonly items: import('react').RefObject<Record<string, {
|
|
8
|
+
id: string;
|
|
9
|
+
item: Item;
|
|
10
|
+
} | undefined>>;
|
|
11
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const useStore: <Item extends {
|
|
2
|
+
id: string;
|
|
3
|
+
}>() => {
|
|
4
|
+
readonly getItem: (id: string) => Item | undefined;
|
|
5
|
+
readonly addItem: (item: Item) => void;
|
|
6
|
+
readonly remoteItem: (id: string) => void;
|
|
7
|
+
readonly clear: () => void;
|
|
8
|
+
readonly store: string[];
|
|
9
|
+
readonly items: import('react').RefObject<Record<string, Item | undefined>>;
|
|
10
|
+
};
|