@loadsmart/loadsmart-ui 5.4.0 → 5.5.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/components/Table/Table.d.ts +9 -1
- package/dist/components/Table/Table.stories.d.ts +6 -0
- package/dist/components/Table/Table.types.d.ts +8 -0
- package/dist/index.js +76 -67
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Table/Table.stories.tsx +61 -0
- package/src/components/Table/Table.test.tsx +128 -0
- package/src/components/Table/Table.tsx +89 -12
- package/src/components/Table/Table.types.ts +9 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { useSelection } from './Selection';
|
|
3
3
|
import TableSortHandle from './TableSortHandle';
|
|
4
|
-
import type { TableProps, TableSectionProps, TableRowProps, TableCellProps, TableCaptionProps, TableSelectionProps, SelectionCellProps, TablePickerItemProps, TablePickerProps } from './Table.types';
|
|
4
|
+
import type { TableProps, TableSectionProps, TableRowProps, TableCellProps, TableCaptionProps, TableSelectionProps, SelectionCellProps, TablePickerItemProps, TablePickerProps, ExpandableTableRowProps } from './Table.types';
|
|
5
5
|
declare function Table<T>({ children, selection, scale, ...others }: TableProps<T>): JSX.Element;
|
|
6
6
|
declare namespace Table {
|
|
7
7
|
var Head: typeof TableHead;
|
|
@@ -16,6 +16,11 @@ declare namespace Table {
|
|
|
16
16
|
Cell: typeof SelectionCell;
|
|
17
17
|
HeadCell: typeof SelectionHeadCell;
|
|
18
18
|
};
|
|
19
|
+
var Expandable: {
|
|
20
|
+
HeadCell: typeof ExpandableHeadCell;
|
|
21
|
+
Cell: typeof ExpandableCell;
|
|
22
|
+
Row: typeof ExpandableTableRow;
|
|
23
|
+
};
|
|
19
24
|
var SortHandle: typeof TableSortHandle;
|
|
20
25
|
var Picker: typeof TablePicker;
|
|
21
26
|
}
|
|
@@ -25,7 +30,10 @@ declare function TableBody({ children, ...others }: TableSectionProps): JSX.Elem
|
|
|
25
30
|
declare function TableCell({ children, alignment, format, ...others }: TableCellProps): JSX.Element;
|
|
26
31
|
declare function SelectionCell<T>({ value, ...props }: SelectionCellProps<T>): JSX.Element;
|
|
27
32
|
declare function SelectionHeadCell<T>(props: SelectionCellProps<T>): JSX.Element;
|
|
33
|
+
declare function ExpandableHeadCell(props: TableCellProps): JSX.Element;
|
|
34
|
+
declare function ExpandableCell(props: TableCellProps): JSX.Element;
|
|
28
35
|
declare function TableRow({ children, ...others }: TableRowProps): JSX.Element;
|
|
36
|
+
declare function ExpandableTableRow({ index, expandableContent, expanded, leading: propsLeading, children, onExpandedChange, initialExpanded, ...others }: ExpandableTableRowProps): JSX.Element;
|
|
29
37
|
declare function TableHeadCell({ alignment, children, onClick, ...others }: TableCellProps): JSX.Element;
|
|
30
38
|
declare function TableSelectionActions({ buttons, children, ...others }: TableSelectionProps): JSX.Element;
|
|
31
39
|
declare function TablePickerItem<T>({ option, checked, children, ...props }: TablePickerItemProps<T>): JSX.Element;
|
|
@@ -29,6 +29,14 @@ export interface TableSectionProps extends HTMLAttributes<HTMLTableSectionElemen
|
|
|
29
29
|
scale?: Scale;
|
|
30
30
|
}
|
|
31
31
|
export declare type TableRowProps = HTMLAttributes<HTMLTableRowElement>;
|
|
32
|
+
export declare type ExpandableTableRowProps = TableRowProps & {
|
|
33
|
+
index: number;
|
|
34
|
+
expandableContent?: ReactNode;
|
|
35
|
+
leading?: ReactNode | ((expanded: boolean) => ReactNode);
|
|
36
|
+
initialExpanded?: boolean;
|
|
37
|
+
expanded?: boolean;
|
|
38
|
+
onExpandedChange?: (expanded: boolean) => void;
|
|
39
|
+
};
|
|
32
40
|
export interface TableCellProps extends HTMLAttributes<HTMLTableCellElement> {
|
|
33
41
|
alignment?: 'left' | 'right';
|
|
34
42
|
format?: 'default' | 'number' | 'currency';
|