@carto/ps-react-ui 6.0.0 → 6.1.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 (135) hide show
  1. package/dist/actions-BWlS5tpP.js +1150 -0
  2. package/dist/actions-BWlS5tpP.js.map +1 -0
  3. package/dist/category-alzjKzvQ.js +839 -0
  4. package/dist/category-alzjKzvQ.js.map +1 -0
  5. package/dist/{download-Vlzn2jzb.js → download-B4sykOFm.js} +94 -83
  6. package/dist/download-B4sykOFm.js.map +1 -0
  7. package/dist/{echart-DjcbtKgi.js → echart-CV8F50gn.js} +6 -5
  8. package/dist/echart-CV8F50gn.js.map +1 -0
  9. package/dist/{formula-CdHWtepq.js → formula-DJS-JLpk.js} +10 -16
  10. package/dist/{formula-CdHWtepq.js.map → formula-DJS-JLpk.js.map} +1 -1
  11. package/dist/legend.js +34 -21
  12. package/dist/legend.js.map +1 -1
  13. package/dist/{markdown-CY-67NRE.js → markdown-Bn2nKCbn.js} +12 -18
  14. package/dist/{markdown-CY-67NRE.js.map → markdown-Bn2nKCbn.js.map} +1 -1
  15. package/dist/{range-DHQSsl2_.js → range-BpU2zBmq.js} +2 -2
  16. package/dist/{range-DHQSsl2_.js.map → range-BpU2zBmq.js.map} +1 -1
  17. package/dist/{spread-DuM5oTI1.js → spread-CQwFIwuz.js} +10 -16
  18. package/dist/{spread-DuM5oTI1.js.map → spread-CQwFIwuz.js.map} +1 -1
  19. package/dist/{stores-B8CHbgw-.js → stores-DcBOZlU3.js} +30 -24
  20. package/dist/stores-DcBOZlU3.js.map +1 -0
  21. package/dist/{table-BE4uO9pp.js → table-DEdW_fDj.js} +7 -13
  22. package/dist/{table-BE4uO9pp.js.map → table-DEdW_fDj.js.map} +1 -1
  23. package/dist/types/legend/stores/types.d.ts +4 -2
  24. package/dist/types/widgets/actions/download/csv-item.d.ts +3 -3
  25. package/dist/types/widgets/actions/download/index.d.ts +2 -1
  26. package/dist/types/widgets/actions/download/png-item.d.ts +2 -2
  27. package/dist/types/widgets/actions/download/types.d.ts +12 -1
  28. package/dist/types/widgets/actions/download/widget-download.d.ts +26 -0
  29. package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +20 -13
  30. package/dist/types/widgets/actions/index.d.ts +1 -1
  31. package/dist/types/widgets/actions/searcher/filter.d.ts +3 -2
  32. package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +3 -0
  33. package/dist/types/widgets/bar/download.d.ts +6 -20
  34. package/dist/types/widgets/category/category-ui.d.ts +9 -1
  35. package/dist/types/widgets/category/download.d.ts +5 -10
  36. package/dist/types/widgets/category/helpers.d.ts +10 -0
  37. package/dist/types/widgets/echart/style.d.ts +1 -0
  38. package/dist/types/widgets/formula/download.d.ts +5 -15
  39. package/dist/types/widgets/histogram/download.d.ts +3 -8
  40. package/dist/types/widgets/index.d.ts +1 -1
  41. package/dist/types/widgets/markdown/download.d.ts +5 -11
  42. package/dist/types/widgets/pie/download.d.ts +3 -8
  43. package/dist/types/widgets/scatterplot/download.d.ts +6 -11
  44. package/dist/types/widgets/spread/download.d.ts +6 -12
  45. package/dist/types/widgets/stores/index.d.ts +1 -1
  46. package/dist/types/widgets/stores/widget-store-registry.d.ts +14 -0
  47. package/dist/types/widgets/table/download.d.ts +7 -13
  48. package/dist/types/widgets/timeseries/download.d.ts +7 -12
  49. package/dist/types/widgets/toolbox/toolbox.d.ts +1 -1
  50. package/dist/{utils-BStJWhZN.js → utils-C-eWwOhE.js} +2 -2
  51. package/dist/{utils-BStJWhZN.js.map → utils-C-eWwOhE.js.map} +1 -1
  52. package/dist/widgets/actions.js +4 -4
  53. package/dist/widgets/bar.js +11 -17
  54. package/dist/widgets/bar.js.map +1 -1
  55. package/dist/widgets/category.js +1 -1
  56. package/dist/widgets/echart.js +1 -1
  57. package/dist/widgets/formula.js +1 -1
  58. package/dist/widgets/histogram.js +14 -20
  59. package/dist/widgets/histogram.js.map +1 -1
  60. package/dist/widgets/markdown.js +1 -1
  61. package/dist/widgets/pie.js +13 -19
  62. package/dist/widgets/pie.js.map +1 -1
  63. package/dist/widgets/range.js +1 -1
  64. package/dist/widgets/scatterplot.js +13 -19
  65. package/dist/widgets/scatterplot.js.map +1 -1
  66. package/dist/widgets/spread.js +1 -1
  67. package/dist/widgets/stores.js +2 -2
  68. package/dist/widgets/table.js +1 -1
  69. package/dist/widgets/timeseries.js +16 -22
  70. package/dist/widgets/timeseries.js.map +1 -1
  71. package/dist/widgets/utils.js +1 -1
  72. package/dist/widgets.js +274 -333
  73. package/dist/widgets.js.map +1 -1
  74. package/dist/{zoom-toggle-D_VuA01l.js → zoom-toggle-MmLjMTEw.js} +2 -2
  75. package/dist/{zoom-toggle-D_VuA01l.js.map → zoom-toggle-MmLjMTEw.js.map} +1 -1
  76. package/package.json +1 -1
  77. package/src/legend/components/legend-item/legend-item-ui.test.tsx +22 -1
  78. package/src/legend/components/legend-ramp/legend-ramp-ui.tsx +22 -6
  79. package/src/legend/stores/types.ts +4 -2
  80. package/src/widgets/actions/download/csv-item.test.tsx +3 -3
  81. package/src/widgets/actions/download/csv-item.tsx +6 -6
  82. package/src/widgets/actions/download/download.tsx +5 -3
  83. package/src/widgets/actions/download/index.ts +2 -1
  84. package/src/widgets/actions/download/png-item.test.tsx +5 -3
  85. package/src/widgets/actions/download/png-item.tsx +4 -4
  86. package/src/widgets/actions/download/types.ts +15 -1
  87. package/src/widgets/actions/download/widget-download.test.ts +30 -0
  88. package/src/widgets/actions/download/widget-download.ts +41 -0
  89. package/src/widgets/actions/fullscreen/fullscreen-store.test.tsx +155 -0
  90. package/src/widgets/actions/fullscreen/fullscreen.test.tsx +39 -41
  91. package/src/widgets/actions/fullscreen/fullscreen.tsx +198 -96
  92. package/src/widgets/actions/index.ts +3 -0
  93. package/src/widgets/actions/searcher/filter.test.ts +28 -0
  94. package/src/widgets/actions/searcher/filter.ts +22 -4
  95. package/src/widgets/actions/searcher/searcher-toggle.tsx +16 -8
  96. package/src/widgets/actions/searcher/searcher.test.tsx +22 -0
  97. package/src/widgets/actions/searcher/searcher.tsx +17 -7
  98. package/src/widgets/bar/download.test.tsx +5 -3
  99. package/src/widgets/bar/download.tsx +11 -35
  100. package/src/widgets/category/category-ui.tsx +26 -14
  101. package/src/widgets/category/category.tsx +37 -2
  102. package/src/widgets/category/components/category-legend.tsx +1 -2
  103. package/src/widgets/category/download.test.ts +4 -2
  104. package/src/widgets/category/download.ts +14 -27
  105. package/src/widgets/category/helpers.test.ts +17 -0
  106. package/src/widgets/category/helpers.ts +16 -0
  107. package/src/widgets/echart/style.ts +6 -0
  108. package/src/widgets/formula/download.test.tsx +3 -1
  109. package/src/widgets/formula/download.tsx +10 -30
  110. package/src/widgets/histogram/download.test.ts +6 -4
  111. package/src/widgets/histogram/download.ts +13 -26
  112. package/src/widgets/index.ts +1 -0
  113. package/src/widgets/markdown/download.test.ts +2 -2
  114. package/src/widgets/markdown/download.tsx +11 -26
  115. package/src/widgets/pie/download.test.ts +7 -3
  116. package/src/widgets/pie/download.ts +12 -25
  117. package/src/widgets/scatterplot/download.test.ts +4 -2
  118. package/src/widgets/scatterplot/download.ts +15 -28
  119. package/src/widgets/spread/download.test.ts +3 -1
  120. package/src/widgets/spread/download.ts +13 -27
  121. package/src/widgets/stores/index.ts +2 -0
  122. package/src/widgets/stores/widget-store-registry.test.ts +25 -0
  123. package/src/widgets/stores/widget-store-registry.ts +22 -0
  124. package/src/widgets/table/download.test.ts +5 -3
  125. package/src/widgets/table/download.ts +15 -29
  126. package/src/widgets/timeseries/download.test.ts +6 -4
  127. package/src/widgets/timeseries/download.ts +16 -29
  128. package/src/widgets/toolbox/toolbox.tsx +1 -1
  129. package/dist/actions-KsX1xdDM.js +0 -1024
  130. package/dist/actions-KsX1xdDM.js.map +0 -1
  131. package/dist/category-CsdDqDzo.js +0 -833
  132. package/dist/category-CsdDqDzo.js.map +0 -1
  133. package/dist/download-Vlzn2jzb.js.map +0 -1
  134. package/dist/echart-DjcbtKgi.js.map +0 -1
  135. package/dist/stores-B8CHbgw-.js.map +0 -1
@@ -0,0 +1,26 @@
1
+ import { DownloadContext, DownloadItem } from './types.js';
2
+ /** Arguments every per-widget `create*DownloadConfig` shares. */
3
+ export interface WidgetDownloadArgs<T> {
4
+ /** Base filename (without extension). */
5
+ filename: string;
6
+ /**
7
+ * Reads the data to export at click time. `ctx.id` is the store the menu
8
+ * was opened from — the fullscreen dialog's own while it's open. See
9
+ * `widgetStoreData` in `widgets/stores`.
10
+ */
11
+ getData: (ctx: DownloadContext) => T;
12
+ /**
13
+ * Reads the element the PNG item rasterises. When given, a PNG item is
14
+ * prepended to the menu. See `widgetCaptureEl` in `widgets/stores`.
15
+ */
16
+ getCaptureEl?: (ctx: DownloadContext) => HTMLElement | null;
17
+ /** PNG `pixelRatio` (default 2). */
18
+ pngPixelRatio?: number;
19
+ /** PNG `backgroundColor` (default transparent). */
20
+ pngBackgroundColor?: string | null;
21
+ }
22
+ /**
23
+ * `items`, with a PNG item in front when `args.getCaptureEl` is given — the
24
+ * order every widget's download menu uses.
25
+ */
26
+ export declare function withPngItem(args: Omit<WidgetDownloadArgs<unknown>, 'getData'>, ...items: DownloadItem[]): DownloadItem[];
@@ -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, withPngItem, 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 WidgetDownloadArgs, 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,5 +1,6 @@
1
1
  import { ComponentType } from 'react';
2
2
  import { SvgIconProps } from '@mui/material';
3
+ import { WidgetState } from '../../stores/index.js';
3
4
  import { SearcherLabels } from './labels.js';
4
5
  export interface SearcherToggleProps {
5
6
  labels?: Partial<SearcherLabels>;
@@ -15,6 +16,8 @@ export interface SearcherToggleProps {
15
16
  initialEnabled?: boolean;
16
17
  }
17
18
  export declare function SearcherToggle({ labels, icon: Icon, iconProps, initialEnabled, }: SearcherToggleProps): import('react').JSX.Element;
19
+ /** The widget's current search text; empty until someone types. */
20
+ export declare function selectSearchText(s: WidgetState): string;
18
21
  /**
19
22
  * Imperatively writes the search text into the widget store. Used by the
20
23
  * Searcher input to update text inside transformStates without going through
@@ -1,24 +1,10 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadItem, WidgetDownloadArgs } from '../actions/download/index.js';
2
2
  import { BarWidgetData } from './types.js';
3
- export interface BarDownloadConfigArgs {
4
- filename: string;
5
- getData: () => BarWidgetData;
6
- /**
7
- * Optional getter for the widget's capture element (registered by
8
- * `Widget.State` on its success path). When provided, a PNG item is
9
- * prepended to the returned list. Wire it to
10
- * `() => getCaptureEl(id)`.
11
- */
12
- getCaptureEl?: () => HTMLElement | null;
13
- /** PNG `pixelRatio` (default 2). */
14
- pngPixelRatio?: number;
15
- /** PNG `backgroundColor` (default transparent). */
16
- pngBackgroundColor?: string | null;
17
- }
3
+ export type BarDownloadConfigArgs = WidgetDownloadArgs<BarWidgetData>;
18
4
  /**
19
- * Builds download items for the Bar widget. Always includes a CSV item
20
- * with one `name,value` block per series, separated by an empty row when
21
- * there are multiple. When `getCaptureEl` is supplied, also prepends a PNG
22
- * item that rasterises the captured element via `html2canvas`.
5
+ * Builds download items for the Bar widget. Always includes a CSV item with
6
+ * one `name,value` block per series, separated by an empty row when there
7
+ * are multiple. When `getCaptureEl` is given, also prepends a PNG item that
8
+ * rasterises the captured element via `html2canvas`.
23
9
  */
24
10
  export declare function createBarDownloadConfig(args: BarDownloadConfigArgs): DownloadItem[];
@@ -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,16 +1,11 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadItem, WidgetDownloadArgs } 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
5
- * with `series, name, value` columns (one row per item). When
6
- * `getCaptureEl` is supplied, prepends a PNG item that rasterises the
7
- * captured element via `html2canvas`.
5
+ * with `series, name, value` columns (one row per item). When `getCaptureEl`
6
+ * is given, prepends a PNG item that rasterises the captured element via
7
+ * `html2canvas`.
8
8
  */
9
- export declare function createCategoryDownloadConfig(args: {
10
- filename: string;
11
- getData: () => CategoryWidgetData;
9
+ export declare function createCategoryDownloadConfig(args: WidgetDownloadArgs<CategoryWidgetData> & {
12
10
  seriesNames?: readonly string[];
13
- getCaptureEl?: () => HTMLElement | null;
14
- pngPixelRatio?: number;
15
- pngBackgroundColor?: string | null;
16
11
  }): DownloadItem[];
@@ -0,0 +1,10 @@
1
+ import { CategorySeriesConfig } from './types.js';
2
+ /** Shared empty set: "no series hidden" without a new identity per render. */
3
+ export declare const NO_HIDDEN_SERIES: ReadonlySet<number>;
4
+ /**
5
+ * Identifies a series breakdown by its names. Hidden-series indices are only
6
+ * valid for the breakdown they were made for, and both the store copy (in
7
+ * `Category`) and the local one (in `CategoryUI`) are tagged with this key —
8
+ * so they must compute it the same way.
9
+ */
10
+ export declare function categorySeriesKey(series: readonly CategorySeriesConfig[] | undefined): string;
@@ -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,20 +1,10 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadItem, WidgetDownloadArgs } from '../actions/download/index.js';
2
2
  import { FormulaWidgetData } from './types.js';
3
- export interface FormulaDownloadConfigArgs {
4
- filename: string;
5
- getData: () => FormulaWidgetData;
6
- /**
7
- * Optional getter for the widget's capture element (registered by
8
- * `Widget.State`). When provided, a PNG item is prepended.
9
- */
10
- getCaptureEl?: () => HTMLElement | null;
11
- pngPixelRatio?: number;
12
- pngBackgroundColor?: string | null;
13
- }
3
+ export type FormulaDownloadConfigArgs = WidgetDownloadArgs<FormulaWidgetData>;
14
4
  /**
15
5
  * Builds download items for the Formula widget. Always includes a CSV item
16
- * with one row per KPI (`prefix`, `value`, `suffix`, `note`, `delta`).
17
- * When `getCaptureEl` is supplied, prepends a PNG item that rasterises the
18
- * captured element via `html2canvas`.
6
+ * with one row per KPI (`prefix`, `value`, `suffix`, `note`, `delta`). When
7
+ * `getCaptureEl` is given, prepends a PNG item that rasterises the captured
8
+ * element via `html2canvas`.
19
9
  */
20
10
  export declare function createFormulaDownloadConfig(args: FormulaDownloadConfigArgs): DownloadItem[];
@@ -1,17 +1,12 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadItem, WidgetDownloadArgs } 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
5
5
  * `bin_low, bin_high, series_1_count, series_2_count, …` columns (one row
6
- * per bin). When `getCaptureEl` is supplied, prepends a PNG item that
6
+ * per bin). When `getCaptureEl` is given, prepends a PNG item that
7
7
  * rasterises the captured element via `html2canvas`.
8
8
  */
9
- export declare function createHistogramDownloadConfig(args: {
10
- filename: string;
11
- getData: () => HistogramWidgetData;
9
+ export declare function createHistogramDownloadConfig(args: WidgetDownloadArgs<HistogramWidgetData> & {
12
10
  getTicks: () => readonly number[];
13
11
  seriesNames?: readonly string[];
14
- getCaptureEl?: () => HTMLElement | null;
15
- pngPixelRatio?: number;
16
- pngBackgroundColor?: string | null;
17
12
  }): 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,16 +1,10 @@
1
- import { toCsvString, triggerLinkDownload, DownloadItem } from '../actions/download/index.js';
1
+ import { toCsvString, triggerLinkDownload, DownloadItem, WidgetDownloadArgs } from '../actions/download/index.js';
2
2
  import { MarkdownWidgetData } from './types.js';
3
3
  /**
4
- * Download menu items for the Markdown widget. Always includes a `.md`
5
- * item that saves the markdown source verbatim. When `getCaptureEl` is
6
- * supplied, prepends a PNG item that rasterises the captured element via
4
+ * Download menu items for the Markdown widget. Always includes a `.md` item
5
+ * that saves the markdown source verbatim. When `getCaptureEl` is given,
6
+ * prepends a PNG item that rasterises the captured element via
7
7
  * `html2canvas`.
8
8
  */
9
- export declare function createMarkdownDownloadConfig(args: {
10
- filename: string;
11
- getData: () => MarkdownWidgetData;
12
- getCaptureEl?: () => HTMLElement | null;
13
- pngPixelRatio?: number;
14
- pngBackgroundColor?: string | null;
15
- }): DownloadItem[];
9
+ export declare function createMarkdownDownloadConfig(args: WidgetDownloadArgs<MarkdownWidgetData>): DownloadItem[];
16
10
  export { toCsvString, triggerLinkDownload };
@@ -1,17 +1,12 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadItem, WidgetDownloadArgs } 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
5
5
  * `series, name, value` columns (one row per slice; series labels come from
6
6
  * `seriesNames` if provided, else `series_<n>`). When `getCaptureEl` is
7
- * supplied, prepends a PNG item that rasterises the captured element via
7
+ * given, prepends a PNG item that rasterises the captured element via
8
8
  * `html2canvas`.
9
9
  */
10
- export declare function createPieDownloadConfig(args: {
11
- filename: string;
12
- getData: () => PieWidgetData;
10
+ export declare function createPieDownloadConfig(args: WidgetDownloadArgs<PieWidgetData> & {
13
11
  seriesNames?: readonly string[];
14
- getCaptureEl?: () => HTMLElement | null;
15
- pngPixelRatio?: number;
16
- pngBackgroundColor?: string | null;
17
12
  }): DownloadItem[];
@@ -1,16 +1,11 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadItem, WidgetDownloadArgs } from '../actions/download/index.js';
2
2
  import { ScatterplotWidgetData } from './types.js';
3
3
  /**
4
- * Download menu items for the Scatterplot widget. Always includes a CSV
5
- * item with `series, x, y` columns (one row per point). When
6
- * `getCaptureEl` is supplied, prepends a PNG item that rasterises the
7
- * captured element via `html2canvas`.
4
+ * Download menu items for the Scatterplot widget. Always includes a CSV item
5
+ * with `series, x, y` columns (one row per point). When `getCaptureEl` is
6
+ * given, prepends a PNG item that rasterises the captured element via
7
+ * `html2canvas`.
8
8
  */
9
- export declare function createScatterplotDownloadConfig(args: {
10
- filename: string;
11
- getData: () => ScatterplotWidgetData;
9
+ export declare function createScatterplotDownloadConfig(args: WidgetDownloadArgs<ScatterplotWidgetData> & {
12
10
  seriesNames?: readonly string[];
13
- getCaptureEl?: () => HTMLElement | null;
14
- pngPixelRatio?: number;
15
- pngBackgroundColor?: string | null;
16
11
  }): DownloadItem[];
@@ -1,15 +1,9 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadItem, WidgetDownloadArgs } from '../actions/download/index.js';
2
2
  import { SpreadWidgetData } from './types.js';
3
3
  /**
4
- * Download menu items for the Spread widget. Always includes a CSV item
5
- * with `series, prefix, min, max, suffix, note` columns (one row per
6
- * entry). When `getCaptureEl` is supplied, prepends a PNG item that
7
- * rasterises the captured element via `html2canvas`.
4
+ * Download menu items for the Spread widget. Always includes a CSV item with
5
+ * `series, prefix, min, max, suffix, note` columns (one row per entry). When
6
+ * `getCaptureEl` is given, prepends a PNG item that rasterises the captured
7
+ * element via `html2canvas`.
8
8
  */
9
- export declare function createSpreadDownloadConfig(args: {
10
- filename: string;
11
- getData: () => SpreadWidgetData;
12
- getCaptureEl?: () => HTMLElement | null;
13
- pngPixelRatio?: number;
14
- pngBackgroundColor?: string | null;
15
- }): DownloadItem[];
9
+ export declare function createSpreadDownloadConfig(args: WidgetDownloadArgs<SpreadWidgetData>): DownloadItem[];
@@ -2,7 +2,7 @@ export type { TransformType, TransformDescriptor, TransformFn, Transform, Transf
2
2
  export { applyTransforms, upsertTransform, removeTransform } from './transforms.js';
3
3
  export { pipelineMiddleware } from './pipeline-middleware.js';
4
4
  export { WidgetContext, useWidgetId } from './widget-context.js';
5
- export { getWidgetStore, hasWidgetStore, deleteWidgetStore, resetWidgetStore, clearAllWidgetStores, registerWidgetStore, unregisterWidgetStore, setWidgetStoreEntry, createWidgetStore, useWidget, useWidgetShallow, setCaptureEl, getCaptureEl, clearAllCaptureEls, setEchartInstance, getEchartInstance, subscribeEchartInstance, clearAllEchartInstances, __debugListWidgetStores, } from './widget-store-registry.js';
5
+ export { getWidgetStore, hasWidgetStore, deleteWidgetStore, resetWidgetStore, clearAllWidgetStores, registerWidgetStore, unregisterWidgetStore, setWidgetStoreEntry, createWidgetStore, useWidget, useWidgetShallow, setCaptureEl, getCaptureEl, widgetStoreData, widgetCaptureEl, clearAllCaptureEls, setEchartInstance, getEchartInstance, subscribeEchartInstance, clearAllEchartInstances, __debugListWidgetStores, } from './widget-store-registry.js';
6
6
  export { useEchartInstance } from './use-echart-instance.js';
7
7
  export { useTransform, useSingleTransform, type UseTransformOptions, type TransformControls, } from './use-transform.js';
8
8
  export { useTransformEnabled } from './use-transform-enabled.js';
@@ -1,5 +1,6 @@
1
1
  import { ECharts } from 'echarts';
2
2
  import { WidgetInit, WidgetState, WidgetStoreApi } from './types.js';
3
+ import { DownloadContext } from '../actions/download/types.js';
3
4
  type EchartInstanceListener = (chart: ECharts | null) => void;
4
5
  export declare function getWidgetStore(id: string): WidgetStoreApi;
5
6
  export declare function hasWidgetStore(id: string): boolean;
@@ -19,6 +20,19 @@ export declare function setCaptureEl(id: string, el: HTMLElement | null): void;
19
20
  * or when the widget hasn't mounted.
20
21
  */
21
22
  export declare function getCaptureEl(id: string): HTMLElement | null;
23
+ /**
24
+ * `getData` for a `create*DownloadConfig`: the `data` of the store the
25
+ * download menu was opened from (`ctx.id` — the fullscreen dialog's own
26
+ * while it's open), or of widget `id` when the menu sits outside a
27
+ * `<Widget.Provider>`.
28
+ */
29
+ export declare function widgetStoreData<T>(id: string): (ctx: DownloadContext) => T;
30
+ /**
31
+ * `getCaptureEl` for a `create*DownloadConfig`: the capture element of the
32
+ * store the download menu was opened from (`ctx.id`), or of widget `id`
33
+ * outside a `<Widget.Provider>`.
34
+ */
35
+ export declare function widgetCaptureEl(id: string): (ctx: DownloadContext) => HTMLElement | null;
22
36
  /** @internal — exposed for tests and debugging only. */
23
37
  export declare function clearAllCaptureEls(): void;
24
38
  /**
@@ -1,18 +1,12 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadItem, WidgetDownloadArgs } from '../actions/download/index.js';
2
2
  import { TableColumn, TableWidgetData } from './types.js';
3
3
  /**
4
- * Download menu items for the Table widget. Always includes a CSV item
5
- * that pulls the latest data from the widget store via `getData()` (so
6
- * locked / sorted / filtered state is honored); headers come from
7
- * `column.label`, cells from `row[column.id]`. When `getCaptureEl` is
8
- * supplied, prepends a PNG item that rasterises the captured element via
9
- * `html2canvas`.
4
+ * Download menu items for the Table widget. Always includes a CSV item that
5
+ * pulls the latest data from the widget store via `getData()` (so locked /
6
+ * sorted / filtered state is honored); headers come from `column.label`,
7
+ * cells from `row[column.id]`. When `getCaptureEl` is given, prepends a PNG
8
+ * item that rasterises the captured element via `html2canvas`.
10
9
  */
11
- export declare function createTableDownloadConfig(opts: {
12
- filename: string;
13
- getData: () => TableWidgetData;
10
+ export declare function createTableDownloadConfig(opts: WidgetDownloadArgs<TableWidgetData> & {
14
11
  columns: readonly TableColumn[];
15
- getCaptureEl?: () => HTMLElement | null;
16
- pngPixelRatio?: number;
17
- pngBackgroundColor?: string | null;
18
12
  }): DownloadItem[];
@@ -1,17 +1,12 @@
1
- import { DownloadItem } from '../actions/download/index.js';
1
+ import { DownloadItem, WidgetDownloadArgs } from '../actions/download/index.js';
2
2
  import { TimeseriesWidgetData } from './types.js';
3
3
  /**
4
- * Download menu items for the Timeseries widget. Always includes a CSV
5
- * item with `time, series_1, series_2, …` columns (one row per unique time
6
- * across all series; ISO-8601 strings for `Date`/numeric times). When
7
- * `getCaptureEl` is supplied, prepends a PNG item that rasterises the
8
- * captured element via `html2canvas`.
4
+ * Download menu items for the Timeseries widget. Always includes a CSV item
5
+ * with `time, series_1, series_2, …` columns (one row per unique time across
6
+ * all series; ISO-8601 strings for `Date`/numeric times). When
7
+ * `getCaptureEl` is given, prepends a PNG item that rasterises the captured
8
+ * element via `html2canvas`.
9
9
  */
10
- export declare function createTimeseriesDownloadConfig(args: {
11
- filename: string;
12
- getData: () => TimeseriesWidgetData;
10
+ export declare function createTimeseriesDownloadConfig(args: WidgetDownloadArgs<TimeseriesWidgetData> & {
13
11
  seriesNames?: readonly string[];
14
- getCaptureEl?: () => HTMLElement | null;
15
- pngPixelRatio?: number;
16
- pngBackgroundColor?: string | null;
17
12
  }): 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
  *
@@ -1,4 +1,4 @@
1
- import { r as e } from "./zoom-toggle-D_VuA01l.js";
1
+ import { r as e } from "./zoom-toggle-MmLjMTEw.js";
2
2
  //#region src/widgets/utils/merge-options.ts
3
3
  function t(e, t) {
4
4
  if (!t) return e;
@@ -55,4 +55,4 @@ function a(e, t) {
55
55
  //#endregion
56
56
  export { i as n, t as r, a as t };
57
57
 
58
- //# sourceMappingURL=utils-BStJWhZN.js.map
58
+ //# sourceMappingURL=utils-C-eWwOhE.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils-BStJWhZN.js","names":[],"sources":["../src/widgets/utils/merge-options.ts","../src/widgets/utils/data-zoom-layout.ts","../src/widgets/utils/resolve-theme-color.ts"],"sourcesContent":["/**\n * Shallow-merges two ECharts option objects:\n * - Top-level keys from both are combined.\n * - Arrays are merged by index (element-wise shallow merge, primitive override).\n * - Plain objects are shallow-merged.\n * - Primitives are overridden by the override value.\n *\n * Designed for the two-stage memoization pattern: first build a base option\n * object from data + theme + formatters, then call `mergeOptions(base, override)`\n * inside a second `useMemo` keyed on `[base, override]`.\n */\nexport function mergeOptions<T extends Record<string, unknown>>(\n base: T,\n override?: Partial<T>,\n): T {\n if (!override) return base\n const out: Record<string, unknown> = { ...base }\n for (const key of Object.keys(override) as (keyof T)[]) {\n const a = base[key]\n const b = override[key]\n if (b === undefined) continue\n out[key as string] = mergeValue(a, b)\n }\n return out as T\n}\n\nfunction mergeValue(a: unknown, b: unknown): unknown {\n if (Array.isArray(a) && Array.isArray(b)) {\n const len = Math.max(a.length, b.length)\n const result = new Array<unknown>(len)\n for (let i = 0; i < len; i++) {\n const av: unknown = a[i]\n const bv: unknown = b[i]\n if (bv === undefined) result[i] = av\n else if (av === undefined) result[i] = bv\n else result[i] = mergeValue(av, bv)\n }\n return result\n }\n if (isPlainObject(a) && isPlainObject(b)) {\n return { ...a, ...b }\n }\n return b\n}\n\nfunction isPlainObject(v: unknown): v is Record<string, unknown> {\n if (v === null || typeof v !== 'object') return false\n const proto = Object.getPrototypeOf(v) as unknown\n return proto === Object.prototype || proto === null\n}\n","import { ZOOM_LAYOUT } from '../actions/zoom-toggle'\n\n/**\n * If the option includes a `dataZoom` array (from ZoomToggle's transform),\n * lift any slider entries above the legend row so they don't overlap.\n * Returns `null` when there is no `dataZoom` — caller skips the layout\n * adjustment entirely.\n *\n * Shared between bar, histogram, and timeseries — every widget with a\n * horizontal x-axis dataZoom slider needs the same offset when a legend\n * is rendered below the plot.\n */\nexport function positionDataZoomForLegend(\n dataZoom: unknown,\n hasLegend: boolean,\n): unknown[] | null {\n if (!Array.isArray(dataZoom) || dataZoom.length === 0) return null\n return dataZoom.map((entry: unknown) => {\n if (entry == null || typeof entry !== 'object') return entry\n const dz = entry as { type?: string; bottom?: number }\n if (dz.type === 'slider' && hasLegend) {\n return { ...dz, bottom: ZOOM_LAYOUT.sliderBottomWithLegend }\n }\n return dz\n })\n}\n","import type { Theme } from '@mui/material'\n\n/**\n * Resolve a colour string against the MUI theme palette.\n *\n * - `'primary.main'`, `'secondary.dark'`, `'success.contrastText'`, … →\n * walks `theme.palette` along the dot-separated path and returns the\n * resolved string when traversal succeeds.\n * - `'#ff0000'`, `'rgb(255, 0, 0)'`, `'red'` → returned as-is (assumed\n * raw CSS; ECharts consumes them directly).\n * - `undefined` → `undefined` (callers fall back to ECharts' palette).\n *\n * Used by the echart option factories (Bar, Pie, Histogram, Scatterplot,\n * Timeseries) so per-series colours specified as theme paths in the\n * unified `WidgetSeries` shape paint correctly. Category, Formula, and\n * Spread render colours through MUI's `sx` resolver, which already\n * handles theme paths — they don't need this helper.\n */\nexport function resolveThemeColor(\n theme: Theme,\n raw: string | undefined,\n): string | undefined {\n if (raw == null) return undefined\n if (!raw.includes('.')) return raw\n const parts = raw.split('.')\n let cursor: unknown = theme.palette\n for (const part of parts) {\n if (cursor == null || typeof cursor !== 'object') {\n return raw\n }\n cursor = (cursor as Record<string, unknown>)[part]\n }\n return typeof cursor === 'string' ? cursor : raw\n}\n"],"mappings":";;AAWA,SAAgB,EACd,GACA,GACG;CACH,IAAI,CAAC,GAAU,OAAO;CACtB,IAAM,IAA+B,EAAE,GAAG,EAAK;CAC/C,KAAK,IAAM,KAAO,OAAO,KAAK,CAAQ,GAAkB;EACtD,IAAM,IAAI,EAAK,IACT,IAAI,EAAS;EACf,MAAM,KAAA,MACV,EAAI,KAAiB,EAAW,GAAG,CAAC;CACtC;CACA,OAAO;AACT;AAEA,SAAS,EAAW,GAAY,GAAqB;CACnD,IAAI,MAAM,QAAQ,CAAC,KAAK,MAAM,QAAQ,CAAC,GAAG;EACxC,IAAM,IAAM,KAAK,IAAI,EAAE,QAAQ,EAAE,MAAM,GACjC,IAAa,MAAe,CAAG;EACrC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAK,KAAK;GAC5B,IAAM,IAAc,EAAE,IAChB,IAAc,EAAE;GACtB,AAAI,MAAO,KAAA,IAAW,EAAO,KAAK,IACzB,MAAO,KAAA,IAAW,EAAO,KAAK,IAClC,EAAO,KAAK,EAAW,GAAI,CAAE;EACpC;EACA,OAAO;CACT;CAIA,OAHI,EAAc,CAAC,KAAK,EAAc,CAAC,IAC9B;EAAE,GAAG;EAAG,GAAG;CAAE,IAEf;AACT;AAEA,SAAS,EAAc,GAA0C;CAC/D,IAAkB,OAAO,KAAM,aAA3B,GAAqC,OAAO;CAChD,IAAM,IAAQ,OAAO,eAAe,CAAC;CACrC,OAAO,MAAU,OAAO,aAAa,MAAU;AACjD;;;ACrCA,SAAgB,EACd,GACA,GACkB;CAElB,OADI,CAAC,MAAM,QAAQ,CAAQ,KAAK,EAAS,WAAW,IAAU,OACvD,EAAS,KAAK,MAAmB;EACtC,IAAqB,OAAO,KAAU,aAAlC,GAA4C,OAAO;EACvD,IAAM,IAAK;EAIX,OAHI,EAAG,SAAS,YAAY,IACnB;GAAE,GAAG;GAAI,QAAQ,EAAY;EAAuB,IAEtD;CACT,CAAC;AACH;;;ACPA,SAAgB,EACd,GACA,GACoB;CACpB,IAAI,KAAO,MAAM;CACjB,IAAI,CAAC,EAAI,SAAS,GAAG,GAAG,OAAO;CAC/B,IAAM,IAAQ,EAAI,MAAM,GAAG,GACvB,IAAkB,EAAM;CAC5B,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAsB,OAAO,KAAW,aAApC,GACF,OAAO;EAET,IAAU,EAAmC;CAC/C;CACA,OAAO,OAAO,KAAW,WAAW,IAAS;AAC/C"}
1
+ {"version":3,"file":"utils-C-eWwOhE.js","names":[],"sources":["../src/widgets/utils/merge-options.ts","../src/widgets/utils/data-zoom-layout.ts","../src/widgets/utils/resolve-theme-color.ts"],"sourcesContent":["/**\n * Shallow-merges two ECharts option objects:\n * - Top-level keys from both are combined.\n * - Arrays are merged by index (element-wise shallow merge, primitive override).\n * - Plain objects are shallow-merged.\n * - Primitives are overridden by the override value.\n *\n * Designed for the two-stage memoization pattern: first build a base option\n * object from data + theme + formatters, then call `mergeOptions(base, override)`\n * inside a second `useMemo` keyed on `[base, override]`.\n */\nexport function mergeOptions<T extends Record<string, unknown>>(\n base: T,\n override?: Partial<T>,\n): T {\n if (!override) return base\n const out: Record<string, unknown> = { ...base }\n for (const key of Object.keys(override) as (keyof T)[]) {\n const a = base[key]\n const b = override[key]\n if (b === undefined) continue\n out[key as string] = mergeValue(a, b)\n }\n return out as T\n}\n\nfunction mergeValue(a: unknown, b: unknown): unknown {\n if (Array.isArray(a) && Array.isArray(b)) {\n const len = Math.max(a.length, b.length)\n const result = new Array<unknown>(len)\n for (let i = 0; i < len; i++) {\n const av: unknown = a[i]\n const bv: unknown = b[i]\n if (bv === undefined) result[i] = av\n else if (av === undefined) result[i] = bv\n else result[i] = mergeValue(av, bv)\n }\n return result\n }\n if (isPlainObject(a) && isPlainObject(b)) {\n return { ...a, ...b }\n }\n return b\n}\n\nfunction isPlainObject(v: unknown): v is Record<string, unknown> {\n if (v === null || typeof v !== 'object') return false\n const proto = Object.getPrototypeOf(v) as unknown\n return proto === Object.prototype || proto === null\n}\n","import { ZOOM_LAYOUT } from '../actions/zoom-toggle'\n\n/**\n * If the option includes a `dataZoom` array (from ZoomToggle's transform),\n * lift any slider entries above the legend row so they don't overlap.\n * Returns `null` when there is no `dataZoom` — caller skips the layout\n * adjustment entirely.\n *\n * Shared between bar, histogram, and timeseries — every widget with a\n * horizontal x-axis dataZoom slider needs the same offset when a legend\n * is rendered below the plot.\n */\nexport function positionDataZoomForLegend(\n dataZoom: unknown,\n hasLegend: boolean,\n): unknown[] | null {\n if (!Array.isArray(dataZoom) || dataZoom.length === 0) return null\n return dataZoom.map((entry: unknown) => {\n if (entry == null || typeof entry !== 'object') return entry\n const dz = entry as { type?: string; bottom?: number }\n if (dz.type === 'slider' && hasLegend) {\n return { ...dz, bottom: ZOOM_LAYOUT.sliderBottomWithLegend }\n }\n return dz\n })\n}\n","import type { Theme } from '@mui/material'\n\n/**\n * Resolve a colour string against the MUI theme palette.\n *\n * - `'primary.main'`, `'secondary.dark'`, `'success.contrastText'`, … →\n * walks `theme.palette` along the dot-separated path and returns the\n * resolved string when traversal succeeds.\n * - `'#ff0000'`, `'rgb(255, 0, 0)'`, `'red'` → returned as-is (assumed\n * raw CSS; ECharts consumes them directly).\n * - `undefined` → `undefined` (callers fall back to ECharts' palette).\n *\n * Used by the echart option factories (Bar, Pie, Histogram, Scatterplot,\n * Timeseries) so per-series colours specified as theme paths in the\n * unified `WidgetSeries` shape paint correctly. Category, Formula, and\n * Spread render colours through MUI's `sx` resolver, which already\n * handles theme paths — they don't need this helper.\n */\nexport function resolveThemeColor(\n theme: Theme,\n raw: string | undefined,\n): string | undefined {\n if (raw == null) return undefined\n if (!raw.includes('.')) return raw\n const parts = raw.split('.')\n let cursor: unknown = theme.palette\n for (const part of parts) {\n if (cursor == null || typeof cursor !== 'object') {\n return raw\n }\n cursor = (cursor as Record<string, unknown>)[part]\n }\n return typeof cursor === 'string' ? cursor : raw\n}\n"],"mappings":";;AAWA,SAAgB,EACd,GACA,GACG;CACH,IAAI,CAAC,GAAU,OAAO;CACtB,IAAM,IAA+B,EAAE,GAAG,EAAK;CAC/C,KAAK,IAAM,KAAO,OAAO,KAAK,CAAQ,GAAkB;EACtD,IAAM,IAAI,EAAK,IACT,IAAI,EAAS;EACf,MAAM,KAAA,MACV,EAAI,KAAiB,EAAW,GAAG,CAAC;CACtC;CACA,OAAO;AACT;AAEA,SAAS,EAAW,GAAY,GAAqB;CACnD,IAAI,MAAM,QAAQ,CAAC,KAAK,MAAM,QAAQ,CAAC,GAAG;EACxC,IAAM,IAAM,KAAK,IAAI,EAAE,QAAQ,EAAE,MAAM,GACjC,IAAa,MAAe,CAAG;EACrC,KAAK,IAAI,IAAI,GAAG,IAAI,GAAK,KAAK;GAC5B,IAAM,IAAc,EAAE,IAChB,IAAc,EAAE;GACtB,AAAI,MAAO,KAAA,IAAW,EAAO,KAAK,IACzB,MAAO,KAAA,IAAW,EAAO,KAAK,IAClC,EAAO,KAAK,EAAW,GAAI,CAAE;EACpC;EACA,OAAO;CACT;CAIA,OAHI,EAAc,CAAC,KAAK,EAAc,CAAC,IAC9B;EAAE,GAAG;EAAG,GAAG;CAAE,IAEf;AACT;AAEA,SAAS,EAAc,GAA0C;CAC/D,IAAkB,OAAO,KAAM,aAA3B,GAAqC,OAAO;CAChD,IAAM,IAAQ,OAAO,eAAe,CAAC;CACrC,OAAO,MAAU,OAAO,aAAa,MAAU;AACjD;;;ACrCA,SAAgB,EACd,GACA,GACkB;CAElB,OADI,CAAC,MAAM,QAAQ,CAAQ,KAAK,EAAS,WAAW,IAAU,OACvD,EAAS,KAAK,MAAmB;EACtC,IAAqB,OAAO,KAAU,aAAlC,GAA4C,OAAO;EACvD,IAAM,IAAK;EAIX,OAHI,EAAG,SAAS,YAAY,IACnB;GAAE,GAAG;GAAI,QAAQ,EAAY;EAAuB,IAEtD;CACT,CAAC;AACH;;;ACPA,SAAgB,EACd,GACA,GACoB;CACpB,IAAI,KAAO,MAAM;CACjB,IAAI,CAAC,EAAI,SAAS,GAAG,GAAG,OAAO;CAC/B,IAAM,IAAQ,EAAI,MAAM,GAAG,GACvB,IAAkB,EAAM;CAC5B,KAAK,IAAM,KAAQ,GAAO;EACxB,IAAsB,OAAO,KAAW,aAApC,GACF,OAAO;EAET,IAAU,EAAmC;CAC/C;CACA,OAAO,OAAO,KAAW,WAAW,IAAS;AAC/C"}
@@ -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-KsX1xdDM.js";
2
- import { a as E, i as D, n as O, r as k, t as A } from "../zoom-toggle-D_VuA01l.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-Vlzn2jzb.js";
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
+ 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-BWlS5tpP.js";
2
+ import { a as E, i as D, n as O, r as k, t as A } from "../zoom-toggle-MmLjMTEw.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, p as z, r as B, s as V, t as H, u as U } from "../download-B4sykOFm.js";
4
+ export { l as BrushToggle, j as CSVIcon, b as ChangeColumn, _ as DEFAULT_BRUSH_TOGGLE_LABELS, h as DEFAULT_CHANGE_COLUMN_LABELS, I 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, F as DOWNLOAD_ITEM_IDS, M as Download, g as FullScreen, v as LockSelection, R as MarkdownIcon, V 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, L as buildCsvDownloadItem, B as buildPngDownloadItem, E as createAddZoom, x as createPercentFormatter, U as downloadDOMToPNG, N as downloadToCSV, a as filterByLockedItems, t as filterBySearchText, C as setSearcherText, i as setShowAll, P as toCsvString, c as toRelativeData, z as triggerLinkDownload, H as withPngItem };
@@ -1,6 +1,6 @@
1
- import { r as e } from "../zoom-toggle-D_VuA01l.js";
2
- import { n as t, t as n } from "../download-Vlzn2jzb.js";
3
- import { n as r, r as i, t as a } from "../utils-BStJWhZN.js";
1
+ import { r as e } from "../zoom-toggle-MmLjMTEw.js";
2
+ import { n as t, t as n } from "../download-B4sykOFm.js";
3
+ import { n as r, r as i, t as a } from "../utils-C-eWwOhE.js";
4
4
  import { a as o, n as s, o as c, r as l, s as u, t as d } from "../option-builders-DQivvvbb.js";
5
5
  import { c as f } from "react/compiler-runtime";
6
6
  import { Box as p, Skeleton as m } from "@mui/material";
@@ -236,23 +236,17 @@ function T(e, t) {
236
236
  //#endregion
237
237
  //#region src/widgets/bar/download.tsx
238
238
  function E(e) {
239
- let r = [];
240
- return e.getCaptureEl && r.push(t({
239
+ return n(e, t({
241
240
  filename: e.filename,
242
- getCaptureEl: e.getCaptureEl,
243
- pixelRatio: e.pngPixelRatio,
244
- backgroundColor: e.pngBackgroundColor
245
- })), r.push(n({
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]);
241
+ getRows: (t) => {
242
+ let n = e.getData(t), r = [];
243
+ for (let [e, t] of n.entries()) {
244
+ e > 0 && r.push([]), r.push(["name", "value"]);
245
+ for (let e of t) r.push([e.name, e.value]);
252
246
  }
253
- return n;
247
+ return r;
254
248
  }
255
- })), r;
249
+ }));
256
250
  }
257
251
  //#endregion
258
252
  export { C as BarSkeleton, v as barOptions, E as createBarDownloadConfig, y as createBarOptionFactory };