bianic-ui 2.10.0-beta.2 → 2.10.1
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/README.md +49 -49
- package/dist/cjs/Empty.svg +12 -0
- package/dist/cjs/index.js +556 -3347
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Forms/Checkbox/index.d.ts +2 -1
- package/dist/cjs/types/components/Forms/Dropdown/DropdownContainer.d.ts +1 -1
- package/dist/cjs/types/components/Sidebar/SidebarCointainer.d.ts +7 -6
- package/dist/cjs/types/components/Sidebar/SidebarItem.d.ts +9 -5
- package/dist/cjs/types/components/Sidebar/SidebarMenu.d.ts +10 -0
- package/dist/cjs/types/components/Sidebar/SidebarProfile.d.ts +17 -0
- package/dist/cjs/types/components/Sidebar/config.d.ts +21 -0
- package/dist/cjs/types/components/Sidebar/index.d.ts +2 -0
- package/dist/cjs/types/components/Table/Table.d.ts +6 -0
- package/dist/cjs/types/components/Table/TableBody.d.ts +6 -0
- package/dist/cjs/types/components/Table/TableHead.d.ts +6 -0
- package/dist/cjs/types/components/Table/TableRow/index.d.ts +6 -0
- package/dist/cjs/types/components/Table/TableUtility/BlockLoading.d.ts +6 -0
- package/dist/cjs/types/components/Table/TableUtility/EmptyTable.d.ts +7 -0
- package/dist/cjs/types/components/Table/TableUtility/TableFooterController.d.ts +12 -0
- package/dist/cjs/types/components/Table/TableUtility/TableHeaderController.d.ts +9 -0
- package/dist/cjs/types/components/Table/TableUtility/TableSearchInput.d.ts +11 -0
- package/dist/cjs/types/components/Table/TableUtility/index.d.ts +5 -0
- package/dist/cjs/types/components/Table/index.d.ts +5 -0
- package/dist/cjs/types/components/TagLabel/index.d.ts +1 -1
- package/dist/cjs/types/components/index.d.ts +3 -2
- package/dist/cjs/types/image/index.d.ts +2 -0
- package/dist/cjs/types/stories/Form/Checkbox/Checkbox.stories.d.ts +0 -1
- package/dist/cjs/types/stories/Form/Checkbox/CheckboxSimulation.stories.d.ts +0 -1
- package/dist/cjs/types/stories/Form/Dropdown/DropdownContainer.stories.d.ts +1 -1
- package/dist/cjs/types/stories/Sidebar/SidebarContainer.stories.d.ts +1 -2
- package/dist/cjs/types/stories/Sidebar/SidebarItem.stories.d.ts +1 -2
- package/dist/cjs/types/utility/helper.d.ts +2 -1
- package/dist/cjs/types/utility/hooks/useTableDataHandler.d.ts +54 -0
- package/dist/esm/Empty.svg +12 -0
- package/dist/esm/index.js +545 -3348
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Forms/Checkbox/index.d.ts +2 -1
- package/dist/esm/types/components/Forms/Dropdown/DropdownContainer.d.ts +1 -1
- package/dist/esm/types/components/Sidebar/SidebarCointainer.d.ts +7 -6
- package/dist/esm/types/components/Sidebar/SidebarItem.d.ts +9 -5
- package/dist/esm/types/components/Sidebar/SidebarMenu.d.ts +10 -0
- package/dist/esm/types/components/Sidebar/SidebarProfile.d.ts +17 -0
- package/dist/esm/types/components/Sidebar/config.d.ts +21 -0
- package/dist/esm/types/components/Sidebar/index.d.ts +2 -0
- package/dist/esm/types/components/Table/Table.d.ts +6 -0
- package/dist/esm/types/components/Table/TableBody.d.ts +6 -0
- package/dist/esm/types/components/Table/TableHead.d.ts +6 -0
- package/dist/esm/types/components/Table/TableRow/index.d.ts +6 -0
- package/dist/esm/types/components/Table/TableUtility/BlockLoading.d.ts +6 -0
- package/dist/esm/types/components/Table/TableUtility/EmptyTable.d.ts +7 -0
- package/dist/esm/types/components/Table/TableUtility/TableFooterController.d.ts +12 -0
- package/dist/esm/types/components/Table/TableUtility/TableHeaderController.d.ts +9 -0
- package/dist/esm/types/components/Table/TableUtility/TableSearchInput.d.ts +11 -0
- package/dist/esm/types/components/Table/TableUtility/index.d.ts +5 -0
- package/dist/esm/types/components/Table/index.d.ts +5 -0
- package/dist/esm/types/components/TagLabel/index.d.ts +1 -1
- package/dist/esm/types/components/index.d.ts +3 -2
- package/dist/esm/types/image/index.d.ts +2 -0
- package/dist/esm/types/stories/Form/Checkbox/Checkbox.stories.d.ts +0 -1
- package/dist/esm/types/stories/Form/Checkbox/CheckboxSimulation.stories.d.ts +0 -1
- package/dist/esm/types/stories/Form/Dropdown/DropdownContainer.stories.d.ts +1 -1
- package/dist/esm/types/stories/Sidebar/SidebarContainer.stories.d.ts +1 -2
- package/dist/esm/types/stories/Sidebar/SidebarItem.stories.d.ts +1 -2
- package/dist/esm/types/utility/helper.d.ts +2 -1
- package/dist/esm/types/utility/hooks/useTableDataHandler.d.ts +54 -0
- package/dist/index.d.ts +155 -15
- package/package.json +143 -143
- package/src/font/SansCode/README.txt +88 -88
- package/src/style/color.css +650 -650
- package/src/style/scrollbar.css +78 -78
- package/tailwind.config.js +574 -574
- package/src/font/SansCode/GoogleSansCode-Italic-VariableFont_MONO,wght.ttf:Zone.Identifier +0 -0
- package/src/font/SansCode/GoogleSansCode-VariableFont_MONO,wght.ttf:Zone.Identifier +0 -0
- package/src/font/SansCode/OFL.txt:Zone.Identifier +0 -0
- package/src/font/SansCode/README.txt:Zone.Identifier +0 -0
|
@@ -6,8 +6,9 @@ interface CheckboxProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size'>
|
|
|
6
6
|
label?: string;
|
|
7
7
|
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
8
8
|
value?: string | number | readonly string[] | undefined;
|
|
9
|
+
isIndeterminate?: boolean;
|
|
9
10
|
}
|
|
10
|
-
declare function Checkbox({ disabled, id, size, label, onChange, ...props }: CheckboxProps): React.JSX.Element;
|
|
11
|
+
declare function Checkbox({ disabled, id, size, label, onChange, isIndeterminate, ...props }: CheckboxProps): React.JSX.Element;
|
|
11
12
|
declare namespace Checkbox {
|
|
12
13
|
var defaultProps: {
|
|
13
14
|
disabled: boolean;
|
|
@@ -13,7 +13,7 @@ export interface DropdownContainerProps extends ComponentPropsWithRef<'div'> {
|
|
|
13
13
|
onClickItem?: (event: React.MouseEvent<HTMLDivElement>, val: string | number | object) => void;
|
|
14
14
|
}
|
|
15
15
|
declare const DropdownContainer: {
|
|
16
|
-
(propsComp: DropdownContainerProps): React.JSX.Element
|
|
16
|
+
(propsComp: DropdownContainerProps): React.JSX.Element;
|
|
17
17
|
defaultProps: {
|
|
18
18
|
isTopFlat: boolean;
|
|
19
19
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
2
|
-
export interface SidebarContainerProps {
|
|
3
|
-
|
|
4
|
-
children?: ReactNode
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
export interface SidebarContainerProps extends ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
color?: string;
|
|
4
|
+
children?: ReactNode;
|
|
5
5
|
isMinimized?: boolean;
|
|
6
|
-
|
|
6
|
+
activeId?: string | null;
|
|
7
|
+
setActiveId?: (id?: string | null) => void;
|
|
7
8
|
}
|
|
8
|
-
declare const SidebarContainer:
|
|
9
|
+
declare const SidebarContainer: React.ForwardRefExoticComponent<SidebarContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
10
|
export default SidebarContainer;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
type SidebarItemLevel = 0 | 1 | 2;
|
|
2
3
|
export interface SidebarItemProps extends ComponentPropsWithoutRef<'button'> {
|
|
3
4
|
title: string;
|
|
4
5
|
icon?: React.ReactNode;
|
|
5
6
|
active?: boolean;
|
|
6
|
-
onClick?: () => void
|
|
7
|
+
onClick?: () => void;
|
|
7
8
|
children?: React.ReactNode;
|
|
8
9
|
isMinimized?: boolean;
|
|
9
|
-
isExpand?: boolean
|
|
10
|
-
notificationCount?: number
|
|
11
|
-
level?:
|
|
10
|
+
isExpand?: boolean;
|
|
11
|
+
notificationCount?: number;
|
|
12
|
+
level?: SidebarItemLevel;
|
|
13
|
+
activeId: string | null;
|
|
14
|
+
setActiveId?: (id?: string | null) => void;
|
|
15
|
+
color?: string;
|
|
12
16
|
}
|
|
13
|
-
declare const SidebarItem:
|
|
17
|
+
declare const SidebarItem: React.ForwardRefExoticComponent<SidebarItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
14
18
|
export default SidebarItem;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
export interface SidebarMenu {
|
|
3
|
+
color?: string;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
isMinimized?: boolean;
|
|
6
|
+
activeId?: string | null;
|
|
7
|
+
setActiveId?: (id?: string | null) => void;
|
|
8
|
+
}
|
|
9
|
+
declare const SidebarMenu: ({ color, children, isMinimized, activeId, setActiveId, }: SidebarMenu) => React.JSX.Element;
|
|
10
|
+
export default SidebarMenu;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export interface SidebarProfileProps extends ComponentPropsWithoutRef<'button'> {
|
|
3
|
+
username: string;
|
|
4
|
+
role: string;
|
|
5
|
+
avatarImg?: React.ReactNode;
|
|
6
|
+
active?: boolean;
|
|
7
|
+
onClick?: () => void;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
isMinimized?: boolean;
|
|
10
|
+
isExpand?: boolean;
|
|
11
|
+
notificationCount?: number;
|
|
12
|
+
activeId?: string | null;
|
|
13
|
+
setActiveId?: (id?: string | null) => void;
|
|
14
|
+
color?: string;
|
|
15
|
+
}
|
|
16
|
+
declare const SidebarProfile: React.ForwardRefExoticComponent<SidebarProfileProps & React.RefAttributes<HTMLButtonElement>>;
|
|
17
|
+
export default SidebarProfile;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const containerSizeConfig: {
|
|
2
|
+
minimized: string;
|
|
3
|
+
maximized: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const itemConfig: {
|
|
6
|
+
minimized: string;
|
|
7
|
+
maximized: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const profileConfig: {
|
|
10
|
+
minimized: string;
|
|
11
|
+
maximized: string;
|
|
12
|
+
};
|
|
13
|
+
export declare const overlaySizeConfig: {
|
|
14
|
+
minimized: string;
|
|
15
|
+
maximized: string;
|
|
16
|
+
};
|
|
17
|
+
export declare const buttonConfig: {
|
|
18
|
+
0: string;
|
|
19
|
+
1: string;
|
|
20
|
+
2: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { ComponentPropsWithRef } from 'react';
|
|
2
|
+
interface TableRowProps extends ComponentPropsWithRef<'tr'> {
|
|
3
|
+
variant: 'head' | 'body';
|
|
4
|
+
}
|
|
5
|
+
declare const TableRow: ({ variant, children, ...rest }: TableRowProps) => React.JSX.Element;
|
|
6
|
+
export default TableRow;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
interface BlockLoadingProps extends ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
backgroundColor?: string;
|
|
4
|
+
}
|
|
5
|
+
declare const BlockLoading: ({ className, backgroundColor, }: BlockLoadingProps) => React.JSX.Element;
|
|
6
|
+
export default BlockLoading;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface TableFooterControllerProps extends ComponentPropsWithoutRef<'div'> {
|
|
4
|
+
currentPage: number;
|
|
5
|
+
totalPages: number;
|
|
6
|
+
pageSize: number;
|
|
7
|
+
setCurrentPage: Dispatch<SetStateAction<number>>;
|
|
8
|
+
setPageSize: Dispatch<SetStateAction<number>>;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const TableFooterController: ({ currentPage, totalPages, pageSize, setCurrentPage, setPageSize, isLoading, }: TableFooterControllerProps) => React.JSX.Element;
|
|
12
|
+
export default TableFooterController;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
+
interface TableHeaderControllerProps extends ComponentPropsWithoutRef<'div'> {
|
|
3
|
+
buttonActions?: ReactNode[];
|
|
4
|
+
totalData?: number;
|
|
5
|
+
firstIndex?: number;
|
|
6
|
+
lastIndex?: number;
|
|
7
|
+
}
|
|
8
|
+
declare const TableHeaderController: ({ buttonActions, totalData, firstIndex, lastIndex, }: TableHeaderControllerProps) => React.JSX.Element;
|
|
9
|
+
export default TableHeaderController;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface TableSearchInputProps extends ComponentPropsWithoutRef<'input'> {
|
|
4
|
+
isShow: boolean;
|
|
5
|
+
onEnter?: any;
|
|
6
|
+
onClose?: any;
|
|
7
|
+
showEnter?: boolean;
|
|
8
|
+
showClose?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const TableSearchInput: ({ isShow, value, onChange, placeholder, }: TableSearchInputProps) => React.JSX.Element | null;
|
|
11
|
+
export default TableSearchInput;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { default as BlockLoading } from './BlockLoading';
|
|
2
|
+
export { default as EmptyTable } from './EmptyTable';
|
|
3
|
+
export { default as TableFooterController } from './TableFooterController';
|
|
4
|
+
export { default as TableHeaderController } from './TableHeaderController';
|
|
5
|
+
export { default as TableSearchInput } from './TableSearchInput';
|
|
@@ -1 +1,6 @@
|
|
|
1
|
+
export { default as Table } from './Table';
|
|
2
|
+
export { default as TableBody } from './TableBody';
|
|
1
3
|
export { default as TableCell } from './TableCell';
|
|
4
|
+
export { default as TableHead } from './TableHead';
|
|
5
|
+
export { default as TableRow } from './TableRow';
|
|
6
|
+
export { BlockLoading, EmptyTable, TableFooterController, TableHeaderController, TableSearchInput, } from './TableUtility';
|
|
@@ -2,7 +2,7 @@ import React, { ComponentPropsWithoutRef } from 'react';
|
|
|
2
2
|
interface TagLabelProps extends ComponentPropsWithoutRef<'div'> {
|
|
3
3
|
color: 'default' | 'blue' | 'teal' | 'green' | 'orange' | 'red' | 'black' | 'white' | 'custom';
|
|
4
4
|
size?: 'md' | 'sm' | 'tn';
|
|
5
|
-
variant?: 'label' | 'icon' | 'closeable';
|
|
5
|
+
variant?: 'label' | 'icon' | 'closeable' | 'monospace';
|
|
6
6
|
closeHandler?: () => void;
|
|
7
7
|
open?: boolean;
|
|
8
8
|
text: string;
|
|
@@ -24,12 +24,12 @@ export { default as Pills } from './Pills/Pills';
|
|
|
24
24
|
export { default as Popover } from './Popover';
|
|
25
25
|
export { ProgressBar, ProgressCircle } from './Progress';
|
|
26
26
|
export { default as ResizeableDiv } from './ResizeableDiv';
|
|
27
|
-
export { SidebarContainer, SidebarItem } from './Sidebar';
|
|
27
|
+
export { SidebarContainer, SidebarItem, SidebarMenu, SidebarProfile, } from './Sidebar';
|
|
28
28
|
export { default as Slider } from './Slider';
|
|
29
29
|
export { default as Spinner } from './Spinner/Spinner';
|
|
30
30
|
export { default as Tab } from './Tab/Tab';
|
|
31
31
|
export { default as TabMenu } from './TabMenu/TabMenu';
|
|
32
|
-
export { TableCell } from './Table';
|
|
32
|
+
export { Table, TableBody, TableCell, TableHead, TableRow, TableFooterController, TableHeaderController, TableSearchInput, EmptyTable, BlockLoading, } from './Table';
|
|
33
33
|
export { default as TagLabel } from './TagLabel';
|
|
34
34
|
export { default as Tooltip } from './Tooltip';
|
|
35
35
|
export { Display, P, Heading, Text, Link } from './Typography';
|
|
@@ -37,3 +37,4 @@ export { Toaster } from './Toaster';
|
|
|
37
37
|
export { default as VerticalStepper } from './Stepper/Vertical';
|
|
38
38
|
export { default as Window } from './Window';
|
|
39
39
|
export { getRelativeTime } from '../utility';
|
|
40
|
+
export { useTableDataHandler } from '../utility/hooks/useTableDataHandler';
|
|
@@ -2,7 +2,7 @@ import type { StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
declare const meta: {
|
|
3
3
|
title: string;
|
|
4
4
|
component: {
|
|
5
|
-
(propsComp: import("../../../components/Forms/Dropdown/DropdownContainer").DropdownContainerProps): import("react").JSX.Element
|
|
5
|
+
(propsComp: import("../../../components/Forms/Dropdown/DropdownContainer").DropdownContainerProps): import("react").JSX.Element;
|
|
6
6
|
defaultProps: {
|
|
7
7
|
isTopFlat: boolean;
|
|
8
8
|
};
|
|
@@ -2,11 +2,10 @@ import React from 'react';
|
|
|
2
2
|
import type { StoryObj } from '@storybook/react-webpack5';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component:
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("../../components/Sidebar/SidebarCointainer").SidebarContainerProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
};
|
|
9
|
-
tags: string[];
|
|
10
9
|
};
|
|
11
10
|
export default meta;
|
|
12
11
|
type Story = StoryObj<typeof meta>;
|
|
@@ -2,11 +2,10 @@ import type { StoryObj } from '@storybook/react-webpack5';
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
|
-
component:
|
|
5
|
+
component: React.ForwardRefExoticComponent<import("../../components/Sidebar/SidebarItem").SidebarItemProps & React.RefAttributes<HTMLButtonElement>>;
|
|
6
6
|
parameters: {
|
|
7
7
|
layout: string;
|
|
8
8
|
};
|
|
9
|
-
tags: string[];
|
|
10
9
|
};
|
|
11
10
|
export default meta;
|
|
12
11
|
type Story = StoryObj<typeof meta>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
declare const childrenElement: (element: any) => any;
|
|
2
|
+
declare const cn: (...classes: Array<string | false | undefined>) => string;
|
|
2
3
|
declare const validUnion: (value: any, union: any) => any;
|
|
3
4
|
declare const useDetectOutsideClick: (ref: React.RefObject<HTMLElement>, initialState: boolean, ignoreRef?: React.RefObject<HTMLElement>, event?: string) => (boolean | import("react").Dispatch<import("react").SetStateAction<boolean>>)[];
|
|
4
|
-
export { childrenElement, validUnion, useDetectOutsideClick };
|
|
5
|
+
export { childrenElement, cn, validUnion, useDetectOutsideClick };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export type SortOrder = 'asc' | 'desc';
|
|
2
|
+
/**
|
|
3
|
+
* Configuration options for the useTableDataHandler hook.
|
|
4
|
+
* * @interface UseTableDataOptions
|
|
5
|
+
* @property {string[]} [searchKeys] - Specific object keys to check during client-side filtering. If omitted, defaults to all keys containing string values.
|
|
6
|
+
* @property {string} [initialSortKey] - The object key to sort the table by on initial render.
|
|
7
|
+
* @property {SortOrder} [initialSortOrder='asc'] - The initial sorting direction ('asc' or 'desc').
|
|
8
|
+
* @property {boolean} [isFilterable=true] - Enables or disables client-side searching functionality.
|
|
9
|
+
* @property {boolean} [isSortable=true] - Enables or disables client-side sorting functionality.
|
|
10
|
+
* @property {boolean} [isServerSide=false] - If true, bypasses client-side processing, assuming filtering and sorting are handled by an API.
|
|
11
|
+
*/
|
|
12
|
+
interface UseTableDataOptions {
|
|
13
|
+
searchKeys?: string[];
|
|
14
|
+
initialSortKey?: string;
|
|
15
|
+
initialSortOrder?: SortOrder;
|
|
16
|
+
isFilterable?: boolean;
|
|
17
|
+
isSortable?: boolean;
|
|
18
|
+
isServerSide?: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A custom hook to handle data processing for tables, managing internal states
|
|
22
|
+
* for client-side filtering (searching) and sorting. It can also safely yield control
|
|
23
|
+
* to server-side operations if configured.
|
|
24
|
+
*
|
|
25
|
+
* ### Key Features:
|
|
26
|
+
* - **Automatic Key Detection:** Automatically finds string fields to search if no `searchKeys` are provided.
|
|
27
|
+
* - **Smart Sorting:** Uses `localeCompare` for strings, standard operators for numbers, and gracefully handles `null`/`undefined` values by moving them to the bottom.
|
|
28
|
+
* - **Server-Side Ready:** Setting `isServerSide: true` disables internal processing while preserving handlers for external API synchronization.
|
|
29
|
+
*
|
|
30
|
+
* @param {any[]} initialData - The raw array of data/rows to be displayed in the table.
|
|
31
|
+
* @param {UseTableDataOptions} [options={}] - Optional configuration flags and initial states.
|
|
32
|
+
* * @returns {Object} Table state and control handlers.
|
|
33
|
+
* @returns {any[]} data - The processed array (filtered and sorted) ready for rendering.
|
|
34
|
+
* @returns {string} searchTerm - The current text being filtered against.
|
|
35
|
+
* @returns {string|undefined} sortKey - The current object key being used to sort.
|
|
36
|
+
* @returns {SortOrder} sortOrder - The current direction of the sort ('asc' or 'desc').
|
|
37
|
+
* @returns {(value: string) => void} handleSearchChange - Callback to update the search filter string.
|
|
38
|
+
* @returns {(key: string) => void} handleSortChange - Callback to trigger sorting on a specific column. Toggles direction if called on the same column consecutively.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* const { data, handleSearchChange, handleSortChange } = useTableDataHandler(users, {
|
|
42
|
+
* searchKeys: ['name', 'email'],
|
|
43
|
+
* initialSortKey: 'name'
|
|
44
|
+
* });
|
|
45
|
+
*/
|
|
46
|
+
export declare const useTableDataHandler: (initialData: any[], options?: UseTableDataOptions) => {
|
|
47
|
+
data: any[];
|
|
48
|
+
searchTerm: string;
|
|
49
|
+
sortKey: string | undefined;
|
|
50
|
+
sortOrder: SortOrder;
|
|
51
|
+
handleSearchChange: (value: string) => void;
|
|
52
|
+
handleSortChange: (key: string) => void;
|
|
53
|
+
};
|
|
54
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg width="92" height="92" viewBox="0 0 92 92" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
2
|
+
<path d="M32.8825 12.968C33.8187 12.0283 35.0905 11.5 36.417 11.5H66.6521C69.4074 11.5 71.641 13.7336 71.641 16.489V75.1388C71.641 77.8941 69.4074 80.1278 66.6521 80.1278H25.8327C23.0774 80.1278 20.8437 77.8875 20.8438 75.1321C20.8438 56.1849 20.8438 44.6779 20.8438 27.1159C20.8438 25.7961 21.3667 24.528 22.2982 23.593L32.8825 12.968Z" fill="#DADEEB"/>
|
|
3
|
+
<path d="M32.8825 12.968C33.8187 12.0283 35.0905 11.5 36.417 11.5H66.6521C69.4074 11.5 71.641 13.7336 71.641 16.489V75.1388C71.641 77.8941 69.4074 80.1278 66.6521 80.1278H25.8327C23.0774 80.1278 20.8437 77.8875 20.8438 75.1321C20.8438 56.1849 20.8438 44.6779 20.8438 27.1159C20.8438 25.7961 21.3667 24.528 22.2982 23.593L32.8825 12.968Z" fill="white" fill-opacity="0.5"/>
|
|
4
|
+
<path d="M34.3638 11.5V16.1283C34.3638 21.0391 30.3828 25.02 25.472 25.02H20.8438L34.3638 11.5Z" fill="#DADEEB"/>
|
|
5
|
+
<rect x="28.1716" y="32.6677" width="18.7253" height="4.07072" rx="1.99559" fill="#DADEEB"/>
|
|
6
|
+
<rect x="28.1716" y="39.9949" width="36.6365" height="4.07072" rx="1.99559" fill="#DADEEB"/>
|
|
7
|
+
<rect x="28.1716" y="47.3223" width="36.6365" height="4.07072" rx="1.99559" fill="#DADEEB"/>
|
|
8
|
+
<rect x="28.1716" y="54.6497" width="36.6365" height="4.07072" rx="1.99559" fill="#DADEEB"/>
|
|
9
|
+
<rect x="28.1716" y="61.9768" width="36.6365" height="4.07072" rx="1.99559" fill="#DADEEB"/>
|
|
10
|
+
<path d="M58.7737 63.8789C63.267 59.3856 70.5519 59.3856 75.0452 63.8789C79.5382 68.3722 79.5384 75.6572 75.0452 80.1504C70.552 84.6436 63.267 84.6434 58.7737 80.1504C54.2804 75.6571 54.2804 68.3722 58.7737 63.8789Z" stroke="#54A0F9" stroke-width="1.70457"/>
|
|
11
|
+
<path d="M75.6475 80.1499L81.9753 86.4778" stroke="#54A0F9" stroke-width="1.70457"/>
|
|
12
|
+
</svg>
|