@npm-questionpro/wick-ui-lib 1.34.0 → 1.35.2

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.
@@ -32,5 +32,7 @@ export type IWuComboboxProps<T> = Omit<React.ButtonHTMLAttributes<HTMLButtonElem
32
32
  onScroll?: React.UIEventHandler<HTMLDivElement>;
33
33
  enableSearch?: boolean;
34
34
  noDataContent?: React.ReactNode;
35
+ /** @description This is an experimental flag. It might have performance impact. Please use at your own risk. */
36
+ selectedToTop?: boolean;
35
37
  };
36
- export declare const WuCombobox: <T>({ data, accessorKey, value, defaultValue, Header, virtualizedThreshold, isEllipse, placeholder, variant, dir, onSelect, Label, maxHeight, multiple, hasGroup, selectAll, id, disabled, labelPosition, className, onScroll, maxContentWidth, enableSearch, noDataContent, ...rest }: IWuComboboxProps<T>) => React.JSX.Element;
38
+ export declare const WuCombobox: <T>({ data, accessorKey, value, defaultValue, Header, virtualizedThreshold, isEllipse, placeholder, variant, dir, onSelect, Label, maxHeight, multiple, hasGroup, selectAll, id, disabled, labelPosition, className, onScroll, maxContentWidth, enableSearch, noDataContent, selectedToTop, ...rest }: IWuComboboxProps<T>) => React.JSX.Element;
@@ -27,5 +27,7 @@ export type IWuSelectProps<T> = Omit<React.ButtonHTMLAttributes<HTMLButtonElemen
27
27
  };
28
28
  labelPosition?: 'left' | 'top' | 'right';
29
29
  onScroll?: React.UIEventHandler<HTMLDivElement>;
30
+ /** @description This is an experimental flag. It might have performance impact. Please use at your own risk. */
31
+ selectedToTop?: boolean;
30
32
  };
31
- export declare const WuSelect: <T>({ data, onSelect, multiple, defaultValue, value: controlledValue, accessorKey, variant, dir, placeholder, Label, virtualizedThreshold, maxHeight, hasGroup, Header, CustomTrigger, selectAll, disabled, labelPosition, onScroll, maxContentWidth, ...rest }: IWuSelectProps<T>) => React.JSX.Element;
33
+ export declare const WuSelect: <T>({ data, onSelect, multiple, defaultValue, value: controlledValue, accessorKey, variant, dir, placeholder, Label, virtualizedThreshold, maxHeight, hasGroup, Header, CustomTrigger, selectAll, disabled, labelPosition, onScroll, maxContentWidth, selectedToTop, ...rest }: IWuSelectProps<T>) => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ export declare const useSortedSelectOptions: <T>(selectedToTop: boolean, data: T[], selectedItems: T | T[] | null | undefined, accessorKey: {
2
+ value: string;
3
+ label: string;
4
+ }) => T[];
@@ -18,10 +18,11 @@ export interface IWuDataTableProps<T> extends React.TableHTMLAttributes<HTMLTabl
18
18
  HeaderAction?: React.ReactNode;
19
19
  NoDataContent?: React.ReactNode;
20
20
  stickyHeader?: boolean;
21
+ isRowExpandable?: boolean;
21
22
  virtualization?: {
22
23
  enabled: boolean;
23
24
  maxHeight?: number;
24
25
  threshold?: number;
25
26
  };
26
27
  }
27
- export declare const WuDataTable: <T>({ data, columns, isLoading, variant, sort, size, rowSelection, HeaderAction, NoDataContent, stickyHeader, CustomLoader, caption, virtualization, ...props }: IWuDataTableProps<T>) => React.JSX.Element;
28
+ export declare const WuDataTable: <T>({ data, columns, isLoading, variant, sort, size, rowSelection, HeaderAction, NoDataContent, stickyHeader, CustomLoader, caption, virtualization, isRowExpandable, ...props }: IWuDataTableProps<T>) => React.JSX.Element;
@@ -23,10 +23,11 @@ export interface IWuTableProps<T> extends React.TableHTMLAttributes<HTMLTableEle
23
23
  CustomLoader?: React.ReactNode;
24
24
  NoDataContent?: React.ReactNode;
25
25
  rowSelection?: IWuTableRowSelection<T>;
26
+ isRowExpandable?: boolean;
26
27
  virtualization?: {
27
28
  enabled: boolean;
28
29
  maxHeight?: number;
29
30
  threshold?: number;
30
31
  };
31
32
  }
32
- export declare const WuTable: <T>({ data, columns, variant, size, sort, filterText, pagination, stickyHeader, HeaderAction, CustomLoader, NoDataContent, isLoading, caption, rowSelection, virtualization, ...rest }: IWuTableProps<T>) => React.JSX.Element;
33
+ export declare const WuTable: <T>({ data, columns, variant, size, sort, filterText, pagination, stickyHeader, HeaderAction, CustomLoader, NoDataContent, isLoading, caption, rowSelection, isRowExpandable, virtualization, ...rest }: IWuTableProps<T>) => React.JSX.Element;
@@ -1,8 +1,10 @@
1
- import { ColumnDef } from '@tanstack/react-table';
1
+ import { ColumnDef, Row } from '@tanstack/react-table';
2
+ import { default as React } from 'react';
2
3
  export type IWuTableColumnDef<Data> = ColumnDef<Data> & {
3
4
  accessorKey: string;
4
5
  filterable?: boolean;
5
6
  columns?: IWuTableColumnDef<Data>[];
6
7
  headerAlign?: 'left' | 'right' | 'center';
7
8
  cellAlign?: 'left' | 'right' | 'center';
9
+ expandableRowContent?: (row: Row<Data>) => React.ReactNode;
8
10
  };
@@ -7,6 +7,7 @@ interface IWuTableBodyProps<T> {
7
7
  isLoading?: boolean;
8
8
  CustomLoader?: React.ReactNode;
9
9
  isRowDisabled?: (row: T) => boolean;
10
+ isRowExpandable?: boolean;
10
11
  }
11
- export declare const WuTableBody: <T>({ table, size, NoDataContent, isLoading, CustomLoader, isRowDisabled, }: IWuTableBodyProps<T>) => React.JSX.Element;
12
+ export declare const WuTableBody: <T>({ table, size, NoDataContent, isLoading, CustomLoader, isRowDisabled, isRowExpandable, }: IWuTableBodyProps<T>) => React.JSX.Element;
12
13
  export {};
@@ -1,7 +1,7 @@
1
1
  import { Table } from '@tanstack/react-table';
2
2
  import { default as React } from 'react';
3
3
  import { IWuManualSorting } from '../types/IWuManualSorting';
4
- export declare const WuTableHeader: <T>({ table, sortableColumns, manual, onSort, size, isRowSelected, HeaderAction, isStickyHeader, asVirtualContent, }: {
4
+ export declare const WuTableHeader: <T>({ table, sortableColumns, manual, onSort, size, isRowSelected, HeaderAction, isStickyHeader, asVirtualContent, isRowExpandable, }: {
5
5
  table: Table<T>;
6
6
  sortableColumns: string[];
7
7
  manual?: boolean;
@@ -11,4 +11,5 @@ export declare const WuTableHeader: <T>({ table, sortableColumns, manual, onSort
11
11
  HeaderAction?: React.ReactNode;
12
12
  isStickyHeader?: boolean;
13
13
  asVirtualContent?: boolean;
14
+ isRowExpandable?: boolean;
14
15
  }) => React.JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Column, Row } from '@tanstack/react-table';
2
+ import { default as React } from 'react';
3
+ import { IWuTableColumnDef } from '../types/IWuTableColumnDef';
4
+ export declare const EXPANDER_COLUMN_SIZE = 48;
5
+ export declare const EXPANDER_COLUMN_ID = "expander";
6
+ export declare function createExpanderColumn<T>(isRowExpandable: boolean | undefined, finalColumns: IWuTableColumnDef<T>[]): IWuTableColumnDef<T>[];
7
+ export declare function getExpandedContent<T>(row: Row<T>, columns: Column<T>[]): React.ReactNode | undefined;
8
+ export declare function shouldVirtualizeTable(enabled: boolean | undefined, threshold: number | undefined, dataLength: number): boolean;