@squadbase/vantage 0.7.1-dev1.9737835 → 0.7.1-dev1.bb6bd72
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/{build-U7GO26HR.js → build-AON4MAQQ.js} +3 -3
- package/dist/{build-U7GO26HR.js.map → build-AON4MAQQ.js.map} +1 -1
- package/dist/{chunk-EG4PX726.js → chunk-GWXKENNH.js} +122 -5
- package/dist/chunk-GWXKENNH.js.map +1 -0
- package/dist/{chunk-SC7K2RD6.js → chunk-I2GWIPTD.js} +101 -27
- package/dist/chunk-I2GWIPTD.js.map +1 -0
- package/dist/{chunk-SDJTTMLK.js → chunk-SR43D6EF.js} +13 -8
- package/dist/chunk-SR43D6EF.js.map +1 -0
- package/dist/{chunk-P2KIHF65.js → chunk-U6MWBCM6.js} +28 -7
- package/dist/chunk-U6MWBCM6.js.map +1 -0
- package/dist/cli.js +2 -2
- package/dist/components/index.d.ts +206 -4
- package/dist/components/index.js +3 -3
- package/dist/{dev-O42JFQ64.js → dev-BZ7FXDB3.js} +3 -3
- package/dist/{dev-O42JFQ64.js.map → dev-BZ7FXDB3.js.map} +1 -1
- package/dist/doc/index.js +1 -1
- package/dist/slide/index.js +1 -1
- package/dist/table/index.js +3 -3
- package/dist/ui/index.d.ts +28 -1
- package/dist/ui/index.js +172 -9
- package/dist/ui/index.js.map +1 -1
- package/dist/vite/index.js +1 -1
- package/package.json +2 -2
- package/registry/parts.json +81 -2
- package/registry/ui/area-chart.tsx +43 -8
- package/registry/ui/bar-chart.tsx +43 -8
- package/registry/ui/bar-list.tsx +43 -8
- package/registry/ui/box-plot-chart.tsx +42 -7
- package/registry/ui/category-bar.tsx +25 -5
- package/registry/ui/chart-frame.tsx +47 -14
- package/registry/ui/checkbox.tsx +4 -3
- package/registry/ui/code-block.tsx +44 -0
- package/registry/ui/combo-chart.tsx +20 -3
- package/registry/ui/combobox.tsx +7 -0
- package/registry/ui/context-menu.tsx +71 -0
- package/registry/ui/dashboard-card.tsx +20 -9
- package/registry/ui/data-table.tsx +7 -1
- package/registry/ui/date-range-picker.tsx +51 -4
- package/registry/ui/delta.tsx +36 -11
- package/registry/ui/donut-chart.tsx +43 -8
- package/registry/ui/echart.tsx +167 -7
- package/registry/ui/file-dropzone.tsx +143 -0
- package/registry/ui/filter-bar.tsx +74 -1
- package/registry/ui/forecast-chart.tsx +42 -7
- package/registry/ui/funnel-steps.tsx +22 -4
- package/registry/ui/heatmap.tsx +20 -3
- package/registry/ui/histogram-chart.tsx +42 -7
- package/registry/ui/kpi-card.tsx +12 -8
- package/registry/ui/legend.tsx +73 -15
- package/registry/ui/line-chart.tsx +43 -8
- package/registry/ui/page-shell.tsx +2 -0
- package/registry/ui/paired-chart.tsx +43 -8
- package/registry/ui/progress.tsx +1 -1
- package/registry/ui/scatter-chart.tsx +50 -12
- package/registry/ui/sparkline.tsx +43 -8
- package/registry/ui/states.tsx +34 -1
- package/registry/ui/status-badge.tsx +7 -7
- package/registry/ui/tabs.tsx +1 -0
- package/registry/ui/treemap.tsx +20 -3
- package/registry/ui/waterfall-chart.tsx +64 -11
- package/dist/chunk-EG4PX726.js.map +0 -1
- package/dist/chunk-P2KIHF65.js.map +0 -1
- package/dist/chunk-SC7K2RD6.js.map +0 -1
- package/dist/chunk-SDJTTMLK.js.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ChartFrameContext, useChartSurface, resolveChartColors, resolveFillColors, EChart, CHART_OTHER_COLOR } from './chunk-
|
|
2
|
-
import { Sparkline } from './chunk-
|
|
1
|
+
import { ChartFrameContext, useChartSurface, resolveChartColors, resolveFillColors, EChart, CHART_OTHER_COLOR } from './chunk-GWXKENNH.js';
|
|
2
|
+
import { Sparkline } from './chunk-U6MWBCM6.js';
|
|
3
3
|
import { formatDateRange, EMPTY_VALUE, toValueFormatter, formatDate, formatValue, formatPoints, formatKind, formatDelta, MINUS_SIGN, DEFAULT_LOCALE, formatDatesInText } from './chunk-XRKSIC5Z.js';
|
|
4
|
-
import { Tooltip, TooltipTrigger, TooltipContent, Badge, SidebarProvider, Sidebar, SidebarContent, SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarFooter, SidebarRail, SidebarInset, SidebarTrigger, Separator, Input, Table, TableHeader, TableRow, TableHead, TableBody, TableCell, Skeleton, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuCheckboxItem, useIsMobile, Popover, PopoverTrigger, PopoverContent, Calendar, ToggleGroup, ToggleGroupItem, SelectGroup, SelectLabel, Collapsible, CollapsibleTrigger, SidebarMenuButton, SidebarMenuBadge, CollapsibleContent, SidebarMenuSub, SidebarMenuSubItem, SidebarMenuSubButton, SidebarMenuItem, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Empty, Checkbox, Card, CardHeader, CardDescription, CardTitle, CardAction, CardFooter } from './chunk-5HBUBVQ3.js';
|
|
4
|
+
import { Tooltip, TooltipTrigger, TooltipContent, Badge, SidebarProvider, Sidebar, SidebarContent, SidebarGroup, SidebarGroupLabel, SidebarMenu, SidebarFooter, SidebarRail, SidebarInset, SidebarTrigger, Separator, Input, Table, TableHeader, TableRow, TableHead, TableBody, TableCell, Skeleton, Select, SelectTrigger, SelectValue, SelectContent, SelectItem, DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuCheckboxItem, useIsMobile, Popover, PopoverTrigger, PopoverContent, Calendar, ToggleGroup, ToggleGroupItem, SelectGroup, SelectLabel, Collapsible, CollapsibleTrigger, SidebarMenuButton, SidebarMenuBadge, CollapsibleContent, SidebarMenuSub, SidebarMenuSubItem, SidebarMenuSubButton, SidebarMenuItem, Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, Empty, Checkbox, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, Card, CardHeader, CardDescription, CardTitle, CardAction, CardFooter } from './chunk-5HBUBVQ3.js';
|
|
5
5
|
import { useLocale, uiLanguage, Button, weekStartsOn, resolveLocale, defaultFiscalYearStartMonth, FALLBACK_LOCALE } from './chunk-ROHNXP7J.js';
|
|
6
6
|
import { cn } from './chunk-U736PVHY.js';
|
|
7
|
-
import { forwardRef, useState, useEffect, createContext, useId, useMemo, useRef,
|
|
7
|
+
import { forwardRef, useState, useEffect, createContext, useId, useCallback, useMemo, useRef, Fragment as Fragment$1, useContext, useInsertionEffect, useLayoutEffect } from 'react';
|
|
8
8
|
import { cva } from 'class-variance-authority';
|
|
9
9
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
10
|
-
import { Search, Columns3, CalendarIcon, ChevronDownIcon, ArrowUp, ArrowDown, ArrowRight, Minus, ChevronRight, ArrowUpDown, XIcon, LoaderIcon, CheckIcon, Download, ChevronDown, X, CircleX, TriangleAlert, CircleCheck } from 'lucide-react';
|
|
10
|
+
import { Search, Columns3, CalendarIcon, ChevronDownIcon, ArrowUp, ArrowDown, ArrowRight, Minus, ChevronRight, ArrowUpDown, XIcon, LoaderIcon, CheckIcon, Download, ChevronDown, Plus, X, CircleX, TriangleAlert, CircleCheck } from 'lucide-react';
|
|
11
11
|
import { use, registerMap } from 'echarts/core';
|
|
12
12
|
import { GraphicComponent, VisualMapComponent, GeoComponent } from 'echarts/components';
|
|
13
13
|
import { ScatterChart as ScatterChart$1, HeatmapChart, MapChart, TreemapChart } from 'echarts/charts';
|
|
@@ -713,6 +713,17 @@ var ChartFrame = forwardRef(function ChartFrame2({
|
|
|
713
713
|
const titleId = title ? `${id}-title` : void 0;
|
|
714
714
|
const summaryId = summary ? `${id}-summary` : void 0;
|
|
715
715
|
const state = isLoading ? "loading" : isEmpty ? "empty" : "ready";
|
|
716
|
+
const [claims, setClaims] = useState(0);
|
|
717
|
+
const claim = useCallback(() => {
|
|
718
|
+
setClaims((n) => n + 1);
|
|
719
|
+
return () => setClaims((n) => n - 1);
|
|
720
|
+
}, []);
|
|
721
|
+
const claimed = claims > 0 && plotRole === "img";
|
|
722
|
+
const plotOwnsImage = state === "ready" && claimed;
|
|
723
|
+
const plot = useMemo(
|
|
724
|
+
() => ({ image: plotRole === "img", claimed, claim, ariaLabel: titleId ? void 0 : ariaLabel, ariaLabelledBy: titleId, ariaDescribedBy: summaryId }),
|
|
725
|
+
[plotRole, claimed, claim, titleId, ariaLabel, summaryId]
|
|
726
|
+
);
|
|
716
727
|
return /* @__PURE__ */ jsxs("figure", { "data-slot": "chart-frame", className: cn("m-0 flex w-full min-w-0 flex-col gap-3", className), ...props, children: [
|
|
717
728
|
(title || summary) && /* @__PURE__ */ jsxs("figcaption", { "data-slot": "chart-frame-header", className: "flex flex-col gap-1", children: [
|
|
718
729
|
title && /* @__PURE__ */ jsx("h3", { id: titleId, "data-slot": "chart-frame-title", className: "text-sm leading-snug font-semibold", children: title }),
|
|
@@ -724,14 +735,14 @@ var ChartFrame = forwardRef(function ChartFrame2({
|
|
|
724
735
|
ref,
|
|
725
736
|
"data-slot": "chart-frame-body",
|
|
726
737
|
"data-state": state,
|
|
727
|
-
role: state === "ready" ? plotRole : "group",
|
|
728
|
-
"aria-label": titleId ? void 0 : ariaLabel,
|
|
729
|
-
"aria-labelledby": titleId,
|
|
730
|
-
"aria-describedby": summaryId,
|
|
738
|
+
role: plotOwnsImage ? void 0 : state === "ready" ? plotRole : "group",
|
|
739
|
+
"aria-label": plotOwnsImage || titleId ? void 0 : ariaLabel,
|
|
740
|
+
"aria-labelledby": plotOwnsImage ? void 0 : titleId,
|
|
741
|
+
"aria-describedby": plotOwnsImage ? void 0 : summaryId,
|
|
731
742
|
"aria-busy": isLoading || void 0,
|
|
732
743
|
className: "relative w-full min-w-0",
|
|
733
744
|
style: { height: typeof height === "number" ? `${height}px` : height },
|
|
734
|
-
children: state === "loading" ? /* @__PURE__ */ jsx(ChartSkeleton, { variant, loadingText: t.loading }) : state === "empty" ? /* @__PURE__ */ jsx(ChartEmpty, { ...emptyState, defaultTitle: t.emptyTitle }) : /* @__PURE__ */ jsx(ChartFrameContext.Provider, { value:
|
|
745
|
+
children: state === "loading" ? /* @__PURE__ */ jsx(ChartSkeleton, { variant, loadingText: t.loading }) : state === "empty" ? /* @__PURE__ */ jsx(ChartEmpty, { ...emptyState, defaultTitle: t.emptyTitle }) : /* @__PURE__ */ jsx(ChartFrameContext.Provider, { value: plot, children })
|
|
735
746
|
}
|
|
736
747
|
),
|
|
737
748
|
footnote && /* @__PURE__ */ jsx("p", { "data-slot": "chart-frame-footnote", className: "text-xs leading-snug text-muted-foreground", children: footnote }),
|
|
@@ -3562,7 +3573,8 @@ var CategoryBar = forwardRef(function CategoryBar2({ values = NO_ROWS6, colors,
|
|
|
3562
3573
|
style: { background: markerColor }
|
|
3563
3574
|
}
|
|
3564
3575
|
);
|
|
3565
|
-
|
|
3576
|
+
const labelled = props["aria-label"] != null || props["aria-labelledby"] != null;
|
|
3577
|
+
return /* @__PURE__ */ jsxs("div", { ref, "data-slot": "category-bar", role: labelled ? "group" : void 0, className: cn("w-full", className), ...props, children: [
|
|
3566
3578
|
showLabels && labels.length > 0 && /* @__PURE__ */ jsx("div", { "data-slot": "category-bar-labels", className: "relative mb-2 h-4 text-xs text-muted-foreground tabular-nums", children: labels.map((label2, i) => /* @__PURE__ */ jsx(
|
|
3567
3579
|
"span",
|
|
3568
3580
|
{
|
|
@@ -3597,7 +3609,7 @@ var CategoryBar = forwardRef(function CategoryBar2({ values = NO_ROWS6, colors,
|
|
|
3597
3609
|
),
|
|
3598
3610
|
style: { left: `${markerPosition}%` },
|
|
3599
3611
|
children: marker.tooltip ? /* @__PURE__ */ jsxs(Tooltip, { children: [
|
|
3600
|
-
/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx("
|
|
3612
|
+
/* @__PURE__ */ jsx(TooltipTrigger, { render: /* @__PURE__ */ jsx("button", { type: "button", "aria-label": marker.tooltip, className: "block cursor-default py-1" }), children: markerDot }),
|
|
3601
3613
|
/* @__PURE__ */ jsx(TooltipContent, { children: marker.tooltip })
|
|
3602
3614
|
] }) : markerDot
|
|
3603
3615
|
}
|
|
@@ -3906,8 +3918,19 @@ var STEP_LABEL_MIN_SLOT = 44;
|
|
|
3906
3918
|
function stepLabelWidth(plotWidth, steps) {
|
|
3907
3919
|
return Math.max(24, stepSlotWidth(plotWidth, steps) - 8);
|
|
3908
3920
|
}
|
|
3909
|
-
function
|
|
3910
|
-
|
|
3921
|
+
function longestWordWidth(names) {
|
|
3922
|
+
let widest = 0;
|
|
3923
|
+
for (const name of names) {
|
|
3924
|
+
for (const word of name.split(/\s+/)) {
|
|
3925
|
+
let w = 0;
|
|
3926
|
+
for (const ch of word) w += ch.charCodeAt(0) > 11903 ? 12 : 7;
|
|
3927
|
+
widest = Math.max(widest, w);
|
|
3928
|
+
}
|
|
3929
|
+
}
|
|
3930
|
+
return widest;
|
|
3931
|
+
}
|
|
3932
|
+
function stepLabelLayout(plotWidth, steps, names = []) {
|
|
3933
|
+
return stepSlotWidth(plotWidth, steps) >= STEP_LABEL_MIN_SLOT && longestWordWidth(names) <= stepLabelWidth(plotWidth, steps) ? { width: stepLabelWidth(plotWidth, steps), rotate: 0 } : { rotate: 45 };
|
|
3911
3934
|
}
|
|
3912
3935
|
function waterfallValueLabelPlan(steps, texts, plotWidth) {
|
|
3913
3936
|
const show = steps.map((s) => s.kind !== "gap");
|
|
@@ -4048,7 +4071,7 @@ function buildWaterfallOption(config) {
|
|
|
4048
4071
|
interval: 0,
|
|
4049
4072
|
hideOverlap: false,
|
|
4050
4073
|
formatter: (value) => labelOf(value, labels),
|
|
4051
|
-
...config.plotWidth ? { ...stepLabelLayout(config.plotWidth, steps.length), overflow: "break" } : {}
|
|
4074
|
+
...config.plotWidth ? { ...stepLabelLayout(config.plotWidth, steps.length, steps.map((st) => labelOf(st.name, labels))), overflow: "break" } : {}
|
|
4052
4075
|
}
|
|
4053
4076
|
},
|
|
4054
4077
|
yAxis: {
|
|
@@ -4423,7 +4446,9 @@ function buildScatterOption(config) {
|
|
|
4423
4446
|
top: (showLegend && !legendBelow ? 12 + 24 * legendLineCount : 12) + (guides.some((line) => line.axis === "x" && line.label) && (!showLegend || legendBelow) ? 14 : 0),
|
|
4424
4447
|
right: 24,
|
|
4425
4448
|
bottom: legendBelow ? 24 + 24 * legendLineCount : 24,
|
|
4426
|
-
left:
|
|
4449
|
+
// The rotated y axis name lies outside `containLabel`'s reach (its right edge is `nameGap` left of the axis line): the
|
|
4450
|
+
// margin holds its height, so the name is never cut at the chart's left edge.
|
|
4451
|
+
left: 36,
|
|
4427
4452
|
containLabel: true
|
|
4428
4453
|
},
|
|
4429
4454
|
...headingWidth > 0 ? {
|
|
@@ -4472,7 +4497,7 @@ function buildScatterOption(config) {
|
|
|
4472
4497
|
label: {
|
|
4473
4498
|
show: keptLabels === null,
|
|
4474
4499
|
position: "right",
|
|
4475
|
-
distance:
|
|
4500
|
+
distance: 8,
|
|
4476
4501
|
fontSize: 11,
|
|
4477
4502
|
color: config.textColors?.label,
|
|
4478
4503
|
// Plain text: an outline / shadow reads as a halo on a dark surface.
|
|
@@ -4480,7 +4505,8 @@ function buildScatterOption(config) {
|
|
|
4480
4505
|
textShadowBlur: 0,
|
|
4481
4506
|
formatter: (p) => p.data?.point?.label ?? ""
|
|
4482
4507
|
},
|
|
4483
|
-
|
|
4508
|
+
// A name stays beside its own dot: one that would collide with another is hidden, not pushed onto a neighbouring dot.
|
|
4509
|
+
labelLayout: { hideOverlap: true }
|
|
4484
4510
|
} : {},
|
|
4485
4511
|
// The guide lines hang off the first series (a markLine belongs to one).
|
|
4486
4512
|
...i === 0 && guides.length > 0 ? {
|
|
@@ -8457,6 +8483,8 @@ var TEXT23 = {
|
|
|
8457
8483
|
selectRow: "\u884C\u3092\u9078\u629E",
|
|
8458
8484
|
trend: (points, first, last, min, max) => `${points}\u70B9\u306E\u63A8\u79FB\u3001${first}\u304B\u3089${last}\u3001\u6700\u5C0F${min}\u3001\u6700\u5927${max}`,
|
|
8459
8485
|
noData: "\u30C7\u30FC\u30BF\u304C\u3042\u308A\u307E\u305B\u3093",
|
|
8486
|
+
search: "\u691C\u7D22",
|
|
8487
|
+
pageSizeLabel: "1\u30DA\u30FC\u30B8\u306E\u8868\u793A\u4EF6\u6570",
|
|
8460
8488
|
pageSize: (size) => `${size}\u4EF6`,
|
|
8461
8489
|
range: (total, start, end) => `${total}\u4EF6\u4E2D ${start} - ${end} \u3092\u8868\u793A`,
|
|
8462
8490
|
first: "\u6700\u521D",
|
|
@@ -8473,6 +8501,8 @@ var TEXT23 = {
|
|
|
8473
8501
|
selectRow: "Select row",
|
|
8474
8502
|
trend: (points, first, last, min, max) => `Trend over ${points} points: ${first} to ${last}, min ${min}, max ${max}`,
|
|
8475
8503
|
noData: "No results.",
|
|
8504
|
+
search: "Search",
|
|
8505
|
+
pageSizeLabel: "Rows per page",
|
|
8476
8506
|
pageSize: (size) => `${size} / page`,
|
|
8477
8507
|
range: (total, start, end) => `Showing ${start}\u2013${end} of ${total}`,
|
|
8478
8508
|
first: "First",
|
|
@@ -8735,6 +8765,7 @@ DataTable.displayName = "DataTable";
|
|
|
8735
8765
|
var DataTableToolbar = forwardRef(
|
|
8736
8766
|
({ showSearch, toolbar, bulkActions, className, ...props }, ref) => {
|
|
8737
8767
|
const { globalFilter, setGlobalFilter, hasSelection, selectedRows, enableFiltering } = useDataTable();
|
|
8768
|
+
const t = useText();
|
|
8738
8769
|
const showSearchEffective = showSearch ?? enableFiltering;
|
|
8739
8770
|
const hasContent = showSearchEffective || toolbar != null || hasSelection && bulkActions != null;
|
|
8740
8771
|
if (!hasContent) return null;
|
|
@@ -8751,6 +8782,7 @@ var DataTableToolbar = forwardRef(
|
|
|
8751
8782
|
/* @__PURE__ */ jsx(
|
|
8752
8783
|
Input,
|
|
8753
8784
|
{
|
|
8785
|
+
"aria-label": t.search,
|
|
8754
8786
|
value: globalFilter,
|
|
8755
8787
|
onChange: (e) => setGlobalFilter(e.target.value),
|
|
8756
8788
|
className: "max-w-sm pl-8"
|
|
@@ -8934,7 +8966,7 @@ var DataTablePagination = forwardRef(
|
|
|
8934
8966
|
value: String(currentPageSize),
|
|
8935
8967
|
onValueChange: (value) => table.setPageSize(Number(value)),
|
|
8936
8968
|
children: [
|
|
8937
|
-
/* @__PURE__ */ jsx(SelectTrigger, { size: "sm", className: "min-w-[80px]", children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
8969
|
+
/* @__PURE__ */ jsx(SelectTrigger, { size: "sm", className: "min-w-[80px]", "aria-label": t.pageSizeLabel, children: /* @__PURE__ */ jsx(SelectValue, {}) }),
|
|
8938
8970
|
/* @__PURE__ */ jsx(SelectContent, { children: pageSizeItems.map((item) => /* @__PURE__ */ jsx(SelectItem, { value: item.value, children: item.label }, item.value)) })
|
|
8939
8971
|
]
|
|
8940
8972
|
}
|
|
@@ -9384,6 +9416,50 @@ function FilterBarMultiSelect({
|
|
|
9384
9416
|
] });
|
|
9385
9417
|
}
|
|
9386
9418
|
FilterBarMultiSelect.displayName = "FilterBarMultiSelect";
|
|
9419
|
+
function FilterBarAddFilter({ filters, className }) {
|
|
9420
|
+
const { value, onChange } = useFilterBar();
|
|
9421
|
+
const t = useText2();
|
|
9422
|
+
const toggle = (filter, option) => {
|
|
9423
|
+
if (filter.type === "multi-select") {
|
|
9424
|
+
const current = value[filter.key] ?? [];
|
|
9425
|
+
const next = current.includes(option) ? current.filter((v) => v !== option) : [...current, option];
|
|
9426
|
+
onChange({ ...value, [filter.key]: next.length > 0 ? next : void 0 });
|
|
9427
|
+
} else {
|
|
9428
|
+
onChange({ ...value, [filter.key]: value[filter.key] === option ? void 0 : option });
|
|
9429
|
+
}
|
|
9430
|
+
};
|
|
9431
|
+
const isChecked = (filter, option) => {
|
|
9432
|
+
const v = value[filter.key];
|
|
9433
|
+
return Array.isArray(v) ? v.includes(option) : v === option;
|
|
9434
|
+
};
|
|
9435
|
+
return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
|
|
9436
|
+
/* @__PURE__ */ jsxs(
|
|
9437
|
+
DropdownMenuTrigger,
|
|
9438
|
+
{
|
|
9439
|
+
render: /* @__PURE__ */ jsx(Button, { variant: "outline", size: "sm", className: cn("h-8 gap-1", className) }),
|
|
9440
|
+
"data-slot": "filter-bar-add-filter",
|
|
9441
|
+
children: [
|
|
9442
|
+
/* @__PURE__ */ jsx(Plus, { className: "size-3.5", "aria-hidden": "true" }),
|
|
9443
|
+
t.addFilter
|
|
9444
|
+
]
|
|
9445
|
+
}
|
|
9446
|
+
),
|
|
9447
|
+
/* @__PURE__ */ jsx(DropdownMenuContent, { align: "start", className: "w-48", children: filters.filter((f) => (f.type === "select" || f.type === "multi-select") && f.options?.length).map((filter) => /* @__PURE__ */ jsxs(DropdownMenuSub, { children: [
|
|
9448
|
+
/* @__PURE__ */ jsx(DropdownMenuSubTrigger, { children: filter.label }),
|
|
9449
|
+
/* @__PURE__ */ jsx(DropdownMenuSubContent, { children: filter.options?.map((option) => /* @__PURE__ */ jsx(
|
|
9450
|
+
DropdownMenuCheckboxItem,
|
|
9451
|
+
{
|
|
9452
|
+
checked: isChecked(filter, option.value),
|
|
9453
|
+
disabled: option.disabled,
|
|
9454
|
+
onCheckedChange: () => toggle(filter, option.value),
|
|
9455
|
+
children: option.label
|
|
9456
|
+
},
|
|
9457
|
+
option.value
|
|
9458
|
+
)) })
|
|
9459
|
+
] }, filter.key)) })
|
|
9460
|
+
] });
|
|
9461
|
+
}
|
|
9462
|
+
FilterBarAddFilter.displayName = "FilterBarAddFilter";
|
|
9387
9463
|
function FilterBarActiveChips({ filters, className }) {
|
|
9388
9464
|
const { value, onChange } = useFilterBar();
|
|
9389
9465
|
const t = useText2();
|
|
@@ -9591,12 +9667,10 @@ var PRESET_LABELS = {
|
|
|
9591
9667
|
var TEXT26 = {
|
|
9592
9668
|
ja: {
|
|
9593
9669
|
placeholder: "\u671F\u9593\u3092\u9078\u629E",
|
|
9594
|
-
rangeSeparator: " - ",
|
|
9595
9670
|
comparison: { "previous-period": "\u524D\u671F\u9593", "previous-year": "\u524D\u5E74\u540C\u671F" }
|
|
9596
9671
|
},
|
|
9597
9672
|
en: {
|
|
9598
9673
|
placeholder: "Pick a date range",
|
|
9599
|
-
rangeSeparator: " \u2013 ",
|
|
9600
9674
|
comparison: { "previous-period": "vs. previous period", "previous-year": "vs. same period last year" }
|
|
9601
9675
|
}
|
|
9602
9676
|
};
|
|
@@ -9719,13 +9793,13 @@ var DateRangePicker = forwardRef(
|
|
|
9719
9793
|
const formatDateRange2 = () => {
|
|
9720
9794
|
if (!value?.from) return placeholder ?? t.placeholder;
|
|
9721
9795
|
if (!value.to) return formatDate(value.from, "date", locale);
|
|
9722
|
-
return
|
|
9796
|
+
return formatDateRange(value.from, value.to, { locale });
|
|
9723
9797
|
};
|
|
9724
9798
|
const selectedPreset = findMatchingPreset(presets, value);
|
|
9725
9799
|
const presetLabel = selectedPreset?.label;
|
|
9726
9800
|
const comparisonText = comparison && value?.from && value.to ? (() => {
|
|
9727
9801
|
const c = comparisonRange({ from: value.from, to: value.to }, comparison);
|
|
9728
|
-
return `${t.comparison[comparison]} ${
|
|
9802
|
+
return `${t.comparison[comparison]} ${formatDateRange(c.from, c.to, { locale })}`;
|
|
9729
9803
|
})() : void 0;
|
|
9730
9804
|
const endMonth = value?.to ?? value?.from;
|
|
9731
9805
|
const defaultMonth = endMonth ? isMobile ? endMonth : subMonths(endMonth, 1) : void 0;
|
|
@@ -10698,7 +10772,7 @@ function KpiCard({
|
|
|
10698
10772
|
{
|
|
10699
10773
|
data: historyPoints.map((v) => ({ value: v })),
|
|
10700
10774
|
height: SPARKLINE_HEIGHT,
|
|
10701
|
-
color: "
|
|
10775
|
+
color: "chart-1",
|
|
10702
10776
|
highlight: "latest",
|
|
10703
10777
|
"aria-label": t.history(label2, historyPoints.length)
|
|
10704
10778
|
}
|
|
@@ -10837,6 +10911,6 @@ function DraftChartPreview({ children }) {
|
|
|
10837
10911
|
return /* @__PURE__ */ jsx("div", { ref, "data-slot": "draft-chart", style: { display: "contents" }, children });
|
|
10838
10912
|
}
|
|
10839
10913
|
|
|
10840
|
-
export { AppShell, AreaChart, AttentionList, BarChart, BarList, BoxPlotChart, COMPARISON_LABELS, CategoryBar, ChartFrame, ComboChart, DEFAULT_SAMPLE_LABEL, DELTA_NOT_COMPARABLE, DashboardCard, DashboardCardAction, DashboardCardContent, DashboardCardDescription, DashboardCardFooter, DashboardCardHeader, DashboardCardPreset, DashboardCardSkeleton, DashboardCardTitle, DataTable, DataTableColumnVisibility, DataTableContent, DataTableExport, DataTablePagination, DataTablePreset, DataTableToolbar, DateRangePicker, Delta, DonutChart, DraftChart, FilledMap, FilterBar, FilterBarActiveChips, FilterBarClearButton, FilterBarMultiSelect, FilterBarPreset, FilterBarSelect, ForecastChart, FunnelSteps, Heatmap, HistogramChart, KpiCard, Legend, LineChart, MetricUnit, MetricValue, MultiSelect, PageShell, PageShellActions, PageShellContent, PageShellDescription, PageShellHeader, PageShellHeaderEnd, PageShellHeading, PageShellMeta, PageShellSummary, PageShellSummaryCard, PageShellTitle, PairedChart, PivotTable, Placeholder, ProgressCircle, RECORD_MIN_POINTS, SampleBadge, SampleClaim, SampleData, ScatterChart, SearchableSelect, SectionHeader, SegmentedControl, StatusBadge, SymbolMap, Tracker, Treemap, TrendIndicator, UpdatedAt, WaterfallChart, comparisonBaseline, comparisonLabel, computeComparison, computeTargetProgress, defaultChangeDisplay, defaultPresets, deltaVariants, detectRecord, fillKpiTemplate, flattenOptions, formatChange, formatChangeAmount, formatRelativeTime, funnelStepsVariants, inferPeriodGrain, isGroupedOptions, metricValueVariants, pageShellSummaryCardVariants, tableToCsv, toCsv, toneForValue, useDataTable, useSampleMark };
|
|
10841
|
-
//# sourceMappingURL=chunk-
|
|
10842
|
-
//# sourceMappingURL=chunk-
|
|
10914
|
+
export { AppShell, AreaChart, AttentionList, BarChart, BarList, BoxPlotChart, COMPARISON_LABELS, CategoryBar, ChartFrame, ComboChart, DEFAULT_SAMPLE_LABEL, DELTA_NOT_COMPARABLE, DashboardCard, DashboardCardAction, DashboardCardContent, DashboardCardDescription, DashboardCardFooter, DashboardCardHeader, DashboardCardPreset, DashboardCardSkeleton, DashboardCardTitle, DataTable, DataTableColumnVisibility, DataTableContent, DataTableExport, DataTablePagination, DataTablePreset, DataTableToolbar, DateRangePicker, Delta, DonutChart, DraftChart, FilledMap, FilterBar, FilterBarActiveChips, FilterBarAddFilter, FilterBarClearButton, FilterBarMultiSelect, FilterBarPreset, FilterBarSelect, ForecastChart, FunnelSteps, Heatmap, HistogramChart, KpiCard, Legend, LineChart, MetricUnit, MetricValue, MultiSelect, PageShell, PageShellActions, PageShellContent, PageShellDescription, PageShellHeader, PageShellHeaderEnd, PageShellHeading, PageShellMeta, PageShellSummary, PageShellSummaryCard, PageShellTitle, PairedChart, PivotTable, Placeholder, ProgressCircle, RECORD_MIN_POINTS, SampleBadge, SampleClaim, SampleData, ScatterChart, SearchableSelect, SectionHeader, SegmentedControl, StatusBadge, SymbolMap, Tracker, Treemap, TrendIndicator, UpdatedAt, WaterfallChart, comparisonBaseline, comparisonLabel, computeComparison, computeTargetProgress, defaultChangeDisplay, defaultPresets, deltaVariants, detectRecord, fillKpiTemplate, flattenOptions, formatChange, formatChangeAmount, formatRelativeTime, funnelStepsVariants, inferPeriodGrain, isGroupedOptions, metricValueVariants, pageShellSummaryCardVariants, tableToCsv, toCsv, toneForValue, useDataTable, useSampleMark };
|
|
10915
|
+
//# sourceMappingURL=chunk-I2GWIPTD.js.map
|
|
10916
|
+
//# sourceMappingURL=chunk-I2GWIPTD.js.map
|