@ai-matrx/records-ui 0.116.27 → 0.116.29

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/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-6GJLCWSO.js";
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})` : `Fields shown (first ${LIST_DEFAULT_FIELDS} filled)`,
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
- useEffect66(() => {
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: "ml-auto shrink-0 text-muted-foreground", children: kind2 === "stuck" ? `${block.days ?? 14} days` : measureName })
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
- const lines = wrapTickWords(String(payload?.value ?? ""), perLine);
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__ */ jsx83(
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: lines.map((line, i) => /* @__PURE__ */ jsx83(
24516
- "tspan",
24517
- {
24518
- x: across ? x - 4 : x,
24519
- dy: i === 0 ? across ? -((lines.length - 1) * lineHeight) / 2 + 3 : 10 : lineHeight,
24520
- children: line
24521
- },
24522
- i
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, { perLine: Math.max(6, Math.floor(width / Math.max(stack.data.length, 1) / 6)) }) }),
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) => /* @__PURE__ */ jsxs76(
24752
- BarChart,
24753
- {
24754
- width,
24755
- height: HEIGHT,
24756
- data,
24757
- layout: horizontal ? "vertical" : "horizontal",
24758
- margin: { top: dataLabels && !horizontal ? 16 : 6, right: dataLabels && horizontal ? 40 : 6, bottom: 0, left: 0 },
24759
- children: [
24760
- /* @__PURE__ */ jsx83(CartesianGrid, { vertical: horizontal, horizontal: !horizontal }),
24761
- horizontal ? /* @__PURE__ */ jsxs76(Fragment34, { children: [
24762
- /* @__PURE__ */ jsx83(XAxis, { type: "number", ...axis }),
24763
- /* @__PURE__ */ jsx83(YAxis, { type: "category", dataKey: "label", width: 96, ...axis, tick: /* @__PURE__ */ jsx83(WrappedTick, { across: true, perLine: 15 }) })
24764
- ] }) : /* @__PURE__ */ jsxs76(Fragment34, { children: [
24765
- /* @__PURE__ */ jsx83(XAxis, { dataKey: "label", ...axis, interval: 0, height: 40, tick: /* @__PURE__ */ jsx83(WrappedTick, { perLine: Math.max(6, Math.floor(width / Math.max(points.length, 1) / 6)) }) }),
24766
- /* @__PURE__ */ jsx83(YAxis, { width: 44, ...axis })
24767
- ] }),
24768
- tooltip,
24769
- legend,
24770
- goalLine(horizontal),
24771
- drawOrder.map((key, index) => /* @__PURE__ */ jsxs76(
24772
- Bar,
24773
- {
24774
- dataKey: key,
24775
- radius: 2,
24776
- isAnimationActive: false,
24777
- fill: `var(--color-${key})`,
24778
- ...click ? { onClick: click, className: "cursor-pointer" } : {},
24779
- children: [
24780
- series.length === 1 ? points.map((point, at) => /* @__PURE__ */ jsx83(Cell, { fill: String(config[point.label]?.color ?? SERIES_COLORS[index]) }, `${at}:${point.label}`)) : null,
24781
- dataLabels && key === series[0] ? /* @__PURE__ */ jsx83(
24782
- LabelList,
24783
- {
24784
- dataKey: key,
24785
- content: /* @__PURE__ */ jsx83(
24786
- SpacedLabel,
24787
- {
24788
- show: horizontal ? labelsThatFit(points.map(() => "0"), HEIGHT - 20, 11, true) : labelsThatFit(points.map((p) => labelText(p.values[key])), width - 50),
24789
- text: labelText,
24790
- placement: horizontal ? "end" : "above"
24791
- }
24792
- )
24793
- }
24794
- ) : null
24795
- ]
24796
- },
24797
- key
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));
@@ -25034,7 +25063,7 @@ import { measureKey as measureKey5 } from "@ai-matrx/records";
25034
25063
  var PIVOT_OPS = ["count", "sum", "avg", "min", "max"];
25035
25064
  var isPivotOp = (v) => PIVOT_OPS.includes(v ?? "");
25036
25065
  var PIVOT_OP_LABEL = { count: "Count", sum: "Sum", avg: "Average", min: "Min", max: "Max" };
25037
- var PIVOT_CELL_LIMIT = 2e3;
25066
+ var PIVOT_CELL_LIMIT = 1e3;
25038
25067
  var NUMBER_TYPES2 = /* @__PURE__ */ new Set(["number", "integer", "decimal", "money", "currency", "percent", "percentage"]);
25039
25068
  var isNumberField = (f) => NUMBER_TYPES2.has(String(f.type));
25040
25069
  function pivotQuestion(view, fields) {
@@ -25259,9 +25288,9 @@ function PivotLayout({ view, fields, filter, onChange, remembered }) {
25259
25288
  ] }) }) : null
25260
25289
  ] }) }),
25261
25290
  table.cut ? /* @__PURE__ */ jsxs78("p", { className: "text-xs text-muted-foreground", "data-records-pivot-cut": "", children: [
25262
- "Showing the first ",
25291
+ "First ",
25263
25292
  PIVOT_CELL_LIMIT.toLocaleString(),
25264
- " cells; narrow the view's filter to see the rest."
25293
+ " cells only. Narrow the filter to see the rest."
25265
25294
  ] }) : null
25266
25295
  ] })
25267
25296
  ] });
@@ -25904,8 +25933,6 @@ function useViewRecords(view, pageSize = 200, filter, viewId) {
25904
25933
  cancelled = true;
25905
25934
  };
25906
25935
  }, [client, ruleId, pageSize]);
25907
- const asked2 = stableFilterKey4(filter ?? null);
25908
- const fromView = asked2 !== "{}" && (asked2 === stableFilterKey4(view.where ?? null) || asked2 === stableFilterKey4(view.filters ?? null));
25909
25936
  const tableRows = useMemo52(() => table.data?.rows ?? [], [table.data]);
25910
25937
  const manual = view.order === "manual" && Boolean(viewId) && !ruleId;
25911
25938
  const hand = useHandOrderRows({
@@ -25957,7 +25984,7 @@ function useViewRecords(view, pageSize = 200, filter, viewId) {
25957
25984
  // sat over every board and gallery. A view of the whole table says nothing about it; a narrowed
25958
25985
  // one says how, in words a person uses.
25959
25986
  membership: [
25960
- ruleId ? "Showing the records this view's rule picks." : fromView ? "Showing the records this view's filter matches." : asked2 !== "{}" ? "Showing only the records behind the number you clicked." : "",
25987
+ // A person sees the rows; the screen does not narrate why they are the rows.
25961
25988
  manual ? HAND_ORDER_NOTE : ""
25962
25989
  ].filter(Boolean).join(" ")
25963
25990
  };
@@ -27016,7 +27043,7 @@ function Gallery({
27016
27043
  layout: "gallery",
27017
27044
  fields,
27018
27045
  hiddenFields,
27019
- summary: chose ? `Fields shown (${shown4.length} of ${fields.length})` : `Fields shown (first ${GALLERY_DEFAULT_FIELDS} filled)`,
27046
+ summary: chose ? `Fields shown (${shown4.length} of ${fields.length})` : "Fields",
27020
27047
  onChange: onHiddenFieldsChange,
27021
27048
  remembered
27022
27049
  }
@@ -39858,7 +39885,7 @@ function TablePresence({ tableId }) {
39858
39885
  }
39859
39886
 
39860
39887
  // src/toolbarFit.ts
39861
- import { useEffect as useEffect104, useLayoutEffect as useLayoutEffect4, useState as useState119 } from "react";
39888
+ import { useEffect as useEffect104, useLayoutEffect as useLayoutEffect5, useState as useState119 } from "react";
39862
39889
  import { flushSync } from "react-dom";
39863
39890
  function widthAtFold(piece, fold) {
39864
39891
  for (let f = Math.min(fold, (piece.byFold?.length ?? 0) - 1); f >= 0; f -= 1) {
@@ -39950,7 +39977,7 @@ function createFitMemory() {
39950
39977
  }
39951
39978
  };
39952
39979
  }
39953
- var useIsoLayoutEffect = typeof window === "undefined" ? useEffect104 : useLayoutEffect4;
39980
+ var useIsoLayoutEffect = typeof window === "undefined" ? useEffect104 : useLayoutEffect5;
39954
39981
  function useToolbarFit(row) {
39955
39982
  const [fold, setFold] = useState119(0);
39956
39983
  useIsoLayoutEffect(() => {