@carto/ps-react-ui 5.1.0 → 5.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.
Files changed (117) hide show
  1. package/dist/actions-Dhlz_adK.js +1167 -0
  2. package/dist/actions-Dhlz_adK.js.map +1 -0
  3. package/dist/category-D01ruG-l.js +842 -0
  4. package/dist/category-D01ruG-l.js.map +1 -0
  5. package/dist/{download-DdaK3qgC.js → download-DGgFOaXj.js} +81 -80
  6. package/dist/download-DGgFOaXj.js.map +1 -0
  7. package/dist/{echart-CRihbmRv.js → echart-CwzbPElc.js} +3 -2
  8. package/dist/echart-CwzbPElc.js.map +1 -0
  9. package/dist/{formula-noJzQwKo.js → formula-BIxJr1P3.js} +6 -6
  10. package/dist/{formula-noJzQwKo.js.map → formula-BIxJr1P3.js.map} +1 -1
  11. package/dist/legend.js +34 -21
  12. package/dist/legend.js.map +1 -1
  13. package/dist/{markdown-2dfL6Cmb.js → markdown-oo9mnJun.js} +6 -6
  14. package/dist/{markdown-2dfL6Cmb.js.map → markdown-oo9mnJun.js.map} +1 -1
  15. package/dist/{spread-Ccpg9fi0.js → spread-CgCTKPQD.js} +7 -7
  16. package/dist/{spread-Ccpg9fi0.js.map → spread-CgCTKPQD.js.map} +1 -1
  17. package/dist/{table-Bx9Uj3U0.js → table-lb5momun.js} +3 -3
  18. package/dist/{table-Bx9Uj3U0.js.map → table-lb5momun.js.map} +1 -1
  19. package/dist/types/legend/stores/types.d.ts +4 -2
  20. package/dist/types/widgets-v2/actions/download/csv-item.d.ts +3 -3
  21. package/dist/types/widgets-v2/actions/download/index.d.ts +1 -1
  22. package/dist/types/widgets-v2/actions/download/png-item.d.ts +2 -2
  23. package/dist/types/widgets-v2/actions/download/types.d.ts +12 -1
  24. package/dist/types/widgets-v2/actions/fullscreen/fullscreen.d.ts +20 -13
  25. package/dist/types/widgets-v2/actions/index.d.ts +1 -1
  26. package/dist/types/widgets-v2/actions/searcher/filter.d.ts +3 -2
  27. package/dist/types/widgets-v2/bar/download.d.ts +3 -3
  28. package/dist/types/widgets-v2/category/category-ui.d.ts +9 -1
  29. package/dist/types/widgets-v2/category/download.d.ts +3 -3
  30. package/dist/types/widgets-v2/echart/style.d.ts +1 -0
  31. package/dist/types/widgets-v2/formula/download.d.ts +3 -3
  32. package/dist/types/widgets-v2/histogram/download.d.ts +3 -3
  33. package/dist/types/widgets-v2/index.d.ts +1 -1
  34. package/dist/types/widgets-v2/markdown/download.d.ts +3 -3
  35. package/dist/types/widgets-v2/pie/download.d.ts +3 -3
  36. package/dist/types/widgets-v2/scatterplot/download.d.ts +3 -3
  37. package/dist/types/widgets-v2/spread/download.d.ts +3 -3
  38. package/dist/types/widgets-v2/table/download.d.ts +3 -3
  39. package/dist/types/widgets-v2/timeseries/download.d.ts +3 -3
  40. package/dist/types/widgets-v2/toolbox/toolbox.d.ts +1 -1
  41. package/dist/types/widgets-v2/wrapper/style.d.ts +31 -2
  42. package/dist/types/widgets-v2/wrapper/widget-actions.d.ts +2 -2
  43. package/dist/types/widgets-v2/wrapper/widget-wrapper.d.ts +2 -2
  44. package/dist/widgets-v2/actions.js +2 -2
  45. package/dist/widgets-v2/bar.js +7 -7
  46. package/dist/widgets-v2/bar.js.map +1 -1
  47. package/dist/widgets-v2/category.js +1 -1
  48. package/dist/widgets-v2/echart.js +1 -1
  49. package/dist/widgets-v2/formula.js +1 -1
  50. package/dist/widgets-v2/histogram.js +10 -10
  51. package/dist/widgets-v2/histogram.js.map +1 -1
  52. package/dist/widgets-v2/markdown.js +1 -1
  53. package/dist/widgets-v2/pie.js +10 -10
  54. package/dist/widgets-v2/pie.js.map +1 -1
  55. package/dist/widgets-v2/scatterplot.js +9 -9
  56. package/dist/widgets-v2/scatterplot.js.map +1 -1
  57. package/dist/widgets-v2/spread.js +1 -1
  58. package/dist/widgets-v2/table.js +1 -1
  59. package/dist/widgets-v2/timeseries.js +12 -12
  60. package/dist/widgets-v2/timeseries.js.map +1 -1
  61. package/dist/widgets-v2.js +364 -376
  62. package/dist/widgets-v2.js.map +1 -1
  63. package/package.json +3 -3
  64. package/src/legend/components/legend-item/legend-item-ui.test.tsx +22 -1
  65. package/src/legend/components/legend-ramp/legend-ramp-ui.tsx +22 -6
  66. package/src/legend/stores/types.ts +4 -2
  67. package/src/widgets-v2/actions/download/csv-item.test.tsx +3 -3
  68. package/src/widgets-v2/actions/download/csv-item.tsx +6 -6
  69. package/src/widgets-v2/actions/download/download.tsx +5 -3
  70. package/src/widgets-v2/actions/download/index.ts +1 -1
  71. package/src/widgets-v2/actions/download/png-item.test.tsx +5 -3
  72. package/src/widgets-v2/actions/download/png-item.tsx +4 -4
  73. package/src/widgets-v2/actions/download/types.ts +15 -1
  74. package/src/widgets-v2/actions/fullscreen/fullscreen-store.test.tsx +155 -0
  75. package/src/widgets-v2/actions/fullscreen/fullscreen.test.tsx +39 -41
  76. package/src/widgets-v2/actions/fullscreen/fullscreen.tsx +211 -96
  77. package/src/widgets-v2/actions/index.ts +1 -0
  78. package/src/widgets-v2/actions/searcher/filter.test.ts +28 -0
  79. package/src/widgets-v2/actions/searcher/filter.ts +22 -4
  80. package/src/widgets-v2/actions/searcher/searcher-toggle.tsx +9 -4
  81. package/src/widgets-v2/actions/searcher/searcher.test.tsx +22 -0
  82. package/src/widgets-v2/actions/searcher/searcher.tsx +16 -0
  83. package/src/widgets-v2/bar/download.test.tsx +5 -3
  84. package/src/widgets-v2/bar/download.tsx +5 -4
  85. package/src/widgets-v2/category/category-ui.tsx +24 -13
  86. package/src/widgets-v2/category/category.tsx +37 -2
  87. package/src/widgets-v2/category/download.test.ts +4 -2
  88. package/src/widgets-v2/category/download.ts +5 -4
  89. package/src/widgets-v2/echart/style.ts +6 -0
  90. package/src/widgets-v2/formula/download.test.tsx +3 -1
  91. package/src/widgets-v2/formula/download.tsx +5 -4
  92. package/src/widgets-v2/histogram/download.test.ts +6 -4
  93. package/src/widgets-v2/histogram/download.ts +5 -4
  94. package/src/widgets-v2/index.ts +1 -0
  95. package/src/widgets-v2/markdown/download.test.ts +2 -2
  96. package/src/widgets-v2/markdown/download.tsx +5 -4
  97. package/src/widgets-v2/pie/download.test.ts +7 -3
  98. package/src/widgets-v2/pie/download.ts +5 -4
  99. package/src/widgets-v2/scatterplot/download.test.ts +4 -2
  100. package/src/widgets-v2/scatterplot/download.ts +5 -4
  101. package/src/widgets-v2/spread/download.test.ts +3 -1
  102. package/src/widgets-v2/spread/download.ts +5 -4
  103. package/src/widgets-v2/table/download.test.ts +5 -3
  104. package/src/widgets-v2/table/download.ts +4 -3
  105. package/src/widgets-v2/timeseries/download.test.ts +6 -4
  106. package/src/widgets-v2/timeseries/download.ts +5 -4
  107. package/src/widgets-v2/toolbox/toolbox.tsx +1 -1
  108. package/src/widgets-v2/wrapper/style.ts +38 -2
  109. package/src/widgets-v2/wrapper/widget-actions.tsx +2 -2
  110. package/src/widgets-v2/wrapper/widget-wrapper.test.tsx +32 -2
  111. package/src/widgets-v2/wrapper/widget-wrapper.tsx +58 -32
  112. package/dist/actions-BjPfCLG9.js +0 -1024
  113. package/dist/actions-BjPfCLG9.js.map +0 -1
  114. package/dist/category-DGUDabsi.js +0 -829
  115. package/dist/category-DGUDabsi.js.map +0 -1
  116. package/dist/download-DdaK3qgC.js.map +0 -1
  117. package/dist/echart-CRihbmRv.js.map +0 -1
@@ -72,7 +72,8 @@ export interface LegendRampVariable {
72
72
  * Ordered low→high stops. Discrete ramps **require `colors.length + 1`**
73
73
  * stops — the boundaries between color steps, including both outer edges —
74
74
  * and each label is centered on its boundary line (keep labels short, e.g.
75
- * `20K`; there is no collision handling). A discrete ramp with any other
75
+ * `20K`; there is no collision handling; pass `''` to hide one — each step's
76
+ * tooltip still shows its full range). A discrete ramp with any other
76
77
  * stop count is incoherent and renders an inline error instead of the bar.
77
78
  * Continuous ramps show only the first/last endpoints.
78
79
  */
@@ -86,7 +87,8 @@ export interface LegendRampVariable {
86
87
  */
87
88
  avg?: number;
88
89
  /**
89
- * Formats `avg` for its tooltip. Default `String(avg)` — pass e.g.
90
+ * Formats `avg` and, on discrete ramps, the stop values shown in each
91
+ * step's range tooltip. Default `String(value)` — pass e.g.
90
92
  * `(v) => formatNumber(v, 'es-ES')` or `(v) => `${v}%``. Use a stable
91
93
  * reference (same contract as the other variable fields).
92
94
  */
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from './types.js';
1
+ import { DownloadContext, DownloadItem } from './types.js';
2
2
  interface BuildCsvDownloadItemBase {
3
3
  /** Base filename (without extension). The item appends `.csv`. */
4
4
  filename: string;
@@ -17,7 +17,7 @@ export type BuildCsvDownloadItemArgs = (BuildCsvDownloadItemBase & {
17
17
  * through `toCsvString` so escaping (incl. the spreadsheet
18
18
  * formula-injection guard) stays consistent across widgets.
19
19
  */
20
- getRows: () => readonly (readonly unknown[])[];
20
+ getRows: (ctx: DownloadContext) => readonly (readonly unknown[])[];
21
21
  getCsv?: never;
22
22
  }) | (BuildCsvDownloadItemBase & {
23
23
  /**
@@ -25,7 +25,7 @@ export type BuildCsvDownloadItemArgs = (BuildCsvDownloadItemBase & {
25
25
  * (e.g. Table) that already serialise their own CSV with bespoke
26
26
  * header/cell handling.
27
27
  */
28
- getCsv: () => string;
28
+ getCsv: (ctx: DownloadContext) => string;
29
29
  getRows?: never;
30
30
  });
31
31
  /**
@@ -4,5 +4,5 @@ export { CSVIcon, PNGIcon, MarkdownIcon } from './icons.js';
4
4
  export { buildPngDownloadItem, type BuildPngDownloadItemArgs } from './png-item.js';
5
5
  export { buildCsvDownloadItem, type BuildCsvDownloadItemArgs } from './csv-item.js';
6
6
  export { DOWNLOAD_ITEM_IDS, type DownloadItemId } from './constants.js';
7
- export type { DownloadItem } from './types.js';
7
+ export type { DownloadItem, DownloadContext } from './types.js';
8
8
  export { DEFAULT_DOWNLOAD_LABELS, type DownloadLabels } from './labels.js';
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from './types.js';
1
+ import { DownloadContext, DownloadItem } from './types.js';
2
2
  export interface BuildPngDownloadItemArgs {
3
3
  /** Base filename (without extension). The item appends `.png`. */
4
4
  filename: string;
@@ -7,7 +7,7 @@ export interface BuildPngDownloadItemArgs {
7
7
  * download config doesn't capture a stale reference. Wire it to
8
8
  * `() => getCaptureEl(id)` from `widgets-v2/stores`.
9
9
  */
10
- getCaptureEl: () => HTMLElement | null;
10
+ getCaptureEl: (ctx: DownloadContext) => HTMLElement | null;
11
11
  /** html2canvas `scale`. Default 2. */
12
12
  pixelRatio?: number;
13
13
  /** html2canvas `backgroundColor`. Default transparent (`null`). */
@@ -1,4 +1,15 @@
1
1
  import { ReactElement } from 'react';
2
+ /**
3
+ * Passed to {@link DownloadItem.resolve} by `<Widget.Download>`.
4
+ */
5
+ export interface DownloadContext {
6
+ /**
7
+ * Id of the widget store the menu was opened from — the dialog's own
8
+ * store when opened from `FullScreen.Slot`'s header, so an export matches
9
+ * what the user is looking at. `null` outside a `<Widget.Provider>`.
10
+ */
11
+ id: string | null;
12
+ }
2
13
  export interface DownloadItem {
3
14
  /** Unique key (also used as menu label key). */
4
15
  id: string;
@@ -27,7 +38,7 @@ export interface DownloadItem {
27
38
  * Resolves to a Blob URL the trigger will click. Optional `revoke` is
28
39
  * called after the click is dispatched.
29
40
  */
30
- resolve: () => Promise<{
41
+ resolve: (ctx: DownloadContext) => Promise<{
31
42
  url: string;
32
43
  filename: string;
33
44
  revoke?: () => void;
@@ -9,11 +9,18 @@ export interface FullScreenTriggerProps {
9
9
  }
10
10
  export interface FullScreenSlotProps {
11
11
  /**
12
- * Render-prop body. Receives the live `isFullScreen` flag so the consumer
13
- * can branch per-mode props (e.g., `Widget.Toolbox visibleCount`) without
14
- * duplicating the JSX.
12
+ * The widget body. Rendered twice, identically: in the card, and again in
13
+ * the dialog while it's open. The components inside don't know which copy
14
+ * they are; the dialog's just runs on a widget store of its own — a copy
15
+ * of the card's taken on open, handed back to the card on close — so read
16
+ * the widget id with `useWidgetId()` inside the body rather than closing
17
+ * over the card's `id`.
18
+ *
19
+ * @deprecated The function form `(isFullScreen) => ReactNode` still works
20
+ * (`false` for the card, `true` for the dialog copy) but will be removed
21
+ * in the next major: pass the body as plain children.
15
22
  */
16
- children: (isFullScreen: boolean) => ReactNode;
23
+ children: ReactNode | ((isFullScreen: boolean) => ReactNode);
17
24
  /** Header text rendered above the body when the modal is open. */
18
25
  title?: ReactNode;
19
26
  /**
@@ -46,15 +53,15 @@ export interface FullScreenSlotProps {
46
53
  * `<Widget.Content>`).
47
54
  */
48
55
  declare function FullScreenTrigger({ labels, enterIcon: EnterIcon, exitIcon: ExitIcon, iconProps, }: FullScreenTriggerProps): import('react').JSX.Element;
56
+ /** Id of the widget store the dialog copy runs on. */
57
+ export declare function fullScreenStoreId(id: string): string;
49
58
  /**
50
- * Body wrapper. Renders its render-prop children once, via a single
51
- * `createPortal` call whose container is a stable `<div>` we hold as a ref.
52
- * That div is moved imperatively between an inline placeholder and the
53
- * `<DialogContent>` of an MUI `<Dialog keepMounted>`. Because both the
54
- * React parent (the portal call site) AND the portal container are
55
- * identical across the toggle, the subtree keeps its fiber identity and
56
- * ECharts (or any other heavy child) stays mounted while only its DOM
57
- * parent changes.
59
+ * Body wrapper. The card keeps its copy of the body while the dialog is
60
+ * open, and the dialog mounts a second one on a store of its own: a copy
61
+ * of the card's UI state taken on open, and handed back to the card when
62
+ * the dialog closes. While open the two don't affect each other. MUI
63
+ * mounts the dialog copy on open and unmounts it after the close
64
+ * transition, which drops its store.
58
65
  */
59
66
  declare function FullScreenSlot({ children, title, actions, paperSx, labels, closeIcon: CloseSvg, iconProps, }: FullScreenSlotProps): import('react').JSX.Element;
60
67
  /**
@@ -66,7 +73,7 @@ declare function FullScreenSlot({ children, title, actions, paperSx, labels, clo
66
73
  * </Widget.Actions>
67
74
  * <Widget.Content>
68
75
  * <Widget.FullScreen.Slot title={title} actions={<Widget.Download items={items} />}>
69
- * {(isFullScreen) => <Body visibleCount={isFullScreen ? undefined : 2} />}
76
+ * <Body />
70
77
  * </Widget.FullScreen.Slot>
71
78
  * </Widget.Content>
72
79
  * ```
@@ -4,7 +4,7 @@ export { ShowAllToggle, setShowAll, SHOW_ALL_ID, DEFAULT_SHOW_ALL_LABELS, type S
4
4
  export { ZoomToggle, addZoom, createAddZoom, ZOOM_LAYOUT, DEFAULT_ZOOM_TOGGLE_LABELS, type ZoomToggleProps, type ZoomToggleLabels, } from './zoom-toggle/index.js';
5
5
  export { BrushToggle, addBrush, DEFAULT_BRUSH_TOGGLE_LABELS, type BrushToggleProps, type BrushToggleLabels, } from './brush-toggle/index.js';
6
6
  export { RelativeData, toRelativeData, createPercentFormatter, DEFAULT_RELATIVE_DATA_LABELS, type RelativeDataProps, type RelativeDataLabels, } from './relative-data/index.js';
7
- export { Download, downloadToCSV, downloadDOMToPNG, toCsvString, triggerLinkDownload, buildPngDownloadItem, buildCsvDownloadItem, CSVIcon, PNGIcon, MarkdownIcon, DEFAULT_DOWNLOAD_LABELS, DOWNLOAD_ITEM_IDS, type DownloadProps, type DownloadItem, type DownloadItemId, type DownloadHandle, type DownloadDOMToPNGOptions, type BuildPngDownloadItemArgs, type BuildCsvDownloadItemArgs, type DownloadLabels, } from './download/index.js';
7
+ export { Download, downloadToCSV, downloadDOMToPNG, toCsvString, triggerLinkDownload, buildPngDownloadItem, buildCsvDownloadItem, CSVIcon, PNGIcon, MarkdownIcon, DEFAULT_DOWNLOAD_LABELS, DOWNLOAD_ITEM_IDS, type DownloadProps, type DownloadItem, type DownloadContext, type DownloadItemId, type DownloadHandle, type DownloadDOMToPNGOptions, type BuildPngDownloadItemArgs, type BuildCsvDownloadItemArgs, type DownloadLabels, } from './download/index.js';
8
8
  export { FullScreen, DEFAULT_FULLSCREEN_LABELS, type FullScreenTriggerProps, type FullScreenSlotProps, type FullScreenLabels, type FullScreenWidgetState, } from './fullscreen/index.js';
9
9
  export { LockSelection, filterByLockedItems, DEFAULT_LOCK_SELECTION_LABELS, type LockSelectionProps, type LockSelectionKey, type LockSelectionLabels, } from './lock-selection/index.js';
10
10
  export { ChangeColumn, DEFAULT_CHANGE_COLUMN_LABELS, type ChangeColumnProps, type ChangeColumnItem, type ChangeColumnLabels, type ChangeColumnWidgetState, } from './change-column/index.js';
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * Filters a 2D series of `{name, ...}` records by case-insensitive substring on
3
- * the `name` field. Keeps the dataset shape (one inner array per series).
3
+ * the label the user sees: `labelFormatter(name)` when a formatter is given,
4
+ * `name` otherwise. Keeps the dataset shape (one inner array per series).
4
5
  * Used by the Searcher action's data transform.
5
6
  */
6
- export declare function filterBySearchText(input: unknown, search: string): unknown;
7
+ export declare function filterBySearchText(input: unknown, search: string, labelFormatter?: (value: string | number) => string | number): unknown;
@@ -1,15 +1,15 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { BarWidgetData } from './types.js';
3
3
  export interface BarDownloadConfigArgs {
4
4
  filename: string;
5
- getData: () => BarWidgetData;
5
+ getData: (ctx: DownloadContext) => BarWidgetData;
6
6
  /**
7
7
  * Optional getter for the widget's capture element (registered by
8
8
  * `Widget.State` on its success path). When provided, a PNG item is
9
9
  * prepended to the returned list. Wire it to
10
10
  * `() => getCaptureEl(id)`.
11
11
  */
12
- getCaptureEl?: () => HTMLElement | null;
12
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
13
13
  /** PNG `pixelRatio` (default 2). */
14
14
  pngPixelRatio?: number;
15
15
  /** PNG `backgroundColor` (default transparent). */
@@ -69,6 +69,14 @@ export interface CategoryUIProps {
69
69
  * No-op for single-series data — same convention as the legend.
70
70
  */
71
71
  stacked?: boolean;
72
+ /**
73
+ * Series indices hidden via the legend. Leave both this and
74
+ * `onHiddenSeriesChange` unset and CategoryUI keeps the set itself; pass
75
+ * them to own it — `Category` does, so the card and the fullscreen copy
76
+ * share it through the widget store.
77
+ */
78
+ hiddenSeries?: ReadonlySet<number>;
79
+ onHiddenSeriesChange?: (next: ReadonlySet<number>) => void;
72
80
  }
73
81
  /**
74
82
  * Pure presentational component for the Category widget. Renders
@@ -85,4 +93,4 @@ export interface CategoryUIProps {
85
93
  * Returns `null` when there's nothing to render — `Widget.State` is the
86
94
  * empty-state authority in the canonical compositor.
87
95
  */
88
- export declare function CategoryUI({ data, selection, onSelectionChange, formatter, labelFormatter, series, maxItems, labels, onShowAll, maxOverride, size, stacked, }: CategoryUIProps): import('react').JSX.Element | null;
96
+ export declare function CategoryUI({ data, selection, onSelectionChange, formatter, labelFormatter, series, maxItems, labels, onShowAll, maxOverride, size, stacked, hiddenSeries: hiddenSeriesProp, onHiddenSeriesChange, }: CategoryUIProps): import('react').JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { CategoryWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Category widget. Always includes a CSV item
@@ -8,9 +8,9 @@ import { CategoryWidgetData } from './types.js';
8
8
  */
9
9
  export declare function createCategoryDownloadConfig(args: {
10
10
  filename: string;
11
- getData: () => CategoryWidgetData;
11
+ getData: (ctx: DownloadContext) => CategoryWidgetData;
12
12
  seriesNames?: readonly string[];
13
- getCaptureEl?: () => HTMLElement | null;
13
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
14
14
  pngPixelRatio?: number;
15
15
  pngBackgroundColor?: string | null;
16
16
  }): DownloadItem[];
@@ -3,5 +3,6 @@ export declare const styles: {
3
3
  width: string;
4
4
  flex: number;
5
5
  minHeight: number;
6
+ isolation: "isolate";
6
7
  };
7
8
  };
@@ -1,13 +1,13 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { FormulaWidgetData } from './types.js';
3
3
  export interface FormulaDownloadConfigArgs {
4
4
  filename: string;
5
- getData: () => FormulaWidgetData;
5
+ getData: (ctx: DownloadContext) => FormulaWidgetData;
6
6
  /**
7
7
  * Optional getter for the widget's capture element (registered by
8
8
  * `Widget.State`). When provided, a PNG item is prepended.
9
9
  */
10
- getCaptureEl?: () => HTMLElement | null;
10
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
11
11
  pngPixelRatio?: number;
12
12
  pngBackgroundColor?: string | null;
13
13
  }
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { HistogramWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for histograms. Always includes a CSV item with
@@ -8,10 +8,10 @@ import { HistogramWidgetData } from './types.js';
8
8
  */
9
9
  export declare function createHistogramDownloadConfig(args: {
10
10
  filename: string;
11
- getData: () => HistogramWidgetData;
11
+ getData: (ctx: DownloadContext) => HistogramWidgetData;
12
12
  getTicks: () => readonly number[];
13
13
  seriesNames?: readonly string[];
14
- getCaptureEl?: () => HTMLElement | null;
14
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
15
15
  pngPixelRatio?: number;
16
16
  pngBackgroundColor?: string | null;
17
17
  }): DownloadItem[];
@@ -96,7 +96,7 @@ export type { ToolboxLabels } from './toolbox/labels.js';
96
96
  export type { EchartProps, EchartUIProps, EchartsEventHandler } from './echart/index.js';
97
97
  export type { NoteProps, NoteMarkdownProps } from './note/widget-note.js';
98
98
  export type { NoteLabels } from './note/labels.js';
99
- export type { SearcherProps, SearcherToggleProps, StackToggleProps, ShowAllToggleProps, ZoomToggleProps, BrushToggleProps, RelativeDataProps, DownloadProps, DownloadItem, FullScreenTriggerProps, FullScreenSlotProps, LockSelectionProps, LockSelectionKey, ChangeColumnProps, ChangeColumnItem, } from './actions/index.js';
99
+ export type { SearcherProps, SearcherToggleProps, StackToggleProps, ShowAllToggleProps, ZoomToggleProps, BrushToggleProps, RelativeDataProps, DownloadProps, DownloadItem, DownloadContext, FullScreenTriggerProps, FullScreenSlotProps, LockSelectionProps, LockSelectionKey, ChangeColumnProps, ChangeColumnItem, } from './actions/index.js';
100
100
  export type { FormulaUIProps, FormulaDataItem, FormulaWidgetData, } from './formula/index.js';
101
101
  export type { MarkdownUIProps, MarkdownWidgetData } from './markdown/index.js';
102
102
  export type { PieDatum, PieWidgetData } from './pie/index.js';
@@ -1,4 +1,4 @@
1
- import { toCsvString, triggerLinkDownload, DownloadItem } from '../actions/download/index.js';
1
+ import { toCsvString, triggerLinkDownload, DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { MarkdownWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Markdown widget. Always includes a `.md`
@@ -8,8 +8,8 @@ import { MarkdownWidgetData } from './types.js';
8
8
  */
9
9
  export declare function createMarkdownDownloadConfig(args: {
10
10
  filename: string;
11
- getData: () => MarkdownWidgetData;
12
- getCaptureEl?: () => HTMLElement | null;
11
+ getData: (ctx: DownloadContext) => MarkdownWidgetData;
12
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
13
13
  pngPixelRatio?: number;
14
14
  pngBackgroundColor?: string | null;
15
15
  }): DownloadItem[];
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { PieWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Pie widget. Always includes a CSV item with
@@ -9,9 +9,9 @@ import { PieWidgetData } from './types.js';
9
9
  */
10
10
  export declare function createPieDownloadConfig(args: {
11
11
  filename: string;
12
- getData: () => PieWidgetData;
12
+ getData: (ctx: DownloadContext) => PieWidgetData;
13
13
  seriesNames?: readonly string[];
14
- getCaptureEl?: () => HTMLElement | null;
14
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
15
15
  pngPixelRatio?: number;
16
16
  pngBackgroundColor?: string | null;
17
17
  }): DownloadItem[];
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { ScatterplotWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Scatterplot widget. Always includes a CSV
@@ -8,9 +8,9 @@ import { ScatterplotWidgetData } from './types.js';
8
8
  */
9
9
  export declare function createScatterplotDownloadConfig(args: {
10
10
  filename: string;
11
- getData: () => ScatterplotWidgetData;
11
+ getData: (ctx: DownloadContext) => ScatterplotWidgetData;
12
12
  seriesNames?: readonly string[];
13
- getCaptureEl?: () => HTMLElement | null;
13
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
14
14
  pngPixelRatio?: number;
15
15
  pngBackgroundColor?: string | null;
16
16
  }): DownloadItem[];
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { SpreadWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Spread widget. Always includes a CSV item
@@ -8,8 +8,8 @@ import { SpreadWidgetData } from './types.js';
8
8
  */
9
9
  export declare function createSpreadDownloadConfig(args: {
10
10
  filename: string;
11
- getData: () => SpreadWidgetData;
12
- getCaptureEl?: () => HTMLElement | null;
11
+ getData: (ctx: DownloadContext) => SpreadWidgetData;
12
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
13
13
  pngPixelRatio?: number;
14
14
  pngBackgroundColor?: string | null;
15
15
  }): DownloadItem[];
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { TableColumn, TableWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Table widget. Always includes a CSV item
@@ -10,9 +10,9 @@ import { TableColumn, TableWidgetData } from './types.js';
10
10
  */
11
11
  export declare function createTableDownloadConfig(opts: {
12
12
  filename: string;
13
- getData: () => TableWidgetData;
13
+ getData: (ctx: DownloadContext) => TableWidgetData;
14
14
  columns: readonly TableColumn[];
15
- getCaptureEl?: () => HTMLElement | null;
15
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
16
16
  pngPixelRatio?: number;
17
17
  pngBackgroundColor?: string | null;
18
18
  }): DownloadItem[];
@@ -1,4 +1,4 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadContext, DownloadItem } from '../actions/download/index.js';
2
2
  import { TimeseriesWidgetData } from './types.js';
3
3
  /**
4
4
  * Download menu items for the Timeseries widget. Always includes a CSV
@@ -9,9 +9,9 @@ import { TimeseriesWidgetData } from './types.js';
9
9
  */
10
10
  export declare function createTimeseriesDownloadConfig(args: {
11
11
  filename: string;
12
- getData: () => TimeseriesWidgetData;
12
+ getData: (ctx: DownloadContext) => TimeseriesWidgetData;
13
13
  seriesNames?: readonly string[];
14
- getCaptureEl?: () => HTMLElement | null;
14
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
15
15
  pngPixelRatio?: number;
16
16
  pngBackgroundColor?: string | null;
17
17
  }): DownloadItem[];
@@ -28,7 +28,7 @@ export interface ToolboxProps {
28
28
  * Smart overflow toolbar with **single-mount** items. Children mount once
29
29
  * into a stable, hidden host element and are *physically reparented* via
30
30
  * `appendChild` between the inline preview area and the overflow `<Paper>`
31
- * as the popper opens / closes — same pattern as `Widget.FullScreen.Slot`.
31
+ * as the popper opens / closes.
32
32
  * Items with no inline space when closed are kept mounted but visually
33
33
  * hidden via `display: none`.
34
34
  *
@@ -40,14 +40,43 @@ export declare const styles: {
40
40
  height: ({ spacing }: Theme) => string;
41
41
  zIndex: number;
42
42
  };
43
+ header: {
44
+ display: "flex";
45
+ alignItems: "center";
46
+ gap: ({ spacing }: Theme) => string;
47
+ minHeight: ({ spacing }: Theme) => string;
48
+ paddingInlineEnd: ({ spacing }: Theme) => string;
49
+ };
43
50
  summary: {
51
+ flex: number;
52
+ minWidth: number;
44
53
  minHeight: ({ spacing }: Theme) => string;
54
+ paddingInlineEnd: number;
45
55
  '& .MuiAccordionSummary-content': {
46
- gap: ({ spacing }: Theme) => string;
47
- paddingInlineEnd: ({ spacing }: Theme) => string;
48
56
  alignItems: "center";
57
+ minWidth: number;
58
+ marginInlineEnd: number;
59
+ paddingInlineEnd: number;
49
60
  };
50
61
  };
62
+ headerNoIcon: {
63
+ paddingInlineEnd: ({ spacing }: Theme) => string;
64
+ };
65
+ expandIcon: {
66
+ display: "flex";
67
+ marginInlineStart: ({ spacing }: Theme) => string;
68
+ color: "text.secondary";
69
+ cursor: "pointer";
70
+ '& svg': {
71
+ width: number;
72
+ height: number;
73
+ color: "inherit";
74
+ };
75
+ transition: ({ transitions }: Theme) => string;
76
+ };
77
+ expanded: {
78
+ transform: "rotate(180deg)";
79
+ };
51
80
  summaryDisabled: {
52
81
  '&, &:hover:not(.Mui-disabled)': {
53
82
  cursor: "default";
@@ -11,8 +11,8 @@ export interface ActionsProps {
11
11
  * pointer devices), and stay full-opacity when a descendant is marked with
12
12
  * `.active` — typically applied by toggled actions.
13
13
  *
14
- * The container also stops click propagation so interacting with an action
15
- * doesn't toggle the wrapper's collapse.
14
+ * The container also stops click propagation, so a click on an action never
15
+ * reaches handlers further up the widget.
16
16
  */
17
17
  export declare function Actions({ sx, children }: ActionsProps): import('react').JSX.Element;
18
18
  export interface OptionsProps {
@@ -30,8 +30,8 @@ export interface WrapperProps {
30
30
  variant?: 'outlined' | 'elevation';
31
31
  labels?: Partial<WrapperLabels>;
32
32
  /**
33
- * Icon shown at the right edge of the summary row. Accordion rotates it
34
- * 180° automatically when the wrapper expands. Default: `ExpandMoreIcon`.
33
+ * Icon shown at the right edge of the header row, rotated 180° while the
34
+ * wrapper is expanded. Default: `ExpandMoreIcon`.
35
35
  */
36
36
  expandIcon?: ComponentType<SvgIconProps>;
37
37
  iconProps?: SvgIconProps;
@@ -1,4 +1,4 @@
1
- import { C as e, E as t, S as n, T as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "../actions-BjPfCLG9.js";
1
+ import { C as e, E as t, S as n, T as r, _ as i, a, b as o, c as s, d as c, f as l, g as u, h as d, i as f, l as p, m, n as h, o as g, p as _, r as v, s as y, t as b, u as x, v as S, w as C, x as w, y as T } from "../actions-Dhlz_adK.js";
2
2
  import { a as E, i as D, n as O, r as k, t as A } from "../zoom-toggle-IsF8BnAp.js";
3
- import { a as j, c as M, d as N, f as P, i as F, l as I, n as L, o as R, r as z, s as B, t as V, u as H } from "../download-DdaK3qgC.js";
3
+ import { a as j, c as M, d as N, f as P, i as F, l as I, n as L, o as R, r as z, s as B, t as V, u as H } from "../download-DGgFOaXj.js";
4
4
  export { l as BrushToggle, F as CSVIcon, b as ChangeColumn, _ as DEFAULT_BRUSH_TOGGLE_LABELS, h as DEFAULT_CHANGE_COLUMN_LABELS, M as DEFAULT_DOWNLOAD_LABELS, y as DEFAULT_FULLSCREEN_LABELS, f as DEFAULT_LOCK_SELECTION_LABELS, p as DEFAULT_RELATIVE_DATA_LABELS, r as DEFAULT_SEARCHER_LABELS, S as DEFAULT_SHOW_ALL_LABELS, o as DEFAULT_STACK_TOGGLE_LABELS, O as DEFAULT_ZOOM_TOGGLE_LABELS, z as DOWNLOAD_ITEM_IDS, B as Download, g as FullScreen, v as LockSelection, j as MarkdownIcon, R as PNGIcon, s as RelativeData, d as SHOW_ALL_ID, n as Searcher, e as SearcherToggle, u as ShowAllToggle, T as StackToggle, k as ZOOM_LAYOUT, A as ZoomToggle, m as addBrush, w as addStack, D as addZoom, V as buildCsvDownloadItem, L as buildPngDownloadItem, E as createAddZoom, x as createPercentFormatter, I as downloadDOMToPNG, H as downloadToCSV, a as filterByLockedItems, t as filterBySearchText, C as setSearcherText, i as setShowAll, N as toCsvString, c as toRelativeData, P as triggerLinkDownload };
@@ -1,5 +1,5 @@
1
1
  import { r as e } from "../zoom-toggle-IsF8BnAp.js";
2
- import { n as t, t as n } from "../download-DdaK3qgC.js";
2
+ import { n as t, t as n } from "../download-DGgFOaXj.js";
3
3
  import { n as r, r as i, t as a } from "../utils-Dr6gf3vD.js";
4
4
  import { a as o, d as s, f as c, i as l, s as u, u as d } from "../chart-config-B_fdIcD3.js";
5
5
  import { c as f } from "react/compiler-runtime";
@@ -244,13 +244,13 @@ function E(e) {
244
244
  backgroundColor: e.pngBackgroundColor
245
245
  })), r.push(n({
246
246
  filename: e.filename,
247
- getRows: () => {
248
- let t = e.getData(), n = [];
249
- for (let [e, r] of t.entries()) {
250
- e > 0 && n.push([]), n.push(["name", "value"]);
251
- for (let e of r) n.push([e.name, e.value]);
247
+ getRows: (t) => {
248
+ let n = e.getData(t), r = [];
249
+ for (let [e, t] of n.entries()) {
250
+ e > 0 && r.push([]), r.push(["name", "value"]);
251
+ for (let e of t) r.push([e.name, e.value]);
252
252
  }
253
- return n;
253
+ return r;
254
254
  }
255
255
  })), r;
256
256
  }