@carto/ps-react-ui 4.2.7 → 5.0.0-widgets.1

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 (248) hide show
  1. package/dist/cjs-D9ro6BXv.js +85 -0
  2. package/dist/cjs-D9ro6BXv.js.map +1 -0
  3. package/dist/components.js +760 -1398
  4. package/dist/components.js.map +1 -1
  5. package/dist/exports-Cr43OCul.js +51 -0
  6. package/dist/exports-Cr43OCul.js.map +1 -0
  7. package/dist/lasso-tool-CYn3ivf-.js +534 -0
  8. package/dist/lasso-tool-CYn3ivf-.js.map +1 -0
  9. package/dist/options-D9wflre6.js +49 -0
  10. package/dist/options-D9wflre6.js.map +1 -0
  11. package/dist/row-C_m1ovHv.js +35 -0
  12. package/dist/row-C_m1ovHv.js.map +1 -0
  13. package/dist/series-6xp-KQ0S.js +91 -0
  14. package/dist/series-6xp-KQ0S.js.map +1 -0
  15. package/dist/smart-tooltip-BEtBaIdz.js +39 -0
  16. package/dist/smart-tooltip-BEtBaIdz.js.map +1 -0
  17. package/dist/styles-dOu_pRNb.js +77 -0
  18. package/dist/styles-dOu_pRNb.js.map +1 -0
  19. package/dist/tooltip-BDnrRKrp.js +25 -0
  20. package/dist/tooltip-BDnrRKrp.js.map +1 -0
  21. package/dist/types/hooks/index.d.ts +2 -0
  22. package/dist/types/hooks/use-debounce.d.ts +19 -0
  23. package/dist/types/hooks/use-widget-ref.d.ts +17 -0
  24. package/dist/types/widgets/_shared/chart-config/config-factory.d.ts +38 -0
  25. package/dist/types/widgets/_shared/chart-config/csv-modifiers.d.ts +19 -0
  26. package/dist/types/widgets/_shared/chart-config/index.d.ts +7 -0
  27. package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +34 -0
  28. package/dist/types/widgets/_shared/skeleton/index.d.ts +4 -0
  29. package/dist/types/widgets/_shared/skeleton/styles.d.ts +19 -0
  30. package/dist/types/widgets/actions/change-column/change-column-icon.d.ts +1 -0
  31. package/dist/types/widgets/actions/change-column/change-column.d.ts +16 -0
  32. package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +9 -0
  33. package/dist/types/widgets/actions/change-column/types.d.ts +19 -0
  34. package/dist/types/widgets/actions/download/download.d.ts +2 -0
  35. package/dist/types/widgets/actions/download/exports.d.ts +6 -0
  36. package/dist/types/widgets/actions/download/types.d.ts +21 -0
  37. package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +2 -0
  38. package/dist/types/widgets/actions/fullscreen/styles.d.ts +16 -0
  39. package/dist/types/widgets/actions/fullscreen/types.d.ts +20 -0
  40. package/dist/types/widgets/actions/index.d.ts +18 -0
  41. package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +19 -0
  42. package/dist/types/widgets/actions/lock-selection/types.d.ts +38 -0
  43. package/dist/types/widgets/actions/relative-data/relative-data.d.ts +18 -0
  44. package/dist/types/widgets/actions/relative-data/style.d.ts +8 -0
  45. package/dist/types/widgets/actions/relative-data/types.d.ts +27 -0
  46. package/dist/types/widgets/actions/relative-data/utils.d.ts +9 -0
  47. package/dist/types/widgets/actions/relative-data/utils.test.d.ts +1 -0
  48. package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +18 -0
  49. package/dist/types/widgets/actions/searcher/searcher.d.ts +21 -0
  50. package/dist/types/widgets/actions/searcher/types.d.ts +62 -0
  51. package/dist/types/widgets/actions/shared/styles.d.ts +11 -0
  52. package/dist/types/widgets/actions/stack-toggle/grouped-bar-chart-icon.d.ts +1 -0
  53. package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +16 -0
  54. package/dist/types/widgets/actions/stack-toggle/types.d.ts +25 -0
  55. package/dist/types/widgets/actions/zoom-toggle/index.d.ts +2 -0
  56. package/dist/types/widgets/actions/zoom-toggle/style.d.ts +13 -0
  57. package/dist/types/widgets/actions/zoom-toggle/types.d.ts +41 -0
  58. package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +18 -0
  59. package/dist/types/widgets/bar/config.d.ts +5 -0
  60. package/dist/types/widgets/bar/index.d.ts +3 -0
  61. package/dist/types/widgets/bar/skeleton.d.ts +1 -0
  62. package/dist/types/widgets/bar/style.d.ts +37 -0
  63. package/dist/types/widgets/bar/types.d.ts +9 -0
  64. package/dist/types/widgets/category/category-ui.d.ts +2 -0
  65. package/dist/types/widgets/category/components/category-bar.d.ts +7 -0
  66. package/dist/types/widgets/category/components/category-legend.d.ts +6 -0
  67. package/dist/types/widgets/category/components/category-row-multi.d.ts +11 -0
  68. package/dist/types/widgets/category/components/category-row-other.d.ts +6 -0
  69. package/dist/types/widgets/category/components/category-row-single.d.ts +11 -0
  70. package/dist/types/widgets/category/components/index.d.ts +10 -0
  71. package/dist/types/widgets/category/config.d.ts +15 -0
  72. package/dist/types/widgets/category/index.d.ts +6 -0
  73. package/dist/types/widgets/category/skeleton.d.ts +1 -0
  74. package/dist/types/widgets/category/style.d.ts +121 -0
  75. package/dist/types/widgets/category/types.d.ts +33 -0
  76. package/dist/types/widgets/echart/const.d.ts +1 -0
  77. package/dist/types/widgets/echart/echart-ui.d.ts +2 -0
  78. package/dist/types/widgets/echart/echart.d.ts +2 -0
  79. package/dist/types/widgets/echart/index.d.ts +5 -0
  80. package/dist/types/widgets/echart/options.d.ts +2 -0
  81. package/dist/types/widgets/echart/types.d.ts +32 -0
  82. package/dist/types/widgets/echart/utils.d.ts +80 -0
  83. package/dist/types/widgets/formula/components/item.d.ts +2 -0
  84. package/dist/types/widgets/formula/components/prefix.d.ts +2 -0
  85. package/dist/types/widgets/formula/components/row.d.ts +2 -0
  86. package/dist/types/widgets/formula/components/series.d.ts +2 -0
  87. package/dist/types/widgets/formula/components/suffix.d.ts +2 -0
  88. package/dist/types/widgets/formula/components/value.d.ts +2 -0
  89. package/dist/types/widgets/formula/config.d.ts +4 -0
  90. package/dist/types/widgets/formula/formula-ui.d.ts +2 -0
  91. package/dist/types/widgets/formula/index.d.ts +11 -0
  92. package/dist/types/widgets/formula/serializer.d.ts +16 -0
  93. package/dist/types/widgets/formula/skeleton.d.ts +1 -0
  94. package/dist/types/widgets/formula/style.d.ts +21 -0
  95. package/dist/types/widgets/formula/types.d.ts +42 -0
  96. package/dist/types/widgets/histogram/config.d.ts +5 -0
  97. package/dist/types/widgets/histogram/index.d.ts +3 -0
  98. package/dist/types/widgets/histogram/skeleton.d.ts +1 -0
  99. package/dist/types/widgets/histogram/style.d.ts +15 -0
  100. package/dist/types/widgets/histogram/types.d.ts +9 -0
  101. package/dist/types/widgets/index.d.ts +2 -1
  102. package/dist/types/widgets/markdown/config.d.ts +4 -0
  103. package/dist/types/widgets/markdown/index.d.ts +5 -0
  104. package/dist/types/widgets/markdown/markdown-ui.d.ts +2 -0
  105. package/dist/types/widgets/markdown/markdown.d.ts +2 -0
  106. package/dist/types/widgets/markdown/skeleton.d.ts +1 -0
  107. package/dist/types/widgets/markdown/style.d.ts +2 -0
  108. package/dist/types/widgets/markdown/types.d.ts +18 -0
  109. package/dist/types/widgets/note/index.d.ts +2 -0
  110. package/dist/types/widgets/note/note.d.ts +2 -0
  111. package/dist/types/widgets/note/style.d.ts +28 -0
  112. package/dist/types/widgets/note/types.d.ts +8 -0
  113. package/dist/types/widgets/pie/config.d.ts +5 -0
  114. package/dist/types/widgets/pie/index.d.ts +3 -0
  115. package/dist/types/widgets/pie/skeleton.d.ts +1 -0
  116. package/dist/types/widgets/pie/style.d.ts +15 -0
  117. package/dist/types/widgets/pie/types.d.ts +9 -0
  118. package/dist/types/widgets/range/components/range-item.d.ts +2 -0
  119. package/dist/types/widgets/range/config.d.ts +6 -0
  120. package/dist/types/widgets/range/index.d.ts +6 -0
  121. package/dist/types/widgets/range/range-ui.d.ts +2 -0
  122. package/dist/types/widgets/range/serializer.d.ts +16 -0
  123. package/dist/types/widgets/range/serializer.test.d.ts +1 -0
  124. package/dist/types/widgets/range/skeleton.d.ts +1 -0
  125. package/dist/types/widgets/range/style.d.ts +2 -0
  126. package/dist/types/widgets/range/types.d.ts +33 -0
  127. package/dist/types/widgets/root/index.d.ts +3 -0
  128. package/dist/types/widgets/root/root.d.ts +2 -0
  129. package/dist/types/widgets/root/style.d.ts +8 -0
  130. package/dist/types/widgets/root/types.d.ts +9 -0
  131. package/dist/types/widgets/root/utils.d.ts +1 -0
  132. package/dist/types/widgets/scatterplot/config.d.ts +5 -0
  133. package/dist/types/widgets/scatterplot/index.d.ts +3 -0
  134. package/dist/types/widgets/scatterplot/skeleton.d.ts +1 -0
  135. package/dist/types/widgets/scatterplot/style.d.ts +24 -0
  136. package/dist/types/widgets/scatterplot/types.d.ts +9 -0
  137. package/dist/types/widgets/selection-summary/index.d.ts +2 -0
  138. package/dist/types/widgets/selection-summary/selection-summary.d.ts +2 -0
  139. package/dist/types/widgets/selection-summary/style.d.ts +9 -0
  140. package/dist/types/widgets/selection-summary/types.d.ts +13 -0
  141. package/dist/types/widgets/skeleton-loader/index.d.ts +2 -0
  142. package/dist/types/widgets/skeleton-loader/skeleton-loader.d.ts +2 -0
  143. package/dist/types/widgets/skeleton-loader/types.d.ts +7 -0
  144. package/dist/types/widgets/spread/components/max-value.d.ts +2 -0
  145. package/dist/types/widgets/spread/components/min-value.d.ts +2 -0
  146. package/dist/types/widgets/spread/components/separator.d.ts +2 -0
  147. package/dist/types/widgets/spread/config.d.ts +10 -0
  148. package/dist/types/widgets/spread/index.d.ts +9 -0
  149. package/dist/types/widgets/spread/skeleton.d.ts +1 -0
  150. package/dist/types/widgets/spread/spread-ui.d.ts +2 -0
  151. package/dist/types/widgets/spread/style.d.ts +21 -0
  152. package/dist/types/widgets/spread/types.d.ts +40 -0
  153. package/dist/types/widgets/stores/index.d.ts +2 -0
  154. package/dist/types/widgets/stores/types.d.ts +233 -0
  155. package/dist/types/widgets/stores/widget-store.d.ts +39 -0
  156. package/dist/types/widgets/stores/widget-store.test.d.ts +1 -0
  157. package/dist/types/widgets/subheader/index.d.ts +2 -0
  158. package/dist/types/widgets/subheader/style.d.ts +19 -0
  159. package/dist/types/widgets/subheader/subheader.d.ts +2 -0
  160. package/dist/types/widgets/subheader/types.d.ts +10 -0
  161. package/dist/types/widgets/table/components/cell-header.d.ts +5 -0
  162. package/dist/types/widgets/table/components/cell.d.ts +16 -0
  163. package/dist/types/widgets/table/components/index.d.ts +4 -0
  164. package/dist/types/widgets/table/components/pagination-actions.d.ts +5 -0
  165. package/dist/types/widgets/table/components/pagination.d.ts +5 -0
  166. package/dist/types/widgets/table/components/row.d.ts +5 -0
  167. package/dist/types/widgets/table/config.d.ts +11 -0
  168. package/dist/types/widgets/table/helpers.d.ts +38 -0
  169. package/dist/types/widgets/table/helpers.test.d.ts +1 -0
  170. package/dist/types/widgets/table/hooks/index.d.ts +6 -0
  171. package/dist/types/widgets/table/hooks/use-pagination.d.ts +45 -0
  172. package/dist/types/widgets/table/hooks/use-pagination.test.d.ts +1 -0
  173. package/dist/types/widgets/table/hooks/use-selection.d.ts +32 -0
  174. package/dist/types/widgets/table/hooks/use-selection.test.d.ts +1 -0
  175. package/dist/types/widgets/table/hooks/use-sort.d.ts +29 -0
  176. package/dist/types/widgets/table/hooks/use-sort.test.d.ts +1 -0
  177. package/dist/types/widgets/table/index.d.ts +13 -0
  178. package/dist/types/widgets/table/serializer.d.ts +16 -0
  179. package/dist/types/widgets/table/skeleton.d.ts +10 -0
  180. package/dist/types/widgets/table/style.d.ts +33 -0
  181. package/dist/types/widgets/table/table-ui.d.ts +32 -0
  182. package/dist/types/widgets/table/types.d.ts +201 -0
  183. package/dist/types/widgets/timeseries/config.d.ts +5 -0
  184. package/dist/types/widgets/timeseries/index.d.ts +3 -0
  185. package/dist/types/widgets/timeseries/skeleton.d.ts +1 -0
  186. package/dist/types/widgets/timeseries/style.d.ts +38 -0
  187. package/dist/types/widgets/timeseries/types.d.ts +9 -0
  188. package/dist/types/widgets/toolbar-actions/index.d.ts +2 -0
  189. package/dist/types/widgets/toolbar-actions/styles.d.ts +37 -0
  190. package/dist/types/widgets/toolbar-actions/toolbar-actions.d.ts +8 -0
  191. package/dist/types/widgets/toolbar-actions/types.d.ts +45 -0
  192. package/dist/types/widgets/wrapper/components/actions.d.ts +2 -0
  193. package/dist/types/widgets/wrapper/components/options.d.ts +2 -0
  194. package/dist/types/widgets/wrapper/components/title.d.ts +6 -0
  195. package/dist/types/widgets/wrapper/index.d.ts +6 -0
  196. package/dist/types/widgets/wrapper/styles.d.ts +89 -0
  197. package/dist/types/widgets/wrapper/types.d.ts +37 -0
  198. package/dist/types/widgets/wrapper/wrapper-ui.d.ts +2 -0
  199. package/dist/types/widgets/wrapper/wrapper.d.ts +2 -0
  200. package/dist/utils-Dv5Z47UQ.js +144 -0
  201. package/dist/utils-Dv5Z47UQ.js.map +1 -0
  202. package/dist/widget-store-DNyVElxd.js +190 -0
  203. package/dist/widget-store-DNyVElxd.js.map +1 -0
  204. package/dist/widgets/actions.js +828 -0
  205. package/dist/widgets/actions.js.map +1 -0
  206. package/dist/widgets/bar.js +192 -0
  207. package/dist/widgets/bar.js.map +1 -0
  208. package/dist/widgets/category.js +460 -0
  209. package/dist/widgets/category.js.map +1 -0
  210. package/dist/widgets/echart.js +123 -0
  211. package/dist/widgets/echart.js.map +1 -0
  212. package/dist/widgets/formula.js +124 -0
  213. package/dist/widgets/formula.js.map +1 -0
  214. package/dist/widgets/histogram.js +175 -0
  215. package/dist/widgets/histogram.js.map +1 -0
  216. package/dist/widgets/markdown.js +127 -0
  217. package/dist/widgets/markdown.js.map +1 -0
  218. package/dist/widgets/note.js +124 -0
  219. package/dist/widgets/note.js.map +1 -0
  220. package/dist/widgets/pie.js +216 -0
  221. package/dist/widgets/pie.js.map +1 -0
  222. package/dist/widgets/range.js +217 -0
  223. package/dist/widgets/range.js.map +1 -0
  224. package/dist/widgets/root.js +68 -0
  225. package/dist/widgets/root.js.map +1 -0
  226. package/dist/widgets/scatterplot.js +222 -0
  227. package/dist/widgets/scatterplot.js.map +1 -0
  228. package/dist/widgets/selection-summary.js +40 -0
  229. package/dist/widgets/selection-summary.js.map +1 -0
  230. package/dist/widgets/skeleton-loader.js +24 -0
  231. package/dist/widgets/skeleton-loader.js.map +1 -0
  232. package/dist/widgets/spread.js +166 -0
  233. package/dist/widgets/spread.js.map +1 -0
  234. package/dist/widgets/stores.js +5 -0
  235. package/dist/widgets/stores.js.map +1 -0
  236. package/dist/widgets/subheader.js +52 -0
  237. package/dist/widgets/subheader.js.map +1 -0
  238. package/dist/widgets/table.js +691 -0
  239. package/dist/widgets/table.js.map +1 -0
  240. package/dist/widgets/timeseries.js +174 -0
  241. package/dist/widgets/timeseries.js.map +1 -0
  242. package/dist/widgets/toolbar-actions.js +6106 -0
  243. package/dist/widgets/toolbar-actions.js.map +1 -0
  244. package/dist/widgets/wrapper.js +295 -0
  245. package/dist/widgets/wrapper.js.map +1 -0
  246. package/dist/widgets.js +4 -1
  247. package/dist/widgets.js.map +1 -1
  248. package/package.json +105 -3
@@ -0,0 +1,34 @@
1
+ import { Theme } from '@mui/material';
2
+ import { LegendComponentOption } from 'echarts';
3
+ /**
4
+ * Shared EChart configuration builders for chart widgets
5
+ */
6
+ /**
7
+ * Builds standard legend configuration for chart widgets
8
+ *
9
+ * @param hasLegend - Whether to show the legend
10
+ * @returns Legend configuration object
11
+ */
12
+ export declare function buildLegendConfig(hasLegend: boolean): LegendComponentOption;
13
+ /**
14
+ * Builds standard grid configuration with legend-aware spacing
15
+ *
16
+ * @param hasLegend - Whether the chart has a legend
17
+ * @param theme - MUI theme for spacing
18
+ * @param additionalConfig - Additional grid configuration to merge
19
+ * @returns Grid configuration object
20
+ */
21
+ export declare function buildGridConfig(hasLegend: boolean, theme: Theme): {
22
+ bottom?: number | undefined;
23
+ };
24
+ /**
25
+ * Creates a tooltip position calculator that handles overflow
26
+ * Used by bar, histogram, and scatterplot widgets
27
+ *
28
+ * @param theme - MUI theme for spacing
29
+ * @returns Tooltip position function
30
+ */
31
+ export declare function createTooltipPositioner(theme: Theme): (point: [number, number], _params: unknown, _dom: unknown, _rect: unknown, size: {
32
+ contentSize: [number, number];
33
+ viewSize: [number, number];
34
+ }) => Record<string, number>;
@@ -0,0 +1,4 @@
1
+ /**
2
+ * Shared skeleton styles for chart widgets
3
+ */
4
+ export { baseSkeletonStyles } from './styles';
@@ -0,0 +1,19 @@
1
+ import { Theme } from '@mui/material';
2
+ /**
3
+ * Base skeleton styles shared across all chart widgets
4
+ */
5
+ export declare const baseSkeletonStyles: {
6
+ readonly graph: {
7
+ /**
8
+ * Common container style for chart widget skeletons
9
+ */
10
+ readonly container: {
11
+ readonly display: "flex";
12
+ readonly alignItems: "center";
13
+ readonly justifyContent: "space-between";
14
+ readonly flexDirection: "column";
15
+ readonly gap: ({ spacing }: Theme) => string;
16
+ readonly height: ({ spacing }: Theme) => string;
17
+ };
18
+ };
19
+ };
@@ -0,0 +1 @@
1
+ export declare const ChangeColumnIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { ChangeColumnProps } from './types';
2
+ /**
3
+ * Widget action to reorder columns in a table widget via drag-and-drop.
4
+ *
5
+ * This action reads the columns from the widget store and allows users to
6
+ * drag and drop columns to reorder them. All columns are displayed and
7
+ * can be reordered.
8
+ *
9
+ * Returns null if there are fewer than 2 columns.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <ChangeColumn id="my-table-widget" />
14
+ * ```
15
+ */
16
+ export declare function ChangeColumn({ id, labels, Icon, IconButtonProps, MenuProps, }: ChangeColumnProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,9 @@
1
+ import { TableColumn } from '../../table/types';
2
+ export interface SortableColumnItemProps {
3
+ column: TableColumn;
4
+ }
5
+ /**
6
+ * A draggable menu item for column reordering.
7
+ * Uses @dnd-kit/sortable for drag-and-drop functionality.
8
+ */
9
+ export declare function SortableColumnItem({ column }: SortableColumnItemProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { IconButtonProps, MenuProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ export interface ChangeColumnProps {
4
+ /** Widget ID to update column configuration in the widget store */
5
+ id: string;
6
+ /** Custom labels for the action */
7
+ labels?: {
8
+ /** Tooltip label */
9
+ tooltip?: string;
10
+ /** Accessibility label */
11
+ ariaLabel?: string;
12
+ };
13
+ /** Props passed to the IconButton component */
14
+ IconButtonProps?: IconButtonProps;
15
+ /** Props passed to the Menu component */
16
+ MenuProps?: Partial<MenuProps>;
17
+ /** Custom icon to display */
18
+ Icon?: ReactNode;
19
+ }
@@ -0,0 +1,2 @@
1
+ import { DownloadProps } from './types';
2
+ export declare function Download({ id, items, labels, Icon, IconButtonProps, }: DownloadProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { Ref } from 'react';
2
+ import { DownloadItem } from './types';
3
+ export declare const downloadToCSV: DownloadItem<unknown[][]>;
4
+ export declare const downloadToPNG: Omit<DownloadItem, 'modifier'> & {
5
+ modifier: (ref: Ref<HTMLElement | null> | undefined) => Promise<string | undefined>;
6
+ };
@@ -0,0 +1,21 @@
1
+ import { JSX, ReactNode } from 'react';
2
+ import { IconButtonProps } from '@mui/material';
3
+ import { WidgetState } from '../../stores/types';
4
+ export interface DownloadItem<D = unknown> {
5
+ id: string;
6
+ label: string;
7
+ icon?: JSX.Element;
8
+ disabled?: boolean;
9
+ filename?: string;
10
+ modifier: (data: D) => Promise<string | undefined>;
11
+ callback?: (data: string) => void;
12
+ }
13
+ export interface DownloadProps {
14
+ id: WidgetState['id'];
15
+ items: DownloadItem[];
16
+ labels?: {
17
+ ariaLabel?: string;
18
+ };
19
+ IconButtonProps?: IconButtonProps;
20
+ Icon?: ReactNode;
21
+ }
@@ -0,0 +1,2 @@
1
+ import { FullScreenProps } from './types';
2
+ export declare function FullScreen({ id, labels, children, Icon, IconButtonProps, DialogContentProps: { sx, ...DialogContentProps }, }: FullScreenProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ title: {
4
+ container: {
5
+ display: "flex";
6
+ alignItems: "center";
7
+ justifyContent: "space-between";
8
+ gap: number;
9
+ };
10
+ };
11
+ content: {
12
+ display: "flex";
13
+ flexDirection: "column";
14
+ gap: ({ spacing }: Theme) => string;
15
+ };
16
+ };
@@ -0,0 +1,20 @@
1
+ import { DialogContentProps, IconButtonProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ import { BaseWidgetState } from '../../../widgets/stores/types';
4
+ export type FullScreenState<T = unknown> = BaseWidgetState<T & FullScreenConfigProps & {
5
+ title: string;
6
+ }>;
7
+ export interface FullScreenConfig {
8
+ isFullScreen?: boolean;
9
+ }
10
+ export type FullScreenConfigProps = FullScreenConfig;
11
+ export interface FullScreenProps {
12
+ id: FullScreenState['id'];
13
+ labels?: {
14
+ ariaLabel?: string;
15
+ };
16
+ children: ReactNode;
17
+ DialogContentProps?: DialogContentProps;
18
+ IconButtonProps?: IconButtonProps;
19
+ Icon?: ReactNode;
20
+ }
@@ -0,0 +1,18 @@
1
+ export { FullScreen } from './fullscreen/fullscreen';
2
+ export type { FullScreenState, FullScreenConfig } from './fullscreen/types';
3
+ export { Download } from './download/download';
4
+ export type { DownloadItem, DownloadProps } from './download/types';
5
+ export { downloadToCSV, downloadToPNG } from './download/exports';
6
+ export { RelativeData, RELATIVE_DATA_TOOL_ID, } from './relative-data/relative-data';
7
+ export type { RelativeDataProps } from './relative-data/types';
8
+ export { ZoomToggle } from './zoom-toggle/zoom-toggle';
9
+ export type { ZoomToggleProps, ZoomState, ZoomConfig, } from './zoom-toggle/types';
10
+ export { StackToggle } from './stack-toggle/stack-toggle';
11
+ export type { StackToggleProps, StackToggleState } from './stack-toggle/types';
12
+ export { Searcher, SEARCHER_TOOL_ID } from './searcher/searcher';
13
+ export { SearcherToggle } from './searcher/searcher-toggle';
14
+ export type { SearcherToggleProps, SearcherProps, SearcherFilterFn, SearcherState, } from './searcher/types';
15
+ export { ChangeColumn } from './change-column/change-column';
16
+ export type { ChangeColumnProps } from './change-column/types';
17
+ export { LockSelection, LOCK_SELECTION_TOOL_ID, } from './lock-selection/lock-selection';
18
+ export type { LockSelectionProps, LockSelectionState, } from './lock-selection/types';
@@ -0,0 +1,19 @@
1
+ import { LockSelectionProps } from './types';
2
+ export declare const LOCK_SELECTION_TOOL_ID = "lock-selection";
3
+ /**
4
+ * Widget action button to lock the current selection.
5
+ *
6
+ * When locked, the widget data is filtered to only show the selected items.
7
+ * The button is only visible when there are selected items.
8
+ * Registers a transformation tool in the widget pipeline when mounted.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * <LockSelection
13
+ * id="my-widget"
14
+ * order={30}
15
+ * selectedItems={selectedItems}
16
+ * />
17
+ * ```
18
+ */
19
+ export declare function LockSelection({ id, selectedItems, order, labels, Icon, IconButtonProps, }: LockSelectionProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,38 @@
1
+ import { IconButtonProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ import { BaseWidgetState } from '../../stores/types';
4
+ /**
5
+ * Lock selection specific state properties.
6
+ */
7
+ export interface LockSelectionStateProps {
8
+ /** Whether the selection is currently locked */
9
+ isLocked?: boolean;
10
+ /** The items that are locked (by name) */
11
+ lockedItems?: string[];
12
+ }
13
+ /**
14
+ * Widget state extension for lock selection functionality.
15
+ * Extends the base widget state with lock-specific properties.
16
+ */
17
+ export type LockSelectionState<T = object> = BaseWidgetState<T & LockSelectionStateProps>;
18
+ export interface LockSelectionProps {
19
+ /** Widget ID to store lock selection state */
20
+ id: string;
21
+ /** Currently selected items (by name) */
22
+ selectedItems: string[];
23
+ /** Execution order in the tool pipeline. Lower values execute first. Defaults to 30. */
24
+ order?: number;
25
+ /** Custom labels for the action */
26
+ labels?: {
27
+ /** Tooltip when unlocked (button will lock selection) */
28
+ lock?: string;
29
+ /** Tooltip when locked (button will unlock selection) */
30
+ unlock?: string;
31
+ /** Accessibility label */
32
+ ariaLabel?: string;
33
+ };
34
+ /** Props passed to the IconButton component */
35
+ IconButtonProps?: IconButtonProps;
36
+ /** Custom icon to display */
37
+ Icon?: ReactNode;
38
+ }
@@ -0,0 +1,18 @@
1
+ import { RelativeDataProps } from './types';
2
+ export declare const RELATIVE_DATA_TOOL_ID = "relative-data";
3
+ /**
4
+ * Widget action to toggle between relative (percentage) and absolute data display.
5
+ *
6
+ * Registers a transformation tool in the widget pipeline when mounted.
7
+ * When relative mode is active, transforms data to percentages via the pipeline.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <RelativeData
12
+ * id="my-widget"
13
+ * order={20}
14
+ * defaultIsRelative={false}
15
+ * />
16
+ * ```
17
+ */
18
+ export declare function RelativeData({ id, order, defaultIsRelative, labels, Icon, IconButtonProps, }: RelativeDataProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ trigger: {
4
+ '&[data-active="true"]': {
5
+ background: (theme: Theme) => string;
6
+ };
7
+ };
8
+ };
@@ -0,0 +1,27 @@
1
+ import { IconButtonProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ import { BaseWidgetState } from '../../stores/types';
4
+ export interface RelativeDataProps {
5
+ /** Widget ID to update data in the widget store */
6
+ id: string;
7
+ /** Execution order in the tool pipeline. Lower values execute first. Defaults to 20. */
8
+ order?: number;
9
+ /** Initial toggle state - when true, shows relative (percentage) values */
10
+ defaultIsRelative?: boolean;
11
+ /** Custom labels for the action */
12
+ labels?: {
13
+ /** Tooltip when showing absolute values (button will switch to relative) */
14
+ relative?: string;
15
+ /** Tooltip when showing relative values (button will switch to absolute) */
16
+ absolute?: string;
17
+ /** Accessibility label */
18
+ ariaLabel?: string;
19
+ };
20
+ /** Props passed to the IconButton component */
21
+ IconButtonProps?: IconButtonProps;
22
+ /** Custom icon to display */
23
+ Icon?: ReactNode;
24
+ }
25
+ export type RelativeDataState<T = unknown> = BaseWidgetState<T & {
26
+ isRelative?: boolean;
27
+ }>;
@@ -0,0 +1,9 @@
1
+ import { EchartWidgetData } from '../../echart/types';
2
+ /**
3
+ * Calculates the sum of all numeric values in the data
4
+ */
5
+ export declare function calculateTotal(data: EchartWidgetData): number;
6
+ /**
7
+ * Transforms data to relative (percentage) values
8
+ */
9
+ export declare function toRelativeData(data: EchartWidgetData, total: number): EchartWidgetData;
@@ -0,0 +1,18 @@
1
+ import { SearcherToggleProps } from './types';
2
+ /**
3
+ * Widget action button to toggle search functionality.
4
+ *
5
+ * Stores the enabled state in the widget store using the provided id.
6
+ * When search is active, the button shows an active state with a light background.
7
+ * Use in conjunction with the Searcher component to display the search input.
8
+ *
9
+ * @example
10
+ * ```tsx
11
+ * <SearcherToggle id="my-widget" />
12
+ * <Searcher
13
+ * id="my-widget"
14
+ * data={widgetData}
15
+ * />
16
+ * ```
17
+ */
18
+ export declare function SearcherToggle({ id, defaultEnabled, labels, Icon, IconButtonProps, }: SearcherToggleProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { SearcherProps } from './types';
2
+ export declare const SEARCHER_TOOL_ID = "searcher";
3
+ /**
4
+ * Search input component that works with SearcherToggle.
5
+ *
6
+ * Registers a transformation tool in the widget pipeline when mounted.
7
+ * Reads the enabled state from the widget store using the provided id.
8
+ * Uses a debounced search to filter data via the transformation pipeline.
9
+ * Auto-focuses when enabled becomes true.
10
+ *
11
+ * @example
12
+ * ```tsx
13
+ * <SearcherToggle id="my-widget" />
14
+ * <Searcher
15
+ * id="my-widget"
16
+ * order={10}
17
+ * labels={{ placeholder: 'Search categories...' }}
18
+ * />
19
+ * ```
20
+ */
21
+ export declare function Searcher({ id, filterFn, order, labels, TextFieldProps, ClearIcon, }: SearcherProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,62 @@
1
+ import { IconButtonProps, TextFieldProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ import { EchartWidgetData } from '../../echart/types';
4
+ import { BaseWidgetState } from '../../stores/types';
5
+ /**
6
+ * Filter function type for custom search filtering logic.
7
+ * Receives the original data and search text, returns filtered data.
8
+ * Can be synchronous or asynchronous to support remote filtering.
9
+ */
10
+ export type SearcherFilterFn = (data: EchartWidgetData, searchText: string) => Promise<EchartWidgetData> | EchartWidgetData;
11
+ /**
12
+ * Searcher-specific state properties.
13
+ */
14
+ export interface SearcherStateProps {
15
+ /** Whether search is currently enabled */
16
+ isSearchEnabled?: boolean;
17
+ /** Current search text */
18
+ searchText?: string;
19
+ }
20
+ /**
21
+ * Widget state extension for searcher functionality.
22
+ * Extends the base widget state with search-specific properties.
23
+ */
24
+ export type SearcherState<T = object> = BaseWidgetState<T & SearcherStateProps>;
25
+ export interface SearcherToggleProps {
26
+ /** Widget ID to store search enabled state */
27
+ id: string;
28
+ /** Initial search enabled state. Defaults to false */
29
+ defaultEnabled?: boolean;
30
+ /** Custom labels for the action */
31
+ labels?: {
32
+ /** Tooltip when search is disabled (button will enable search) */
33
+ enable?: string;
34
+ /** Tooltip when search is enabled (button will disable search) */
35
+ disable?: string;
36
+ /** Accessibility label */
37
+ ariaLabel?: string;
38
+ };
39
+ /** Props passed to the IconButton component */
40
+ IconButtonProps?: IconButtonProps;
41
+ /** Custom icon to display */
42
+ Icon?: ReactNode;
43
+ }
44
+ export interface SearcherProps {
45
+ /** Widget ID to update filtered data in the widget store */
46
+ id: string;
47
+ /** Custom filter function. Defaults to case-insensitive search across all string fields */
48
+ filterFn?: SearcherFilterFn;
49
+ /** Execution order in the tool pipeline. Lower values execute first. Defaults to 10. */
50
+ order?: number;
51
+ /** Custom labels for the searcher input */
52
+ labels?: {
53
+ /** Placeholder text for the input */
54
+ placeholder?: string;
55
+ /** Accessibility label for clear button */
56
+ clearAriaLabel?: string;
57
+ };
58
+ /** Props passed to the TextField component */
59
+ TextFieldProps?: Omit<TextFieldProps, 'value' | 'onChange' | 'size'>;
60
+ /** Custom icon for clear button */
61
+ ClearIcon?: ReactNode;
62
+ }
@@ -0,0 +1,11 @@
1
+ import { Theme } from '@mui/material';
2
+ /**
3
+ * Shared styles for widget action buttons
4
+ */
5
+ export declare const actionButtonStyles: {
6
+ trigger: {
7
+ '&[data-active="true"]': {
8
+ background: (theme: Theme) => string;
9
+ };
10
+ };
11
+ };
@@ -0,0 +1 @@
1
+ export declare const GroupedBarChartIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { StackToggleProps } from './types';
2
+ /**
3
+ * Widget action to toggle stacking behavior in ECharts bar and histogram widgets.
4
+ *
5
+ * Stores the stack state in the widget store and updates the ECharts option
6
+ * using getEChartStackConfig to apply stacking to all series.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <StackToggle
11
+ * id="my-widget"
12
+ * defaultIsStacked={false}
13
+ * />
14
+ * ```
15
+ */
16
+ export declare function StackToggle({ id, defaultIsStacked, labels, Icon, IconButtonProps, }: StackToggleProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { IconButtonProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ import { BaseWidgetState } from '../../stores/types';
4
+ export interface StackToggleProps {
5
+ /** Widget ID to update stack configuration in the widget store */
6
+ id: string;
7
+ /** Initial toggle state - when true, starts with stacking enabled */
8
+ defaultIsStacked?: boolean;
9
+ /** Custom labels for the action */
10
+ labels?: {
11
+ /** Tooltip when stacking is disabled (button will enable stacking) */
12
+ stacked?: string;
13
+ /** Tooltip when stacking is enabled (button will disable stacking) */
14
+ unstacked?: string;
15
+ /** Accessibility label */
16
+ ariaLabel?: string;
17
+ };
18
+ /** Props passed to the IconButton component */
19
+ IconButtonProps?: IconButtonProps;
20
+ /** Custom icon to display */
21
+ Icon?: ReactNode;
22
+ }
23
+ export type StackToggleState<T = unknown> = BaseWidgetState<T & {
24
+ isStacked?: boolean;
25
+ }>;
@@ -0,0 +1,2 @@
1
+ export { ZoomToggle } from './zoom-toggle';
2
+ export type { ZoomToggleProps, ZoomState, ZoomConfig } from './types';
@@ -0,0 +1,13 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ container: {
4
+ display: "flex";
5
+ alignItems: "center";
6
+ gap: ({ spacing }: Theme) => string;
7
+ };
8
+ trigger: {
9
+ '&[data-active="true"]': {
10
+ background: (theme: Theme) => string;
11
+ };
12
+ };
13
+ };
@@ -0,0 +1,41 @@
1
+ import { IconButtonProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ import { BaseWidgetState } from '../../stores/types';
4
+ /**
5
+ * State stored in widget store for zoom functionality
6
+ */
7
+ export interface ZoomConfig {
8
+ zoom?: boolean;
9
+ /** Start percentage for zoom range (0-100) */
10
+ zoomStart?: number;
11
+ /** End percentage for zoom range (0-100) */
12
+ zoomEnd?: number;
13
+ }
14
+ export type ZoomState<T = unknown> = BaseWidgetState<T & ZoomConfig>;
15
+ export interface ZoomToggleProps {
16
+ /** Widget ID to update zoom state in the widget store */
17
+ id: string;
18
+ /** Initial zoom state - when true, zoom is enabled */
19
+ defaultZoom?: boolean;
20
+ /** Initial start percentage for zoom range (0-100) */
21
+ defaultZoomStart?: number;
22
+ /** Initial end percentage for zoom range (0-100) */
23
+ defaultZoomEnd?: number;
24
+ /** Custom labels for the action */
25
+ labels?: {
26
+ /** Tooltip when zoom is disabled (button will enable zoom) */
27
+ enable?: string;
28
+ /** Tooltip when zoom is enabled (button will disable zoom) */
29
+ disable?: string;
30
+ /** Tooltip for reset button */
31
+ reset?: string;
32
+ /** Accessibility label */
33
+ ariaLabel?: string;
34
+ };
35
+ /** Props passed to the IconButton component */
36
+ IconButtonProps?: IconButtonProps;
37
+ /** Custom icon to display for zoom toggle */
38
+ Icon?: ReactNode;
39
+ /** Custom icon to display for reset button */
40
+ ResetIcon?: ReactNode;
41
+ }
@@ -0,0 +1,18 @@
1
+ import { ZoomToggleProps } from './types';
2
+ /**
3
+ * Widget action to toggle EChart zoom functionality.
4
+ *
5
+ * When zoom is active, displays an inline reset button to disable zoom.
6
+ * Only intended for use in fullscreen ToolbarActions for bar and histogram widgets.
7
+ *
8
+ * @example
9
+ * ```tsx
10
+ * <ZoomToggle
11
+ * id="my-widget"
12
+ * defaultZoom={false}
13
+ * zoomStart={0}
14
+ * zoomEnd={100}
15
+ * />
16
+ * ```
17
+ */
18
+ export declare function ZoomToggle({ id, defaultZoom, defaultZoomStart, defaultZoomEnd, labels, Icon, ResetIcon, IconButtonProps, }: ZoomToggleProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { BarConfig, BarWidgetConfig, BarWidgetData } from './types';
2
+ import { DownloadItem } from '../actions';
3
+ import { ConfigProps } from '../root/types';
4
+ export declare function barDownloadConfig({ refUI, }: ConfigProps): DownloadItem<BarWidgetData>[];
5
+ export declare function barConfig(props: BarConfig): BarWidgetConfig;
@@ -0,0 +1,3 @@
1
+ export { barConfig, barDownloadConfig } from './config';
2
+ export { BarSkeleton } from './skeleton';
3
+ export type { BarWidgetData, BarWidgetState, BarConfig, BarWidgetConfig, } from './types';
@@ -0,0 +1 @@
1
+ export declare function BarSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,37 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ skeleton: {
4
+ item: {
5
+ flex: number;
6
+ maxWidth: ({ spacing }: Theme) => string;
7
+ '& + &': {
8
+ marginLeft: ({ spacing }: Theme) => string;
9
+ };
10
+ };
11
+ graph: {
12
+ grid: {
13
+ display: "flex";
14
+ justifyContent: "space-between";
15
+ flex: "1 1 auto";
16
+ alignItems: "flex-end";
17
+ width: "100%";
18
+ };
19
+ container: {
20
+ readonly display: "flex";
21
+ readonly alignItems: "center";
22
+ readonly justifyContent: "space-between";
23
+ readonly flexDirection: "column";
24
+ readonly gap: ({ spacing }: Theme) => string;
25
+ readonly height: ({ spacing }: Theme) => string;
26
+ };
27
+ };
28
+ mask: {
29
+ gray: {
30
+ backgroundColor: ({ palette }: Theme) => string;
31
+ };
32
+ white: {
33
+ backgroundColor: ({ palette }: Theme) => string;
34
+ };
35
+ };
36
+ };
37
+ };
@@ -0,0 +1,9 @@
1
+ import { EchartWidgetData, EchartWidgetState } from '../echart';
2
+ import { EchartWidgetOptionProps, EchartWidgetProps } from '../echart/types';
3
+ import { ConfigProps } from '../root';
4
+ export type BarWidgetData = EchartWidgetData;
5
+ export type BarWidgetState = EchartWidgetState;
6
+ export type BarWidgetConfig = EchartWidgetProps & {
7
+ type: 'bar';
8
+ };
9
+ export type BarConfig = ConfigProps & EchartWidgetOptionProps<BarWidgetData>;