@siyahi/ui 0.1.9-next.32 → 0.1.9-next.34
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/DESIGN.md +20 -7
- package/agents/examples/chart-panels-three.tsx +51 -0
- package/agents/examples/context-menu.tsx +14 -4
- package/agents/examples/overview-dashboard.tsx +2 -2
- package/agents/examples/{page-hero.tsx → page-header.tsx} +4 -4
- package/agents/examples/select.tsx +2 -1
- package/agents/manifest.json +16 -3
- package/dist/components/registry/charts/area-chart-card.d.ts +2 -2
- package/dist/components/registry/charts/area-chart-card.js +1 -0
- package/dist/components/registry/charts/bar-chart-card.d.ts +4 -4
- package/dist/components/registry/charts/bar-chart-card.js +0 -2
- package/dist/components/registry/charts/line-chart-card.d.ts +1 -1
- package/dist/components/registry/dashboard-01/section-cards.d.ts +4 -4
- package/dist/components/registry/dashboardcn/bar-list.d.ts +8 -8
- package/dist/components/registry/dashboardcn/distribution-bar.d.ts +11 -11
- package/dist/components/registry/dashboardcn/kpi-row-card.d.ts +4 -4
- package/dist/components/registry/dashboardcn/sparkline.d.ts +6 -6
- package/dist/components/registry/heatmap/calendar-heatmap.d.ts +50 -50
- package/dist/components/registry/heatmap/calendar-heatmap.js +1 -1
- package/dist/components/registry/heatmap/status-heatmap.d.ts +44 -44
- package/dist/components/registry/heatmap/status-heatmap.js +1 -1
- package/dist/components/registry/heatmap/weekday-heatmap.d.ts +53 -53
- package/dist/components/registry/heatmap/weekday-heatmap.js +1 -1
- package/dist/components/registry/minidev/copy-button.d.ts +2 -2
- package/dist/components/registry/niko-table/components/data-table-column-actions.d.ts +1 -1
- package/dist/components/registry/niko-table/components/data-table-column-filter.d.ts +1 -1
- package/dist/components/registry/niko-table/components/data-table-empty-state.d.ts +7 -7
- package/dist/components/registry/niko-table/components/data-table-faceted-filter.d.ts +5 -5
- package/dist/components/registry/niko-table/components/data-table-grouped-rows.d.ts +1 -1
- package/dist/components/registry/niko-table/components/data-table-row-context-menu-slot.d.ts +1 -1
- package/dist/components/registry/niko-table/components/data-table-row-context-menu.d.ts +1 -1
- package/dist/components/registry/niko-table/config/feature-detection.d.ts +13 -13
- package/dist/components/registry/niko-table/core/data-table-context.d.ts +5 -5
- package/dist/components/registry/niko-table/core/data-table-error-boundary.d.ts +3 -3
- package/dist/components/registry/niko-table/core/data-table-grouped-row.d.ts +2 -2
- package/dist/components/registry/niko-table/core/data-table-root.d.ts +36 -35
- package/dist/components/registry/niko-table/core/data-table-structure.d.ts +22 -22
- package/dist/components/registry/niko-table/core/data-table-structure.js +6 -0
- package/dist/components/registry/niko-table/core/data-table.d.ts +3 -3
- package/dist/components/registry/niko-table/core/data-table.js +1 -1
- package/dist/components/registry/niko-table/filters/table-column-actions.d.ts +5 -5
- package/dist/components/registry/niko-table/filters/table-column-sort.d.ts +6 -6
- package/dist/components/registry/niko-table/filters/table-column-sort.js +2 -2
- package/dist/components/registry/niko-table/filters/table-column-title.d.ts +2 -2
- package/dist/components/registry/niko-table/filters/table-faceted-filter.d.ts +9 -9
- package/dist/components/registry/niko-table/filters/table-faceted-filter.js +1 -1
- package/dist/components/registry/niko-table/filters/table-search-filter.d.ts +7 -7
- package/dist/components/registry/niko-table/hooks/use-generated-options.d.ts +7 -7
- package/dist/components/registry/niko-table/lib/build-faceted-options.d.ts +2 -2
- package/dist/components/registry/niko-table/lib/column-resize-handle.d.ts +3 -3
- package/dist/components/registry/niko-table/lib/column-resize-handle.js +1 -1
- package/dist/components/registry/niko-table/lib/create-scroll-handler.d.ts +4 -4
- package/dist/components/registry/niko-table/types/index.d.ts +29 -29
- package/dist/components/registry/sidebar-07/app-sidebar.d.ts +6 -5
- package/dist/components/registry/sidebar-07/nav-main.d.ts +4 -4
- package/dist/components/registry/sidebar-07/nav-user.js +16 -19
- package/dist/components/siyahi/callout.d.ts +1 -1
- package/dist/components/siyahi/change-bar.d.ts +3 -3
- package/dist/components/siyahi/change-grid.d.ts +6 -6
- package/dist/components/siyahi/data-bar.d.ts +2 -2
- package/dist/components/siyahi/data-list.d.ts +1 -1
- package/dist/components/siyahi/data-table-row-count.d.ts +1 -1
- package/dist/components/siyahi/data-table-sort-header.d.ts +1 -1
- package/dist/components/siyahi/delta.d.ts +2 -2
- package/dist/components/siyahi/drawdown-chart.d.ts +2 -2
- package/dist/components/siyahi/histogram-chart.d.ts +5 -5
- package/dist/components/siyahi/local-time.d.ts +1 -1
- package/dist/components/siyahi/{page-hero.d.ts → page-header.d.ts} +3 -3
- package/dist/components/siyahi/{page-hero.js → page-header.js} +4 -4
- package/dist/components/siyahi/page-section.d.ts +1 -1
- package/dist/components/siyahi/page-toc.d.ts +2 -2
- package/dist/components/siyahi/panel-grid.d.ts +7 -4
- package/dist/components/siyahi/panel-grid.js +1 -1
- package/dist/components/siyahi/price-chart.d.ts +1 -1
- package/dist/components/siyahi/range-position.d.ts +5 -5
- package/dist/components/siyahi/range-position.js +1 -1
- package/dist/components/siyahi/scale-toggle.d.ts +2 -2
- package/dist/components/siyahi/scatter-chart.d.ts +15 -15
- package/dist/components/siyahi/scatter-chart.js +14 -1
- package/dist/components/siyahi/siyahi-provider.d.ts +3 -2
- package/dist/components/siyahi/siyahi-provider.js +1 -4
- package/dist/components/siyahi/slope-chart.d.ts +4 -4
- package/dist/components/siyahi/status-alert.d.ts +1 -1
- package/dist/components/siyahi/status-badge.d.ts +1 -1
- package/dist/components/siyahi/target-rows.d.ts +6 -6
- package/dist/components/siyahi/target-rows.js +2 -2
- package/dist/components/siyahi/treemap.d.ts +8 -8
- package/dist/components/siyahi/treemap.js +0 -3
- package/dist/components/siyahi/waterfall-chart.d.ts +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/lib/chart-frame.d.ts +48 -20
- package/dist/lib/chart-frame.js +60 -30
- package/dist/lib/chart-marks.d.ts +2 -2
- package/dist/lib/chart-series.d.ts +25 -24
- package/dist/lib/format.d.ts +1 -1
- package/dist/lib/optional.d.ts +7 -0
- package/dist/lib/optional.js +0 -0
- package/dist/lib/scatter.d.ts +7 -7
- package/dist/lib/ticks.d.ts +9 -0
- package/dist/lib/ticks.js +25 -3
- package/dist/lib/treemap.d.ts +1 -1
- package/dist/lib/use-render-when-fonts-load.d.ts +11 -0
- package/dist/lib/use-render-when-fonts-load.js +49 -0
- package/package.json +2 -2
- package/report.css +1 -0
- package/styles/siyahi.css +51 -4
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { DataTableFeatures } from "../lib/data-table-features.js";
|
|
2
2
|
import { DataTableColumns, GlobalFilter } from "../types/index.js";
|
|
3
|
+
import { Optional } from "../../../../lib/optional.js";
|
|
3
4
|
import React from "react";
|
|
4
5
|
import { ColumnFiltersState, ColumnOrderState, ColumnVisibilityState, ExpandedState, GroupingState, PaginationState, ReactTable, RowData, RowSelectionState, SortingState, TableOptions, Updater } from "@tanstack/react-table";
|
|
5
6
|
//#region src/components/registry/niko-table/core/data-table-root.d.ts
|
|
6
7
|
export interface DataTableConfig {
|
|
7
|
-
enablePagination?: boolean;
|
|
8
|
-
enableFilters?: boolean;
|
|
9
|
-
enableSorting?: boolean;
|
|
10
|
-
enableRowSelection?: boolean;
|
|
11
|
-
enableMultiSort?: boolean;
|
|
12
|
-
enableGrouping?: boolean;
|
|
13
|
-
enableExpanding?: boolean;
|
|
8
|
+
enablePagination?: boolean | undefined;
|
|
9
|
+
enableFilters?: boolean | undefined;
|
|
10
|
+
enableSorting?: boolean | undefined;
|
|
11
|
+
enableRowSelection?: boolean | undefined;
|
|
12
|
+
enableMultiSort?: boolean | undefined;
|
|
13
|
+
enableGrouping?: boolean | undefined;
|
|
14
|
+
enableExpanding?: boolean | undefined;
|
|
14
15
|
/**
|
|
15
16
|
* Enable drag-to-resize column widths (opt-in; off by default so existing
|
|
16
17
|
* tables are unaffected). When on, columns render at `column.getSize()` and a
|
|
@@ -18,41 +19,41 @@ export interface DataTableConfig {
|
|
|
18
19
|
* `<DataTableColumnResize />` inside the root to enable via feature detection.
|
|
19
20
|
* Double-click a grip to autosize; columns opt out with `enableResizing: false`.
|
|
20
21
|
*/
|
|
21
|
-
enableColumnResizing?: boolean;
|
|
22
|
+
enableColumnResizing?: boolean | undefined;
|
|
22
23
|
/**
|
|
23
24
|
* When grouping is active, how grouped columns are placed in the column flow.
|
|
24
25
|
* TanStack default: `'reorder'` (move grouped columns to the start).
|
|
25
26
|
* `'remove'` hides them; `false` leaves them in place.
|
|
26
27
|
*/
|
|
27
|
-
groupedColumnMode?: false | "reorder" | "remove";
|
|
28
|
-
manualSorting?: boolean;
|
|
29
|
-
manualPagination?: boolean;
|
|
30
|
-
manualFiltering?: boolean;
|
|
31
|
-
pageCount?: number;
|
|
32
|
-
initialPageSize?: number;
|
|
33
|
-
initialPageIndex?: number;
|
|
34
|
-
autoResetPageIndex?: boolean;
|
|
35
|
-
autoResetExpanded?: boolean;
|
|
28
|
+
groupedColumnMode?: false | "reorder" | "remove" | undefined;
|
|
29
|
+
manualSorting?: boolean | undefined;
|
|
30
|
+
manualPagination?: boolean | undefined;
|
|
31
|
+
manualFiltering?: boolean | undefined;
|
|
32
|
+
pageCount?: number | undefined;
|
|
33
|
+
initialPageSize?: number | undefined;
|
|
34
|
+
initialPageIndex?: number | undefined;
|
|
35
|
+
autoResetPageIndex?: boolean | undefined;
|
|
36
|
+
autoResetExpanded?: boolean | undefined;
|
|
36
37
|
}
|
|
37
|
-
interface TableRootProps<TData extends RowData> extends Omit<
|
|
38
|
-
table?: ReactTable<DataTableFeatures, TData
|
|
39
|
-
columns?: DataTableColumns<TData
|
|
40
|
-
data?: TData[];
|
|
38
|
+
interface TableRootProps<TData extends RowData> extends Omit<Optional<TableOptions<DataTableFeatures, TData>>, "columns" | "data" | "getRowId" | "key"> {
|
|
39
|
+
table?: ReactTable<DataTableFeatures, TData> | undefined;
|
|
40
|
+
columns?: DataTableColumns<TData> | undefined;
|
|
41
|
+
data?: TData[] | undefined;
|
|
41
42
|
children: React.ReactNode;
|
|
42
|
-
className?: string;
|
|
43
|
-
config?: DataTableConfig;
|
|
44
|
-
getRowId?: (originalRow: TData, index: number) => string;
|
|
45
|
-
isLoading?: boolean;
|
|
46
|
-
onGlobalFilterChange?: (value: GlobalFilter) => void;
|
|
47
|
-
onPaginationChange?: (updater: Updater<PaginationState>) => void;
|
|
48
|
-
onSortingChange?: (updater: Updater<SortingState>) => void;
|
|
49
|
-
onColumnVisibilityChange?: (updater: Updater<ColumnVisibilityState>) => void;
|
|
50
|
-
onColumnFiltersChange?: (updater: Updater<ColumnFiltersState>) => void;
|
|
51
|
-
onRowSelectionChange?: (updater: Updater<RowSelectionState>) => void;
|
|
52
|
-
onExpandedChange?: (updater: Updater<ExpandedState>) => void;
|
|
53
|
-
onGroupingChange?: (updater: Updater<GroupingState>) => void;
|
|
54
|
-
onColumnOrderChange?: (updater: Updater<ColumnOrderState>) => void;
|
|
55
|
-
onRowSelection?: (selectedRows: TData[]) => void;
|
|
43
|
+
className?: string | undefined;
|
|
44
|
+
config?: DataTableConfig | undefined;
|
|
45
|
+
getRowId?: ((originalRow: TData, index: number) => string) | undefined;
|
|
46
|
+
isLoading?: boolean | undefined;
|
|
47
|
+
onGlobalFilterChange?: ((value: GlobalFilter) => void) | undefined;
|
|
48
|
+
onPaginationChange?: ((updater: Updater<PaginationState>) => void) | undefined;
|
|
49
|
+
onSortingChange?: ((updater: Updater<SortingState>) => void) | undefined;
|
|
50
|
+
onColumnVisibilityChange?: ((updater: Updater<ColumnVisibilityState>) => void) | undefined;
|
|
51
|
+
onColumnFiltersChange?: ((updater: Updater<ColumnFiltersState>) => void) | undefined;
|
|
52
|
+
onRowSelectionChange?: ((updater: Updater<RowSelectionState>) => void) | undefined;
|
|
53
|
+
onExpandedChange?: ((updater: Updater<ExpandedState>) => void) | undefined;
|
|
54
|
+
onGroupingChange?: ((updater: Updater<GroupingState>) => void) | undefined;
|
|
55
|
+
onColumnOrderChange?: ((updater: Updater<ColumnOrderState>) => void) | undefined;
|
|
56
|
+
onRowSelection?: ((selectedRows: TData[]) => void) | undefined;
|
|
56
57
|
}
|
|
57
58
|
export declare function DataTableRoot<TData extends RowData>({ table: externalTable, columns, data, children, className, isLoading, ...rest }: TableRootProps<TData>): React.JSX.Element;
|
|
58
59
|
export declare namespace DataTableRoot {
|
|
@@ -3,21 +3,21 @@ import React from "react";
|
|
|
3
3
|
import { RowData } from "@tanstack/react-table";
|
|
4
4
|
//#region src/components/registry/niko-table/core/data-table-structure.d.ts
|
|
5
5
|
export interface DataTableHeaderProps {
|
|
6
|
-
className?: string;
|
|
6
|
+
className?: string | undefined;
|
|
7
7
|
/**
|
|
8
8
|
* Makes the header sticky at the top when scrolling.
|
|
9
9
|
* @default true
|
|
10
10
|
*/
|
|
11
|
-
sticky?: boolean;
|
|
11
|
+
sticky?: boolean | undefined;
|
|
12
12
|
}
|
|
13
13
|
export declare const DataTableHeader: React.MemoExoticComponent<({ className, sticky }: DataTableHeaderProps) => React.JSX.Element | null>;
|
|
14
14
|
export interface DataTableBodyProps<TData extends RowData> {
|
|
15
15
|
children?: React.ReactNode;
|
|
16
|
-
className?: string;
|
|
17
|
-
onScroll?: (event: ScrollEvent) => void;
|
|
18
|
-
onScrolledTop?: () => void;
|
|
19
|
-
onScrolledBottom?: () => void;
|
|
20
|
-
scrollThreshold?: number;
|
|
16
|
+
className?: string | undefined;
|
|
17
|
+
onScroll?: ((event: ScrollEvent) => void) | undefined;
|
|
18
|
+
onScrolledTop?: (() => void) | undefined;
|
|
19
|
+
onScrolledBottom?: (() => void) | undefined;
|
|
20
|
+
scrollThreshold?: number | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* Click is dispatched per-row from each cell's onClick. The event's
|
|
23
23
|
* `currentTarget` is the `<td>` cell — typed as `HTMLElement` to
|
|
@@ -25,12 +25,12 @@ export interface DataTableBodyProps<TData extends RowData> {
|
|
|
25
25
|
* `<tbody>`). Consumers needing the row element can
|
|
26
26
|
* `event.target.closest("tr[data-row-id]")`.
|
|
27
27
|
*/
|
|
28
|
-
onRowClick?: (row: TData, event: React.MouseEvent<HTMLElement>) => void;
|
|
28
|
+
onRowClick?: ((row: TData, event: React.MouseEvent<HTMLElement>) => void) | undefined;
|
|
29
29
|
/**
|
|
30
30
|
* Return a per-row memo invalidation key. When this key changes for a
|
|
31
31
|
* specific row, only that row re-renders.
|
|
32
32
|
*/
|
|
33
|
-
getRowMemoKey?: (row: TData) => string;
|
|
33
|
+
getRowMemoKey?: ((row: TData) => string) | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* Attach a native right-click context menu to each row. Return the menu
|
|
36
36
|
* items (`ContextMenuItem`, `ContextMenuSeparator`, `ContextMenuSub`, …)
|
|
@@ -39,14 +39,14 @@ export interface DataTableBodyProps<TData extends RowData> {
|
|
|
39
39
|
*
|
|
40
40
|
* Wrap the callback in `useCallback` so memoized rows don't re-render.
|
|
41
41
|
*/
|
|
42
|
-
renderRowContextMenu?: (row: TData) => React.ReactNode;
|
|
42
|
+
renderRowContextMenu?: ((row: TData) => React.ReactNode) | undefined;
|
|
43
43
|
/**
|
|
44
44
|
* Mark the row that needs a look, such as a holding in deep loss: return
|
|
45
45
|
* `"negative"` or `"warning"` and the row takes a faint wash of that
|
|
46
46
|
* colour, as a `TableRow` with `data-tone` does; `undefined` leaves it
|
|
47
47
|
* plain. The page decides, never the sign. Mark one or two rows.
|
|
48
48
|
*/
|
|
49
|
-
getRowTone?: (row: TData) => "negative" | "warning" | undefined;
|
|
49
|
+
getRowTone?: ((row: TData) => "negative" | "warning" | undefined) | undefined;
|
|
50
50
|
}
|
|
51
51
|
export declare function DataTableBody<TData extends RowData>({ children, className, onScroll, onScrolledTop, onScrolledBottom, scrollThreshold, onRowClick, getRowMemoKey, renderRowContextMenu, getRowTone }: DataTableBodyProps<TData>): React.JSX.Element;
|
|
52
52
|
export declare namespace DataTableBody {
|
|
@@ -54,8 +54,8 @@ export declare namespace DataTableBody {
|
|
|
54
54
|
}
|
|
55
55
|
export interface DataTableEmptyBodyProps {
|
|
56
56
|
children?: React.ReactNode;
|
|
57
|
-
colSpan?: number;
|
|
58
|
-
className?: string;
|
|
57
|
+
colSpan?: number | undefined;
|
|
58
|
+
className?: string | undefined;
|
|
59
59
|
}
|
|
60
60
|
/**
|
|
61
61
|
* Empty state component for data tables.
|
|
@@ -86,16 +86,16 @@ export declare namespace DataTableEmptyBody {
|
|
|
86
86
|
}
|
|
87
87
|
export interface DataTableSkeletonProps {
|
|
88
88
|
children?: React.ReactNode;
|
|
89
|
-
colSpan?: number;
|
|
89
|
+
colSpan?: number | undefined;
|
|
90
90
|
/**
|
|
91
91
|
* Number of skeleton rows to display.
|
|
92
92
|
* @default 5
|
|
93
93
|
* @recommendation Set this to match your page size for better UX (e.g., if page size is 10, set rows={10})
|
|
94
94
|
*/
|
|
95
|
-
rows?: number;
|
|
96
|
-
className?: string;
|
|
97
|
-
cellClassName?: string;
|
|
98
|
-
skeletonClassName?: string;
|
|
95
|
+
rows?: number | undefined;
|
|
96
|
+
className?: string | undefined;
|
|
97
|
+
cellClassName?: string | undefined;
|
|
98
|
+
skeletonClassName?: string | undefined;
|
|
99
99
|
}
|
|
100
100
|
export declare function DataTableSkeleton({ children, colSpan, rows, className, cellClassName, skeletonClassName }: DataTableSkeletonProps): React.JSX.Element | null;
|
|
101
101
|
export declare namespace DataTableSkeleton {
|
|
@@ -103,8 +103,8 @@ export declare namespace DataTableSkeleton {
|
|
|
103
103
|
}
|
|
104
104
|
export interface DataTableLoadingProps {
|
|
105
105
|
children?: React.ReactNode;
|
|
106
|
-
colSpan?: number;
|
|
107
|
-
className?: string;
|
|
106
|
+
colSpan?: number | undefined;
|
|
107
|
+
className?: string | undefined;
|
|
108
108
|
}
|
|
109
109
|
export declare function DataTableLoading({ children, colSpan, className }: DataTableLoadingProps): React.JSX.Element | null;
|
|
110
110
|
export declare namespace DataTableLoading {
|
|
@@ -123,8 +123,8 @@ export interface DataTableLoadingMoreProps {
|
|
|
123
123
|
* customize the label per-table (e.g. "Loading more venues…").
|
|
124
124
|
*/
|
|
125
125
|
children?: React.ReactNode;
|
|
126
|
-
colSpan?: number;
|
|
127
|
-
className?: string;
|
|
126
|
+
colSpan?: number | undefined;
|
|
127
|
+
className?: string | undefined;
|
|
128
128
|
}
|
|
129
129
|
/**
|
|
130
130
|
* Composable "loading more" row for infinite-scroll tables. Renders
|
|
@@ -19,6 +19,10 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
19
19
|
import React from "react";
|
|
20
20
|
import { flexRender } from "@tanstack/react-table";
|
|
21
21
|
//#region src/components/registry/niko-table/core/data-table-structure.tsx
|
|
22
|
+
const ARIA_SORT = {
|
|
23
|
+
asc: "ascending",
|
|
24
|
+
desc: "descending"
|
|
25
|
+
};
|
|
22
26
|
const DataTableHeader = React.memo(function DataTableHeader({ className, sticky = true }) {
|
|
23
27
|
const { table, headerMinWidths, setColumnResizePreview, isCompact } = useDataTable();
|
|
24
28
|
const resizing = table?.options.enableColumnResizing ?? false;
|
|
@@ -39,8 +43,10 @@ const DataTableHeader = React.memo(function DataTableHeader({ className, sticky
|
|
|
39
43
|
}),
|
|
40
44
|
...getCommonPinningStyles(header.column, true, !isCompact)
|
|
41
45
|
};
|
|
46
|
+
const sorted = !header.isPlaceholder && header.column.getSortIndex() === 0 && header.column.getIsSorted();
|
|
42
47
|
return /* @__PURE__ */ jsxs(TableHead, {
|
|
43
48
|
"data-col-id": header.column.id,
|
|
49
|
+
"aria-sort": sorted ? ARIA_SORT[sorted] : void 0,
|
|
44
50
|
"data-numeric": header.column.columnDef.meta?.variant === "number" || void 0,
|
|
45
51
|
style: headerStyle,
|
|
46
52
|
className: cn(!isCompact && header.column.getIsPinned() && "bg-background", resizing && "relative overflow-hidden"),
|
|
@@ -8,20 +8,20 @@ export interface DataTableContainerProps extends React.AriaAttributes {
|
|
|
8
8
|
* and applied as inline styles to ensure scroll event callbacks work reliably.
|
|
9
9
|
* For other height utilities, use the height/maxHeight props directly.
|
|
10
10
|
*/
|
|
11
|
-
className?: string;
|
|
11
|
+
className?: string | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* Sets the height of the table container.
|
|
14
14
|
* When provided, enables vertical scrolling and allows DataTableBody/DataTableVirtualizedBody
|
|
15
15
|
* to use onScroll, onScrolledTop, and onScrolledBottom callbacks.
|
|
16
16
|
* Takes precedence over height utilities in className.
|
|
17
17
|
*/
|
|
18
|
-
height?: number | string;
|
|
18
|
+
height?: number | string | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Sets the maximum height of the table container.
|
|
21
21
|
* Defaults to the height value if not specified.
|
|
22
22
|
* Takes precedence over max-height utilities in className.
|
|
23
23
|
*/
|
|
24
|
-
maxHeight?: number | string;
|
|
24
|
+
maxHeight?: number | string | undefined;
|
|
25
25
|
}
|
|
26
26
|
export declare function DataTable({ children, className, height, maxHeight, "aria-label": label, "aria-labelledby": labelledBy }: DataTableContainerProps): React.JSX.Element;
|
|
27
27
|
export declare namespace DataTable {
|
|
@@ -117,7 +117,7 @@ function DataTable({ children, className, height, maxHeight, "aria-label": label
|
|
|
117
117
|
"aria-label": labelledBy ? void 0 : label,
|
|
118
118
|
"aria-labelledby": labelledBy,
|
|
119
119
|
tabIndex: 0,
|
|
120
|
-
className: cn("relative isolate w-full overflow-auto rounded-lg border", "[&::-webkit-scrollbar]:h-2.5 [&::-webkit-scrollbar]:w-2.5", "[&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:
|
|
120
|
+
className: cn("relative isolate w-full overflow-auto rounded-lg border", "[&::-webkit-scrollbar]:h-2.5 [&::-webkit-scrollbar]:w-2.5", "[&::-webkit-scrollbar-track]:bg-transparent", "[&::-webkit-scrollbar-thumb]:bg-border/40", "hover:[&::-webkit-scrollbar-thumb]:bg-border", "[&::-webkit-scrollbar-thumb:hover]:bg-border/80!", "scrollbar-thin scrollbar-thumb-border/40 scrollbar-track-transparent", "hover:scrollbar-thumb-border", parsed.safeClassName),
|
|
121
121
|
style: {
|
|
122
122
|
height: finalHeight,
|
|
123
123
|
maxHeight: finalMaxHeight
|
|
@@ -2,25 +2,25 @@ import React from "react";
|
|
|
2
2
|
//#region src/components/registry/niko-table/filters/table-column-actions.d.ts
|
|
3
3
|
export interface TableColumnActionsProps {
|
|
4
4
|
children: React.ReactNode;
|
|
5
|
-
className?: string;
|
|
5
|
+
className?: string | undefined;
|
|
6
6
|
/**
|
|
7
7
|
* Optional label shown at the top of the dropdown.
|
|
8
8
|
* @default "Column Actions"
|
|
9
9
|
*/
|
|
10
|
-
label?: string;
|
|
10
|
+
label?: string | undefined;
|
|
11
11
|
/**
|
|
12
12
|
* Whether to show a visual indicator when actions are active.
|
|
13
13
|
*/
|
|
14
|
-
isActive?: boolean;
|
|
14
|
+
isActive?: boolean | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Custom trigger element. If not provided, uses a MoreVertical icon button.
|
|
17
17
|
*/
|
|
18
|
-
trigger?: React.ReactElement;
|
|
18
|
+
trigger?: React.ReactElement | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* Alignment of the dropdown content.
|
|
21
21
|
* @default "end"
|
|
22
22
|
*/
|
|
23
|
-
align?: "start" | "center" | "end";
|
|
23
|
+
align?: "start" | "center" | "end" | undefined;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* A simple dropdown container for composing column actions.
|
|
@@ -15,10 +15,10 @@ import { RowData } from "@tanstack/react-table";
|
|
|
15
15
|
*/
|
|
16
16
|
export declare function TableColumnSortOptions<TData extends RowData, TValue>({ column, table: propTable, variant: propVariant, withSeparator }: {
|
|
17
17
|
column: DataTableColumn<TData, TValue>;
|
|
18
|
-
table?: DataTableInstance<TData
|
|
19
|
-
variant?: SortIconVariant;
|
|
18
|
+
table?: DataTableInstance<TData> | undefined;
|
|
19
|
+
variant?: SortIconVariant | undefined;
|
|
20
20
|
/** Whether to render a separator before the options. @default true */
|
|
21
|
-
withSeparator?: boolean;
|
|
21
|
+
withSeparator?: boolean | undefined;
|
|
22
22
|
}): React.JSX.Element;
|
|
23
23
|
export declare namespace TableColumnSortOptions {
|
|
24
24
|
var displayName: string;
|
|
@@ -41,9 +41,9 @@ export declare namespace TableColumnSortOptions {
|
|
|
41
41
|
*/
|
|
42
42
|
export declare function TableColumnSortMenu<TData extends RowData, TValue>({ column, table: propTable, variant: propVariant, className }: {
|
|
43
43
|
column: DataTableColumn<TData, TValue>;
|
|
44
|
-
table?: DataTableInstance<TData
|
|
45
|
-
variant?: SortIconVariant;
|
|
46
|
-
className?: string;
|
|
44
|
+
table?: DataTableInstance<TData> | undefined;
|
|
45
|
+
variant?: SortIconVariant | undefined;
|
|
46
|
+
className?: string | undefined;
|
|
47
47
|
}): React.JSX.Element | null;
|
|
48
48
|
export declare namespace TableColumnSortMenu {
|
|
49
49
|
var displayName: string;
|
|
@@ -82,7 +82,7 @@ function TableColumnSortOptions({ column, table: propTable, variant: propVariant
|
|
|
82
82
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
83
83
|
className: "flex items-center gap-2",
|
|
84
84
|
children: [/* @__PURE__ */ jsx("span", { children: "Column Sort" }), showSortBadge && /* @__PURE__ */ jsxs(Tooltip, { children: [/* @__PURE__ */ jsx(TooltipTrigger, {
|
|
85
|
-
render: /* @__PURE__ */ jsx("span", { className: "flex size-4 cursor-help items-center justify-center
|
|
85
|
+
render: /* @__PURE__ */ jsx("span", { className: "flex size-4 cursor-help items-center justify-center bg-primary text-[10px] font-medium text-primary-foreground" }),
|
|
86
86
|
children: sortIndex + 1
|
|
87
87
|
}), /* @__PURE__ */ jsx(TooltipContent, {
|
|
88
88
|
side: "right",
|
|
@@ -159,7 +159,7 @@ function TableColumnSortMenu({ column, table: propTable, variant: propVariant, c
|
|
|
159
159
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
160
160
|
className: "relative flex items-center justify-center",
|
|
161
161
|
children: [/* @__PURE__ */ jsx(SortIcon, { className: "size-4" }), showSortBadge && /* @__PURE__ */ jsx("span", {
|
|
162
|
-
className: "absolute -top-1 -right-2 flex size-3 items-center justify-center
|
|
162
|
+
className: "absolute -top-1 -right-2 flex size-3 items-center justify-center bg-primary text-[9px] text-primary-foreground",
|
|
163
163
|
children: sortIndex + 1
|
|
164
164
|
})]
|
|
165
165
|
}), /* @__PURE__ */ jsx("span", {
|
|
@@ -7,8 +7,8 @@ import { RowData } from "@tanstack/react-table";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare function TableColumnTitle<TData extends RowData, TValue>({ column, title, className, children }: {
|
|
9
9
|
column: DataTableColumn<TData, TValue>;
|
|
10
|
-
title?: string;
|
|
11
|
-
className?: string;
|
|
10
|
+
title?: string | undefined;
|
|
11
|
+
className?: string | undefined;
|
|
12
12
|
children?: React.ReactNode;
|
|
13
13
|
}): React.JSX.Element;
|
|
14
14
|
export declare namespace TableColumnTitle {
|
|
@@ -3,24 +3,24 @@ import * as React$1 from "react";
|
|
|
3
3
|
import { RowData } from "@tanstack/react-table";
|
|
4
4
|
//#region src/components/registry/niko-table/filters/table-faceted-filter.d.ts
|
|
5
5
|
export interface TableFacetedFilterProps<TData extends RowData, TValue> {
|
|
6
|
-
column?: DataTableColumn<TData, TValue
|
|
7
|
-
title?: string;
|
|
6
|
+
column?: DataTableColumn<TData, TValue> | undefined;
|
|
7
|
+
title?: string | undefined;
|
|
8
8
|
options: Option[];
|
|
9
|
-
multiple?: boolean;
|
|
9
|
+
multiple?: boolean | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* Callback fired when filter value changes
|
|
12
12
|
* Useful for server-side filtering or external state management
|
|
13
13
|
*/
|
|
14
|
-
onValueChange?: (value: string[] | undefined) => void;
|
|
14
|
+
onValueChange?: ((value: string[] | undefined) => void) | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Optional custom trigger element
|
|
17
17
|
*/
|
|
18
|
-
trigger?: React$1.ReactElement;
|
|
18
|
+
trigger?: React$1.ReactElement | undefined;
|
|
19
19
|
}
|
|
20
20
|
export declare function useTableFacetedFilter<TData extends RowData, TValue = unknown>({ column, onValueChange, multiple }: {
|
|
21
|
-
column?: DataTableColumn<TData, TValue
|
|
22
|
-
onValueChange?: (value: string[] | undefined) => void;
|
|
23
|
-
multiple?: boolean;
|
|
21
|
+
column?: DataTableColumn<TData, TValue> | undefined;
|
|
22
|
+
onValueChange?: ((value: string[] | undefined) => void) | undefined;
|
|
23
|
+
multiple?: boolean | undefined;
|
|
24
24
|
}): {
|
|
25
25
|
selectedValues: Set<any>;
|
|
26
26
|
onItemSelect: (option: Option, isSelected: boolean) => void;
|
|
@@ -31,7 +31,7 @@ export declare namespace TableFacetedFilter {
|
|
|
31
31
|
var displayName: string;
|
|
32
32
|
}
|
|
33
33
|
export declare function TableFacetedFilterContent({ title, options, selectedValues, onItemSelect, onReset }: {
|
|
34
|
-
title?: string;
|
|
34
|
+
title?: string | undefined;
|
|
35
35
|
options: Option[];
|
|
36
36
|
selectedValues: Set<string>;
|
|
37
37
|
onItemSelect: (option: Option, isSelected: boolean) => void;
|
|
@@ -107,7 +107,7 @@ function TableFacetedFilter({ column, title, options = [], multiple, onValueChan
|
|
|
107
107
|
children: [/* @__PURE__ */ jsx(PopoverTrigger, { render: trigger || /* @__PURE__ */ jsxs(Button, {
|
|
108
108
|
variant: "outline",
|
|
109
109
|
size: "sm",
|
|
110
|
-
className: "h-8
|
|
110
|
+
className: "h-8",
|
|
111
111
|
children: [
|
|
112
112
|
selectedValues?.size > 0 ? /* @__PURE__ */ jsx("div", {
|
|
113
113
|
role: "button",
|
|
@@ -4,13 +4,13 @@ import { RowData } from "@tanstack/react-table";
|
|
|
4
4
|
//#region src/components/registry/niko-table/filters/table-search-filter.d.ts
|
|
5
5
|
export interface TableSearchFilterProps<TData extends RowData> {
|
|
6
6
|
table: DataTableInstance<TData>;
|
|
7
|
-
className?: string;
|
|
8
|
-
placeholder?: string;
|
|
7
|
+
className?: string | undefined;
|
|
8
|
+
placeholder?: string | undefined;
|
|
9
9
|
/** The field's accessible name, such as "Filter holdings". */
|
|
10
|
-
label?: string;
|
|
11
|
-
showClearButton?: boolean;
|
|
12
|
-
onChange?: (value: string) => void;
|
|
13
|
-
value?: string;
|
|
10
|
+
label?: string | undefined;
|
|
11
|
+
showClearButton?: boolean | undefined;
|
|
12
|
+
onChange?: ((value: string) => void) | undefined;
|
|
13
|
+
value?: string | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Debounce ms before pushing the typed value into table state. The
|
|
16
16
|
* input reflects keystrokes immediately; only the call to
|
|
@@ -29,7 +29,7 @@ export interface TableSearchFilterProps<TData extends RowData> {
|
|
|
29
29
|
*
|
|
30
30
|
* @default 0
|
|
31
31
|
*/
|
|
32
|
-
debounceMs?: number;
|
|
32
|
+
debounceMs?: number | undefined;
|
|
33
33
|
}
|
|
34
34
|
export declare function TableSearchFilter<TData extends RowData>({ table, className, placeholder, label, showClearButton, onChange, value, debounceMs }: TableSearchFilterProps<TData>): React$1.JSX.Element;
|
|
35
35
|
export declare namespace TableSearchFilter {
|
|
@@ -6,36 +6,36 @@ export interface GenerateOptionsConfig {
|
|
|
6
6
|
* Whether to include counts for each option label
|
|
7
7
|
* @default true
|
|
8
8
|
*/
|
|
9
|
-
showCounts?: boolean;
|
|
9
|
+
showCounts?: boolean | undefined;
|
|
10
10
|
/**
|
|
11
11
|
* If true, recompute counts based on the filtered rows; otherwise use all core rows
|
|
12
12
|
* @default true
|
|
13
13
|
*/
|
|
14
|
-
dynamicCounts?: boolean;
|
|
14
|
+
dynamicCounts?: boolean | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* If true, only generate options from filtered rows. If false, generate from all rows.
|
|
17
17
|
* This controls which rows are used to generate the option list itself.
|
|
18
18
|
* Note: This is separate from dynamicCounts which controls count calculation.
|
|
19
19
|
* @default true
|
|
20
20
|
*/
|
|
21
|
-
limitToFilteredRows?: boolean;
|
|
21
|
+
limitToFilteredRows?: boolean | undefined;
|
|
22
22
|
/**
|
|
23
23
|
* Only generate options for these column ids (if provided)
|
|
24
24
|
*/
|
|
25
|
-
includeColumns?: string[];
|
|
25
|
+
includeColumns?: string[] | undefined;
|
|
26
26
|
/**
|
|
27
27
|
* Exclude these column ids from option generation
|
|
28
28
|
*/
|
|
29
|
-
excludeColumns?: string[];
|
|
29
|
+
excludeColumns?: string[] | undefined;
|
|
30
30
|
/**
|
|
31
31
|
* Optional cap on number of options per column (after sorting)
|
|
32
32
|
*/
|
|
33
|
-
limitPerColumn?: number;
|
|
33
|
+
limitPerColumn?: number | undefined;
|
|
34
34
|
/**
|
|
35
35
|
* Default merge strategy when a column does not provide meta.mergeStrategy.
|
|
36
36
|
* Column-level mergeStrategy still takes precedence.
|
|
37
37
|
*/
|
|
38
|
-
mergeStrategy?: "preserve" | "augment" | "replace";
|
|
38
|
+
mergeStrategy?: "preserve" | "augment" | "replace" | undefined;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Generate a map of options for select/multiSelect columns based on table data.
|
|
@@ -11,7 +11,7 @@ export interface BuildFacetedOptionsConfig {
|
|
|
11
11
|
* columns that are not declared as `select`/`multiSelect` variants but are
|
|
12
12
|
* still being used with a faceted filter (boolean, text, etc.).
|
|
13
13
|
*/
|
|
14
|
-
staticOptions?: Option[];
|
|
14
|
+
staticOptions?: Option[] | undefined;
|
|
15
15
|
/**
|
|
16
16
|
* Narrow the returned options to values that exist in rows passing every
|
|
17
17
|
* *other* active filter (the current column's own filter is excluded).
|
|
@@ -37,7 +37,7 @@ export interface BuildFacetedOptionsConfig {
|
|
|
37
37
|
* present. Receives the stringified row value, returns the display label.
|
|
38
38
|
* Ignored when `staticOptions` is provided.
|
|
39
39
|
*/
|
|
40
|
-
formatOptionLabel?: (value: string) => string;
|
|
40
|
+
formatOptionLabel?: ((value: string) => string) | undefined;
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
43
|
* Pure builder for the option list surfaced by a faceted filter. Handles
|
|
@@ -17,16 +17,16 @@ export interface DataTableColumnResizeHandleProps<TData extends RowData> {
|
|
|
17
17
|
* from the rendered width (no jump) and, on release, writes an explicit width
|
|
18
18
|
* — which pins the column and hands the fill to the next eligible column.
|
|
19
19
|
*/
|
|
20
|
-
isFlex?: boolean;
|
|
20
|
+
isFlex?: boolean | undefined;
|
|
21
21
|
/**
|
|
22
22
|
* Drive the resize preview line during a flex drag (from the DataTable
|
|
23
23
|
* context). Passed `{ resizingColumnId, deltaOffset }` while dragging, `null`
|
|
24
24
|
* on release.
|
|
25
25
|
*/
|
|
26
|
-
setResizePreview?: (info: {
|
|
26
|
+
setResizePreview?: ((info: {
|
|
27
27
|
resizingColumnId: string | null;
|
|
28
28
|
deltaOffset: number;
|
|
29
|
-
} | null) => void;
|
|
29
|
+
} | null) => void) | undefined;
|
|
30
30
|
}
|
|
31
31
|
export declare function DataTableColumnResizeHandle<TData extends RowData>({ header, isFlex, setResizePreview }: DataTableColumnResizeHandleProps<TData>): React$1.JSX.Element;
|
|
32
32
|
//#endregion
|
|
@@ -168,7 +168,7 @@ function DataTableColumnResizeHandle({ header, isFlex = false, setResizePreview
|
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
170
|
className: "group/resize absolute top-0 right-0 z-10 flex h-full w-2 cursor-col-resize touch-none justify-end outline-none select-none",
|
|
171
|
-
children: /* @__PURE__ */ jsx("div", { className: cn("my-1.5 w-px
|
|
171
|
+
children: /* @__PURE__ */ jsx("div", { className: cn("my-1.5 w-px bg-border opacity-0 transition-all", "group-hover/resize:my-0 group-hover/resize:w-0.5 group-hover/resize:bg-primary group-hover/resize:opacity-100", "group-focus-visible/resize:my-0 group-focus-visible/resize:w-0.5 group-focus-visible/resize:bg-primary group-focus-visible/resize:opacity-100", isResizing && "my-0 w-0.5 bg-primary opacity-100") })
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
//#endregion
|
|
@@ -27,9 +27,9 @@ export interface ScrollEvent {
|
|
|
27
27
|
* a `useEffect` already key on those callbacks via their own deps.
|
|
28
28
|
*/
|
|
29
29
|
export declare function createScrollHandler({ onScroll, onScrolledTop, onScrolledBottom, scrollThreshold }: {
|
|
30
|
-
onScroll?: (event: ScrollEvent) => void;
|
|
31
|
-
onScrolledTop?: () => void;
|
|
32
|
-
onScrolledBottom?: () => void;
|
|
33
|
-
scrollThreshold?: number;
|
|
30
|
+
onScroll?: ((event: ScrollEvent) => void) | undefined;
|
|
31
|
+
onScrolledTop?: (() => void) | undefined;
|
|
32
|
+
onScrolledBottom?: (() => void) | undefined;
|
|
33
|
+
scrollThreshold?: number | undefined;
|
|
34
34
|
}): (event: Event) => void;
|
|
35
35
|
//#endregion
|