@hybr1d-tech/charizard 0.4.9 → 0.4.11
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/index.d.ts +21 -0
- package/dist/{table → components/table}/Table.d.ts +1 -1
- package/dist/components/table/constants.d.ts +3 -0
- package/dist/components/table/store.d.ts +14 -0
- package/dist/components/table/table-actions/index.d.ts +1 -0
- package/dist/components/table/table-columns/TableCheckbox.d.ts +11 -0
- package/dist/components/table/table-columns/TableRadio.d.ts +7 -0
- package/dist/components/table/table-columns/index.d.ts +2 -0
- package/dist/components/table/table-empty/index.d.ts +1 -0
- package/dist/components/table/table-filters/FilterCheckbox.d.ts +12 -0
- package/dist/components/table/table-filters/FilterTooltip.d.ts +8 -0
- package/dist/components/table/table-loader/TableLoader.d.ts +4 -0
- package/dist/components/table/table-loader/index.d.ts +1 -0
- package/dist/components/table/table-selected-actions/index.d.ts +1 -0
- package/dist/components/table-v2/TableV2.d.ts +116 -0
- package/dist/components/table-v2/index.d.ts +1 -0
- package/dist/components/table-v2/table-actions/TableActions.d.ts +7 -0
- package/dist/components/table-v2/table-empty/TableEmpty.d.ts +5 -0
- package/dist/components/table-v2/table-filters-drawer/TableFiltersDrawer.d.ts +5 -0
- package/dist/components/table-v2/table-header-filters/TableHeaderFilter.d.ts +13 -0
- package/dist/components/table-v2/table-header-filters/TableHeaderFilters.d.ts +7 -0
- package/dist/components/table-v2/table-header-filters/index.d.ts +1 -0
- package/dist/components/table-v2/table-meta-header/TableMetaHeader.d.ts +12 -0
- package/dist/components/table-v2/table-selected-actions/TableSelectedActions.d.ts +7 -0
- package/dist/components/table-v2/types.d.ts +38 -0
- package/dist/hybr1d-ui.js +3338 -2601
- package/dist/hybr1d-ui.umd.cjs +19 -19
- package/dist/index.d.ts +1 -20
- package/dist/style.css +1 -1
- package/package.json +2 -2
- /package/dist/{button → components/button}/Button.d.ts +0 -0
- /package/dist/{button → components/button}/actions-dropdown.stories.d.ts +0 -0
- /package/dist/{button → components/button}/button.stories.d.ts +0 -0
- /package/dist/{button → components/button}/index.d.ts +0 -0
- /package/dist/{button → components/button}/menu-button.stories.d.ts +0 -0
- /package/dist/{checkbox → components/checkbox}/Checkbox.d.ts +0 -0
- /package/dist/{checkbox → components/checkbox}/index.d.ts +0 -0
- /package/dist/{drawer → components/drawer}/Drawer.d.ts +0 -0
- /package/dist/{drawer → components/drawer}/index.d.ts +0 -0
- /package/dist/{empty-state → components/empty-state}/EmptyState.d.ts +0 -0
- /package/dist/{empty-state → components/empty-state}/empty-state.stories.d.ts +0 -0
- /package/dist/{empty-state → components/empty-state}/index.d.ts +0 -0
- /package/dist/{input → components/input}/Input.d.ts +0 -0
- /package/dist/{input → components/input}/InputAddon.d.ts +0 -0
- /package/dist/{input → components/input}/InputContainer.d.ts +0 -0
- /package/dist/{input → components/input}/InputElement.d.ts +0 -0
- /package/dist/{input → components/input}/InputGroup.d.ts +0 -0
- /package/dist/{input → components/input}/InputLabel.d.ts +0 -0
- /package/dist/{input → components/input}/index.d.ts +0 -0
- /package/dist/{input → components/input}/input.stories.d.ts +0 -0
- /package/dist/{input → components/input}/types.d.ts +0 -0
- /package/dist/{layout-tabs → components/layout-tabs}/LayoutTabs.d.ts +0 -0
- /package/dist/{layout-tabs → components/layout-tabs}/index.d.ts +0 -0
- /package/dist/{loader → components/loader}/Loader.d.ts +0 -0
- /package/dist/{loader → components/loader}/index.d.ts +0 -0
- /package/dist/{loader → components/loader}/loader.stories.d.ts +0 -0
- /package/dist/{modal → components/modal}/Modal.d.ts +0 -0
- /package/dist/{modal → components/modal}/ModalBody.d.ts +0 -0
- /package/dist/{modal → components/modal}/ModalContent.d.ts +0 -0
- /package/dist/{modal → components/modal}/ModalFooter.d.ts +0 -0
- /package/dist/{modal → components/modal}/ModalHeader.d.ts +0 -0
- /package/dist/{modal → components/modal}/ModalOverlay.d.ts +0 -0
- /package/dist/{modal → components/modal}/index.d.ts +0 -0
- /package/dist/{modal → components/modal}/usage.d.ts +0 -0
- /package/dist/{popover → components/popover}/Popover.d.ts +0 -0
- /package/dist/{popover → components/popover}/PopoverCloseButton.d.ts +0 -0
- /package/dist/{popover → components/popover}/PopoverContent.d.ts +0 -0
- /package/dist/{popover → components/popover}/PopoverDescription.d.ts +0 -0
- /package/dist/{popover → components/popover}/PopoverTitle.d.ts +0 -0
- /package/dist/{popover → components/popover}/PopoverTrigger.d.ts +0 -0
- /package/dist/{popover → components/popover}/index.d.ts +0 -0
- /package/dist/{popover → components/popover}/usage.d.ts +0 -0
- /package/dist/{progress → components/progress}/Progress.d.ts +0 -0
- /package/dist/{progress → components/progress}/index.d.ts +0 -0
- /package/dist/{radio-group → components/radio-group}/RadioGroup.d.ts +0 -0
- /package/dist/{radio-group → components/radio-group}/index.d.ts +0 -0
- /package/dist/{search → components/search}/Search.d.ts +0 -0
- /package/dist/{search → components/search}/index.d.ts +0 -0
- /package/dist/{segmented-control → components/segmented-control}/SegmentedControl.d.ts +0 -0
- /package/dist/{segmented-control → components/segmented-control}/index.d.ts +0 -0
- /package/dist/{select → components/select}/Common.d.ts +0 -0
- /package/dist/{select → components/select}/CreatableSelect.d.ts +0 -0
- /package/dist/{select → components/select}/Select.d.ts +0 -0
- /package/dist/{select → components/select}/SelectAsync.d.ts +0 -0
- /package/dist/{select → components/select}/config.d.ts +0 -0
- /package/dist/{select → components/select}/index.d.ts +0 -0
- /package/dist/{select → components/select}/types.d.ts +0 -0
- /package/dist/{selectors → components/selectors}/Selectors.d.ts +0 -0
- /package/dist/{selectors → components/selectors}/index.d.ts +0 -0
- /package/dist/{svg → components/svg}/SVG.d.ts +0 -0
- /package/dist/{svg → components/svg}/index.d.ts +0 -0
- /package/dist/{switch → components/switch}/Switch.d.ts +0 -0
- /package/dist/{switch → components/switch}/index.d.ts +0 -0
- /package/dist/{table → components/table}/index.d.ts +0 -0
- /package/dist/{table → components/table}/table-actions/TableActions.d.ts +0 -0
- /package/dist/{table → components/table}/table-empty/TableEmpty.d.ts +0 -0
- /package/dist/{table → components/table}/table-filters/TableFilter.d.ts +0 -0
- /package/dist/{table → components/table}/table-filters/TableFilters.d.ts +0 -0
- /package/dist/{table → components/table}/table-filters/index.d.ts +0 -0
- /package/dist/{table → components/table}/table-selected-actions/TableSelectedActions.d.ts +0 -0
- /package/dist/{table → components/table}/types.d.ts +0 -0
- /package/dist/{table → components/table-v2}/constants.d.ts +0 -0
- /package/dist/{table → components/table-v2}/store.d.ts +0 -0
- /package/dist/{table → components/table-v2}/table-actions/index.d.ts +0 -0
- /package/dist/{table → components/table-v2}/table-columns/TableCheckbox.d.ts +0 -0
- /package/dist/{table → components/table-v2}/table-columns/TableRadio.d.ts +0 -0
- /package/dist/{table → components/table-v2}/table-columns/index.d.ts +0 -0
- /package/dist/{table → components/table-v2}/table-empty/index.d.ts +0 -0
- /package/dist/{table/table-filters → components/table-v2/table-header-filters}/FilterCheckbox.d.ts +0 -0
- /package/dist/{table/table-filters → components/table-v2/table-header-filters}/FilterTooltip.d.ts +0 -0
- /package/dist/{table → components/table-v2}/table-loader/TableLoader.d.ts +0 -0
- /package/dist/{table → components/table-v2}/table-loader/index.d.ts +0 -0
- /package/dist/{table → components/table-v2}/table-selected-actions/index.d.ts +0 -0
- /package/dist/{tag → components/tag}/Tag.d.ts +0 -0
- /package/dist/{tag → components/tag}/index.d.ts +0 -0
- /package/dist/{tooltip → components/tooltip}/Tooltip.d.ts +0 -0
- /package/dist/{tooltip → components/tooltip}/TooltipContent.d.ts +0 -0
- /package/dist/{tooltip → components/tooltip}/TooltipTrigger.d.ts +0 -0
- /package/dist/{tooltip → components/tooltip}/index.d.ts +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './button';
|
|
2
|
+
export * from './empty-state';
|
|
3
|
+
export * from './table';
|
|
4
|
+
export * from './search';
|
|
5
|
+
export * from './drawer';
|
|
6
|
+
export * from './input';
|
|
7
|
+
export * from './modal';
|
|
8
|
+
export * from './popover';
|
|
9
|
+
export * from './select';
|
|
10
|
+
export * from './svg';
|
|
11
|
+
export * from './checkbox';
|
|
12
|
+
export * from './tooltip';
|
|
13
|
+
export * from './progress';
|
|
14
|
+
export * from './segmented-control';
|
|
15
|
+
export * from './radio-group';
|
|
16
|
+
export * from './layout-tabs';
|
|
17
|
+
export * from './selectors';
|
|
18
|
+
export * from './loader';
|
|
19
|
+
export * from './switch';
|
|
20
|
+
export * from './tag';
|
|
21
|
+
export * from './table-v2';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InternalTableFilters } from './types';
|
|
2
|
+
export interface TableStore {
|
|
3
|
+
filters: InternalTableFilters[];
|
|
4
|
+
setDefaultFilters: (filters: InternalTableFilters[]) => void;
|
|
5
|
+
addFilters: (filterKey: string, value: string, filterDispatch: any) => void;
|
|
6
|
+
removeFilters: (filterKey: string, value: string, filterDispatch: any) => void;
|
|
7
|
+
resetFilters: (filterKey: string, filterDispatch: any) => void;
|
|
8
|
+
resetAllFilters: (filterReset?: any) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare const useTableStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<TableStore>, "setState"> & {
|
|
11
|
+
setState<A extends string | {
|
|
12
|
+
type: string;
|
|
13
|
+
}>(partial: TableStore | Partial<TableStore> | ((state: TableStore) => TableStore | Partial<TableStore>), replace?: boolean | undefined, action?: A | undefined): void;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableActions';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @author Soham Sarkar <soham@hybr1d.io>
|
|
3
|
+
*/
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import type { Row } from '@tanstack/react-table';
|
|
6
|
+
export declare function TableCheckbox({ indeterminate, row, isHeader, ...rest }: {
|
|
7
|
+
indeterminate: boolean;
|
|
8
|
+
row: Row<unknown>;
|
|
9
|
+
setSelectedRows?: any;
|
|
10
|
+
isHeader?: boolean;
|
|
11
|
+
} & React.HTMLProps<HTMLInputElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { Row } from '@tanstack/react-table';
|
|
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 @@
|
|
|
1
|
+
export { default } from './TableEmpty';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TableStore } from '../store';
|
|
2
|
+
export default function FilterCheckbox({ label, value, addFilters, removeFilters, checked, filterKey, filterDispatch, countryCode, customName, }: {
|
|
3
|
+
label: string;
|
|
4
|
+
value: string;
|
|
5
|
+
checked: boolean;
|
|
6
|
+
filterKey: string;
|
|
7
|
+
addFilters: TableStore['addFilters'];
|
|
8
|
+
removeFilters: TableStore['removeFilters'];
|
|
9
|
+
filterDispatch: (value: any) => void;
|
|
10
|
+
countryCode?: string;
|
|
11
|
+
customName?: string;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FilterOptions, InternalTableFilters } from '../types';
|
|
2
|
+
type FilterTooltipProps = {
|
|
3
|
+
filter: FilterOptions;
|
|
4
|
+
tableFilter: InternalTableFilters;
|
|
5
|
+
selectedFilters: number;
|
|
6
|
+
};
|
|
7
|
+
export default function FilterTooltip({ filter, tableFilter, selectedFilters }: FilterTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableLoader';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableSelectedActions';
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { FilterConfig } from './types';
|
|
3
|
+
export interface TableV2Props {
|
|
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
|
+
key?: string;
|
|
19
|
+
customComp?: (data: any) => React.ReactNode | JSX.Element;
|
|
20
|
+
};
|
|
21
|
+
loaderConfig: {
|
|
22
|
+
text?: string;
|
|
23
|
+
isFetching: boolean;
|
|
24
|
+
isError: boolean;
|
|
25
|
+
errMsg?: string;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* table search
|
|
29
|
+
*/
|
|
30
|
+
searchConfig?: {
|
|
31
|
+
placeholder?: string;
|
|
32
|
+
search: string;
|
|
33
|
+
setSearch: any;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* table sorting
|
|
37
|
+
* @param sortBy used for
|
|
38
|
+
*/
|
|
39
|
+
sortConfig?: {
|
|
40
|
+
sortBy: string;
|
|
41
|
+
setSortBy: any;
|
|
42
|
+
sortOrd: 'asc' | 'desc' | '';
|
|
43
|
+
setSortOrd: any;
|
|
44
|
+
sortMap: Record<string, string>;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* table filtering, data comes from an api
|
|
48
|
+
*/
|
|
49
|
+
filterConfig?: FilterConfig;
|
|
50
|
+
totalText?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Row checkbox or radio selection config
|
|
53
|
+
*
|
|
54
|
+
* @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
|
|
55
|
+
* @param entityName: singular format of entity name
|
|
56
|
+
*/
|
|
57
|
+
rowSelectionConfig?: {
|
|
58
|
+
isCheckbox?: boolean;
|
|
59
|
+
isRadio?: boolean;
|
|
60
|
+
entityName: string;
|
|
61
|
+
actions?: {
|
|
62
|
+
icon: string;
|
|
63
|
+
text: string;
|
|
64
|
+
onClick: any;
|
|
65
|
+
}[];
|
|
66
|
+
setSelectedRows?: React.Dispatch<React.SetStateAction<any>>;
|
|
67
|
+
iconSrc?: string;
|
|
68
|
+
clearOnSearch?: boolean;
|
|
69
|
+
rowIdKey?: string;
|
|
70
|
+
rowSelection?: {};
|
|
71
|
+
setRowSelection?: React.Dispatch<React.SetStateAction<{}>>;
|
|
72
|
+
};
|
|
73
|
+
selectorConfig?: {
|
|
74
|
+
selectors: {
|
|
75
|
+
name: string;
|
|
76
|
+
onClick: any;
|
|
77
|
+
}[];
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* @deprecated use infiniteScrollConfig
|
|
81
|
+
*/
|
|
82
|
+
paginationConfig?: {
|
|
83
|
+
metaData: {
|
|
84
|
+
total_items: number;
|
|
85
|
+
items_on_page: number;
|
|
86
|
+
page_no: number;
|
|
87
|
+
};
|
|
88
|
+
loader: React.ReactNode;
|
|
89
|
+
fetchNextPage: () => void;
|
|
90
|
+
height?: string;
|
|
91
|
+
scrollThreshold?: string | number;
|
|
92
|
+
scrollableTarget?: string;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* Used for infinite scroll, all the properties comes from useInfiniteQuery
|
|
96
|
+
*/
|
|
97
|
+
infiniteScrollConfig?: {
|
|
98
|
+
fetchNextPage: () => void;
|
|
99
|
+
isFetchingNextPage: boolean;
|
|
100
|
+
};
|
|
101
|
+
emptyStateConfig?: {
|
|
102
|
+
icon: string;
|
|
103
|
+
isCustom?: {
|
|
104
|
+
value: boolean;
|
|
105
|
+
component: React.ReactNode;
|
|
106
|
+
};
|
|
107
|
+
title: string;
|
|
108
|
+
desc: string;
|
|
109
|
+
btnText: string;
|
|
110
|
+
onClick: any;
|
|
111
|
+
columns: number;
|
|
112
|
+
emptySearchTitle?: string;
|
|
113
|
+
};
|
|
114
|
+
headerText?: string;
|
|
115
|
+
}
|
|
116
|
+
export declare function TableV2({ data, loaderConfig, columns, filterConfig, sortConfig, rowSelectionConfig, actionsConfig, searchConfig, totalText, selectorConfig, paginationConfig, emptyStateConfig, headerText, infiniteScrollConfig, }: TableV2Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './TableV2';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TableV2Props } from '../TableV2';
|
|
2
|
+
type TableActionsProps = {
|
|
3
|
+
actionsConfig: TableV2Props['actionsConfig'];
|
|
4
|
+
data: any;
|
|
5
|
+
};
|
|
6
|
+
export default function TableActions({ actionsConfig, data }: TableActionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TableStore } from '../store';
|
|
2
|
+
import type { FilterOptions, InternalTableFilters } from '../types';
|
|
3
|
+
interface TableHeaderFilterProps {
|
|
4
|
+
filter: FilterOptions;
|
|
5
|
+
tableFilters: TableStore['filters'];
|
|
6
|
+
tableFilter: InternalTableFilters;
|
|
7
|
+
addFilters: TableStore['addFilters'];
|
|
8
|
+
removeFilters: TableStore['removeFilters'];
|
|
9
|
+
resetFilters: (filterKey: string, filterDispatch: any) => void;
|
|
10
|
+
filterDispatch: (value: any) => void;
|
|
11
|
+
}
|
|
12
|
+
export default function TableHeaderFilter({ filter, tableFilters, tableFilter, addFilters, removeFilters, resetFilters, filterDispatch, }: TableHeaderFilterProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FilterConfig } from '../types';
|
|
2
|
+
interface TableHeaderFiltersProps {
|
|
3
|
+
filterConfig: FilterConfig;
|
|
4
|
+
filters: FilterConfig['filters'];
|
|
5
|
+
}
|
|
6
|
+
export default function TableHeaderFilters({ filterConfig, filters }: TableHeaderFiltersProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './TableHeaderFilters';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { TableV2Props } from '../TableV2';
|
|
3
|
+
interface TableMetaHeaderProps {
|
|
4
|
+
rowSelectionConfig: TableV2Props['rowSelectionConfig'];
|
|
5
|
+
totalText: TableV2Props['totalText'];
|
|
6
|
+
searchConfig: TableV2Props['searchConfig'];
|
|
7
|
+
filterConfig: TableV2Props['filterConfig'];
|
|
8
|
+
rowSelection: {};
|
|
9
|
+
setRowSelection: React.Dispatch<React.SetStateAction<{}>>;
|
|
10
|
+
}
|
|
11
|
+
export default function TableMetaHeader({ rowSelectionConfig, totalText, searchConfig, filterConfig, rowSelection, setRowSelection, }: TableMetaHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TableV2Props } from '../TableV2';
|
|
2
|
+
interface TableSelectedActionsProps {
|
|
3
|
+
rowSelectionConfig: TableV2Props['rowSelectionConfig'];
|
|
4
|
+
rowSelection: {};
|
|
5
|
+
}
|
|
6
|
+
export default function TableSelectedActions({ rowSelectionConfig, rowSelection, }: TableSelectedActionsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
};
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @param filters comes from an api, must follow the type definition strictly
|
|
18
|
+
* @param isLoading is fetching from api
|
|
19
|
+
* @param isError api threw error
|
|
20
|
+
* @param filterDispatch must be of @type (value) => dispatch({type,payload})
|
|
21
|
+
* this is used to sync the internal table filter state with the external zustand store of the consumer
|
|
22
|
+
* @param filterReset same type as above but is used to reset all the filters
|
|
23
|
+
* @param headerFilterIds this is used for the filters which should be in the table header itself, and not inside the filters drawer
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
export type FilterConfig = {
|
|
28
|
+
filters: FilterOptions[];
|
|
29
|
+
isLoading: boolean;
|
|
30
|
+
isError: boolean;
|
|
31
|
+
filterDispatch: (value: any) => void;
|
|
32
|
+
filterReset: (value: any) => void;
|
|
33
|
+
headerFilterIds?: string[];
|
|
34
|
+
};
|
|
35
|
+
export type InternalTableFilters = {
|
|
36
|
+
key: string;
|
|
37
|
+
values: string[];
|
|
38
|
+
};
|