@vendorflow/components 2.0.62 → 2.0.63
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/lib/components/material-ui/DataTable/Data.d.ts +1 -0
- package/lib/components/material-ui/DataTable/Data.js +1 -0
- package/lib/components/material-ui/DataTable/DataTable.d.ts +5 -1
- package/lib/components/material-ui/DataTable/DataTable.js +4 -0
- package/lib/components/material-ui/DataTable/DataTable.story.js +3 -0
- package/package.json +1 -1
|
@@ -30,6 +30,7 @@ exports.Columns = [
|
|
|
30
30
|
__assign({ Header: 'Company', id: 'company', accessor: function (originalRow) { return originalRow.company.name; }, disableFilters: false }, (0, DataTable_1.getColumnFilterConfig)('select')),
|
|
31
31
|
];
|
|
32
32
|
exports.Data = new Array(20).fill(null).map(function () { return ({
|
|
33
|
+
id: faker_1.default.datatype.uuid(),
|
|
33
34
|
firstName: faker_1.default.name.firstName(),
|
|
34
35
|
lastName: faker_1.default.name.lastName(),
|
|
35
36
|
age: faker_1.default.datatype.number(60),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Column, UseSortByColumnProps, HeaderGroup, UseSortByOptions, TableOptions, UseSortByColumnOptions, PluginHook, UsePaginationOptions, UseSortByInstanceProps, UsePaginationInstanceProps, TableInstance, TableState, UseSortByState, UsePaginationState, UseRowSelectOptions, UseRowSelectInstanceProps, UseRowSelectState, Row, UseRowSelectRowProps, UseExpandedOptions, UseExpandedInstanceProps, UseExpandedState, UseExpandedRowProps, UseGlobalFiltersInstanceProps, UseGlobalFiltersState, UseFiltersOptions, UseFiltersInstanceProps, UseFiltersState, UseFiltersColumnOptions, UseFiltersColumnProps, Renderer, FilterProps } from 'react-table';
|
|
1
|
+
import { Column, UseSortByColumnProps, HeaderGroup, UseSortByOptions, TableOptions, UseSortByColumnOptions, PluginHook, UsePaginationOptions, UseSortByInstanceProps, UsePaginationInstanceProps, TableInstance, TableState, UseSortByState, UsePaginationState, UseRowSelectOptions, UseRowSelectInstanceProps, UseRowSelectState, Row, UseRowSelectRowProps, UseExpandedOptions, UseExpandedInstanceProps, UseExpandedState, UseExpandedRowProps, UseGlobalFiltersInstanceProps, UseGlobalFiltersState, UseFiltersOptions, UseFiltersInstanceProps, UseFiltersState, UseFiltersColumnOptions, UseFiltersColumnProps, Renderer, FilterProps, UseTableOptions } from 'react-table';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
export declare type Mode = 'single' | 'multi';
|
|
4
4
|
export declare type CustomColumnConfigProps<D extends object> = {
|
|
@@ -22,6 +22,7 @@ export interface TableFeatureOptions<D extends object> {
|
|
|
22
22
|
Component: (props: {
|
|
23
23
|
data: D;
|
|
24
24
|
}) => JSX.Element;
|
|
25
|
+
autoResetExpanded?: boolean;
|
|
25
26
|
};
|
|
26
27
|
filters?: {
|
|
27
28
|
enabled: boolean;
|
|
@@ -45,6 +46,9 @@ export interface TableFeatureOptions<D extends object> {
|
|
|
45
46
|
sorting?: {
|
|
46
47
|
enabled: boolean;
|
|
47
48
|
};
|
|
49
|
+
table?: {
|
|
50
|
+
getRowId?: UseTableOptions<D>['getRowId'];
|
|
51
|
+
};
|
|
48
52
|
}
|
|
49
53
|
interface Props<D extends object> {
|
|
50
54
|
title?: string;
|
|
@@ -298,7 +298,11 @@ function useDefaultTableInstance(_a) {
|
|
|
298
298
|
});
|
|
299
299
|
}
|
|
300
300
|
}
|
|
301
|
+
var getRowId = ((options === null || options === void 0 ? void 0 : options.table) || {}).getRowId;
|
|
302
|
+
var _e = ((options === null || options === void 0 ? void 0 : options.rowExpanding) || {}).autoResetExpanded, autoResetExpanded = _e === void 0 ? true : _e;
|
|
301
303
|
return react_table_1.useTable.apply(void 0, __spreadArray([{
|
|
304
|
+
autoResetExpanded: autoResetExpanded,
|
|
305
|
+
getRowId: getRowId,
|
|
302
306
|
columns: columns,
|
|
303
307
|
data: data,
|
|
304
308
|
filterTypes: filterTypes,
|
|
@@ -54,6 +54,9 @@ function DataTable() {
|
|
|
54
54
|
sorting: {
|
|
55
55
|
enabled: true,
|
|
56
56
|
},
|
|
57
|
+
table: {
|
|
58
|
+
getRowId: function (person) { return person.id; },
|
|
59
|
+
},
|
|
57
60
|
};
|
|
58
61
|
var instance = (0, DataTable_1.useDefaultTableInstance)({ columns: columns, data: data, options: options });
|
|
59
62
|
return (react_1.default.createElement(material_1.ThemeProvider, { theme: (0, material_1.createTheme)() },
|