bianic-ui 2.14.0-beta.8 → 2.14.0
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/cjs/index.js +958 -93
- package/dist/cjs/lib.css +1 -1
- package/dist/cjs/types/components/Button/PropInterfaceButton.d.ts +1 -0
- package/dist/cjs/types/components/Button/buttonConfigs.d.ts +6 -0
- package/dist/cjs/types/components/Forms/LiveSearch/hooks/useLiveSearch.d.ts +2 -0
- package/dist/cjs/types/components/Forms/LiveSearch/index.d.ts +1 -1
- package/dist/cjs/types/components/Forms/LiveSearch/types/index.d.ts +1 -0
- package/dist/cjs/types/components/Forms/TagLabelInput/index.d.ts +1 -0
- package/dist/cjs/types/components/InfoPanel/config.d.ts +2 -5
- package/dist/cjs/types/components/InfoPanel/index.d.ts +7 -3
- package/dist/cjs/types/components/Table/DataTable/DataTable.d.ts +4 -0
- package/dist/cjs/types/components/Table/DataTable/SortableHeadCell.d.ts +11 -0
- package/dist/cjs/types/components/Table/DataTable/configs.d.ts +5 -0
- package/dist/cjs/types/components/Table/DataTable/index.d.ts +5 -0
- package/dist/cjs/types/components/Table/DataTable/types.d.ts +100 -0
- package/dist/cjs/types/components/Table/DataTable/useDataTable.d.ts +4 -0
- package/dist/cjs/types/components/Table/DataTable/utils.d.ts +7 -0
- package/dist/cjs/types/components/Table/index.d.ts +2 -0
- package/dist/cjs/types/components/TagLabel/configs.d.ts +8 -1
- package/dist/cjs/types/components/index.d.ts +5 -1
- package/dist/cjs/types/stories/Button/Button.stories.d.ts +19 -0
- package/dist/cjs/types/stories/Form/LiveSearch/Livesearch.stories.d.ts +1 -0
- package/dist/cjs/types/stories/Form/LiveSearch/Livesearch.test.stories.d.ts +3 -0
- package/dist/cjs/types/stories/Form/TagLabelInput/TagLabelInput.stories.d.ts +13 -0
- package/dist/cjs/types/stories/InfoPanel/InfoPanel.stories.d.ts +95 -1
- package/dist/cjs/types/stories/InfoPanel/InfoPanel.test.stories.d.ts +33 -0
- package/dist/cjs/types/stories/PaginationBar/PaginationBar.test.stories.d.ts +27 -0
- package/dist/cjs/types/stories/Table/DataTable.stories.d.ts +245 -0
- package/dist/cjs/types/stories/Table/DataTable.test.stories.d.ts +76 -0
- package/dist/cjs/types/stories/Table/useTableDataHandler.test.stories.d.ts +19 -0
- package/dist/cjs/types/stories/TagLabel/TagLabel.stories.d.ts +4 -0
- package/dist/cjs/types/stories/TagLabel/TagLabel.test.stories.d.ts +38 -0
- package/dist/cjs/types/stories/Tooltip/Tooltip.stories.d.ts +19 -0
- package/dist/cjs/types/stories/Tooltip/Tooltip.test.stories.d.ts +33 -0
- package/dist/cjs/types/stories/Utility/Formatters.stories.d.ts +18 -0
- package/dist/cjs/types/stories/Utility/Formatters.test.stories.d.ts +21 -0
- package/dist/cjs/types/stories/Utility/cleanParams.stories.d.ts +33 -0
- package/dist/cjs/types/stories/Utility/filterSamples.d.ts +62 -0
- package/dist/cjs/types/stories/Utility/useAppliedFilter.stories.d.ts +46 -0
- package/dist/cjs/types/stories/Utility/useDebounce.stories.d.ts +31 -0
- package/dist/cjs/types/stories/Utility/useDebounce.test.stories.d.ts +19 -0
- package/dist/cjs/types/stories/Utility/usePersistentState.stories.d.ts +44 -0
- package/dist/cjs/types/stories/Utility/usePersistentState.test.stories.d.ts +21 -0
- package/dist/cjs/types/utility/hooks/useAppliedFilter.d.ts +19 -0
- package/dist/cjs/types/utility/hooks/useDebounce.d.ts +3 -0
- package/dist/cjs/types/utility/hooks/usePersistentState.d.ts +8 -0
- package/dist/cjs/types/utility/hooks/useTableDataHandler.d.ts +1 -1
- package/dist/cjs/types/utility/index.d.ts +8 -0
- package/dist/cjs/types/utility/public/filterParams.d.ts +4 -0
- package/dist/cjs/types/utility/public/formatters.d.ts +2 -0
- package/dist/cjs/types/utility/public/highlightMatch.d.ts +3 -0
- package/dist/esm/index.js +948 -95
- package/dist/esm/lib.css +1 -1
- package/dist/esm/types/components/Button/PropInterfaceButton.d.ts +1 -0
- package/dist/esm/types/components/Button/buttonConfigs.d.ts +6 -0
- package/dist/esm/types/components/Forms/LiveSearch/hooks/useLiveSearch.d.ts +2 -0
- package/dist/esm/types/components/Forms/LiveSearch/index.d.ts +1 -1
- package/dist/esm/types/components/Forms/LiveSearch/types/index.d.ts +1 -0
- package/dist/esm/types/components/Forms/TagLabelInput/index.d.ts +1 -0
- package/dist/esm/types/components/InfoPanel/config.d.ts +2 -5
- package/dist/esm/types/components/InfoPanel/index.d.ts +7 -3
- package/dist/esm/types/components/Table/DataTable/DataTable.d.ts +4 -0
- package/dist/esm/types/components/Table/DataTable/SortableHeadCell.d.ts +11 -0
- package/dist/esm/types/components/Table/DataTable/configs.d.ts +5 -0
- package/dist/esm/types/components/Table/DataTable/index.d.ts +5 -0
- package/dist/esm/types/components/Table/DataTable/types.d.ts +100 -0
- package/dist/esm/types/components/Table/DataTable/useDataTable.d.ts +4 -0
- package/dist/esm/types/components/Table/DataTable/utils.d.ts +7 -0
- package/dist/esm/types/components/Table/index.d.ts +2 -0
- package/dist/esm/types/components/TagLabel/configs.d.ts +8 -1
- package/dist/esm/types/components/index.d.ts +5 -1
- package/dist/esm/types/stories/Button/Button.stories.d.ts +19 -0
- package/dist/esm/types/stories/Form/LiveSearch/Livesearch.stories.d.ts +1 -0
- package/dist/esm/types/stories/Form/LiveSearch/Livesearch.test.stories.d.ts +3 -0
- package/dist/esm/types/stories/Form/TagLabelInput/TagLabelInput.stories.d.ts +13 -0
- package/dist/esm/types/stories/InfoPanel/InfoPanel.stories.d.ts +95 -1
- package/dist/esm/types/stories/InfoPanel/InfoPanel.test.stories.d.ts +33 -0
- package/dist/esm/types/stories/PaginationBar/PaginationBar.test.stories.d.ts +27 -0
- package/dist/esm/types/stories/Table/DataTable.stories.d.ts +245 -0
- package/dist/esm/types/stories/Table/DataTable.test.stories.d.ts +76 -0
- package/dist/esm/types/stories/Table/useTableDataHandler.test.stories.d.ts +19 -0
- package/dist/esm/types/stories/TagLabel/TagLabel.stories.d.ts +4 -0
- package/dist/esm/types/stories/TagLabel/TagLabel.test.stories.d.ts +38 -0
- package/dist/esm/types/stories/Tooltip/Tooltip.stories.d.ts +19 -0
- package/dist/esm/types/stories/Tooltip/Tooltip.test.stories.d.ts +33 -0
- package/dist/esm/types/stories/Utility/Formatters.stories.d.ts +18 -0
- package/dist/esm/types/stories/Utility/Formatters.test.stories.d.ts +21 -0
- package/dist/esm/types/stories/Utility/cleanParams.stories.d.ts +33 -0
- package/dist/esm/types/stories/Utility/filterSamples.d.ts +62 -0
- package/dist/esm/types/stories/Utility/useAppliedFilter.stories.d.ts +46 -0
- package/dist/esm/types/stories/Utility/useDebounce.stories.d.ts +31 -0
- package/dist/esm/types/stories/Utility/useDebounce.test.stories.d.ts +19 -0
- package/dist/esm/types/stories/Utility/usePersistentState.stories.d.ts +44 -0
- package/dist/esm/types/stories/Utility/usePersistentState.test.stories.d.ts +21 -0
- package/dist/esm/types/utility/hooks/useAppliedFilter.d.ts +19 -0
- package/dist/esm/types/utility/hooks/useDebounce.d.ts +3 -0
- package/dist/esm/types/utility/hooks/usePersistentState.d.ts +8 -0
- package/dist/esm/types/utility/hooks/useTableDataHandler.d.ts +1 -1
- package/dist/esm/types/utility/index.d.ts +8 -0
- package/dist/esm/types/utility/public/filterParams.d.ts +4 -0
- package/dist/esm/types/utility/public/formatters.d.ts +2 -0
- package/dist/esm/types/utility/public/highlightMatch.d.ts +3 -0
- package/dist/index.d.ts +160 -7
- package/package.json +1 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { PersistentStorageType } from '../../components';
|
|
4
|
+
interface CounterDemoProps {
|
|
5
|
+
storageKey?: string;
|
|
6
|
+
storage?: PersistentStorageType;
|
|
7
|
+
}
|
|
8
|
+
declare function CounterDemo({ storageKey, storage, }: CounterDemoProps): React.JSX.Element;
|
|
9
|
+
declare const meta: {
|
|
10
|
+
title: string;
|
|
11
|
+
component: typeof CounterDemo;
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: string;
|
|
14
|
+
a11y: {
|
|
15
|
+
test: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
argTypes: {
|
|
19
|
+
storageKey: {
|
|
20
|
+
control: "text";
|
|
21
|
+
description: string;
|
|
22
|
+
table: {
|
|
23
|
+
defaultValue: {
|
|
24
|
+
summary: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
storage: {
|
|
29
|
+
control: "inline-radio";
|
|
30
|
+
options: string[];
|
|
31
|
+
description: string;
|
|
32
|
+
table: {
|
|
33
|
+
defaultValue: {
|
|
34
|
+
summary: string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export default meta;
|
|
41
|
+
type Story = StoryObj<typeof meta>;
|
|
42
|
+
export declare const Default: Story;
|
|
43
|
+
export declare const LocalStorage: Story;
|
|
44
|
+
export declare const NoKey: Story;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
declare function Remountable(): React.JSX.Element;
|
|
4
|
+
declare const meta: {
|
|
5
|
+
title: string;
|
|
6
|
+
component: typeof Remountable;
|
|
7
|
+
tags: string[];
|
|
8
|
+
parameters: {
|
|
9
|
+
a11y: {
|
|
10
|
+
test: string;
|
|
11
|
+
};
|
|
12
|
+
chromatic: {
|
|
13
|
+
disableSnapshot: boolean;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default meta;
|
|
18
|
+
type Story = StoryObj<typeof meta>;
|
|
19
|
+
export declare const SavesRestoresAndClears: Story;
|
|
20
|
+
export declare const BlockedStorageDoesNotThrow: Story;
|
|
21
|
+
export declare const NoKeyWritesNothing: Story;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
import type { PersistentStorageType } from './usePersistentState';
|
|
3
|
+
export interface UseAppliedFilterOptions {
|
|
4
|
+
storageKey?: string;
|
|
5
|
+
storage?: PersistentStorageType;
|
|
6
|
+
}
|
|
7
|
+
export interface UseAppliedFilterResult<T> {
|
|
8
|
+
draft: T;
|
|
9
|
+
setDraft: Dispatch<SetStateAction<T>>;
|
|
10
|
+
setDraftValue: <K extends keyof T>(key: K, value: T[K]) => void;
|
|
11
|
+
applied: T;
|
|
12
|
+
params: Partial<T>;
|
|
13
|
+
isActive: boolean;
|
|
14
|
+
apply: () => void;
|
|
15
|
+
reset: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare function useAppliedFilter<T extends object>(initial: T, options?: UseAppliedFilterOptions): UseAppliedFilterResult<T>;
|
|
18
|
+
export { useAppliedFilter };
|
|
19
|
+
export default useAppliedFilter;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
2
|
+
export type PersistentStorageType = 'local' | 'session';
|
|
3
|
+
export interface UsePersistentStateOptions {
|
|
4
|
+
storage?: PersistentStorageType;
|
|
5
|
+
}
|
|
6
|
+
declare function usePersistentState<T>(key: string | undefined, initialValue: T | (() => T), options?: UsePersistentStateOptions): [T, Dispatch<SetStateAction<T>>, () => void];
|
|
7
|
+
export { usePersistentState };
|
|
8
|
+
export default usePersistentState;
|
|
@@ -2,7 +2,7 @@ export type SortOrder = 'asc' | 'desc';
|
|
|
2
2
|
/**
|
|
3
3
|
* Configuration options for the useTableDataHandler hook.
|
|
4
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.
|
|
5
|
+
* @property {string[]} [searchKeys] - Specific object keys to check during client-side filtering. If omitted, defaults to all keys containing string or number values.
|
|
6
6
|
* @property {string} [initialSortKey] - The object key to sort the table by on initial render.
|
|
7
7
|
* @property {SortOrder} [initialSortOrder='asc'] - The initial sorting direction ('asc' or 'desc').
|
|
8
8
|
* @property {boolean} [isFilterable=true] - Enables or disables client-side searching functionality.
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
export { getRelativeTime, formatDateTime } from './public/words';
|
|
2
2
|
export type { DateTimeFormatType } from './public/words';
|
|
3
|
+
export { useDebounce } from './hooks/useDebounce';
|
|
4
|
+
export { usePersistentState } from './hooks/usePersistentState';
|
|
5
|
+
export { useAppliedFilter } from './hooks/useAppliedFilter';
|
|
6
|
+
export type { UseAppliedFilterOptions, UseAppliedFilterResult, } from './hooks/useAppliedFilter';
|
|
7
|
+
export { cleanParams, isFilterActive, isEmptyFilterValue, } from './public/filterParams';
|
|
8
|
+
export type { UsePersistentStateOptions, PersistentStorageType, } from './hooks/usePersistentState';
|
|
9
|
+
export { formatFileSize, truncateText } from './public/formatters';
|
|
10
|
+
export { highlightMatch } from './public/highlightMatch';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare function isEmptyFilterValue(value: unknown): boolean;
|
|
2
|
+
declare function cleanParams<T extends object>(filter: T | null | undefined): Partial<T>;
|
|
3
|
+
declare function isFilterActive(filter: object | null | undefined): boolean;
|
|
4
|
+
export { isEmptyFilterValue, cleanParams, isFilterActive };
|
package/dist/index.d.ts
CHANGED
|
@@ -80,6 +80,7 @@ interface ButtonProps extends Omit<ComponentPropsWithRef<'button'>, 'disabled'>,
|
|
|
80
80
|
disabled?: boolean;
|
|
81
81
|
iconRight?: ReactNode;
|
|
82
82
|
iconLeft?: ReactNode;
|
|
83
|
+
iconSize?: number;
|
|
83
84
|
right?: ReactNode;
|
|
84
85
|
left?: ReactNode;
|
|
85
86
|
label?: string;
|
|
@@ -343,6 +344,7 @@ interface LiveSearchProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size'
|
|
|
343
344
|
id?: string;
|
|
344
345
|
isValid?: boolean | null;
|
|
345
346
|
label?: string;
|
|
347
|
+
noResultsContent?: ReactNode | ((searchTerm: string) => ReactNode);
|
|
346
348
|
onChangeText?: (e: ChangeEvent<HTMLInputElement>) => void;
|
|
347
349
|
onChangeButton?: ReactNode;
|
|
348
350
|
onClickDropdown?: (event: MouseEvent<HTMLDivElement>) => void;
|
|
@@ -356,7 +358,7 @@ interface LiveSearchProps extends Omit<ComponentPropsWithoutRef<'input'>, 'size'
|
|
|
356
358
|
value: OptionValue;
|
|
357
359
|
}
|
|
358
360
|
|
|
359
|
-
declare function LiveSearch({ autoComplete, children, descText, disabled, dropContProps, id, label, onChangeText, onChangeButton, onClickDropdown, options, placeholder, readOnly, required, searchVariant, setValue, size, isValid, value, }: LiveSearchProps): React__default.JSX.Element;
|
|
361
|
+
declare function LiveSearch({ autoComplete, children, descText, disabled, dropContProps, id, label, noResultsContent, onChangeText, onChangeButton, onClickDropdown, options, placeholder, readOnly, required, searchVariant, setValue, size, isValid, value, }: LiveSearchProps): React__default.JSX.Element;
|
|
360
362
|
|
|
361
363
|
interface TagOption {
|
|
362
364
|
id: string;
|
|
@@ -374,6 +376,7 @@ interface TagLabelInputProps<T extends TagValue = TagValue> extends Omit<React__
|
|
|
374
376
|
description?: string;
|
|
375
377
|
disabled?: boolean;
|
|
376
378
|
dropContProps?: Omit<DropdownContainerProps, 'children'>;
|
|
379
|
+
noResultsContent?: ReactNode | ((searchTerm: string) => ReactNode);
|
|
377
380
|
id?: string;
|
|
378
381
|
isValid?: boolean | null;
|
|
379
382
|
label?: string;
|
|
@@ -584,9 +587,13 @@ declare function Unlinked({ className, fill, size }: IconProps): React__default.
|
|
|
584
587
|
|
|
585
588
|
declare function VirtualPort({ className, fill, size, }: IconProps): React__default.JSX.Element;
|
|
586
589
|
|
|
590
|
+
type InfoPanelVariant = 'container' | 'form' | 'form-sm' | 'form-md';
|
|
591
|
+
type InfoPanelSize = 'md' | 'sm';
|
|
592
|
+
type InfoPanelColor = 'yellow' | 'blue' | 'green' | 'grey' | 'white' | 'custom';
|
|
587
593
|
interface InfoPanelProps {
|
|
588
|
-
variant?:
|
|
589
|
-
|
|
594
|
+
variant?: InfoPanelVariant;
|
|
595
|
+
size?: InfoPanelSize;
|
|
596
|
+
color?: InfoPanelColor;
|
|
590
597
|
/** Palette token without the `bia-` prefix, e.g. `green-light-90`. */
|
|
591
598
|
bgColor?: string;
|
|
592
599
|
/** Palette token without the `bia-` prefix, e.g. `green-dark-10`. */
|
|
@@ -596,7 +603,7 @@ interface InfoPanelProps {
|
|
|
596
603
|
className?: string;
|
|
597
604
|
children?: React__default.ReactNode;
|
|
598
605
|
}
|
|
599
|
-
declare function InfoPanel({ variant, color, bgColor, textColor, outlineColor, className, children, }: InfoPanelProps): React__default.JSX.Element;
|
|
606
|
+
declare function InfoPanel({ variant, size, color, bgColor, textColor, outlineColor, className, children, }: InfoPanelProps): React__default.JSX.Element;
|
|
600
607
|
|
|
601
608
|
interface ModalProps extends ComponentPropsWithoutRef<'div'> {
|
|
602
609
|
size?: 'sm' | 'md' | 'lg' | 'xl';
|
|
@@ -841,6 +848,119 @@ interface TableSearchInputProps extends ComponentPropsWithoutRef<'input'> {
|
|
|
841
848
|
}
|
|
842
849
|
declare function TableSearchInput({ isShow, value, onChange, placeholder, }: TableSearchInputProps): React__default.JSX.Element | null;
|
|
843
850
|
|
|
851
|
+
type DataTableMode = 'client' | 'server';
|
|
852
|
+
type DataTableAlign = 'start' | 'center' | 'end';
|
|
853
|
+
type DataTableColumnType = 'index' | 'actions';
|
|
854
|
+
type DataTableSortOrder = 'asc' | 'desc';
|
|
855
|
+
interface DataTableColumn<T> {
|
|
856
|
+
key: string;
|
|
857
|
+
label: ReactNode;
|
|
858
|
+
type?: DataTableColumnType;
|
|
859
|
+
accessor?: (row: T) => unknown;
|
|
860
|
+
render?: (value: unknown, row: T, index: number) => ReactNode;
|
|
861
|
+
sortable?: boolean;
|
|
862
|
+
sortKey?: string;
|
|
863
|
+
align?: DataTableAlign;
|
|
864
|
+
width?: number | string;
|
|
865
|
+
minWidth?: number | string;
|
|
866
|
+
maxWidth?: number | string;
|
|
867
|
+
cellClassName?: string | ((row: T, index: number) => string);
|
|
868
|
+
headerClassName?: string;
|
|
869
|
+
}
|
|
870
|
+
interface DataTablePageState {
|
|
871
|
+
page: number;
|
|
872
|
+
pageSize: number;
|
|
873
|
+
}
|
|
874
|
+
interface DataTablePagination {
|
|
875
|
+
mode?: DataTableMode;
|
|
876
|
+
page?: number;
|
|
877
|
+
defaultPage?: number | 'last';
|
|
878
|
+
pageSize?: number;
|
|
879
|
+
defaultPageSize?: number;
|
|
880
|
+
totalCount?: number;
|
|
881
|
+
onChange?: (state: DataTablePageState) => void;
|
|
882
|
+
}
|
|
883
|
+
interface DataTableSearch {
|
|
884
|
+
mode?: DataTableMode;
|
|
885
|
+
defaultValue?: string;
|
|
886
|
+
onChange?: (text: string) => void;
|
|
887
|
+
keys?: string[];
|
|
888
|
+
debounceMs?: number;
|
|
889
|
+
placeholder?: string;
|
|
890
|
+
}
|
|
891
|
+
interface DataTableSort {
|
|
892
|
+
key: string;
|
|
893
|
+
order: DataTableSortOrder;
|
|
894
|
+
}
|
|
895
|
+
interface DataTableSortConfig {
|
|
896
|
+
mode?: DataTableMode;
|
|
897
|
+
value?: DataTableSort | null;
|
|
898
|
+
defaultValue?: DataTableSort | null;
|
|
899
|
+
onChange?: (sort: DataTableSort | null) => void;
|
|
900
|
+
}
|
|
901
|
+
interface UseDataTableOptions<T> {
|
|
902
|
+
data: T[];
|
|
903
|
+
columns: DataTableColumn<T>[];
|
|
904
|
+
pagination?: DataTablePagination;
|
|
905
|
+
search?: DataTableSearch;
|
|
906
|
+
sort?: DataTableSortConfig;
|
|
907
|
+
}
|
|
908
|
+
interface UseDataTableResult<T> {
|
|
909
|
+
rows: T[];
|
|
910
|
+
rowOffset: number;
|
|
911
|
+
page: number;
|
|
912
|
+
pageSize: number;
|
|
913
|
+
totalPages: number;
|
|
914
|
+
totalCount: number;
|
|
915
|
+
firstIndex: number;
|
|
916
|
+
lastIndex: number;
|
|
917
|
+
setPage: (page: number) => void;
|
|
918
|
+
setPageSize: (pageSize: number) => void;
|
|
919
|
+
searchText: string;
|
|
920
|
+
setSearchText: (text: string) => void;
|
|
921
|
+
submitSearch: () => void;
|
|
922
|
+
isSearchActive: boolean;
|
|
923
|
+
isNoResults: boolean;
|
|
924
|
+
sort: DataTableSort | null;
|
|
925
|
+
toggleSort: (columnKey: string) => void;
|
|
926
|
+
getValue: (row: T, column: DataTableColumn<T>) => unknown;
|
|
927
|
+
}
|
|
928
|
+
interface DataTableProps<T extends object> extends Omit<ComponentPropsWithoutRef<'div'>, 'children'> {
|
|
929
|
+
columns: DataTableColumn<T>[];
|
|
930
|
+
data: T[];
|
|
931
|
+
rowKey: (keyof T & string) | ((row: T) => string | number);
|
|
932
|
+
pagination?: DataTablePagination;
|
|
933
|
+
search?: DataTableSearch;
|
|
934
|
+
sort?: DataTableSortConfig;
|
|
935
|
+
isLoading?: boolean;
|
|
936
|
+
buttonActions?: ReactNode[];
|
|
937
|
+
middleSection?: ReactNode;
|
|
938
|
+
rowClassName?: (row: T, index: number) => string;
|
|
939
|
+
rowProps?: (row: T, index: number) => ComponentPropsWithoutRef<'tr'>;
|
|
940
|
+
renderRow?: (row: T, index: number, defaultCells: ReactNode[]) => ReactNode;
|
|
941
|
+
emptyValue?: ReactNode;
|
|
942
|
+
emptyContent?: string;
|
|
943
|
+
emptySubContent?: string;
|
|
944
|
+
noResultsContent?: string;
|
|
945
|
+
noResultsSubContent?: string;
|
|
946
|
+
customEmptyContent?: ReactNode;
|
|
947
|
+
tableClassName?: string;
|
|
948
|
+
className?: string;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
declare function DataTable<T extends object>({ columns, data, rowKey, pagination, search, sort, isLoading, buttonActions, middleSection, rowClassName, rowProps, renderRow, emptyValue, emptyContent, emptySubContent, noResultsContent, noResultsSubContent, customEmptyContent, tableClassName, className, ...rest }: DataTableProps<T>): React__default.JSX.Element;
|
|
952
|
+
|
|
953
|
+
interface SortableHeadCellProps extends Omit<ComponentPropsWithoutRef<'th'>, 'children' | 'onClick' | 'align'> {
|
|
954
|
+
label: ReactNode;
|
|
955
|
+
sortOrder?: DataTableSortOrder | null;
|
|
956
|
+
onSort?: () => void;
|
|
957
|
+
align?: DataTableAlign;
|
|
958
|
+
className?: string;
|
|
959
|
+
}
|
|
960
|
+
declare function SortableHeadCell({ label, sortOrder, onSort, align, className, ...rest }: SortableHeadCellProps): React__default.JSX.Element;
|
|
961
|
+
|
|
962
|
+
declare function useDataTable<T>(options: UseDataTableOptions<T>): UseDataTableResult<T>;
|
|
963
|
+
|
|
844
964
|
interface TagLabelProps extends ComponentPropsWithoutRef<'div'> {
|
|
845
965
|
color: 'default' | 'blue' | 'teal' | 'green' | 'orange' | 'red' | 'black' | 'white' | 'custom';
|
|
846
966
|
size?: 'md' | 'sm' | 'tn';
|
|
@@ -994,11 +1114,44 @@ type DateTimeFormatType = 'short' | 'long' | 'long-with-time' | 'table' | 'table
|
|
|
994
1114
|
*/
|
|
995
1115
|
declare const formatDateTime: (dateString: string | number | Date, type?: DateTimeFormatType | null) => string;
|
|
996
1116
|
|
|
1117
|
+
declare function useDebounce<T>(value: T, delay?: number): T;
|
|
1118
|
+
|
|
1119
|
+
type PersistentStorageType = 'local' | 'session';
|
|
1120
|
+
interface UsePersistentStateOptions {
|
|
1121
|
+
storage?: PersistentStorageType;
|
|
1122
|
+
}
|
|
1123
|
+
declare function usePersistentState<T>(key: string | undefined, initialValue: T | (() => T), options?: UsePersistentStateOptions): [T, Dispatch<SetStateAction<T>>, () => void];
|
|
1124
|
+
|
|
1125
|
+
interface UseAppliedFilterOptions {
|
|
1126
|
+
storageKey?: string;
|
|
1127
|
+
storage?: PersistentStorageType;
|
|
1128
|
+
}
|
|
1129
|
+
interface UseAppliedFilterResult<T> {
|
|
1130
|
+
draft: T;
|
|
1131
|
+
setDraft: Dispatch<SetStateAction<T>>;
|
|
1132
|
+
setDraftValue: <K extends keyof T>(key: K, value: T[K]) => void;
|
|
1133
|
+
applied: T;
|
|
1134
|
+
params: Partial<T>;
|
|
1135
|
+
isActive: boolean;
|
|
1136
|
+
apply: () => void;
|
|
1137
|
+
reset: () => void;
|
|
1138
|
+
}
|
|
1139
|
+
declare function useAppliedFilter<T extends object>(initial: T, options?: UseAppliedFilterOptions): UseAppliedFilterResult<T>;
|
|
1140
|
+
|
|
1141
|
+
declare function isEmptyFilterValue(value: unknown): boolean;
|
|
1142
|
+
declare function cleanParams<T extends object>(filter: T | null | undefined): Partial<T>;
|
|
1143
|
+
declare function isFilterActive(filter: object | null | undefined): boolean;
|
|
1144
|
+
|
|
1145
|
+
declare function formatFileSize(bytes?: number): string;
|
|
1146
|
+
declare function truncateText(text: string | null | undefined, maxLength: number): string;
|
|
1147
|
+
|
|
1148
|
+
declare function highlightMatch(text: string | number | null | undefined, keyword: string | undefined): ReactNode;
|
|
1149
|
+
|
|
997
1150
|
type SortOrder = 'asc' | 'desc';
|
|
998
1151
|
/**
|
|
999
1152
|
* Configuration options for the useTableDataHandler hook.
|
|
1000
1153
|
* * @interface UseTableDataOptions
|
|
1001
|
-
* @property {string[]} [searchKeys] - Specific object keys to check during client-side filtering. If omitted, defaults to all keys containing string values.
|
|
1154
|
+
* @property {string[]} [searchKeys] - Specific object keys to check during client-side filtering. If omitted, defaults to all keys containing string or number values.
|
|
1002
1155
|
* @property {string} [initialSortKey] - The object key to sort the table by on initial render.
|
|
1003
1156
|
* @property {SortOrder} [initialSortOrder='asc'] - The initial sorting direction ('asc' or 'desc').
|
|
1004
1157
|
* @property {boolean} [isFilterable=true] - Enables or disables client-side searching functionality.
|
|
@@ -1048,5 +1201,5 @@ declare const useTableDataHandler: (initialData: any[], options?: UseTableDataOp
|
|
|
1048
1201
|
handleSortChange: (key: string) => void;
|
|
1049
1202
|
};
|
|
1050
1203
|
|
|
1051
|
-
export { Accordions, Alert, Avatar, AlertRoundedSquare as BCAlertRoundedSquare, CubeHeader as BCCubeHeader, Discrepancy as BCDiscrepancy, ExposedPort as BCExposedPort, FQAnalytical as BCFQAnalytical, FQGetaway as BCFQGetaway, FQModeler as BCFQModeler, FQOperation as BCFQOperation, FQWelldone as BCFQWelldone, Flowqount as BCFlowqount, Inlet as BCInlet, Legend as BCLegend, ModalBalance as BCModalBalance, Neutral as BCNeutral, Node as BCNode, Outlet as BCOutlet, Port as BCPort, Rhombus as BCRhombus, SelectAllAdd as BCSelectAllAdd, SelectAllRemove as BCSelectAllRemove, Spinner$1 as BCSpinner, Stack as BCStack, Unlinked as BCUnlinked, VirtualPort as BCVirtualPort, Badge, Banner, BlockLoading, Brand, Breadcrumb, Button, ButtonApp, Card, Checkbox, Color, ContextualButton, Countdown, DatePicker, Display, Divider, DropdownContainer, DropdownItem, DropzoneFileUploader, EmptyTable, FormGroup, FormGroupButton, FormGroupLabel, FormLabel, Heading, HorizontalStepper, InfoPanel, Link, LiveSearch, MenuContainer, MenuItem, Modal, MonospaceBadge, Notification, P, PaginationBar, PickerCalendar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, SidebarContainer, SidebarItem, SidebarMenu, SidebarProfile, SimpleFileUploader, Slider, Spinner, Tab, TabMenu, Table, TableBody, TableCell, TableFooterController, TableHead, TableHeaderController, TableRow, TableSearchInput, TagLabel, TagLabelInput, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, _default as TreeItem, StepperItem as VerticalStepper, Window, YearPicker, formatDateTime, getRelativeTime, useFileTree, useTableDataHandler };
|
|
1052
|
-
export type { DateTimeFormatType, HorizontalStepperProps, HorizontalStepperVariant, NavbarHorizontalStepperProps, StandardHorizontalStepperProps };
|
|
1204
|
+
export { Accordions, Alert, Avatar, AlertRoundedSquare as BCAlertRoundedSquare, CubeHeader as BCCubeHeader, Discrepancy as BCDiscrepancy, ExposedPort as BCExposedPort, FQAnalytical as BCFQAnalytical, FQGetaway as BCFQGetaway, FQModeler as BCFQModeler, FQOperation as BCFQOperation, FQWelldone as BCFQWelldone, Flowqount as BCFlowqount, Inlet as BCInlet, Legend as BCLegend, ModalBalance as BCModalBalance, Neutral as BCNeutral, Node as BCNode, Outlet as BCOutlet, Port as BCPort, Rhombus as BCRhombus, SelectAllAdd as BCSelectAllAdd, SelectAllRemove as BCSelectAllRemove, Spinner$1 as BCSpinner, Stack as BCStack, Unlinked as BCUnlinked, VirtualPort as BCVirtualPort, Badge, Banner, BlockLoading, Brand, Breadcrumb, Button, ButtonApp, Card, Checkbox, Color, ContextualButton, Countdown, DataTable, DatePicker, Display, Divider, DropdownContainer, DropdownItem, DropzoneFileUploader, EmptyTable, FormGroup, FormGroupButton, FormGroupLabel, FormLabel, Heading, HorizontalStepper, InfoPanel, Link, LiveSearch, MenuContainer, MenuItem, Modal, MonospaceBadge, Notification, P, PaginationBar, PickerCalendar, Pills, Popover, ProgressBar, ProgressCircle, Radio, ResizeableDiv, SegmentButtonGroup, SegmentButtonItem, SelectInput, SidebarContainer, SidebarItem, SidebarMenu, SidebarProfile, SimpleFileUploader, Slider, SortableHeadCell, Spinner, Tab, TabMenu, Table, TableBody, TableCell, TableFooterController, TableHead, TableHeaderController, TableRow, TableSearchInput, TagLabel, TagLabelInput, Text, TextArea, TextInput, Toaster, Toggle, Tooltip, _default as TreeItem, StepperItem as VerticalStepper, Window, YearPicker, cleanParams, formatDateTime, formatFileSize, getRelativeTime, highlightMatch, isEmptyFilterValue, isFilterActive, truncateText, useAppliedFilter, useDataTable, useDebounce, useFileTree, usePersistentState, useTableDataHandler };
|
|
1205
|
+
export type { DataTableAlign, DataTableColumn, DataTableColumnType, DataTableMode, DataTablePageState, DataTablePagination, DataTableProps, DataTableSearch, DataTableSort, DataTableSortConfig, DataTableSortOrder, DateTimeFormatType, HorizontalStepperProps, HorizontalStepperVariant, InfoPanelColor, InfoPanelProps, InfoPanelSize, InfoPanelVariant, NavbarHorizontalStepperProps, PersistentStorageType, SortableHeadCellProps, StandardHorizontalStepperProps, UseAppliedFilterOptions, UseAppliedFilterResult, UseDataTableOptions, UseDataTableResult, UsePersistentStateOptions };
|
package/package.json
CHANGED