@npm-questionpro/wick-ui-lib 1.36.1 → 1.37.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.
@@ -1,5 +1,5 @@
1
1
  import { default as React } from 'react';
2
- import { IWuManualSorting } from '../../types/IWuManualSorting';
2
+ import { IColumnDefaultSorting } from '../../types/IColumnDefaultSorting';
3
3
  import { IWuTableRowSelection } from '../../types/IWuRowSelection';
4
4
  import { IWuTableColumnDef } from '../../types/IWuTableColumnDef';
5
5
  export interface IWuDataTableProps<T> extends React.TableHTMLAttributes<HTMLTableElement> {
@@ -10,8 +10,8 @@ export interface IWuDataTableProps<T> extends React.TableHTMLAttributes<HTMLTabl
10
10
  size?: 'compact' | 'default';
11
11
  sort?: {
12
12
  enabled: boolean;
13
- onSort: (sort: IWuManualSorting) => void;
14
- defaultSort?: IWuManualSorting;
13
+ onSort: (sort: IColumnDefaultSorting) => void;
14
+ defaultSort?: IColumnDefaultSorting;
15
15
  };
16
16
  isLoading?: boolean;
17
17
  rowSelection?: IWuTableRowSelection<T>;
@@ -25,5 +25,6 @@ export interface IWuDataTableProps<T> extends React.TableHTMLAttributes<HTMLTabl
25
25
  maxHeight?: number;
26
26
  threshold?: number;
27
27
  };
28
+ tableLayout?: 'fixed' | 'auto';
28
29
  }
29
- 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;
30
+ export declare const WuDataTable: <T>({ data, columns, isLoading, variant, sort, size, rowSelection, HeaderAction, NoDataContent, stickyHeader, CustomLoader, caption, virtualization, isRowExpandable, tableLayout, style, className, ...props }: IWuDataTableProps<T>) => React.JSX.Element;
@@ -10,7 +10,7 @@ export interface IWuTableProps<T> extends React.TableHTMLAttributes<HTMLTableEle
10
10
  caption?: string;
11
11
  sort?: {
12
12
  enabled?: boolean;
13
- initial?: ColumnSort[];
13
+ defaultSort?: ColumnSort;
14
14
  };
15
15
  isLoading?: boolean;
16
16
  filterText?: string;
@@ -29,5 +29,6 @@ export interface IWuTableProps<T> extends React.TableHTMLAttributes<HTMLTableEle
29
29
  maxHeight?: number;
30
30
  threshold?: number;
31
31
  };
32
+ tableLayout?: 'fixed' | 'auto';
32
33
  }
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;
34
+ export declare const WuTable: <T>({ data, columns, variant, size, sort, filterText, pagination, stickyHeader, HeaderAction, CustomLoader, NoDataContent, isLoading, caption, rowSelection, isRowExpandable, virtualization, tableLayout, style, className, ...rest }: IWuTableProps<T>) => React.JSX.Element;
@@ -0,0 +1,4 @@
1
+ export interface IColumnDefaultSorting {
2
+ desc: boolean;
3
+ id: string;
4
+ }
@@ -4,7 +4,7 @@ export interface IWuTableRowSelection<T> {
4
4
  selectedRows: T[];
5
5
  onRowSelect: React.Dispatch<React.SetStateAction<T[]>>;
6
6
  rowUniqueKey: string;
7
- size?: number;
8
7
  isRowDisabled?: (row: T) => boolean;
9
8
  hideSelectAll?: boolean;
9
+ size?: number;
10
10
  }
@@ -1,11 +1,11 @@
1
1
  import { Table } from '@tanstack/react-table';
2
2
  import { default as React } from 'react';
3
- import { IWuManualSorting } from '../types/IWuManualSorting';
3
+ import { IColumnDefaultSorting } from '../types/IColumnDefaultSorting';
4
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;
8
- onSort?: (meta: IWuManualSorting) => void;
8
+ onSort?: (meta: IColumnDefaultSorting) => void;
9
9
  size?: "compact" | "default";
10
10
  isRowSelected?: boolean;
11
11
  HeaderAction?: React.ReactNode;
@@ -1,6 +1,6 @@
1
1
  import { Table } from '@tanstack/react-table';
2
2
  import { default as React } from 'react';
3
- import { IWuManualSorting } from '../types/IWuManualSorting';
3
+ import { IColumnDefaultSorting } from '../types/IColumnDefaultSorting';
4
4
  export interface IWuVirtualTableBodyProps<T> {
5
5
  table: Table<T>;
6
6
  size?: 'compact' | 'default';
@@ -10,6 +10,7 @@ export interface IWuVirtualTableBodyProps<T> {
10
10
  HeaderAction?: React.ReactNode;
11
11
  isRowSelected?: boolean;
12
12
  manual?: boolean;
13
- onSort?: (meta: IWuManualSorting) => void;
13
+ onSort?: (meta: IColumnDefaultSorting) => void;
14
+ tableLayout?: 'fixed' | 'auto';
14
15
  }
15
- export declare const WuVirtualTableBody: <T>({ table, size, isRowDisabled, containerHeight, sortableColumns, HeaderAction, isRowSelected, manual, onSort, }: IWuVirtualTableBodyProps<T>) => React.JSX.Element;
16
+ export declare const WuVirtualTableBody: <T>({ table, size, isRowDisabled, containerHeight, sortableColumns, HeaderAction, isRowSelected, manual, onSort, tableLayout, }: IWuVirtualTableBodyProps<T>) => React.JSX.Element;
@@ -39,8 +39,13 @@ export declare const MOCK_COLUMNS: ({
39
39
  } | {
40
40
  accessorKey: string;
41
41
  header: string;
42
- size: number;
43
42
  enableSorting: boolean;
43
+ size?: undefined;
44
+ } | {
45
+ accessorKey: string;
46
+ header: string;
47
+ size?: undefined;
48
+ enableSorting?: undefined;
44
49
  })[];
45
50
  export declare const EXTENDED_MOCK_COLUMNS: ({
46
51
  accessorKey: string;
@@ -58,14 +63,3 @@ export declare const EXTENDED_MOCK_COLUMNS: ({
58
63
  size: number;
59
64
  enableSorting?: undefined;
60
65
  })[];
61
- export declare const EXTENDED_MOCK_COLUMNS_SIZES: ({
62
- accessorKey: string;
63
- header: string;
64
- size: number;
65
- enableSorting: boolean;
66
- } | {
67
- accessorKey: string;
68
- header: string;
69
- size: number;
70
- enableSorting?: undefined;
71
- })[];
@@ -1,5 +1,5 @@
1
1
  export declare const getTableRowClasses: (isSelected: boolean, isDisabled: boolean) => string;
2
- export declare const getTableCellClasses: (columnId: string, size?: "compact" | "default", cellAlign?: "left" | "center" | "right", includeOverflow?: boolean) => string;
2
+ export declare const getTableCellClasses: (columnId: string, size?: "compact" | "default", cellAlign?: "left" | "center" | "right") => string;
3
3
  export declare const getHeaderHeightClass: (size?: "compact" | "default") => string;
4
4
  export declare const getHeaderAlignClasses: (headerAlign?: "left" | "center" | "right") => string;
5
5
  export declare const getSortIconAlignClasses: (headerAlign?: "left" | "center" | "right") => string;