@uipath/apollo-vertex 1.1.0 → 1.3.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 +2 -0
- package/dist/lib/table-features.d.ts +38 -0
- package/dist/lib/table-features.js +32 -0
- package/dist/locales/en.json +1 -0
- package/dist/registry/bar-chart/bar-chart-view.js +19 -17
- package/dist/registry/bar-chart/util/get-bar-color.js +2 -2
- package/dist/registry/calendar/calendar.js +2 -2
- package/dist/registry/chart/chart.d.ts +19 -17
- package/dist/registry/chart/chart.js +52 -20
- 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-theme-provider.js +12 -6
- package/dist/registry/solution-tests/config.d.ts +5 -5
- package/dist/registry/solution-tests/solution-tests-view.js +1 -1
- package/dist/registry/sonner/sonner.d.ts +1 -1
- package/dist/registry/sonner/sonner.js +4 -4
- 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 +4 -5
- 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
|
@@ -277,6 +277,7 @@ declare const localeLoaders: {
|
|
|
277
277
|
scroll_to_bottom: string;
|
|
278
278
|
search: string;
|
|
279
279
|
search_frameworks: string;
|
|
280
|
+
search_input: string;
|
|
280
281
|
secondary: string;
|
|
281
282
|
select_a_framework: string;
|
|
282
283
|
select_all: string;
|
|
@@ -643,6 +644,7 @@ declare const localeLoaders: {
|
|
|
643
644
|
scroll_to_bottom: string;
|
|
644
645
|
search: string;
|
|
645
646
|
search_frameworks: string;
|
|
647
|
+
search_input: string;
|
|
646
648
|
secondary: string;
|
|
647
649
|
select_a_framework: string;
|
|
648
650
|
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
|
@@ -274,6 +274,7 @@
|
|
|
274
274
|
"scroll_to_bottom": "Scroll to bottom",
|
|
275
275
|
"search": "Search...",
|
|
276
276
|
"search_frameworks": "Search frameworks",
|
|
277
|
+
"search_input": "Search",
|
|
277
278
|
"secondary": "Secondary",
|
|
278
279
|
"select_a_framework": "Select a framework",
|
|
279
280
|
"select_all": "Select all",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Bar, BarChart,
|
|
2
|
+
import { Bar, BarChart, LabelList, Rectangle, XAxis, YAxis } from "recharts";
|
|
3
3
|
import { ChartContainer, ChartTooltip, ChartTooltipContent } from "../chart/chart.js";
|
|
4
4
|
import { BarLabel } from "./bar-label.js";
|
|
5
5
|
import { MetricColumn } from "./metric-column.js";
|
|
@@ -9,6 +9,12 @@ import { isRechartsBarData } from "./util/recharts-bar-data.js";
|
|
|
9
9
|
const BAR_SIZE = 20;
|
|
10
10
|
const BAR_GAP = 4;
|
|
11
11
|
const CATEGORY_GAP = 8;
|
|
12
|
+
function PaletteBar(props) {
|
|
13
|
+
return /*#__PURE__*/ jsx(Rectangle, {
|
|
14
|
+
...props,
|
|
15
|
+
fill: PALETTE[props.index % PALETTE.length]
|
|
16
|
+
});
|
|
17
|
+
}
|
|
12
18
|
function bar_chart_view_BarChart({ rows, series }) {
|
|
13
19
|
const dimensionKeys = rows[0]?.dimensions.map((d)=>d.key) ?? [];
|
|
14
20
|
const dimensionCount = dimensionKeys.length;
|
|
@@ -159,24 +165,20 @@ function bar_chart_view_BarChart({ rows, series }) {
|
|
|
159
165
|
}),
|
|
160
166
|
cursor: false
|
|
161
167
|
}),
|
|
162
|
-
1 === seriesCount ? /*#__PURE__*/
|
|
168
|
+
1 === seriesCount ? /*#__PURE__*/ jsx(Bar, {
|
|
163
169
|
dataKey: series[0]?.label ?? "",
|
|
164
170
|
barSize: BAR_SIZE,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
rechartsData.map((row, index)=>/*#__PURE__*/ jsx(Cell, {
|
|
177
|
-
fill: PALETTE[index % PALETTE.length]
|
|
178
|
-
}, row.__id))
|
|
179
|
-
]
|
|
171
|
+
shape: PaletteBar,
|
|
172
|
+
children: /*#__PURE__*/ jsx(LabelList, {
|
|
173
|
+
content: (props)=>{
|
|
174
|
+
const payload = isRechartsBarData(props.payload) ? props.payload : null;
|
|
175
|
+
const formatted = payload && series[0] ? payload.__formatted[series[0].id] ?? "" : "";
|
|
176
|
+
return /*#__PURE__*/ jsx(BarLabel, {
|
|
177
|
+
...props,
|
|
178
|
+
formatted: formatted
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
})
|
|
180
182
|
}) : series.map((s, idx)=>/*#__PURE__*/ jsx(Bar, {
|
|
181
183
|
dataKey: s.label,
|
|
182
184
|
fill: s.color ?? COLORS[idx % COLORS.length],
|
|
@@ -5,8 +5,8 @@ function getBarColor({ seriesCount, seriesIndex, item, payload, rechartsData })
|
|
|
5
5
|
const payloadFill = item.payload?.fill;
|
|
6
6
|
if (1 === seriesCount) {
|
|
7
7
|
const rowIndex = rechartsData.findIndex((row)=>row.__id === payload?.__id);
|
|
8
|
-
|
|
9
|
-
return assertDefined(itemColor ?? payloadFill ??
|
|
8
|
+
if (rowIndex >= 0) return assertDefined(PALETTE[rowIndex % PALETTE.length], "Bar color");
|
|
9
|
+
return assertDefined(itemColor ?? payloadFill ?? PALETTE["0"], "Bar color");
|
|
10
10
|
}
|
|
11
11
|
const fallbackColor = COLORS[seriesIndex % COLORS.length];
|
|
12
12
|
return assertDefined(itemColor ?? payloadFill ?? fallbackColor, "Bar color");
|
|
@@ -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),
|
|
@@ -4,21 +4,23 @@ declare const THEMES: {
|
|
|
4
4
|
readonly light: "";
|
|
5
5
|
readonly dark: ".dark";
|
|
6
6
|
};
|
|
7
|
-
export type ChartConfig = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
19
|
-
declare function ChartContainer({ id, className, children, config, ...props }: React.ComponentProps<"div"> & {
|
|
7
|
+
export type ChartConfig = Record<string, {
|
|
8
|
+
label?: React.ReactNode;
|
|
9
|
+
icon?: React.ComponentType;
|
|
10
|
+
} & ({
|
|
11
|
+
color?: string;
|
|
12
|
+
theme?: never;
|
|
13
|
+
} | {
|
|
14
|
+
color?: never;
|
|
15
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
16
|
+
})>;
|
|
17
|
+
declare function ChartContainer({ id, className, children, config, initialDimension, ...props }: React.ComponentProps<"div"> & {
|
|
20
18
|
config: ChartConfig;
|
|
21
19
|
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
20
|
+
initialDimension?: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
22
24
|
}): import("react/jsx-runtime").JSX.Element;
|
|
23
25
|
declare const ChartStyle: ({ id, config }: {
|
|
24
26
|
id: string;
|
|
@@ -31,10 +33,10 @@ declare function ChartTooltipContent({ active, payload, className, indicator, hi
|
|
|
31
33
|
indicator?: "line" | "dot" | "dashed";
|
|
32
34
|
nameKey?: string;
|
|
33
35
|
labelKey?: string;
|
|
34
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
35
|
-
declare const ChartLegend:
|
|
36
|
-
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> &
|
|
36
|
+
} & Omit<RechartsPrimitive.DefaultTooltipContentProps, "accessibilityLayer">): import("react/jsx-runtime").JSX.Element | null;
|
|
37
|
+
declare const ChartLegend: React.MemoExoticComponent<(outsideProps: RechartsPrimitive.LegendProps) => React.ReactPortal | null>;
|
|
38
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & {
|
|
37
39
|
hideIcon?: boolean;
|
|
38
40
|
nameKey?: string;
|
|
39
|
-
}): import("react/jsx-runtime").JSX.Element | null;
|
|
41
|
+
} & RechartsPrimitive.DefaultLegendContentProps): import("react/jsx-runtime").JSX.Element | null;
|
|
40
42
|
export { ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle, };
|
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, useContext, useId } from "react";
|
|
3
|
+
import { createContext, useContext, useId, useMemo } from "react";
|
|
4
4
|
import { Legend, ResponsiveContainer, Tooltip } from "recharts";
|
|
5
5
|
import { cn } from "../../lib/utils.js";
|
|
6
6
|
const THEMES = {
|
|
7
7
|
light: "",
|
|
8
8
|
dark: ".dark"
|
|
9
9
|
};
|
|
10
|
+
const THEME_SELECTORS = [
|
|
11
|
+
[
|
|
12
|
+
"light",
|
|
13
|
+
THEMES.light
|
|
14
|
+
],
|
|
15
|
+
[
|
|
16
|
+
"dark",
|
|
17
|
+
THEMES.dark
|
|
18
|
+
]
|
|
19
|
+
];
|
|
20
|
+
const INITIAL_DIMENSION = {
|
|
21
|
+
width: 320,
|
|
22
|
+
height: 200
|
|
23
|
+
};
|
|
10
24
|
const ChartContext = /*#__PURE__*/ createContext(null);
|
|
11
25
|
function useChart() {
|
|
12
26
|
const context = useContext(ChartContext);
|
|
13
27
|
if (!context) throw new Error("useChart must be used within a <ChartContainer />");
|
|
14
28
|
return context;
|
|
15
29
|
}
|
|
16
|
-
function ChartContainer({ id, className, children, config, ...props }) {
|
|
30
|
+
function ChartContainer({ id, className, children, config, initialDimension = INITIAL_DIMENSION, ...props }) {
|
|
17
31
|
const uniqueId = useId();
|
|
18
32
|
const chartId = `chart-${id ?? uniqueId.replaceAll(":", "")}`;
|
|
19
33
|
return /*#__PURE__*/ jsx(ChartContext.Provider, {
|
|
@@ -23,7 +37,7 @@ function ChartContainer({ id, className, children, config, ...props }) {
|
|
|
23
37
|
children: /*#__PURE__*/ jsxs("div", {
|
|
24
38
|
"data-slot": "chart",
|
|
25
39
|
"data-chart": chartId,
|
|
26
|
-
className: cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border
|
|
40
|
+
className: cn("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className),
|
|
27
41
|
...props,
|
|
28
42
|
children: [
|
|
29
43
|
/*#__PURE__*/ jsx(ChartStyle, {
|
|
@@ -31,6 +45,7 @@ function ChartContainer({ id, className, children, config, ...props }) {
|
|
|
31
45
|
config: config
|
|
32
46
|
}),
|
|
33
47
|
/*#__PURE__*/ jsx(ResponsiveContainer, {
|
|
48
|
+
initialDimension: initialDimension,
|
|
34
49
|
children: children
|
|
35
50
|
})
|
|
36
51
|
]
|
|
@@ -42,7 +57,7 @@ const ChartStyle = ({ id, config })=>{
|
|
|
42
57
|
if (0 === colorConfig.length) return null;
|
|
43
58
|
return /*#__PURE__*/ jsx("style", {
|
|
44
59
|
dangerouslySetInnerHTML: {
|
|
45
|
-
__html:
|
|
60
|
+
__html: THEME_SELECTORS.map(([theme, prefix])=>`
|
|
46
61
|
${prefix} [data-chart=${id}] {
|
|
47
62
|
${colorConfig.map(([key, itemConfig])=>{
|
|
48
63
|
const color = itemConfig.theme?.[theme] ?? itemConfig.color;
|
|
@@ -56,10 +71,10 @@ ${colorConfig.map(([key, itemConfig])=>{
|
|
|
56
71
|
const ChartTooltip = Tooltip;
|
|
57
72
|
function ChartTooltipContent({ active, payload, className, indicator = "dot", hideLabel = false, hideIndicator = false, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey }) {
|
|
58
73
|
const { config } = useChart();
|
|
59
|
-
|
|
74
|
+
const tooltipLabel = useMemo(()=>{
|
|
60
75
|
if (hideLabel || !payload?.length) return null;
|
|
61
76
|
const [item] = payload;
|
|
62
|
-
const key =
|
|
77
|
+
const key = chartConfigKey(labelKey ?? item?.dataKey ?? item?.name);
|
|
63
78
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
64
79
|
const value = labelKey || "string" != typeof label ? itemConfig?.label : config[label]?.label ?? label;
|
|
65
80
|
if (labelFormatter) return /*#__PURE__*/ jsx("div", {
|
|
@@ -71,22 +86,29 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
|
71
86
|
className: cn("font-medium", labelClassName),
|
|
72
87
|
children: value
|
|
73
88
|
});
|
|
74
|
-
}
|
|
75
|
-
|
|
89
|
+
}, [
|
|
90
|
+
label,
|
|
91
|
+
labelFormatter,
|
|
92
|
+
payload,
|
|
93
|
+
hideLabel,
|
|
94
|
+
labelClassName,
|
|
95
|
+
config,
|
|
96
|
+
labelKey
|
|
97
|
+
]);
|
|
76
98
|
if (!active || !payload?.length) return null;
|
|
77
99
|
const nestLabel = 1 === payload.length && "dot" !== indicator;
|
|
78
100
|
return /*#__PURE__*/ jsxs("div", {
|
|
79
|
-
className: cn("
|
|
101
|
+
className: cn("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl", className),
|
|
80
102
|
children: [
|
|
81
103
|
nestLabel ? null : tooltipLabel,
|
|
82
104
|
/*#__PURE__*/ jsx("div", {
|
|
83
105
|
className: "grid gap-1.5",
|
|
84
106
|
children: payload.filter((item)=>"none" !== item.type).map((item, index)=>{
|
|
85
|
-
const key =
|
|
107
|
+
const key = chartConfigKey(nameKey ?? item.name ?? item.dataKey);
|
|
86
108
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
87
|
-
const indicatorColor = color
|
|
109
|
+
const indicatorColor = readIndicatorColor(color, item);
|
|
88
110
|
return /*#__PURE__*/ jsx("div", {
|
|
89
|
-
className: cn("
|
|
111
|
+
className: cn("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground", "dot" === indicator && "items-center"),
|
|
90
112
|
children: formatter && item?.value != null && item.name ? formatter(item.value, item.name, item, index, item.payload) : /*#__PURE__*/ jsxs(Fragment, {
|
|
91
113
|
children: [
|
|
92
114
|
itemConfig?.icon ? /*#__PURE__*/ jsx(itemConfig.icon, {}) : !hideIndicator && /*#__PURE__*/ jsx("div", {
|
|
@@ -114,15 +136,15 @@ function ChartTooltipContent({ active, payload, className, indicator = "dot", hi
|
|
|
114
136
|
})
|
|
115
137
|
]
|
|
116
138
|
}),
|
|
117
|
-
item.value && /*#__PURE__*/ jsx("span", {
|
|
118
|
-
className: "
|
|
119
|
-
children: item.value.toLocaleString()
|
|
139
|
+
null != item.value && /*#__PURE__*/ jsx("span", {
|
|
140
|
+
className: "font-mono font-medium text-foreground tabular-nums",
|
|
141
|
+
children: "number" == typeof item.value ? item.value.toLocaleString() : String(item.value)
|
|
120
142
|
})
|
|
121
143
|
]
|
|
122
144
|
})
|
|
123
145
|
]
|
|
124
146
|
})
|
|
125
|
-
},
|
|
147
|
+
}, index);
|
|
126
148
|
})
|
|
127
149
|
})
|
|
128
150
|
]
|
|
@@ -134,11 +156,11 @@ function ChartLegendContent({ className, hideIcon = false, payload, verticalAlig
|
|
|
134
156
|
if (!payload?.length) return null;
|
|
135
157
|
return /*#__PURE__*/ jsx("div", {
|
|
136
158
|
className: cn("flex items-center justify-center gap-4", "top" === verticalAlign ? "pb-3" : "pt-3", className),
|
|
137
|
-
children: payload.filter((item)=>"none" !== item.type).map((item)=>{
|
|
138
|
-
const key =
|
|
159
|
+
children: payload.filter((item)=>"none" !== item.type).map((item, index)=>{
|
|
160
|
+
const key = chartConfigKey(nameKey ?? item.dataKey);
|
|
139
161
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
140
162
|
return /*#__PURE__*/ jsxs("div", {
|
|
141
|
-
className: cn("
|
|
163
|
+
className: cn("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),
|
|
142
164
|
children: [
|
|
143
165
|
itemConfig?.icon && !hideIcon ? /*#__PURE__*/ jsx(itemConfig.icon, {}) : /*#__PURE__*/ jsx("div", {
|
|
144
166
|
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
@@ -148,10 +170,20 @@ function ChartLegendContent({ className, hideIcon = false, payload, verticalAlig
|
|
|
148
170
|
}),
|
|
149
171
|
itemConfig?.label
|
|
150
172
|
]
|
|
151
|
-
},
|
|
173
|
+
}, index);
|
|
152
174
|
})
|
|
153
175
|
});
|
|
154
176
|
}
|
|
177
|
+
function chartConfigKey(value) {
|
|
178
|
+
if ("string" == typeof value || "number" == typeof value || "function" == typeof value) return String(value);
|
|
179
|
+
return "value";
|
|
180
|
+
}
|
|
181
|
+
function readIndicatorColor(color, item) {
|
|
182
|
+
const point = item.payload;
|
|
183
|
+
if ("object" != typeof point || null === point || !("fill" in point)) return color ?? item.color;
|
|
184
|
+
const { fill } = point;
|
|
185
|
+
return color ?? ("string" == typeof fill ? fill : item.color);
|
|
186
|
+
}
|
|
155
187
|
function getPayloadConfigFromPayload(config, payload, key) {
|
|
156
188
|
if ("object" != typeof payload || null === payload) return;
|
|
157
189
|
const payloadPayload = "payload" in payload && "object" == typeof payload.payload && null !== payload.payload ? payload.payload : null;
|
|
@@ -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 };
|