@loadsmart/loadsmart-ui 5.3.2 → 5.5.1

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,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;
@@ -54,3 +54,9 @@ export declare namespace WithCustomRowSelection {
54
54
  };
55
55
  };
56
56
  }
57
+ export declare function WithExpandableRow(args: TableProps): JSX.Element;
58
+ export declare namespace WithExpandableRow {
59
+ var args: {
60
+ scale: string;
61
+ };
62
+ }
@@ -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';