@omniviewdev/base-ui 0.4.3 → 0.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/base-ui.css +1 -1
- package/dist/index.d.ts +45 -14
- package/dist/index.js +8451 -8326
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { Checkbox as Checkbox_2 } from '@base-ui/react/checkbox';
|
|
|
12
12
|
import { CheckboxGroup as CheckboxGroup_2 } from '@base-ui/react/checkbox-group';
|
|
13
13
|
import { ClipboardEvent as ClipboardEvent_2 } from 'react';
|
|
14
14
|
import { ColumnDef as ColumnDef_2 } from '@tanstack/react-table';
|
|
15
|
+
import { ColumnFiltersState } from '@tanstack/react-table';
|
|
15
16
|
import { ColumnOrderState } from '@tanstack/react-table';
|
|
16
17
|
import { ColumnPinningState } from '@tanstack/react-table';
|
|
17
18
|
import { ColumnSizingState } from '@tanstack/react-table';
|
|
@@ -42,6 +43,7 @@ import { FieldLabelProps } from '@base-ui/react';
|
|
|
42
43
|
import { FieldsetHTMLAttributes } from 'react';
|
|
43
44
|
import { FocusEvent as FocusEvent_2 } from 'react';
|
|
44
45
|
import { ForwardRefExoticComponent } from 'react';
|
|
46
|
+
import { GroupingState } from '@tanstack/react-table';
|
|
45
47
|
import { HTMLAttributes } from 'react';
|
|
46
48
|
import { ImgHTMLAttributes } from 'react';
|
|
47
49
|
import { Input as Input_2 } from '@base-ui/react/input';
|
|
@@ -1384,6 +1386,7 @@ export declare const DataTable: DataTableCompound;
|
|
|
1384
1386
|
declare const DataTableBody: ForwardRefExoticComponent<DataTableBodyProps & RefAttributes<HTMLTableSectionElement>>;
|
|
1385
1387
|
|
|
1386
1388
|
export declare interface DataTableBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
|
|
1389
|
+
/** Use DataTable.ExpansionToggle, or mark a custom disclosure with data-ov-expansion-toggle="". */
|
|
1387
1390
|
renderExpandedRow?: (row: unknown) => ReactNode;
|
|
1388
1391
|
}
|
|
1389
1392
|
|
|
@@ -1403,10 +1406,12 @@ declare type DataTableCompound = typeof DataTableRoot & {
|
|
|
1403
1406
|
Pagination: typeof DataTablePagination;
|
|
1404
1407
|
Empty: typeof DataTableEmpty;
|
|
1405
1408
|
Loading: typeof DataTableLoading;
|
|
1409
|
+
ExpansionToggle: typeof DataTableExpansionToggle;
|
|
1406
1410
|
};
|
|
1407
1411
|
|
|
1408
1412
|
declare const DataTableContainer: ForwardRefExoticComponent<DataTableContainerProps & RefAttributes<HTMLDivElement>>;
|
|
1409
1413
|
|
|
1414
|
+
/** Supply aria-label/aria-labelledby to name the viewport focus fallback. */
|
|
1410
1415
|
export declare interface DataTableContainerProps extends HTMLAttributes<HTMLDivElement> {
|
|
1411
1416
|
height?: number | string;
|
|
1412
1417
|
maxHeight?: number | string;
|
|
@@ -1428,6 +1433,17 @@ export declare interface DataTableEmptyProps extends HTMLAttributes<HTMLDivEleme
|
|
|
1428
1433
|
description?: string;
|
|
1429
1434
|
}
|
|
1430
1435
|
|
|
1436
|
+
/** Native Tab/Enter/Space behavior; does not turn the table into a grid. */
|
|
1437
|
+
declare function DataTableExpansionToggle<TData>({ row, label, getAccessibleLabel, className, children, disabled, onClick, ...props }: DataTableExpansionToggleProps<TData>): JSX.Element;
|
|
1438
|
+
|
|
1439
|
+
declare interface DataTableExpansionToggleProps<TData> extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'aria-label' | 'aria-expanded'> {
|
|
1440
|
+
row: Row<TData>;
|
|
1441
|
+
/** Row-specific accessible name, e.g. the displayed resource name. */
|
|
1442
|
+
label: string;
|
|
1443
|
+
/** Localize the complete accessible name; defaults to English Expand/Collapse plus label. */
|
|
1444
|
+
getAccessibleLabel?: (expanded: boolean, label: string) => string;
|
|
1445
|
+
}
|
|
1446
|
+
|
|
1431
1447
|
export declare interface DataTableFeatures {
|
|
1432
1448
|
sorting?: boolean;
|
|
1433
1449
|
filtering?: boolean;
|
|
@@ -1475,25 +1491,27 @@ export declare interface DataTableToolbarProps extends HTMLAttributes<HTMLDivEle
|
|
|
1475
1491
|
searchPlaceholder?: string;
|
|
1476
1492
|
}
|
|
1477
1493
|
|
|
1478
|
-
declare const DataTableVirtualBody:
|
|
1494
|
+
declare const DataTableVirtualBody: <TData = unknown>(props: DataTableVirtualBodyProps<TData> & RefAttributes<HTMLTableSectionElement>) => ReactElement | null;
|
|
1479
1495
|
|
|
1480
|
-
export declare interface DataTableVirtualBodyProps extends HTMLAttributes<HTMLTableSectionElement> {
|
|
1496
|
+
export declare interface DataTableVirtualBodyProps<TData = unknown> extends HTMLAttributes<HTMLTableSectionElement> {
|
|
1481
1497
|
estimateRowSize?: number;
|
|
1482
1498
|
overscan?: number;
|
|
1483
|
-
/**
|
|
1484
|
-
* When true, skips dynamic row measurement via `getBoundingClientRect`.
|
|
1485
|
-
* Use this when all rows have the same height (set via `estimateRowSize`)
|
|
1486
|
-
* to avoid forced reflow on mount — a significant perf win for large tables.
|
|
1487
|
-
*/
|
|
1499
|
+
/** Fixed parent-row height only. Expanded content is always dynamically measured. */
|
|
1488
1500
|
fixedRowHeight?: boolean;
|
|
1489
|
-
/**
|
|
1490
|
-
|
|
1501
|
+
/** Estimate for an unmeasured detail slot; actual asynchronous height is observed. */
|
|
1502
|
+
estimateExpandedRowSize?: number;
|
|
1491
1503
|
/**
|
|
1492
|
-
*
|
|
1493
|
-
*
|
|
1494
|
-
*
|
|
1504
|
+
* Same original-data slot as Body. Children mount only while expanded AND in
|
|
1505
|
+
* the virtual range. Retain query/cache ownership outside this component if
|
|
1506
|
+
* it must survive scrolling away. Collapse always removes the slot.
|
|
1507
|
+
* Use DataTable.ExpansionToggle for the disclosure. Custom disclosure buttons
|
|
1508
|
+
* need data-ov-expansion-toggle="" for parent-focus recovery after collapse.
|
|
1495
1509
|
*/
|
|
1496
|
-
|
|
1510
|
+
renderExpandedRow?: (original: TData) => ReactNode;
|
|
1511
|
+
/** Plain-cell pointer convenience; expose equivalent actions in native controls. */
|
|
1512
|
+
onRowClick?: (row: Row<TData>, event: MouseEvent_2<HTMLTableRowElement>) => void;
|
|
1513
|
+
/** Internal positioning and measurement attributes take precedence. */
|
|
1514
|
+
getRowProps?: (row: Row<TData>) => HTMLAttributes<HTMLTableRowElement>;
|
|
1497
1515
|
}
|
|
1498
1516
|
|
|
1499
1517
|
/**
|
|
@@ -4639,7 +4657,7 @@ export declare function useCommandListItem(store: CommandListStore, key: Key_2):
|
|
|
4639
4657
|
|
|
4640
4658
|
export declare function useCommandListStoreContext(): CommandListStore;
|
|
4641
4659
|
|
|
4642
|
-
export declare function useDataTable<TData =
|
|
4660
|
+
export declare function useDataTable<TData = unknown>(options: UseDataTableOptions<TData>): Table_2<TData>;
|
|
4643
4661
|
|
|
4644
4662
|
export declare function useDataTableContext(): DataTableContextValue;
|
|
4645
4663
|
|
|
@@ -4648,15 +4666,24 @@ export declare interface UseDataTableOptions<TData> {
|
|
|
4648
4666
|
columns: ColumnDef_2<TData, unknown>[];
|
|
4649
4667
|
features?: DataTableFeatures;
|
|
4650
4668
|
initialState?: Partial<TableState>;
|
|
4669
|
+
/** Controlled slices override internal state. Callbacks request host edits. */
|
|
4670
|
+
state?: Partial<TableState>;
|
|
4651
4671
|
getRowId?: (row: TData, index: number) => string;
|
|
4652
4672
|
getSubRows?: (row: TData) => TData[] | undefined;
|
|
4653
4673
|
getRowCanExpand?: (row: {
|
|
4654
4674
|
original: TData;
|
|
4655
4675
|
depth: number;
|
|
4656
4676
|
}) => boolean;
|
|
4677
|
+
getRowCanSelect?: (row: {
|
|
4678
|
+
original: TData;
|
|
4679
|
+
depth: number;
|
|
4680
|
+
}) => boolean;
|
|
4657
4681
|
persistenceKey?: string;
|
|
4658
4682
|
onRowSelectionChange?: (selection: RowSelectionState) => void;
|
|
4659
4683
|
onSortingChange?: (sorting: SortingState) => void;
|
|
4684
|
+
onGlobalFilterChange?: (filter: string) => void;
|
|
4685
|
+
onColumnFiltersChange?: (filters: ColumnFiltersState) => void;
|
|
4686
|
+
onGroupingChange?: (grouping: GroupingState) => void;
|
|
4660
4687
|
onColumnVisibilityChange?: (visibility: VisibilityState) => void;
|
|
4661
4688
|
onColumnOrderChange?: (order: ColumnOrderState) => void;
|
|
4662
4689
|
onColumnSizingChange?: (sizing: ColumnSizingState) => void;
|
|
@@ -4669,6 +4696,10 @@ export declare interface UseDataTableOptions<TData> {
|
|
|
4669
4696
|
manualSorting?: boolean;
|
|
4670
4697
|
manualFiltering?: boolean;
|
|
4671
4698
|
manualPagination?: boolean;
|
|
4699
|
+
/** Host-prepared groups/subrows are never regrouped in the browser. */
|
|
4700
|
+
manualGrouping?: boolean;
|
|
4701
|
+
manualExpanding?: boolean;
|
|
4702
|
+
rowCount?: number;
|
|
4672
4703
|
pageCount?: number;
|
|
4673
4704
|
globalFilterFn?: 'auto' | 'includesString' | 'includesStringSensitive';
|
|
4674
4705
|
}
|