zavadil-react-common 1.2.126 → 1.2.127
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/component/tables/TableWithSelect.d.ts +3 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.esm.js +1 -1
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/component/tables/AdvancedTable.tsx +36 -30
- package/src/component/tables/TableWithSelect.tsx +4 -4
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import React, {useCallback, useEffect, useMemo, useState} from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {ObjectUtil} from 'zavadil-ts-common';
|
|
3
3
|
import {AdvancedTable, AdvancedTableProps} from "./AdvancedTable";
|
|
4
4
|
import {RenderFunc, SelectableTableHeader, TableHeader} from "./TableTypes";
|
|
5
5
|
import {BsCheckAll} from "react-icons/bs";
|
|
6
6
|
import IconCheck from "../forms/IconCheck";
|
|
7
7
|
|
|
8
|
-
export type SelectableItem<T
|
|
8
|
+
export type SelectableItem<T> = {
|
|
9
9
|
selected: boolean;
|
|
10
10
|
item: T;
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
-
export type TableWithSelectProps<T
|
|
13
|
+
export type TableWithSelectProps<T> = Omit<AdvancedTableProps, 'header'> & {
|
|
14
14
|
showSelect?: boolean;
|
|
15
15
|
header: SelectableTableHeader<T>;
|
|
16
16
|
items?: Array<T>;
|
|
@@ -22,7 +22,7 @@ function createRenderer<T>(name: string): RenderFunc<T> {
|
|
|
22
22
|
return (e: T) => ObjectUtil.getNestedValue(e, name);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export function TableWithSelect<T
|
|
25
|
+
export function TableWithSelect<T>({
|
|
26
26
|
showSelect,
|
|
27
27
|
header,
|
|
28
28
|
items,
|