@uipath/apollo-vertex 1.2.0 → 1.4.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/lib/i18n.d.ts +10 -0
- package/dist/lib/table-features.d.ts +38 -0
- package/dist/lib/table-features.js +32 -0
- package/dist/locales/en.json +5 -0
- package/dist/registry/calendar/calendar.js +2 -2
- package/dist/registry/command/command.js +3 -0
- package/dist/registry/confidence-signal/confidence-signal-chip.js +1 -1
- package/dist/registry/data-table/data-table-column-header.d.ts +5 -4
- package/dist/registry/data-table/data-table-column-header.js +21 -18
- package/dist/registry/data-table/data-table-expand-toggle.d.ts +5 -4
- package/dist/registry/data-table/data-table-expand-toggle.js +1 -1
- package/dist/registry/data-table/data-table-filters.d.ts +4 -3
- package/dist/registry/data-table/data-table-filters.js +4 -4
- package/dist/registry/data-table/data-table-pagination.d.ts +5 -4
- package/dist/registry/data-table/data-table-pagination.js +2 -3
- package/dist/registry/data-table/data-table-search.d.ts +5 -4
- package/dist/registry/data-table/data-table-search.js +2 -2
- package/dist/registry/data-table/data-table-toolbar.d.ts +5 -4
- package/dist/registry/data-table/data-table-view-options.d.ts +5 -4
- package/dist/registry/data-table/data-table-view-options.js +2 -2
- package/dist/registry/data-table/data-table.d.ts +13 -12
- package/dist/registry/data-table/data-table.js +9 -12
- package/dist/registry/data-table/index.d.ts +3 -2
- package/dist/registry/data-table/index.js +1 -1
- package/dist/registry/filter-dropdown/filter-dropdown.d.ts +4 -4
- package/dist/registry/filter-dropdown/filter-dropdown.js +1 -1
- package/dist/registry/shell/shell-company.js +2 -1
- package/dist/registry/shell/shell-locale-provider.d.ts +2 -1
- package/dist/registry/shell/shell-locale-provider.js +12 -8
- package/dist/registry/shell/shell-minimal-nav-item.d.ts +4 -3
- package/dist/registry/shell/shell-minimal-nav-item.js +3 -7
- package/dist/registry/shell/shell-nav-active.d.ts +12 -0
- package/dist/registry/shell/shell-nav-active.js +24 -0
- package/dist/registry/shell/shell-nav-label.d.ts +7 -0
- package/dist/registry/shell/shell-nav-label.js +54 -0
- package/dist/registry/shell/shell-sidebar.js +126 -114
- package/dist/registry/shell/shell-text.d.ts +2 -2
- package/dist/registry/shell/shell-text.js +3 -2
- package/dist/registry/shell/shell-translation-key.d.ts +5 -0
- package/dist/registry/shell/shell.d.ts +6 -3
- package/dist/registry/shell/shell.js +18 -13
- package/dist/registry/solution-tests/config.d.ts +5 -5
- package/dist/registry/solution-tests/solution-tests-view.js +1 -1
- package/dist/registry/table-chart/table-chart-view.js +9 -5
- package/dist/registry/timeline/timeline-marker.js +2 -2
- package/dist/registry/use-data-table/types.d.ts +3 -2
- package/dist/registry/use-data-table/useColumnVisibility.d.ts +3 -3
- package/dist/registry/use-data-table/useDataTable.d.ts +8 -7
- package/dist/registry/use-data-table/useEntityColumns.d.ts +2 -2
- package/dist/registry/use-data-table/useEntityDataTable.d.ts +3 -3
- package/package.json +2 -2
- package/skills/setup/SKILL.md +123 -0
- package/dist/registry/use-data-table/useReactTableCompat.d.ts +0 -13
- package/dist/registry/use-data-table/useReactTableCompat.js +0 -9
package/dist/lib/i18n.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ declare const localeLoaders: {
|
|
|
6
6
|
access_denied: string;
|
|
7
7
|
access_denied_description: string;
|
|
8
8
|
actions: string;
|
|
9
|
+
active: string;
|
|
9
10
|
actual_input: string;
|
|
10
11
|
actual_output: string;
|
|
11
12
|
add_attachment: string;
|
|
@@ -27,6 +28,7 @@ declare const localeLoaders: {
|
|
|
27
28
|
analytics: string;
|
|
28
29
|
apollo_vertex: string;
|
|
29
30
|
apollo_vertex_description: string;
|
|
31
|
+
archive: string;
|
|
30
32
|
are_you_sure: string;
|
|
31
33
|
asc: string;
|
|
32
34
|
ask_ai: string;
|
|
@@ -189,6 +191,8 @@ declare const localeLoaders: {
|
|
|
189
191
|
more_pages: string;
|
|
190
192
|
multi_line_too_few_metrics: string;
|
|
191
193
|
my_template: string;
|
|
194
|
+
nav_collapse: string;
|
|
195
|
+
nav_expand: string;
|
|
192
196
|
need_help: string;
|
|
193
197
|
new_conversation: string;
|
|
194
198
|
new_conversation_confirm_description: string;
|
|
@@ -277,6 +281,7 @@ declare const localeLoaders: {
|
|
|
277
281
|
scroll_to_bottom: string;
|
|
278
282
|
search: string;
|
|
279
283
|
search_frameworks: string;
|
|
284
|
+
search_input: string;
|
|
280
285
|
secondary: string;
|
|
281
286
|
select_a_framework: string;
|
|
282
287
|
select_all: string;
|
|
@@ -372,6 +377,7 @@ declare const localeLoaders: {
|
|
|
372
377
|
access_denied: string;
|
|
373
378
|
access_denied_description: string;
|
|
374
379
|
actions: string;
|
|
380
|
+
active: string;
|
|
375
381
|
actual_input: string;
|
|
376
382
|
actual_output: string;
|
|
377
383
|
add_attachment: string;
|
|
@@ -393,6 +399,7 @@ declare const localeLoaders: {
|
|
|
393
399
|
analytics: string;
|
|
394
400
|
apollo_vertex: string;
|
|
395
401
|
apollo_vertex_description: string;
|
|
402
|
+
archive: string;
|
|
396
403
|
are_you_sure: string;
|
|
397
404
|
asc: string;
|
|
398
405
|
ask_ai: string;
|
|
@@ -555,6 +562,8 @@ declare const localeLoaders: {
|
|
|
555
562
|
more_pages: string;
|
|
556
563
|
multi_line_too_few_metrics: string;
|
|
557
564
|
my_template: string;
|
|
565
|
+
nav_collapse: string;
|
|
566
|
+
nav_expand: string;
|
|
558
567
|
need_help: string;
|
|
559
568
|
new_conversation: string;
|
|
560
569
|
new_conversation_confirm_description: string;
|
|
@@ -643,6 +652,7 @@ declare const localeLoaders: {
|
|
|
643
652
|
scroll_to_bottom: string;
|
|
644
653
|
search: string;
|
|
645
654
|
search_frameworks: string;
|
|
655
|
+
search_input: string;
|
|
646
656
|
secondary: string;
|
|
647
657
|
select_a_framework: string;
|
|
648
658
|
select_all: string;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type Column, type ColumnDef, type FilterFn, type ReactTable, type Row, type RowData } from "@tanstack/react-table";
|
|
2
|
+
export type { RowData };
|
|
3
|
+
export declare const dataTableFeatures: {
|
|
4
|
+
rowSortingFeature: import("@tanstack/react-table").TableFeature;
|
|
5
|
+
columnFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
6
|
+
globalFilteringFeature: import("@tanstack/react-table").TableFeature;
|
|
7
|
+
rowPaginationFeature: import("@tanstack/react-table").TableFeature;
|
|
8
|
+
rowSelectionFeature: import("@tanstack/react-table").TableFeature;
|
|
9
|
+
rowExpandingFeature: import("@tanstack/react-table").TableFeature;
|
|
10
|
+
columnVisibilityFeature: import("@tanstack/react-table").TableFeature;
|
|
11
|
+
columnOrderingFeature: import("@tanstack/react-table").TableFeature;
|
|
12
|
+
columnSizingFeature: import("@tanstack/react-table").TableFeature;
|
|
13
|
+
columnResizingFeature: import("@tanstack/react-table").TableFeature;
|
|
14
|
+
sortedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
15
|
+
filteredRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
16
|
+
paginatedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
17
|
+
expandedRowModel: (table: import("@tanstack/react-table").Table<any, any>) => () => import("@tanstack/react-table").RowModel<any, any>;
|
|
18
|
+
sortFns: {
|
|
19
|
+
alphanumeric: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
20
|
+
text: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
21
|
+
datetime: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
22
|
+
basic: import("@tanstack/react-table").CreatedSortFn<any, any>;
|
|
23
|
+
};
|
|
24
|
+
filterFns: {
|
|
25
|
+
includesString: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
26
|
+
inNumberRange: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
27
|
+
equals: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
28
|
+
arrIncludes: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
29
|
+
inDateRange: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
30
|
+
weakEquals: import("@tanstack/react-table").CreatedFilterFn<any, any>;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type DataTableFeatures = typeof dataTableFeatures;
|
|
34
|
+
export type DataTableColumnDef<TData extends RowData, TValue = unknown> = ColumnDef<DataTableFeatures, TData, TValue>;
|
|
35
|
+
export type DataTableRow<TData extends RowData> = Row<DataTableFeatures, TData>;
|
|
36
|
+
export type DataTableColumn<TData extends RowData, TValue = unknown> = Column<DataTableFeatures, TData, TValue>;
|
|
37
|
+
export type DataTableInstance<TData extends RowData> = ReactTable<DataTableFeatures, TData>;
|
|
38
|
+
export type DataTableFilterFn<TData extends RowData> = FilterFn<DataTableFeatures, TData>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { columnFilteringFeature, columnOrderingFeature, columnResizingFeature, columnSizingFeature, columnVisibilityFeature, createExpandedRowModel, createFilteredRowModel, createPaginatedRowModel, createSortedRowModel, filterFn_arrIncludes, filterFn_equals, filterFn_inDateRange, filterFn_inNumberRange, filterFn_includesString, filterFn_weakEquals, globalFilteringFeature, rowExpandingFeature, rowPaginationFeature, rowSelectionFeature, rowSortingFeature, sortFn_alphanumeric, sortFn_basic, sortFn_datetime, sortFn_text, tableFeatures } from "@tanstack/react-table";
|
|
2
|
+
const dataTableFeatures = tableFeatures({
|
|
3
|
+
rowSortingFeature: rowSortingFeature,
|
|
4
|
+
columnFilteringFeature: columnFilteringFeature,
|
|
5
|
+
globalFilteringFeature: globalFilteringFeature,
|
|
6
|
+
rowPaginationFeature: rowPaginationFeature,
|
|
7
|
+
rowSelectionFeature: rowSelectionFeature,
|
|
8
|
+
rowExpandingFeature: rowExpandingFeature,
|
|
9
|
+
columnVisibilityFeature: columnVisibilityFeature,
|
|
10
|
+
columnOrderingFeature: columnOrderingFeature,
|
|
11
|
+
columnSizingFeature: columnSizingFeature,
|
|
12
|
+
columnResizingFeature: columnResizingFeature,
|
|
13
|
+
sortedRowModel: createSortedRowModel(),
|
|
14
|
+
filteredRowModel: createFilteredRowModel(),
|
|
15
|
+
paginatedRowModel: createPaginatedRowModel(),
|
|
16
|
+
expandedRowModel: createExpandedRowModel(),
|
|
17
|
+
sortFns: {
|
|
18
|
+
alphanumeric: sortFn_alphanumeric,
|
|
19
|
+
text: sortFn_text,
|
|
20
|
+
datetime: sortFn_datetime,
|
|
21
|
+
basic: sortFn_basic
|
|
22
|
+
},
|
|
23
|
+
filterFns: {
|
|
24
|
+
includesString: filterFn_includesString,
|
|
25
|
+
inNumberRange: filterFn_inNumberRange,
|
|
26
|
+
equals: filterFn_equals,
|
|
27
|
+
arrIncludes: filterFn_arrIncludes,
|
|
28
|
+
inDateRange: filterFn_inDateRange,
|
|
29
|
+
weakEquals: filterFn_weakEquals
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export { dataTableFeatures };
|
package/dist/locales/en.json
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
"access_denied": "Access Denied",
|
|
4
4
|
"access_denied_description": "You don't have access to this application. Ask your administrator to add you to the users group.",
|
|
5
5
|
"actions": "Actions",
|
|
6
|
+
"active": "Active",
|
|
6
7
|
"actual_input": "Actual input",
|
|
7
8
|
"actual_output": "Actual output",
|
|
8
9
|
"add_attachment": "Add attachment",
|
|
@@ -24,6 +25,7 @@
|
|
|
24
25
|
"analytics": "Analytics",
|
|
25
26
|
"apollo_vertex": "Apollo Vertex",
|
|
26
27
|
"apollo_vertex_description": "- UiPath Apollo Vertex",
|
|
28
|
+
"archive": "Archive",
|
|
27
29
|
"are_you_sure": "Are you sure?",
|
|
28
30
|
"asc": "Asc",
|
|
29
31
|
"ask_ai": "Ask AI",
|
|
@@ -186,6 +188,8 @@
|
|
|
186
188
|
"more_pages": "More pages",
|
|
187
189
|
"multi_line_too_few_metrics": "Multi-line needs two distinct metrics, but the request resolved to fewer than two.",
|
|
188
190
|
"my_template": "My Template",
|
|
191
|
+
"nav_collapse": "Collapse {{label}}",
|
|
192
|
+
"nav_expand": "Expand {{label}}",
|
|
189
193
|
"need_help": "Need help? Contact your administrator",
|
|
190
194
|
"new_conversation": "New conversation",
|
|
191
195
|
"new_conversation_confirm_description": "This will clear all messages and cannot be undone.",
|
|
@@ -274,6 +278,7 @@
|
|
|
274
278
|
"scroll_to_bottom": "Scroll to bottom",
|
|
275
279
|
"search": "Search...",
|
|
276
280
|
"search_frameworks": "Search frameworks",
|
|
281
|
+
"search_input": "Search",
|
|
277
282
|
"secondary": "Secondary",
|
|
278
283
|
"select_a_framework": "Select a framework",
|
|
279
284
|
"select_all": "Select all",
|
|
@@ -34,10 +34,10 @@ function Calendar({ className, classNames, showOutsideDays = true, captionLayout
|
|
|
34
34
|
dropdown: cn("absolute bg-popover inset-0 opacity-0", defaultClassNames.dropdown),
|
|
35
35
|
caption_label: cn("select-none font-medium", "label" === captionLayout ? "text-sm" : "rounded-md pl-2 pr-1 flex items-center gap-1 text-sm h-8 [&>svg]:text-muted-foreground [&>svg]:size-3.5", defaultClassNames.caption_label),
|
|
36
36
|
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
37
|
-
weekday: cn("text-muted-foreground rounded-md flex-1 font-normal text-
|
|
37
|
+
weekday: cn("text-muted-foreground rounded-md flex-1 font-normal text-xs select-none", defaultClassNames.weekday),
|
|
38
38
|
week: cn("flex w-full mt-2", defaultClassNames.week),
|
|
39
39
|
week_number_header: cn("select-none w-(--cell-size)", defaultClassNames.week_number_header),
|
|
40
|
-
week_number: cn("text-
|
|
40
|
+
week_number: cn("text-xs select-none text-muted-foreground", defaultClassNames.week_number),
|
|
41
41
|
day: cn("relative w-full h-full p-0 text-center [&:last-child[data-selected=true]_button]:rounded-r-md group/day aspect-square select-none", props.showWeekNumber ? "[&:nth-child(2)[data-selected=true]_button]:rounded-l-md" : "[&:first-child[data-selected=true]_button]:rounded-l-md", defaultClassNames.day),
|
|
42
42
|
range_start: cn("rounded-l-md bg-accent", defaultClassNames.range_start),
|
|
43
43
|
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
@@ -5,6 +5,7 @@ import { SearchIcon } from "lucide-react";
|
|
|
5
5
|
import "react";
|
|
6
6
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "../dialog/dialog.js";
|
|
7
7
|
import { cn } from "../../lib/utils.js";
|
|
8
|
+
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
8
9
|
function command_Command({ className, ...props }) {
|
|
9
10
|
return /*#__PURE__*/ jsx(Command, {
|
|
10
11
|
"data-slot": "command",
|
|
@@ -39,6 +40,7 @@ function CommandDialog({ title = "Command Palette", description = "Search for a
|
|
|
39
40
|
});
|
|
40
41
|
}
|
|
41
42
|
function CommandInput({ className, ...props }) {
|
|
43
|
+
const { t } = useVertexTranslation();
|
|
42
44
|
return /*#__PURE__*/ jsxs("div", {
|
|
43
45
|
"data-slot": "command-input-wrapper",
|
|
44
46
|
className: "flex h-9 items-center gap-2 border-b px-3",
|
|
@@ -48,6 +50,7 @@ function CommandInput({ className, ...props }) {
|
|
|
48
50
|
}),
|
|
49
51
|
/*#__PURE__*/ jsx(Command.Input, {
|
|
50
52
|
"data-slot": "command-input",
|
|
53
|
+
"aria-label": t("search_input"),
|
|
51
54
|
className: cn("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50", className),
|
|
52
55
|
...props
|
|
53
56
|
})
|
|
@@ -5,7 +5,7 @@ import { SignalBars } from "./confidence-signal-bars.js";
|
|
|
5
5
|
import { LEVEL_CONFIG } from "./confidence-signal-levels.js";
|
|
6
6
|
function ConfidenceSignalChip({ level, label, accessibleLabel, animateIn = false, interactive = false, className, ...props }) {
|
|
7
7
|
return /*#__PURE__*/ jsxs("button", {
|
|
8
|
-
className: cn("inline-flex items-center gap-1.5 text-xs font-semibold focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", LEVEL_CONFIG[level].textClass, interactive && "cursor-pointer", className),
|
|
8
|
+
className: cn("relative inline-flex items-center gap-1.5 text-xs font-semibold focus-visible:outline-none focus-visible:ring-[3px] focus-visible:ring-ring/50", "after:absolute after:top-1/2 after:left-1/2 after:size-full after:min-h-6 after:min-w-6 after:-translate-x-1/2 after:-translate-y-1/2", LEVEL_CONFIG[level].textClass, interactive && "cursor-pointer", className),
|
|
9
9
|
"aria-label": accessibleLabel,
|
|
10
10
|
...props,
|
|
11
11
|
type: "button",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type RowData } from "@tanstack/react-table";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { DataTableColumn } from "../../lib/table-features";
|
|
4
|
+
interface DataTableColumnHeaderProps<TData extends RowData, TValue> extends React.HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
column: DataTableColumn<TData, TValue>;
|
|
5
6
|
title: string;
|
|
6
7
|
}
|
|
7
|
-
declare function DataTableColumnHeader<TData, TValue>({ column, title, className, }: DataTableColumnHeaderProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DataTableColumnHeader<TData extends RowData, TValue>({ column, title, className, }: DataTableColumnHeaderProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export { DataTableColumnHeader };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Subscribe } from "@tanstack/react-table";
|
|
3
4
|
import { ArrowDownIcon, ArrowUpIcon } from "lucide-react";
|
|
4
5
|
import "react";
|
|
5
6
|
import { Button } from "../button/button.js";
|
|
@@ -16,29 +17,31 @@ function SortIcon({ sortDirection }) {
|
|
|
16
17
|
});
|
|
17
18
|
}
|
|
18
19
|
function DataTableColumnHeader({ column, title, className }) {
|
|
19
|
-
"use no memo";
|
|
20
20
|
if (!column.getCanSort()) return /*#__PURE__*/ jsx("div", {
|
|
21
21
|
className: cn(className),
|
|
22
22
|
children: title
|
|
23
23
|
});
|
|
24
|
-
return /*#__PURE__*/ jsx(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
24
|
+
return /*#__PURE__*/ jsx(Subscribe, {
|
|
25
|
+
source: column.table.atoms.sorting,
|
|
26
|
+
children: ()=>/*#__PURE__*/ jsx("div", {
|
|
27
|
+
"data-slot": "data-table-column-header",
|
|
28
|
+
className: cn("flex items-center gap-2", className),
|
|
29
|
+
children: /*#__PURE__*/ jsxs(Button, {
|
|
30
|
+
variant: "ghost",
|
|
31
|
+
size: "sm",
|
|
32
|
+
onClick: ()=>column.toggleSorting("asc" === column.getIsSorted()),
|
|
33
|
+
className: "group/sort gap-1.5 -mx-2.5 -my-1 px-2.5 text-xs font-semibold text-muted-foreground",
|
|
34
|
+
children: [
|
|
35
|
+
/*#__PURE__*/ jsx("span", {
|
|
36
|
+
className: "truncate",
|
|
37
|
+
children: title
|
|
38
|
+
}),
|
|
39
|
+
/*#__PURE__*/ jsx(SortIcon, {
|
|
40
|
+
sortDirection: column.getIsSorted()
|
|
41
|
+
})
|
|
42
|
+
]
|
|
39
43
|
})
|
|
40
|
-
|
|
41
|
-
})
|
|
44
|
+
})
|
|
42
45
|
});
|
|
43
46
|
}
|
|
44
47
|
export { DataTableColumnHeader };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { RowData } from "@tanstack/react-table";
|
|
2
|
+
import type { DataTableInstance } from "../../lib/table-features";
|
|
3
|
+
interface DataTableExpandAllToggleProps<TData extends RowData> {
|
|
4
|
+
table: DataTableInstance<TData>;
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
6
7
|
* Expand/collapse-all toggle for a data table's expand-column header. Reflects
|
|
7
8
|
* and toggles the table's all-rows-expanded state, with distinct double-chevron
|
|
8
9
|
* icons to set it apart from the per-row single-chevron expand controls.
|
|
9
10
|
*/
|
|
10
|
-
declare function DataTableExpandAllToggle<TData>({ table, }: DataTableExpandAllToggleProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare function DataTableExpandAllToggle<TData extends RowData>({ table, }: DataTableExpandAllToggleProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export { DataTableExpandAllToggle };
|
|
12
13
|
export type { DataTableExpandAllToggleProps };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { ChevronsDownUp, ChevronsUpDown } from "lucide-react";
|
|
4
|
-
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
5
4
|
import { Button } from "../button/button.js";
|
|
5
|
+
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
6
6
|
function DataTableExpandAllToggle({ table }) {
|
|
7
7
|
const { t } = useVertexTranslation();
|
|
8
8
|
const allExpanded = table.getIsAllRowsExpanded();
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
export declare
|
|
1
|
+
import type { RowData } from "@tanstack/react-table";
|
|
2
|
+
import type { DataTableRow } from "../../lib/table-features";
|
|
3
|
+
export declare function dataTableGlobalFilterFn<TData extends RowData>(row: DataTableRow<TData>, _columnId: string, filterValue: string): boolean;
|
|
4
|
+
export declare function dataTableFacetedFilterFn<TData extends RowData>(row: DataTableRow<TData>, columnId: string, filterValue: unknown): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
function dataTableGlobalFilterFn(row, _columnId, filterValue) {
|
|
2
2
|
if (!filterValue) return true;
|
|
3
3
|
const searchStr = filterValue.toLowerCase();
|
|
4
4
|
return row.getVisibleCells().some((cell)=>{
|
|
@@ -7,10 +7,10 @@ const dataTableGlobalFilterFn = (row, _columnId, filterValue)=>{
|
|
|
7
7
|
const displayValue = meta?.getFilterValue ? meta.getFilterValue(value, row) : "string" == typeof value ? value : "number" == typeof value || "boolean" == typeof value ? String(value) : "";
|
|
8
8
|
return displayValue.toLowerCase().includes(searchStr);
|
|
9
9
|
});
|
|
10
|
-
}
|
|
11
|
-
|
|
10
|
+
}
|
|
11
|
+
function dataTableFacetedFilterFn(row, columnId, filterValue) {
|
|
12
12
|
if (!filterValue || !Array.isArray(filterValue) || 0 === filterValue.length) return true;
|
|
13
13
|
const cellValue = String(row.getValue(columnId) ?? "");
|
|
14
14
|
return filterValue.includes(cellValue);
|
|
15
|
-
}
|
|
15
|
+
}
|
|
16
16
|
export { dataTableFacetedFilterFn, dataTableGlobalFilterFn };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { RowData } from "@tanstack/react-table";
|
|
2
|
+
import type { DataTableInstance } from "../../lib/table-features";
|
|
3
|
+
interface DataTablePaginationProps<TData extends RowData> {
|
|
4
|
+
table: DataTableInstance<TData>;
|
|
4
5
|
paginationSizes?: number[];
|
|
5
6
|
className?: string;
|
|
6
7
|
}
|
|
7
|
-
declare function DataTablePagination<TData>({ table, paginationSizes, className, }: DataTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DataTablePagination<TData extends RowData>({ table, paginationSizes, className, }: DataTablePaginationProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export { DataTablePagination };
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { ChevronLeftIcon, ChevronRightIcon, ChevronsLeftIcon, ChevronsRightIcon } from "lucide-react";
|
|
4
|
-
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
5
4
|
import { Button } from "../button/button.js";
|
|
6
5
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../select/select.js";
|
|
7
6
|
import { cn } from "../../lib/utils.js";
|
|
7
|
+
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
8
8
|
function DataTablePagination({ table, paginationSizes = [
|
|
9
9
|
10,
|
|
10
10
|
25,
|
|
11
11
|
50,
|
|
12
12
|
100
|
|
13
13
|
], className }) {
|
|
14
|
-
"use no memo";
|
|
15
14
|
const { t } = useVertexTranslation();
|
|
16
|
-
const { pageIndex, pageSize } = table.
|
|
15
|
+
const { pageIndex, pageSize } = table.state.pagination;
|
|
17
16
|
const totalRows = table.getFilteredRowModel().rows.length;
|
|
18
17
|
const pageCount = table.getPageCount();
|
|
19
18
|
const canPreviousPage = pageIndex > 0;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { RowData } from "@tanstack/react-table";
|
|
2
|
+
import type { DataTableInstance } from "../../lib/table-features";
|
|
3
|
+
interface DataTableSearchProps<TData extends RowData> {
|
|
4
|
+
table: DataTableInstance<TData>;
|
|
4
5
|
placeholder?: string;
|
|
5
6
|
className?: string;
|
|
6
7
|
}
|
|
7
|
-
declare function DataTableSearch<TData>({ table, placeholder, className, }: DataTableSearchProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function DataTableSearch<TData extends RowData>({ table, placeholder, className, }: DataTableSearchProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export { DataTableSearch };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { SearchIcon } from "lucide-react";
|
|
4
|
-
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
5
4
|
import { Input } from "../input/input.js";
|
|
6
5
|
import { cn } from "../../lib/utils.js";
|
|
6
|
+
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
7
7
|
function DataTableSearch({ table, placeholder, className }) {
|
|
8
8
|
const { t } = useVertexTranslation();
|
|
9
9
|
return /*#__PURE__*/ jsxs("div", {
|
|
@@ -17,7 +17,7 @@ function DataTableSearch({ table, placeholder, className }) {
|
|
|
17
17
|
placeholder: placeholder ?? t("search", {
|
|
18
18
|
defaultValue: "Search..."
|
|
19
19
|
}),
|
|
20
|
-
value: String(table.
|
|
20
|
+
value: String(table.state.globalFilter ?? ""),
|
|
21
21
|
onChange: (e)=>table.setGlobalFilter(e.target.value),
|
|
22
22
|
className: "w-full sm:w-80 md:w-96 pl-9 border-0"
|
|
23
23
|
})
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RowData } from "@tanstack/react-table";
|
|
2
2
|
import type * as React from "react";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import type { DataTableInstance } from "../../lib/table-features";
|
|
4
|
+
interface DataTableToolbarProps<TData extends RowData> {
|
|
5
|
+
table: DataTableInstance<TData>;
|
|
5
6
|
className?: string;
|
|
6
7
|
enableSearch?: boolean;
|
|
7
8
|
enableViewOptions?: boolean;
|
|
8
9
|
customContent?: React.ReactNode;
|
|
9
10
|
}
|
|
10
|
-
declare function DataTableToolbar<TData>({ table, className, enableSearch, enableViewOptions, customContent, }: DataTableToolbarProps<TData>): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
declare function DataTableToolbar<TData extends RowData>({ table, className, enableSearch, enableViewOptions, customContent, }: DataTableToolbarProps<TData>): import("react/jsx-runtime").JSX.Element | null;
|
|
11
12
|
export { DataTableToolbar };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { RowData } from "@tanstack/react-table";
|
|
2
|
+
import type { DataTableInstance } from "../../lib/table-features";
|
|
3
|
+
interface DataTableViewOptionsProps<TData extends RowData> {
|
|
4
|
+
table: DataTableInstance<TData>;
|
|
4
5
|
className?: string;
|
|
5
6
|
}
|
|
6
|
-
declare function DataTableViewOptions<TData>({ table, className, }: DataTableViewOptionsProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function DataTableViewOptions<TData extends RowData>({ table, className, }: DataTableViewOptionsProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export { DataTableViewOptions };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { Columns3Icon } from "lucide-react";
|
|
4
|
-
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
5
4
|
import { Button } from "../button/button.js";
|
|
6
5
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "../dropdown-menu/dropdown-menu.js";
|
|
7
6
|
import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip/tooltip.js";
|
|
7
|
+
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
8
8
|
import { SortableColumnList } from "./sortable-column-list.js";
|
|
9
9
|
function DataTableViewOptions({ table, className }) {
|
|
10
10
|
const { t } = useVertexTranslation();
|
|
11
11
|
const allReorderableColumns = table.getAllColumns().filter((column)=>null != column.accessorFn && column.getCanHide());
|
|
12
|
-
const currentOrder = table.
|
|
12
|
+
const currentOrder = table.state.columnOrder;
|
|
13
13
|
const orderedColumns = ()=>{
|
|
14
14
|
if (!currentOrder || 0 === currentOrder.length) return allReorderableColumns;
|
|
15
15
|
const orderMap = new Map(currentOrder.map((id, index)=>[
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ColumnFiltersState, type ColumnVisibilityState, type ExpandedState, type OnChangeFn, type PaginationState, type RowData, type RowSelectionState, type SortingState } from "@tanstack/react-table";
|
|
2
2
|
import * as React from "react";
|
|
3
|
+
import { type DataTableColumnDef, type DataTableFilterFn, type DataTableInstance, type DataTableRow } from "../../lib/table-features";
|
|
3
4
|
declare module "@tanstack/react-table" {
|
|
4
|
-
interface ColumnMeta<TData extends RowData, TValue> {
|
|
5
|
+
interface ColumnMeta<TFeatures, TData extends RowData, TValue> {
|
|
5
6
|
displayName?: string;
|
|
6
|
-
getFilterValue?: (value: unknown, row:
|
|
7
|
+
getFilterValue?: (value: unknown, row: DataTableRow<TData>) => string;
|
|
7
8
|
overflowVisible?: boolean;
|
|
8
9
|
}
|
|
9
10
|
}
|
|
10
|
-
interface DataTableProps<TData, TValue> {
|
|
11
|
-
columns:
|
|
11
|
+
interface DataTableProps<TData extends RowData, TValue = unknown> {
|
|
12
|
+
columns: DataTableColumnDef<TData, TValue>[];
|
|
12
13
|
data: TData[];
|
|
13
14
|
className?: string;
|
|
14
15
|
isLoading?: boolean;
|
|
@@ -17,8 +18,8 @@ interface DataTableProps<TData, TValue> {
|
|
|
17
18
|
onSortingChange: OnChangeFn<SortingState>;
|
|
18
19
|
columnFilters: ColumnFiltersState;
|
|
19
20
|
onColumnFiltersChange: OnChangeFn<ColumnFiltersState>;
|
|
20
|
-
columnVisibility:
|
|
21
|
-
onColumnVisibilityChange: OnChangeFn<
|
|
21
|
+
columnVisibility: ColumnVisibilityState;
|
|
22
|
+
onColumnVisibilityChange: OnChangeFn<ColumnVisibilityState>;
|
|
22
23
|
columnOrder: string[];
|
|
23
24
|
onColumnOrderChange: OnChangeFn<string[]>;
|
|
24
25
|
rowSelection?: RowSelectionState;
|
|
@@ -27,22 +28,22 @@ interface DataTableProps<TData, TValue> {
|
|
|
27
28
|
onGlobalFilterChange: OnChangeFn<string>;
|
|
28
29
|
pagination?: PaginationState;
|
|
29
30
|
onPaginationChange?: OnChangeFn<PaginationState>;
|
|
30
|
-
getRowId?: (originalRow: TData, index: number, parent?:
|
|
31
|
-
globalFilterFn?:
|
|
31
|
+
getRowId?: (originalRow: TData, index: number, parent?: DataTableRow<TData>) => string;
|
|
32
|
+
globalFilterFn?: DataTableFilterFn<TData>;
|
|
32
33
|
enableSearch?: boolean;
|
|
33
34
|
enableViewOptions?: boolean;
|
|
34
35
|
enableColumnResizing?: boolean;
|
|
35
|
-
toolbarContent?: (table:
|
|
36
|
+
toolbarContent?: (table: DataTableInstance<TData>) => React.ReactNode;
|
|
36
37
|
noResultsMessage?: React.ReactNode;
|
|
37
38
|
stickyHeader?: boolean;
|
|
38
39
|
expanded?: ExpandedState;
|
|
39
40
|
onExpandedChange?: OnChangeFn<ExpandedState>;
|
|
40
|
-
renderExpandedRow?: (row:
|
|
41
|
+
renderExpandedRow?: (row: DataTableRow<TData>) => React.ReactNode;
|
|
41
42
|
getRowClassName?: (row: TData) => string;
|
|
42
43
|
skeletonColumnWidths?: string[];
|
|
43
44
|
plain?: boolean;
|
|
44
45
|
}
|
|
45
|
-
declare function DataTable<TData, TValue>({ columns, data, className, isLoading, onRowClick, sorting, onSortingChange, columnFilters, onColumnFiltersChange, columnVisibility, onColumnVisibilityChange, columnOrder, onColumnOrderChange, rowSelection, onRowSelectionChange, globalFilter, onGlobalFilterChange, pagination, onPaginationChange, getRowId, globalFilterFn, enableSearch, enableViewOptions, enableColumnResizing, toolbarContent, noResultsMessage, stickyHeader, expanded, onExpandedChange, renderExpandedRow, getRowClassName, skeletonColumnWidths, plain, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
declare function DataTable<TData extends RowData, TValue = unknown>({ columns, data, className, isLoading, onRowClick, sorting, onSortingChange, columnFilters, onColumnFiltersChange, columnVisibility, onColumnVisibilityChange, columnOrder, onColumnOrderChange, rowSelection, onRowSelectionChange, globalFilter, onGlobalFilterChange, pagination, onPaginationChange, getRowId, globalFilterFn, enableSearch, enableViewOptions, enableColumnResizing, toolbarContent, noResultsMessage, stickyHeader, expanded, onExpandedChange, renderExpandedRow, getRowClassName, skeletonColumnWidths, plain, }: DataTableProps<TData, TValue>): import("react/jsx-runtime").JSX.Element;
|
|
46
47
|
export { DataTable };
|
|
47
48
|
export type { DataTableProps };
|
|
48
49
|
/** @public */
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { flexRender,
|
|
3
|
+
import { flexRender, useTable } from "@tanstack/react-table";
|
|
4
4
|
import { Fragment } from "react";
|
|
5
|
+
import { dataTableFeatures } from "../../lib/table-features.js";
|
|
5
6
|
import { useVertexTranslation } from "../../lib/vertex-translation.js";
|
|
6
7
|
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../table/table.js";
|
|
7
|
-
import { useReactTableCompat } from "../use-data-table/useReactTableCompat.js";
|
|
8
8
|
import { cn } from "../../lib/utils.js";
|
|
9
9
|
import { DataTableExpandAllToggle } from "./data-table-expand-toggle.js";
|
|
10
10
|
import { DataTablePagination } from "./data-table-pagination.js";
|
|
@@ -24,9 +24,10 @@ function DataTable({ columns, data, className, isLoading = false, onRowClick, so
|
|
|
24
24
|
pageIndex: 0
|
|
25
25
|
});
|
|
26
26
|
};
|
|
27
|
-
const table =
|
|
27
|
+
const table = useTable({
|
|
28
|
+
features: dataTableFeatures,
|
|
28
29
|
data,
|
|
29
|
-
columns,
|
|
30
|
+
columns: columns,
|
|
30
31
|
onSortingChange,
|
|
31
32
|
onColumnFiltersChange: (updater)=>{
|
|
32
33
|
onColumnFiltersChange(updater);
|
|
@@ -42,8 +43,10 @@ function DataTable({ columns, data, className, isLoading = false, onRowClick, so
|
|
|
42
43
|
resetPageIndex();
|
|
43
44
|
},
|
|
44
45
|
...isPaginationEnabled && {
|
|
45
|
-
onPaginationChange
|
|
46
|
-
|
|
46
|
+
onPaginationChange
|
|
47
|
+
},
|
|
48
|
+
...!isPaginationEnabled && {
|
|
49
|
+
manualPagination: true
|
|
47
50
|
},
|
|
48
51
|
...onExpandedChange ? {
|
|
49
52
|
onExpandedChange
|
|
@@ -51,12 +54,6 @@ function DataTable({ columns, data, className, isLoading = false, onRowClick, so
|
|
|
51
54
|
...getRowId ? {
|
|
52
55
|
getRowId
|
|
53
56
|
} : {},
|
|
54
|
-
getCoreRowModel: getCoreRowModel(),
|
|
55
|
-
getSortedRowModel: getSortedRowModel(),
|
|
56
|
-
getFilteredRowModel: getFilteredRowModel(),
|
|
57
|
-
...renderExpandedRow ? {
|
|
58
|
-
getExpandedRowModel: getExpandedRowModel()
|
|
59
|
-
} : {},
|
|
60
57
|
...globalFilterFn ? {
|
|
61
58
|
globalFilterFn
|
|
62
59
|
} : {},
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export type {
|
|
1
|
+
export type { ColumnFiltersState, ColumnVisibilityState, ColumnVisibilityState as VisibilityState, ExpandedState, OnChangeFn, PaginationState, RowSelectionState, SortingState, } from "@tanstack/react-table";
|
|
2
|
+
export { FilterDropdown, type FilterDropdownOption, type FilterDropdownProps, } from "../filter-dropdown/index";
|
|
3
|
+
export type { DataTableColumnDef as ColumnDef, DataTableInstance as TanstackTable, DataTableRow as Row, } from "../../lib/table-features";
|
|
2
4
|
export type { DataTableProps } from "./data-table";
|
|
3
5
|
export { DataTable } from "./data-table";
|
|
4
6
|
export { DataTableColumnHeader } from "./data-table-column-header";
|
|
5
|
-
export { FilterDropdown, type FilterDropdownOption, type FilterDropdownProps, } from "../filter-dropdown/index";
|
|
6
7
|
export { dataTableFacetedFilterFn, dataTableGlobalFilterFn, } from "./data-table-filters";
|
|
7
8
|
export { DataTablePagination } from "./data-table-pagination";
|
|
8
9
|
export { DataTableCell, DataTableRow } from "./data-table-row";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { FilterDropdown } from "../filter-dropdown/index.js";
|
|
1
2
|
import { DataTable } from "./data-table.js";
|
|
2
3
|
import { DataTableColumnHeader } from "./data-table-column-header.js";
|
|
3
|
-
import { FilterDropdown } from "../filter-dropdown/index.js";
|
|
4
4
|
import { dataTableFacetedFilterFn, dataTableGlobalFilterFn } from "./data-table-filters.js";
|
|
5
5
|
import { DataTablePagination } from "./data-table-pagination.js";
|
|
6
6
|
import { DataTableCell, DataTableRow } from "./data-table-row.js";
|