@bluemarble/bm-components 0.0.81 → 0.0.82
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.
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { ColumnsProps } from '../BaseGrid';
|
|
2
2
|
import { FilterProps } from './useFilter';
|
|
3
|
+
interface SearchOptions {
|
|
4
|
+
caseSensitive?: boolean;
|
|
5
|
+
exact?: boolean;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
3
8
|
interface UseGridProps {
|
|
4
9
|
columns: ColumnsProps[];
|
|
5
10
|
filters?: FilterProps[];
|
|
6
11
|
rowsPerPageOptions?: number[];
|
|
12
|
+
search?: SearchOptions;
|
|
7
13
|
}
|
|
8
|
-
export declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions }: UseGridProps): {
|
|
14
|
+
export declare function useGrid<T extends Record<string, any>>({ columns, filters, search, rowsPerPageOptions }: UseGridProps): {
|
|
9
15
|
data: T[];
|
|
10
16
|
set: (data: T[]) => void;
|
|
11
17
|
onSortBy: (prop: string) => void;
|
package/dist/index.d.ts
CHANGED
|
@@ -245,12 +245,18 @@ declare function createFilter<T extends Record<string, any>>(filters: FilterProp
|
|
|
245
245
|
apply: (item: T) => boolean;
|
|
246
246
|
};
|
|
247
247
|
|
|
248
|
+
interface SearchOptions {
|
|
249
|
+
caseSensitive?: boolean;
|
|
250
|
+
exact?: boolean;
|
|
251
|
+
value: string;
|
|
252
|
+
}
|
|
248
253
|
interface UseGridProps {
|
|
249
254
|
columns: ColumnsProps[];
|
|
250
255
|
filters?: FilterProps[];
|
|
251
256
|
rowsPerPageOptions?: number[];
|
|
257
|
+
search?: SearchOptions;
|
|
252
258
|
}
|
|
253
|
-
declare function useGrid<T extends Record<string, any>>({ columns, filters, rowsPerPageOptions }: UseGridProps): {
|
|
259
|
+
declare function useGrid<T extends Record<string, any>>({ columns, filters, search, rowsPerPageOptions }: UseGridProps): {
|
|
254
260
|
data: T[];
|
|
255
261
|
set: (data: T[]) => void;
|
|
256
262
|
onSortBy: (prop: string) => void;
|