@hybr1d-tech/charizard 0.6.30 → 0.6.31
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/button-v2/ButtonV2.d.ts +14 -15
- package/dist/components/button-v2/index.d.ts +1 -0
- package/dist/components/button-v2/types.d.ts +15 -0
- package/dist/components/index.d.ts +1 -0
- package/dist/components/table-v3/TableV3.d.ts +116 -0
- package/dist/components/table-v3/constants.d.ts +3 -0
- package/dist/components/table-v3/index.d.ts +1 -0
- package/dist/components/table-v3/inventory/inventory.store.d.ts +40 -0
- package/dist/components/table-v3/store.d.ts +16 -0
- package/dist/components/table-v3/table-actions/TableActions.d.ts +8 -0
- package/dist/components/table-v3/table-actions/index.d.ts +1 -0
- package/dist/components/table-v3/table-columns/TableCheckbox.d.ts +8 -0
- package/dist/components/table-v3/table-columns/TableRadio.d.ts +7 -0
- package/dist/components/table-v3/table-columns/index.d.ts +2 -0
- package/dist/components/table-v3/table-custom-cols/CustomColCheckbox.d.ts +10 -0
- package/dist/components/table-v3/table-custom-cols/TableCustomCols.d.ts +30 -0
- package/dist/components/table-v3/table-custom-cols/index.d.ts +1 -0
- package/dist/components/table-v3/table-custom-cols/sortable/SortableItem.d.ts +10 -0
- package/dist/components/table-v3/table-custom-cols/sortable/SortableList.d.ts +19 -0
- package/dist/components/table-v3/table-custom-cols/sortable/SortableOverlay.d.ts +6 -0
- package/dist/components/table-v3/table-custom-cols/utils.d.ts +16 -0
- package/dist/components/table-v3/table-empty/TableEmpty.d.ts +6 -0
- package/dist/components/table-v3/table-empty/index.d.ts +1 -0
- package/dist/components/table-v3/table-filters-drawer/TableFiltersDrawer.d.ts +7 -0
- package/dist/components/table-v3/table-filters-drawer/index.d.ts +1 -0
- package/dist/components/table-v3/table-filters-drawer/utils.d.ts +16 -0
- package/dist/components/table-v3/table-header-filters/FilterCheckbox.d.ts +13 -0
- package/dist/components/table-v3/table-header-filters/FilterDrawerAllCheckbox.d.ts +7 -0
- package/dist/components/table-v3/table-header-filters/FilterDrawerCheckbox.d.ts +12 -0
- package/dist/components/table-v3/table-header-filters/FilterTooltip.d.ts +9 -0
- package/dist/components/table-v3/table-header-filters/TableHeaderFilter.d.ts +14 -0
- package/dist/components/table-v3/table-header-filters/TableHeaderFilters.d.ts +8 -0
- package/dist/components/table-v3/table-header-filters/index.d.ts +1 -0
- package/dist/components/table-v3/table-loader/TableLoader.d.ts +4 -0
- package/dist/components/table-v3/table-loader/index.d.ts +1 -0
- package/dist/components/table-v3/table-meta-header/TableMetaHeader.d.ts +18 -0
- package/dist/components/table-v3/table-meta-header/index.d.ts +1 -0
- package/dist/components/table-v3/table-pagination/TableEllipses.d.ts +6 -0
- package/dist/components/table-v3/table-pagination/TableLimit.d.ts +8 -0
- package/dist/components/table-v3/table-pagination/TablePagination.d.ts +7 -0
- package/dist/components/table-v3/table-pagination/index.d.ts +1 -0
- package/dist/components/table-v3/table-pagination/utils.d.ts +4 -0
- package/dist/components/table-v3/table-selected-actions/TableSelectedActions.d.ts +8 -0
- package/dist/components/table-v3/table-selected-actions/index.d.ts +1 -0
- package/dist/components/table-v3/types.d.ts +52 -0
- package/dist/hybr1d-ui.js +5368 -3762
- package/dist/hybr1d-ui.umd.cjs +14 -14
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import { PositioningOptions } from '@zag-js/popper';
|
|
2
|
+
import { BUTTON_V2_SIZE, BUTTON_V2_TYPE, BUTTON_V2_VARIANT } from './types';
|
|
2
3
|
import * as React from 'react';
|
|
3
|
-
export declare enum BUTTON_V2_VARIANT {
|
|
4
|
-
PRIMARY = "primary",
|
|
5
|
-
SECONDARY = "secondary",
|
|
6
|
-
TERTIARY = "tertiary"
|
|
7
|
-
}
|
|
8
|
-
export declare enum BUTTON_V2_SIZE {
|
|
9
|
-
SMALL = "small",
|
|
10
|
-
DEFAULT = "default"
|
|
11
|
-
}
|
|
12
|
-
export declare enum BUTTON_V2_TYPE {
|
|
13
|
-
BASIC = "basic",
|
|
14
|
-
ICON_LEFT = "iconLeft",
|
|
15
|
-
ICON_RIGHT = "iconRight",
|
|
16
|
-
ICON_ONLY = "iconOnly"
|
|
17
|
-
}
|
|
18
4
|
interface BaseButtonProps {
|
|
19
5
|
variant?: BUTTON_V2_VARIANT;
|
|
20
6
|
disabled?: boolean;
|
|
@@ -41,6 +27,7 @@ export type ButtonV2Props = IconOnlyButtonV2TypeProps | IconButtonV2TypeProps |
|
|
|
41
27
|
export declare function ButtonV2({ children, variant, disabled, onClick, type, size, customStyles, icon, }: ButtonV2Props): import("react/jsx-runtime").JSX.Element;
|
|
42
28
|
export declare namespace ButtonV2 {
|
|
43
29
|
var GroupAction: ({ children, variant, disabled, menuItems, customData, size, actionsDropdownOptions, positionerProps, isTable, }: GroupActionProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
var ActionsDropdown: ({ variant, disabled, menuItems, customData, size, actionsDropdownOptions, positionerProps, isTable, }: ActionsDropdownProps) => import("react/jsx-runtime").JSX.Element;
|
|
44
31
|
}
|
|
45
32
|
export type MenuItemV2 = {
|
|
46
33
|
label: string;
|
|
@@ -62,4 +49,16 @@ export interface GroupActionProps {
|
|
|
62
49
|
positionerProps?: PositioningOptions;
|
|
63
50
|
isTable?: boolean;
|
|
64
51
|
}
|
|
52
|
+
export interface ActionsDropdownProps {
|
|
53
|
+
variant?: BUTTON_V2_VARIANT;
|
|
54
|
+
disabled?: boolean;
|
|
55
|
+
menuItems: MenuItemV2[];
|
|
56
|
+
customData?: any;
|
|
57
|
+
size?: BUTTON_V2_SIZE;
|
|
58
|
+
actionsDropdownOptions?: {
|
|
59
|
+
setIsActive: React.Dispatch<React.SetStateAction<boolean>>;
|
|
60
|
+
};
|
|
61
|
+
positionerProps?: PositioningOptions;
|
|
62
|
+
isTable?: boolean;
|
|
63
|
+
}
|
|
65
64
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum BUTTON_V2_VARIANT {
|
|
2
|
+
PRIMARY = "primary",
|
|
3
|
+
SECONDARY = "secondary",
|
|
4
|
+
TERTIARY = "tertiary"
|
|
5
|
+
}
|
|
6
|
+
export declare enum BUTTON_V2_SIZE {
|
|
7
|
+
SMALL = "small",
|
|
8
|
+
DEFAULT = "default"
|
|
9
|
+
}
|
|
10
|
+
export declare enum BUTTON_V2_TYPE {
|
|
11
|
+
BASIC = "basic",
|
|
12
|
+
ICON_LEFT = "iconLeft",
|
|
13
|
+
ICON_RIGHT = "iconRight",
|
|
14
|
+
ICON_ONLY = "iconOnly"
|
|
15
|
+
}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { FilterConfig, TableCustomColumns } from './types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface TableV3Props {
|
|
4
|
+
data: any;
|
|
5
|
+
columns: any;
|
|
6
|
+
/**
|
|
7
|
+
* column for actions dropdown in the last row
|
|
8
|
+
*/
|
|
9
|
+
actionsConfig?: {
|
|
10
|
+
isDropdownActions?: boolean;
|
|
11
|
+
menuItems?: {
|
|
12
|
+
label: string;
|
|
13
|
+
iconSrc?: string;
|
|
14
|
+
onClick: any;
|
|
15
|
+
filterFn?: any;
|
|
16
|
+
disabled?: boolean | ((data: any) => boolean);
|
|
17
|
+
}[];
|
|
18
|
+
};
|
|
19
|
+
loaderConfig: {
|
|
20
|
+
text?: string;
|
|
21
|
+
isFetching: boolean;
|
|
22
|
+
isError: boolean;
|
|
23
|
+
errMsg?: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* table search
|
|
27
|
+
*/
|
|
28
|
+
searchConfig?: {
|
|
29
|
+
placeholder?: string;
|
|
30
|
+
search: string;
|
|
31
|
+
setSearch: any;
|
|
32
|
+
};
|
|
33
|
+
/**
|
|
34
|
+
* table sorting
|
|
35
|
+
* @param sortBy used for
|
|
36
|
+
*/
|
|
37
|
+
sortConfig?: {
|
|
38
|
+
sortBy: string;
|
|
39
|
+
setSortBy: any;
|
|
40
|
+
sortOrd: 'asc' | 'desc' | '';
|
|
41
|
+
setSortOrd: any;
|
|
42
|
+
sortMap: Record<string, string>;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* table filtering, data comes from an api
|
|
46
|
+
*/
|
|
47
|
+
filterConfig?: FilterConfig;
|
|
48
|
+
totalText?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Row checkbox or radio selection config
|
|
51
|
+
*
|
|
52
|
+
* @param rowIdKey: needed to keep the selected rows when search is being used server side https://tanstack.com/table/v8/docs/guide/row-selection#useful-row-ids
|
|
53
|
+
* @param entityName: singular format of entity name
|
|
54
|
+
*/
|
|
55
|
+
rowSelectionConfig?: {
|
|
56
|
+
isCheckbox?: boolean;
|
|
57
|
+
isRadio?: boolean;
|
|
58
|
+
entityName: string;
|
|
59
|
+
actions?: {
|
|
60
|
+
icon: string;
|
|
61
|
+
text: string;
|
|
62
|
+
onClick: any;
|
|
63
|
+
}[];
|
|
64
|
+
setSelectedRows?: React.Dispatch<React.SetStateAction<any>>;
|
|
65
|
+
iconSrc?: string;
|
|
66
|
+
clearOnSearch?: boolean;
|
|
67
|
+
rowIdKey: string;
|
|
68
|
+
rowSelection?: {};
|
|
69
|
+
setRowSelection?: React.Dispatch<React.SetStateAction<{}>>;
|
|
70
|
+
};
|
|
71
|
+
paginationConfig?: {
|
|
72
|
+
metaData?: {
|
|
73
|
+
total_items: number;
|
|
74
|
+
items_on_page: number;
|
|
75
|
+
page_no: number;
|
|
76
|
+
};
|
|
77
|
+
page: number;
|
|
78
|
+
setPage: (page: number) => void;
|
|
79
|
+
limit: number;
|
|
80
|
+
setLimit: (limit: number) => void;
|
|
81
|
+
defaultLimit: string;
|
|
82
|
+
};
|
|
83
|
+
emptyStateConfig?: {
|
|
84
|
+
icon: string;
|
|
85
|
+
isCustom?: {
|
|
86
|
+
value: boolean;
|
|
87
|
+
component: React.ReactNode;
|
|
88
|
+
};
|
|
89
|
+
title: string;
|
|
90
|
+
desc: string;
|
|
91
|
+
btnText: string;
|
|
92
|
+
onClick: any;
|
|
93
|
+
columns: number;
|
|
94
|
+
emptySearchTitle?: string;
|
|
95
|
+
};
|
|
96
|
+
headerText?: string;
|
|
97
|
+
tableStyleConfig?: {
|
|
98
|
+
maxHeight?: string;
|
|
99
|
+
stickyIds?: string[];
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* custom columns
|
|
103
|
+
*/
|
|
104
|
+
customColumnConfig?: {
|
|
105
|
+
description?: string;
|
|
106
|
+
columns?: TableCustomColumns;
|
|
107
|
+
isPending: boolean;
|
|
108
|
+
isError: boolean;
|
|
109
|
+
handleSaveColumns: (columns: any) => Promise<void>;
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* export config (csv)
|
|
113
|
+
*/
|
|
114
|
+
exportConfig?: {};
|
|
115
|
+
}
|
|
116
|
+
export declare function TableV3({ data, loaderConfig, columns, filterConfig, sortConfig, rowSelectionConfig, actionsConfig, searchConfig, totalText, paginationConfig, emptyStateConfig, headerText, tableStyleConfig, customColumnConfig, exportConfig, }: TableV3Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TableV3';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
interface InventoryStore {
|
|
2
|
+
query: InventoryQueries;
|
|
3
|
+
dispatch: (action: {
|
|
4
|
+
type: INV_ACTION_TYPES;
|
|
5
|
+
payload: string | number | null;
|
|
6
|
+
}) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const invInitialQueries: {
|
|
9
|
+
page: number;
|
|
10
|
+
limit: number;
|
|
11
|
+
search: string;
|
|
12
|
+
sort_by: string;
|
|
13
|
+
sort_order: "" | "asc" | "desc";
|
|
14
|
+
filters: {
|
|
15
|
+
filter_type: string;
|
|
16
|
+
filter_brand: string;
|
|
17
|
+
filter_country: string;
|
|
18
|
+
filter_status: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
export type InventoryQueries = typeof invInitialQueries;
|
|
22
|
+
export declare enum INV_ACTION_TYPES {
|
|
23
|
+
SEARCH = "search",
|
|
24
|
+
SORT_BY = "sort_by",
|
|
25
|
+
SORT_ORDER = "sort_order",
|
|
26
|
+
INITIAL_FILTER = "initial_filter",
|
|
27
|
+
STATUS_FILTER = "status",
|
|
28
|
+
FILTER = "filter",
|
|
29
|
+
RESET_FILTERS = "reset_filters",
|
|
30
|
+
RESET_ALL = "reset_all",
|
|
31
|
+
SELECTOR_FILTER = "selector_filter",
|
|
32
|
+
PAGE = "page",
|
|
33
|
+
LIMIT = "limit"
|
|
34
|
+
}
|
|
35
|
+
export declare const invQueryReducer: (query: any, { payload, type }: {
|
|
36
|
+
payload: any;
|
|
37
|
+
type: any;
|
|
38
|
+
}) => any;
|
|
39
|
+
export declare const useInventoryStore: import('zustand').UseBoundStore<import('zustand').StoreApi<InventoryStore>>;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { InternalTableFilters } from './types';
|
|
2
|
+
|
|
3
|
+
export interface TableStore {
|
|
4
|
+
filters: InternalTableFilters[];
|
|
5
|
+
setDefaultFilters: (filters: InternalTableFilters[]) => void;
|
|
6
|
+
addFilters: (filterKey: string, value: string, filterDispatch: any) => void;
|
|
7
|
+
changeFiltersDrawer: (filterKey: string, value: string[], filterDispatch: any) => void;
|
|
8
|
+
removeFilters: (filterKey: string, value: string, filterDispatch: any) => void;
|
|
9
|
+
resetFilters: (filterKey: string, filterDispatch: any) => void;
|
|
10
|
+
resetAllFilters: (filterReset?: any) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const useTableStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<TableStore>, "setState"> & {
|
|
13
|
+
setState<A extends string | {
|
|
14
|
+
type: string;
|
|
15
|
+
}>(partial: TableStore | Partial<TableStore> | ((state: TableStore) => TableStore | Partial<TableStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableV3Props } from '../TableV3';
|
|
2
|
+
|
|
3
|
+
interface TableActionsProps {
|
|
4
|
+
actionsConfig: TableV3Props['actionsConfig'];
|
|
5
|
+
data: any;
|
|
6
|
+
}
|
|
7
|
+
export default function TableActions({ actionsConfig, data }: TableActionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableActions';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Row } from '@tanstack/react-table';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare function TableCheckbox({ indeterminate, row, isHeader, ...rest }: {
|
|
4
|
+
indeterminate: boolean;
|
|
5
|
+
row: Row<unknown>;
|
|
6
|
+
setSelectedRows?: any;
|
|
7
|
+
isHeader?: boolean;
|
|
8
|
+
} & React.HTMLProps<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Row } from '@tanstack/react-table';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare function TableRadio({ indeterminate, row, ...rest }: {
|
|
4
|
+
indeterminate: boolean;
|
|
5
|
+
row: Row<unknown>;
|
|
6
|
+
setSelectedRows?: any;
|
|
7
|
+
} & React.HTMLProps<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { OptionsProp } from './TableCustomCols';
|
|
2
|
+
|
|
3
|
+
type CustomColCheckboxProps = Pick<OptionsProp, 'setCheckedState'> & {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export default function CustomColCheckbox({ id, label, checked, setCheckedState, disabled, }: CustomColCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Table } from '@tanstack/react-table';
|
|
2
|
+
import { TableCustomColumns } from '../types';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
interface TableCustomColsProps {
|
|
5
|
+
customColumnConfig: {
|
|
6
|
+
description?: string;
|
|
7
|
+
columns?: TableCustomColumns;
|
|
8
|
+
isPending: boolean;
|
|
9
|
+
isError: boolean;
|
|
10
|
+
handleSaveColumns: (columns: any) => Promise<void>;
|
|
11
|
+
};
|
|
12
|
+
table: Table<any>;
|
|
13
|
+
isCheckbox?: boolean;
|
|
14
|
+
isDropdownActions?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type CheckedState = {
|
|
17
|
+
id: string;
|
|
18
|
+
label: string;
|
|
19
|
+
checked: boolean;
|
|
20
|
+
};
|
|
21
|
+
export default function TableCustomCols({ customColumnConfig, table, isCheckbox, isDropdownActions, }: TableCustomColsProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export interface OptionsProp {
|
|
23
|
+
cols: CheckedState[];
|
|
24
|
+
text: string;
|
|
25
|
+
textCn: string;
|
|
26
|
+
checkedState: CheckedState[];
|
|
27
|
+
setCheckedState: React.Dispatch<React.SetStateAction<CheckedState[]>>;
|
|
28
|
+
isDraggable?: boolean;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableCustomCols';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { UniqueIdentifier } from '@dnd-kit/core';
|
|
2
|
+
import { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
interface Props {
|
|
5
|
+
id: UniqueIdentifier;
|
|
6
|
+
isHidden?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function SortableItem({ children, id, isHidden }: PropsWithChildren<Props>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare function DragHandle(): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SortableItem } from './SortableItem';
|
|
2
|
+
import { UniqueIdentifier } from '@dnd-kit/core';
|
|
3
|
+
import { CheckedState } from '../TableCustomCols';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
interface BaseItem {
|
|
6
|
+
id: UniqueIdentifier;
|
|
7
|
+
}
|
|
8
|
+
interface Props<T extends BaseItem> {
|
|
9
|
+
items: T[];
|
|
10
|
+
onChange: React.Dispatch<React.SetStateAction<CheckedState[]>>;
|
|
11
|
+
renderItem(item: T): React.ReactNode;
|
|
12
|
+
search: string;
|
|
13
|
+
}
|
|
14
|
+
export declare function SortableList<T extends BaseItem>({ items: _items, onChange, renderItem, search, }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare namespace SortableList {
|
|
16
|
+
var Item: typeof SortableItem;
|
|
17
|
+
var DragHandle: typeof import("./SortableItem").DragHandle;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FilterOptions, InternalTableFilters } from '../types';
|
|
2
|
+
|
|
3
|
+
type FilterItem = {
|
|
4
|
+
label?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
};
|
|
8
|
+
type Filters = {
|
|
9
|
+
[key: string]: FilterItem[];
|
|
10
|
+
};
|
|
11
|
+
type FilterResults = {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function removeUncheckedItems(input: Filters): FilterResults;
|
|
15
|
+
export declare const getDefaultCheckedState: (filters: FilterOptions[], tableFilters: InternalTableFilters[]) => Record<string, any[]>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableEmpty';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableFiltersDrawer';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FilterOptions, InternalTableFilters } from '../types';
|
|
2
|
+
|
|
3
|
+
type FilterItem = {
|
|
4
|
+
label?: string;
|
|
5
|
+
value?: string;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
};
|
|
8
|
+
type Filters = {
|
|
9
|
+
[key: string]: FilterItem[];
|
|
10
|
+
};
|
|
11
|
+
type FilterResults = {
|
|
12
|
+
[key: string]: string;
|
|
13
|
+
};
|
|
14
|
+
export declare function removeUncheckedItems(input: Filters): FilterResults;
|
|
15
|
+
export declare const getDefaultCheckedState: (filters: FilterOptions[], tableFilters: InternalTableFilters[]) => Record<string, any[]>;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableStore } from '../store';
|
|
2
|
+
|
|
3
|
+
export default function FilterCheckbox({ label, value, addFilters, removeFilters, checked, filterKey, filterDispatch, countryCode, customName, }: {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
checked: boolean;
|
|
7
|
+
filterKey: string;
|
|
8
|
+
addFilters: TableStore['addFilters'];
|
|
9
|
+
removeFilters: TableStore['removeFilters'];
|
|
10
|
+
filterDispatch: (value: any) => void;
|
|
11
|
+
countryCode?: string;
|
|
12
|
+
customName?: string;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export default function FilterDrawerCheckbox({ label, value, checked, filterKey, countryCode, customName, setFilterCheckedState, idx, setHasChanges, }: {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
checked: boolean;
|
|
6
|
+
filterKey: string;
|
|
7
|
+
countryCode?: string;
|
|
8
|
+
customName?: string;
|
|
9
|
+
setFilterCheckedState: any;
|
|
10
|
+
idx: number;
|
|
11
|
+
setHasChanges: React.Dispatch<React.SetStateAction<boolean>>;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FilterOptions, InternalTableFilters } from '../types';
|
|
2
|
+
|
|
3
|
+
type FilterTooltipProps = {
|
|
4
|
+
filter: FilterOptions;
|
|
5
|
+
tableFilter: InternalTableFilters;
|
|
6
|
+
selectedFilters: number;
|
|
7
|
+
};
|
|
8
|
+
export default function FilterTooltip({ filter, tableFilter, selectedFilters }: FilterTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TableStore } from '../store';
|
|
2
|
+
import { FilterOptions, InternalTableFilters } from '../types';
|
|
3
|
+
|
|
4
|
+
interface TableHeaderFilterProps {
|
|
5
|
+
filter: FilterOptions;
|
|
6
|
+
tableFilters: TableStore['filters'];
|
|
7
|
+
tableFilter: InternalTableFilters;
|
|
8
|
+
addFilters: TableStore['addFilters'];
|
|
9
|
+
removeFilters: TableStore['removeFilters'];
|
|
10
|
+
resetFilters: (filterKey: string, filterDispatch: any) => void;
|
|
11
|
+
filterDispatch: (value: any) => void;
|
|
12
|
+
}
|
|
13
|
+
export default function TableHeaderFilter({ filter, tableFilters, tableFilter, addFilters, removeFilters, resetFilters, filterDispatch, }: TableHeaderFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FilterConfig, FilterOptions } from '../types';
|
|
2
|
+
|
|
3
|
+
interface TableHeaderFiltersProps {
|
|
4
|
+
filterConfig: FilterConfig;
|
|
5
|
+
filters: FilterOptions[];
|
|
6
|
+
}
|
|
7
|
+
export default function TableHeaderFilters({ filterConfig, filters }: TableHeaderFiltersProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableHeaderFilters';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableLoader';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TableV3Props } from '../TableV3';
|
|
2
|
+
import { Table } from '@tanstack/react-table';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
interface TableMetaHeaderProps {
|
|
5
|
+
rowSelectionConfig: TableV3Props['rowSelectionConfig'];
|
|
6
|
+
totalText: TableV3Props['totalText'];
|
|
7
|
+
searchConfig: TableV3Props['searchConfig'];
|
|
8
|
+
filterConfig: TableV3Props['filterConfig'];
|
|
9
|
+
customColumnConfig: TableV3Props['customColumnConfig'];
|
|
10
|
+
exportConfig: TableV3Props['exportConfig'];
|
|
11
|
+
rowSelection: {};
|
|
12
|
+
setRowSelection: React.Dispatch<React.SetStateAction<{}>>;
|
|
13
|
+
table: Table<any>;
|
|
14
|
+
isCheckbox?: boolean;
|
|
15
|
+
isDropdownActions?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export default function TableMetaHeader({ rowSelectionConfig, totalText, searchConfig, filterConfig, customColumnConfig, exportConfig, rowSelection, setRowSelection, table, isCheckbox, isDropdownActions, }: TableMetaHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableMetaHeader';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface TableLimitProps {
|
|
2
|
+
setLimit: (l: number) => void;
|
|
3
|
+
limit: number;
|
|
4
|
+
totalItems?: number;
|
|
5
|
+
itemsOnPage?: number;
|
|
6
|
+
}
|
|
7
|
+
export default function TableLimit({ setLimit, limit, totalItems, itemsOnPage }: TableLimitProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TableV3Props } from '../TableV3';
|
|
2
|
+
|
|
3
|
+
interface TablePaginationProps {
|
|
4
|
+
paginationConfig: TableV3Props['paginationConfig'];
|
|
5
|
+
}
|
|
6
|
+
export default function TablePagination({ paginationConfig }: TablePaginationProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TablePagination';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TableV3Props } from '../TableV3';
|
|
2
|
+
|
|
3
|
+
interface TableSelectedActionsProps {
|
|
4
|
+
rowSelectionConfig: TableV3Props['rowSelectionConfig'];
|
|
5
|
+
rowSelection: {};
|
|
6
|
+
}
|
|
7
|
+
export default function TableSelectedActions({ rowSelectionConfig, rowSelection, }: TableSelectedActionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableSelectedActions';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export type FilterOptions = {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
key: string;
|
|
5
|
+
options: {
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
country_code?: string;
|
|
9
|
+
customName?: string;
|
|
10
|
+
}[];
|
|
11
|
+
config?: {
|
|
12
|
+
hideSearch?: boolean;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
type?: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* @param filters comes from an api, must follow the type definition strictly
|
|
19
|
+
* @param isLoading is fetching from api
|
|
20
|
+
* @param isError api threw error
|
|
21
|
+
* @param filterDispatch must be of @type (value) => dispatch({type,payload})
|
|
22
|
+
* this is used to sync the internal table filter state with the external zustand store of the consumer
|
|
23
|
+
* @param filterReset same type as above but is used to reset all the filters
|
|
24
|
+
* @param headerFilterIds this is used for the filters which should be in the table header itself, and not inside the filters drawer
|
|
25
|
+
*
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
export type FilterConfig = {
|
|
29
|
+
filters?: TableFilters;
|
|
30
|
+
isLoading: boolean;
|
|
31
|
+
isError: boolean;
|
|
32
|
+
filterDispatch: (value: any) => void;
|
|
33
|
+
filterReset: (value: any) => void;
|
|
34
|
+
headerFilterIds?: string[];
|
|
35
|
+
};
|
|
36
|
+
export type InternalTableFilters = {
|
|
37
|
+
key: string;
|
|
38
|
+
values: string[];
|
|
39
|
+
};
|
|
40
|
+
export type TableFilters = {
|
|
41
|
+
header?: FilterOptions[];
|
|
42
|
+
drawer?: FilterOptions[];
|
|
43
|
+
};
|
|
44
|
+
export type TableCustomColumns = {
|
|
45
|
+
checked_state: Array<{
|
|
46
|
+
id: string;
|
|
47
|
+
label: string;
|
|
48
|
+
checked: boolean;
|
|
49
|
+
}>;
|
|
50
|
+
is_default: boolean;
|
|
51
|
+
table_name: string;
|
|
52
|
+
};
|