@ai-matrx/records-ui 0.116.27 → 0.116.28
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/CHANGELOG.md +1 -1
- package/dist/{chunk-6GJLCWSO.js → chunk-5EFM2G2O.js} +99 -21
- package/dist/chunk-5EFM2G2O.js.map +1 -0
- package/dist/index.cjs +202 -96
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -6
- package/dist/index.d.ts +1 -6
- package/dist/index.js +108 -79
- package/dist/index.js.map +1 -1
- package/dist/pickers.cjs +98 -20
- package/dist/pickers.cjs.map +1 -1
- package/dist/pickers.js +1 -1
- package/package.json +6 -6
- package/dist/chunk-6GJLCWSO.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -5310,12 +5310,7 @@ type ChartConfig = Record<string, {
|
|
|
5310
5310
|
icon?: ComponentType;
|
|
5311
5311
|
color?: string;
|
|
5312
5312
|
}>;
|
|
5313
|
-
|
|
5314
|
-
* MEASURE THE BOX, DO NOT ASK RECHARTS TO. Returns the ref to put on the
|
|
5315
|
-
* wrapper and the width to hand the chart. `ResizeObserver` being absent is not
|
|
5316
|
-
* an error: the fallback stands and the chart still draws.
|
|
5317
|
-
*/
|
|
5318
|
-
declare function useMeasuredWidth(fallback?: number): [RefObject<HTMLDivElement | null>, number];
|
|
5313
|
+
declare function useMeasuredWidth<T extends HTMLElement = HTMLDivElement>(fallback?: number): [RefObject<T | null>, number];
|
|
5319
5314
|
/**
|
|
5320
5315
|
* The box a chart lives in. It carries the app's own Recharts class overrides —
|
|
5321
5316
|
* axis ticks in `muted-foreground`, the grid and the cursor in `border`, no
|
package/dist/index.d.ts
CHANGED
|
@@ -5310,12 +5310,7 @@ type ChartConfig = Record<string, {
|
|
|
5310
5310
|
icon?: ComponentType;
|
|
5311
5311
|
color?: string;
|
|
5312
5312
|
}>;
|
|
5313
|
-
|
|
5314
|
-
* MEASURE THE BOX, DO NOT ASK RECHARTS TO. Returns the ref to put on the
|
|
5315
|
-
* wrapper and the width to hand the chart. `ResizeObserver` being absent is not
|
|
5316
|
-
* an error: the fallback stands and the chart still draws.
|
|
5317
|
-
*/
|
|
5318
|
-
declare function useMeasuredWidth(fallback?: number): [RefObject<HTMLDivElement | null>, number];
|
|
5313
|
+
declare function useMeasuredWidth<T extends HTMLElement = HTMLDivElement>(fallback?: number): [RefObject<T | null>, number];
|
|
5319
5314
|
/**
|
|
5320
5315
|
* The box a chart lives in. It carries the app's own Recharts class overrides —
|
|
5321
5316
|
* axis ticks in `muted-foreground`, the grid and the cursor in `border`, no
|
package/dist/index.js
CHANGED
|
@@ -182,7 +182,7 @@ import {
|
|
|
182
182
|
withoutAddition,
|
|
183
183
|
withoutLeadingBlank,
|
|
184
184
|
workedOutErrorFor
|
|
185
|
-
} from "./chunk-
|
|
185
|
+
} from "./chunk-5EFM2G2O.js";
|
|
186
186
|
import {
|
|
187
187
|
CHART_PLOT_PX,
|
|
188
188
|
EMBEDDED_ROW_PX,
|
|
@@ -23522,7 +23522,7 @@ function ListView({
|
|
|
23522
23522
|
layout: "list",
|
|
23523
23523
|
fields,
|
|
23524
23524
|
hiddenFields,
|
|
23525
|
-
summary: chose ? `Fields shown (${shown4.length} of ${fields.length})` :
|
|
23525
|
+
summary: chose ? `Fields shown (${shown4.length} of ${fields.length})` : "Fields",
|
|
23526
23526
|
onChange: onHiddenFieldsChange,
|
|
23527
23527
|
remembered
|
|
23528
23528
|
}
|
|
@@ -23995,15 +23995,17 @@ function useCompactWith(plain2) {
|
|
|
23995
23995
|
import {
|
|
23996
23996
|
useEffect as useEffect66,
|
|
23997
23997
|
useId as useId2,
|
|
23998
|
+
useLayoutEffect as useLayoutEffect4,
|
|
23998
23999
|
useRef as useRef34,
|
|
23999
24000
|
useState as useState75
|
|
24000
24001
|
} from "react";
|
|
24001
24002
|
import { cn as cn35 } from "@ai-matrx/design-system";
|
|
24002
24003
|
import { jsx as jsx82, jsxs as jsxs75 } from "react/jsx-runtime";
|
|
24004
|
+
var useBeforePaint = typeof document === "undefined" ? useEffect66 : useLayoutEffect4;
|
|
24003
24005
|
function useMeasuredWidth(fallback = 480) {
|
|
24004
24006
|
const ref = useRef34(null);
|
|
24005
24007
|
const [width, setWidth] = useState75(fallback);
|
|
24006
|
-
|
|
24008
|
+
useBeforePaint(() => {
|
|
24007
24009
|
const node = ref.current;
|
|
24008
24010
|
if (!node) return;
|
|
24009
24011
|
const apply = () => {
|
|
@@ -24092,7 +24094,7 @@ function ChartLegendContent({
|
|
|
24092
24094
|
if (!payload || payload.length === 0) return null;
|
|
24093
24095
|
return /* @__PURE__ */ jsx82("div", { className: cn35("flex flex-wrap items-center justify-center gap-3 pt-2", className), children: payload.map((entry, index) => {
|
|
24094
24096
|
const key = String(entry.dataKey ?? entry.value ?? index);
|
|
24095
|
-
return /* @__PURE__ */ jsxs75("span", { className: "flex items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
24097
|
+
return /* @__PURE__ */ jsxs75("span", { className: "flex max-w-full items-center gap-1.5 text-xs text-muted-foreground", children: [
|
|
24096
24098
|
/* @__PURE__ */ jsx82(
|
|
24097
24099
|
"span",
|
|
24098
24100
|
{
|
|
@@ -24100,7 +24102,7 @@ function ChartLegendContent({
|
|
|
24100
24102
|
style: { "--color-swatch": entry.color }
|
|
24101
24103
|
}
|
|
24102
24104
|
),
|
|
24103
|
-
config[key]?.label ?? key
|
|
24105
|
+
/* @__PURE__ */ jsx82("span", { className: "min-w-0 truncate", title: String(config[key]?.label ?? key), children: config[key]?.label ?? key })
|
|
24104
24106
|
] }, key);
|
|
24105
24107
|
}) });
|
|
24106
24108
|
}
|
|
@@ -24182,6 +24184,8 @@ function colorOfGroup(groups, colors) {
|
|
|
24182
24184
|
var NO_GROUPS = { title: "", kind: "bar", group_by: [], rows: [] };
|
|
24183
24185
|
function ChartBlock({ block, subject, tableName: tableName2, className, centerValue, centerTotal, dataLabels, legend = true, groupColors, variant = "card", source, shape }) {
|
|
24184
24186
|
const bare = variant === "bare";
|
|
24187
|
+
const [figureRef, figureWidth] = useMeasuredWidth(480);
|
|
24188
|
+
const narrow = figureWidth < 400;
|
|
24185
24189
|
const host = useRecordsUi();
|
|
24186
24190
|
const drawn = shape ?? block.kind;
|
|
24187
24191
|
const kind2 = shape ? BASE_KIND_OF_SHAPE[shape] : block.kind;
|
|
@@ -24296,18 +24300,19 @@ function ChartBlock({ block, subject, tableName: tableName2, className, centerVa
|
|
|
24296
24300
|
return /* @__PURE__ */ jsx83(ChartFormatContext.Provider, { value: numberFormat, children: /* @__PURE__ */ jsxs76(
|
|
24297
24301
|
"figure",
|
|
24298
24302
|
{
|
|
24303
|
+
ref: figureRef,
|
|
24299
24304
|
className: cn36("flex min-w-0 flex-col gap-1.5", bare ? null : "rounded border p-2", className),
|
|
24300
24305
|
...bare ? { "aria-label": block.title || CHART_KIND_LABEL[kind2] } : {},
|
|
24301
24306
|
...typeof block.ms === "number" ? { "data-store-ms": pretty(block.ms) } : {},
|
|
24302
24307
|
children: [
|
|
24303
|
-
bare ? null : /* @__PURE__ */ jsxs76("figcaption", { className: "flex items-baseline gap-2 text-xs", children: [
|
|
24304
|
-
tableName2 ? /* @__PURE__ */ jsx83("span", { className: "shrink-0 text-muted-foreground", "data-records-chart-table": "", children: tableName2 }) : null,
|
|
24305
|
-
/* @__PURE__ */ jsx83("span", { className: "truncate font-medium", children: block.title || CHART_KIND_LABEL[kind2] }),
|
|
24308
|
+
bare ? null : /* @__PURE__ */ jsxs76("figcaption", { className: cn36("flex min-w-0 items-baseline gap-x-2 text-xs", narrow ? "flex-wrap" : null), "data-records-chart-caption": "", children: [
|
|
24309
|
+
tableName2 ? /* @__PURE__ */ jsx83("span", { className: "max-w-[40%] shrink-0 truncate text-muted-foreground", title: tableName2, "data-records-chart-table": "", children: tableName2 }) : null,
|
|
24310
|
+
/* @__PURE__ */ jsx83("span", { className: cn36("truncate font-medium", narrow ? "min-w-0 max-w-full flex-[1_1_100%]" : "min-w-[6ch] shrink"), title: block.title || CHART_KIND_LABEL[kind2], "data-records-chart-title": "", children: block.title || CHART_KIND_LABEL[kind2] }),
|
|
24306
24311
|
kind2 !== "number" && compared && block.totals && typeof block.totals.current === "number" ? /* @__PURE__ */ jsxs76("span", { className: "flex shrink-0 items-baseline gap-1 tabular-nums", children: [
|
|
24307
24312
|
/* @__PURE__ */ jsx83("span", { children: pretty(block.totals.current) }),
|
|
24308
24313
|
/* @__PURE__ */ jsx83(Trend, { pct: block.totals.change_pct, aimingUp: !!target })
|
|
24309
24314
|
] }) : null,
|
|
24310
|
-
/* @__PURE__ */ jsx83("span", { className: "
|
|
24315
|
+
/* @__PURE__ */ jsx83("span", { className: cn36("min-w-0 truncate text-muted-foreground", narrow ? "max-w-full" : "ml-auto max-w-[45%] shrink-0"), title: kind2 === "stuck" ? void 0 : measureName, children: kind2 === "stuck" ? `${block.days ?? 14} days` : measureName })
|
|
24311
24316
|
] }),
|
|
24312
24317
|
block.compare_refused ? /* @__PURE__ */ jsx83("p", { className: "px-1 text-xs text-muted-foreground", children: block.compare_refused }) : null,
|
|
24313
24318
|
!block.refused && targetNote(target) ? /* @__PURE__ */ jsx83("p", { className: "px-1 text-xs text-muted-foreground", children: targetNote(target) }) : null,
|
|
@@ -24499,11 +24504,27 @@ function wrapTickWords(label, perLine, maxLines = 3) {
|
|
|
24499
24504
|
kept[maxLines - 1] = `${last.length >= perLine ? last.slice(0, perLine - 1) : last}\u2026`;
|
|
24500
24505
|
return kept;
|
|
24501
24506
|
}
|
|
24507
|
+
var TICK_CHAR_PX = 5.6;
|
|
24508
|
+
var TICK_MIN_CHARS = 6;
|
|
24509
|
+
function planCategoryTicks(slotPx, charPx = TICK_CHAR_PX, minChars = TICK_MIN_CHARS) {
|
|
24510
|
+
const slot = Math.max(1, slotPx);
|
|
24511
|
+
const fit = Math.floor((slot - 4) / charPx);
|
|
24512
|
+
if (fit >= minChars) return { step: 1, perLine: fit };
|
|
24513
|
+
const step2 = Math.max(1, Math.ceil((minChars * charPx + 4) / slot));
|
|
24514
|
+
return { step: step2, perLine: Math.max(3, Math.floor((slot * step2 - 4) / charPx)) };
|
|
24515
|
+
}
|
|
24516
|
+
function lineAxis(width, count) {
|
|
24517
|
+
const plan = planCategoryTicks((width - 56) / Math.max(count, 1));
|
|
24518
|
+
const pad2 = Math.min(30, Math.ceil(plan.perLine * TICK_CHAR_PX / 2));
|
|
24519
|
+
return { interval: 0, height: 40, padding: { left: pad2, right: pad2 }, tick: /* @__PURE__ */ jsx83(WrappedTick, { ...plan }) };
|
|
24520
|
+
}
|
|
24502
24521
|
function WrappedTick(props) {
|
|
24503
|
-
const { x = 0, y = 0, payload, across, perLine } = props;
|
|
24504
|
-
|
|
24522
|
+
const { x = 0, y = 0, index = 0, payload, across, perLine, step: step2 = 1, maxLines = 3 } = props;
|
|
24523
|
+
if (step2 > 1 && index % step2 !== 0) return /* @__PURE__ */ jsx83("g", {});
|
|
24524
|
+
const full = String(payload?.value ?? "");
|
|
24525
|
+
const lines = wrapTickWords(full, perLine, maxLines);
|
|
24505
24526
|
const lineHeight = 11;
|
|
24506
|
-
return /* @__PURE__ */
|
|
24527
|
+
return /* @__PURE__ */ jsxs76(
|
|
24507
24528
|
"text",
|
|
24508
24529
|
{
|
|
24509
24530
|
x,
|
|
@@ -24512,15 +24533,18 @@ function WrappedTick(props) {
|
|
|
24512
24533
|
fill: "currentColor",
|
|
24513
24534
|
textAnchor: across ? "end" : "middle",
|
|
24514
24535
|
"data-records-chart-tick": "",
|
|
24515
|
-
children:
|
|
24516
|
-
"
|
|
24517
|
-
|
|
24518
|
-
|
|
24519
|
-
|
|
24520
|
-
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
|
|
24536
|
+
children: [
|
|
24537
|
+
/* @__PURE__ */ jsx83("title", { children: full }),
|
|
24538
|
+
lines.map((line, i) => /* @__PURE__ */ jsx83(
|
|
24539
|
+
"tspan",
|
|
24540
|
+
{
|
|
24541
|
+
x: across ? x - 4 : x,
|
|
24542
|
+
dy: i === 0 ? across ? -((lines.length - 1) * lineHeight) / 2 + 3 : 10 : lineHeight,
|
|
24543
|
+
children: line
|
|
24544
|
+
},
|
|
24545
|
+
i
|
|
24546
|
+
))
|
|
24547
|
+
]
|
|
24524
24548
|
}
|
|
24525
24549
|
);
|
|
24526
24550
|
}
|
|
@@ -24633,7 +24657,7 @@ function Drawing({
|
|
|
24633
24657
|
if (kind2 === "area") {
|
|
24634
24658
|
return /* @__PURE__ */ jsx83(ChartFrame, { config, height: HEIGHT, children: (width) => /* @__PURE__ */ jsxs76(AreaChart, { width, height: HEIGHT, data, margin: { top: dataLabels ? 16 : 6, right: dataLabels ? 14 : 6, bottom: 0, left: 0 }, children: [
|
|
24635
24659
|
/* @__PURE__ */ jsx83(CartesianGrid, { vertical: false }),
|
|
24636
|
-
/* @__PURE__ */ jsx83(XAxis, { dataKey: "label", ...axis }),
|
|
24660
|
+
/* @__PURE__ */ jsx83(XAxis, { dataKey: "label", ...axis, ...lineAxis(width, points.length) }),
|
|
24637
24661
|
/* @__PURE__ */ jsx83(YAxis, { width: 44, ...axis }),
|
|
24638
24662
|
tooltip,
|
|
24639
24663
|
legend,
|
|
@@ -24662,7 +24686,7 @@ function Drawing({
|
|
|
24662
24686
|
const tallest = Math.max(1, ...stack.data.map((row) => keys.reduce((sum, k) => sum + (typeof row[k] === "number" ? row[k] : 0), 0)));
|
|
24663
24687
|
return /* @__PURE__ */ jsx83(ChartFrame, { config, height: HEIGHT, children: (width) => /* @__PURE__ */ jsxs76(BarChart, { width, height: HEIGHT, data: stack.data, margin: { top: dataLabels ? 16 : 6, right: 6, bottom: 0, left: 0 }, "data-records-stacked": "", children: [
|
|
24664
24688
|
/* @__PURE__ */ jsx83(CartesianGrid, { vertical: false }),
|
|
24665
|
-
/* @__PURE__ */ jsx83(XAxis, { dataKey: "label", ...axis, interval: 0, height: 40, tick: /* @__PURE__ */ jsx83(WrappedTick, {
|
|
24689
|
+
/* @__PURE__ */ jsx83(XAxis, { dataKey: "label", ...axis, interval: 0, height: 40, tick: /* @__PURE__ */ jsx83(WrappedTick, { ...planCategoryTicks((width - 56) / Math.max(stack.data.length, 1)) }) }),
|
|
24666
24690
|
/* @__PURE__ */ jsx83(YAxis, { width: 44, ...axis, allowDecimals: !onlyWholeNumbers(stack.data) }),
|
|
24667
24691
|
tooltip,
|
|
24668
24692
|
showLegend ? /* @__PURE__ */ jsx83(Legend, { content: /* @__PURE__ */ jsx83(ChartLegendContent, { config }) }) : null,
|
|
@@ -24696,7 +24720,7 @@ function Drawing({
|
|
|
24696
24720
|
const dots = points.map((point) => ({ label: point.label, x: point.values[xKey] ?? 0, y: point.values[yKey] ?? 0 }));
|
|
24697
24721
|
return /* @__PURE__ */ jsx83(ChartFrame, { config, height: HEIGHT, children: (width) => /* @__PURE__ */ jsxs76(ScatterChart, { width, height: HEIGHT, margin: { top: dataLabels ? 16 : 6, right: 14, bottom: 0, left: 0 }, "data-records-scatter": "", children: [
|
|
24698
24722
|
/* @__PURE__ */ jsx83(CartesianGrid, {}),
|
|
24699
|
-
/* @__PURE__ */ jsx83(XAxis, { type: "number", dataKey: "x", name: String(config[xKey]?.label ?? ""), ...axis, allowDecimals: !onlyWholeNumbers(dots) }),
|
|
24723
|
+
/* @__PURE__ */ jsx83(XAxis, { type: "number", dataKey: "x", name: String(config[xKey]?.label ?? ""), ...axis, tickCount: Math.max(2, Math.floor((width - 56) / 52)), interval: "preserveStartEnd", allowDecimals: !onlyWholeNumbers(dots) }),
|
|
24700
24724
|
/* @__PURE__ */ jsx83(YAxis, { type: "number", dataKey: "y", name: String(config[yKey]?.label ?? ""), width: 44, ...axis, allowDecimals: !onlyWholeNumbers(dots) }),
|
|
24701
24725
|
/* @__PURE__ */ jsx83(
|
|
24702
24726
|
Tooltip,
|
|
@@ -24725,7 +24749,7 @@ function Drawing({
|
|
|
24725
24749
|
if (kind2 === "line") {
|
|
24726
24750
|
return /* @__PURE__ */ jsx83(ChartFrame, { config, height: HEIGHT, children: (width) => /* @__PURE__ */ jsxs76(LineChart, { width, height: HEIGHT, data, margin: { top: dataLabels ? 16 : 6, right: dataLabels ? 14 : 6, bottom: 0, left: 0 }, children: [
|
|
24727
24751
|
/* @__PURE__ */ jsx83(CartesianGrid, { vertical: false }),
|
|
24728
|
-
/* @__PURE__ */ jsx83(XAxis, { dataKey: "label", ...axis }),
|
|
24752
|
+
/* @__PURE__ */ jsx83(XAxis, { dataKey: "label", ...axis, ...lineAxis(width, points.length) }),
|
|
24729
24753
|
/* @__PURE__ */ jsx83(YAxis, { width: 44, ...axis }),
|
|
24730
24754
|
tooltip,
|
|
24731
24755
|
legend,
|
|
@@ -24748,57 +24772,62 @@ function Drawing({
|
|
|
24748
24772
|
] }) });
|
|
24749
24773
|
}
|
|
24750
24774
|
const horizontal = kind2 === "bar";
|
|
24751
|
-
return /* @__PURE__ */ jsx83(ChartFrame, { config, height: HEIGHT, children: (width) =>
|
|
24752
|
-
|
|
24753
|
-
|
|
24754
|
-
|
|
24755
|
-
|
|
24756
|
-
|
|
24757
|
-
|
|
24758
|
-
|
|
24759
|
-
|
|
24760
|
-
|
|
24761
|
-
horizontal ?
|
|
24762
|
-
|
|
24763
|
-
|
|
24764
|
-
|
|
24765
|
-
|
|
24766
|
-
|
|
24767
|
-
|
|
24768
|
-
|
|
24769
|
-
|
|
24770
|
-
|
|
24771
|
-
|
|
24772
|
-
|
|
24773
|
-
|
|
24774
|
-
|
|
24775
|
-
|
|
24776
|
-
|
|
24777
|
-
|
|
24778
|
-
|
|
24779
|
-
|
|
24780
|
-
|
|
24781
|
-
|
|
24782
|
-
|
|
24783
|
-
|
|
24784
|
-
|
|
24785
|
-
|
|
24786
|
-
|
|
24787
|
-
|
|
24788
|
-
|
|
24789
|
-
|
|
24790
|
-
|
|
24791
|
-
|
|
24792
|
-
|
|
24793
|
-
|
|
24794
|
-
|
|
24795
|
-
|
|
24796
|
-
|
|
24797
|
-
|
|
24798
|
-
|
|
24799
|
-
|
|
24800
|
-
|
|
24801
|
-
|
|
24775
|
+
return /* @__PURE__ */ jsx83(ChartFrame, { config, height: HEIGHT, children: (width) => {
|
|
24776
|
+
const sideWidth = Math.max(56, Math.min(96, Math.floor(width * 0.34)));
|
|
24777
|
+
const rowPx = (HEIGHT - 30) / Math.max(points.length, 1);
|
|
24778
|
+
const sideRows = { maxLines: Math.max(1, Math.min(3, Math.floor(rowPx / 11))), step: rowPx >= 11 ? 1 : Math.ceil(11 / rowPx) };
|
|
24779
|
+
return /* @__PURE__ */ jsxs76(
|
|
24780
|
+
BarChart,
|
|
24781
|
+
{
|
|
24782
|
+
width,
|
|
24783
|
+
height: HEIGHT,
|
|
24784
|
+
data,
|
|
24785
|
+
layout: horizontal ? "vertical" : "horizontal",
|
|
24786
|
+
margin: { top: dataLabels && !horizontal ? 16 : 6, right: dataLabels && horizontal ? 40 : 6, bottom: 0, left: 0 },
|
|
24787
|
+
children: [
|
|
24788
|
+
/* @__PURE__ */ jsx83(CartesianGrid, { vertical: horizontal, horizontal: !horizontal }),
|
|
24789
|
+
horizontal ? /* @__PURE__ */ jsxs76(Fragment34, { children: [
|
|
24790
|
+
/* @__PURE__ */ jsx83(XAxis, { type: "number", ...axis }),
|
|
24791
|
+
/* @__PURE__ */ jsx83(YAxis, { type: "category", dataKey: "label", width: sideWidth, ...axis, tick: /* @__PURE__ */ jsx83(WrappedTick, { across: true, perLine: Math.max(4, Math.floor((sideWidth - 8) / TICK_CHAR_PX)), ...sideRows }) })
|
|
24792
|
+
] }) : /* @__PURE__ */ jsxs76(Fragment34, { children: [
|
|
24793
|
+
/* @__PURE__ */ jsx83(XAxis, { dataKey: "label", ...axis, interval: 0, height: 40, tick: /* @__PURE__ */ jsx83(WrappedTick, { ...planCategoryTicks((width - 56) / Math.max(points.length, 1)) }) }),
|
|
24794
|
+
/* @__PURE__ */ jsx83(YAxis, { width: 44, ...axis })
|
|
24795
|
+
] }),
|
|
24796
|
+
tooltip,
|
|
24797
|
+
legend,
|
|
24798
|
+
goalLine(horizontal),
|
|
24799
|
+
drawOrder.map((key, index) => /* @__PURE__ */ jsxs76(
|
|
24800
|
+
Bar,
|
|
24801
|
+
{
|
|
24802
|
+
dataKey: key,
|
|
24803
|
+
radius: 2,
|
|
24804
|
+
isAnimationActive: false,
|
|
24805
|
+
fill: `var(--color-${key})`,
|
|
24806
|
+
...click ? { onClick: click, className: "cursor-pointer" } : {},
|
|
24807
|
+
children: [
|
|
24808
|
+
series.length === 1 ? points.map((point, at) => /* @__PURE__ */ jsx83(Cell, { fill: String(config[point.label]?.color ?? SERIES_COLORS[index]) }, `${at}:${point.label}`)) : null,
|
|
24809
|
+
dataLabels && key === series[0] ? /* @__PURE__ */ jsx83(
|
|
24810
|
+
LabelList,
|
|
24811
|
+
{
|
|
24812
|
+
dataKey: key,
|
|
24813
|
+
content: /* @__PURE__ */ jsx83(
|
|
24814
|
+
SpacedLabel,
|
|
24815
|
+
{
|
|
24816
|
+
show: horizontal ? labelsThatFit(points.map(() => "0"), HEIGHT - 20, 11, true) : labelsThatFit(points.map((p) => labelText(p.values[key])), width - 50),
|
|
24817
|
+
text: labelText,
|
|
24818
|
+
placement: horizontal ? "end" : "above"
|
|
24819
|
+
}
|
|
24820
|
+
)
|
|
24821
|
+
}
|
|
24822
|
+
) : null
|
|
24823
|
+
]
|
|
24824
|
+
},
|
|
24825
|
+
key
|
|
24826
|
+
))
|
|
24827
|
+
]
|
|
24828
|
+
}
|
|
24829
|
+
);
|
|
24830
|
+
} });
|
|
24802
24831
|
}
|
|
24803
24832
|
function centerOfGroups(points, key, op) {
|
|
24804
24833
|
const vals = points.map((p) => p.values[key]).filter((v) => typeof v === "number" && Number.isFinite(v));
|
|
@@ -27016,7 +27045,7 @@ function Gallery({
|
|
|
27016
27045
|
layout: "gallery",
|
|
27017
27046
|
fields,
|
|
27018
27047
|
hiddenFields,
|
|
27019
|
-
summary: chose ? `Fields shown (${shown4.length} of ${fields.length})` :
|
|
27048
|
+
summary: chose ? `Fields shown (${shown4.length} of ${fields.length})` : "Fields",
|
|
27020
27049
|
onChange: onHiddenFieldsChange,
|
|
27021
27050
|
remembered
|
|
27022
27051
|
}
|
|
@@ -39858,7 +39887,7 @@ function TablePresence({ tableId }) {
|
|
|
39858
39887
|
}
|
|
39859
39888
|
|
|
39860
39889
|
// src/toolbarFit.ts
|
|
39861
|
-
import { useEffect as useEffect104, useLayoutEffect as
|
|
39890
|
+
import { useEffect as useEffect104, useLayoutEffect as useLayoutEffect5, useState as useState119 } from "react";
|
|
39862
39891
|
import { flushSync } from "react-dom";
|
|
39863
39892
|
function widthAtFold(piece, fold) {
|
|
39864
39893
|
for (let f = Math.min(fold, (piece.byFold?.length ?? 0) - 1); f >= 0; f -= 1) {
|
|
@@ -39950,7 +39979,7 @@ function createFitMemory() {
|
|
|
39950
39979
|
}
|
|
39951
39980
|
};
|
|
39952
39981
|
}
|
|
39953
|
-
var useIsoLayoutEffect = typeof window === "undefined" ? useEffect104 :
|
|
39982
|
+
var useIsoLayoutEffect = typeof window === "undefined" ? useEffect104 : useLayoutEffect5;
|
|
39954
39983
|
function useToolbarFit(row) {
|
|
39955
39984
|
const [fold, setFold] = useState119(0);
|
|
39956
39985
|
useIsoLayoutEffect(() => {
|