@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,28 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ root: {
4
+ typography: string;
5
+ color: (theme: Theme) => string;
6
+ marginBlockStart: ({ spacing }: Theme) => string;
7
+ };
8
+ clamped: {
9
+ display: "-webkit-box";
10
+ WebkitLineClamp: number;
11
+ WebkitBoxOrient: "vertical";
12
+ overflow: "hidden";
13
+ };
14
+ expanded: {
15
+ display: "block";
16
+ };
17
+ linkButton: {
18
+ padding: number;
19
+ minWidth: string;
20
+ textTransform: "none";
21
+ typography: string;
22
+ fontWeight: number;
23
+ textDecoration: string;
24
+ '&:hover': {
25
+ backgroundColor: "transparent";
26
+ };
27
+ };
28
+ };
@@ -0,0 +1,8 @@
1
+ import { MarkdownComponentProps } from '../markdown';
2
+ export interface NoteProps {
3
+ children: MarkdownComponentProps['children'];
4
+ labels?: {
5
+ showMore?: string;
6
+ showLess?: string;
7
+ };
8
+ }
@@ -0,0 +1,5 @@
1
+ import { PieConfig, PieWidgetConfig, PieWidgetData } from './types';
2
+ import { DownloadItem } from '../actions';
3
+ import { ConfigProps } from '../root/types';
4
+ export declare function pieDownloadConfig({ refUI, }: ConfigProps): DownloadItem<PieWidgetData>[];
5
+ export declare function pieConfig(props: PieConfig): PieWidgetConfig;
@@ -0,0 +1,3 @@
1
+ export type { PieWidgetData, PieWidgetState, PieWidgetConfig, PieConfig, } from './types';
2
+ export { pieConfig, pieDownloadConfig } from './config';
3
+ export { PieSkeleton } from './skeleton';
@@ -0,0 +1 @@
1
+ export declare function PieSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ skeleton: {
4
+ graph: {
5
+ readonly container: {
6
+ readonly display: "flex";
7
+ readonly alignItems: "center";
8
+ readonly justifyContent: "space-between";
9
+ readonly flexDirection: "column";
10
+ readonly gap: ({ spacing }: Theme) => string;
11
+ readonly height: ({ spacing }: Theme) => string;
12
+ };
13
+ };
14
+ };
15
+ };
@@ -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 PieWidgetData = EchartWidgetData;
5
+ export type PieWidgetState = EchartWidgetState;
6
+ export type PieWidgetConfig = EchartWidgetProps & {
7
+ type: 'pie';
8
+ };
9
+ export type PieConfig = ConfigProps & EchartWidgetOptionProps<PieWidgetData>;
@@ -0,0 +1,2 @@
1
+ import { RangeItemProps } from '../types';
2
+ export declare function RangeItem({ id, index }: RangeItemProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,6 @@
1
+ import { RangeWidgetConfig } from './types';
2
+ export interface RangeConfigProps {
3
+ formatter?: (value: number) => string;
4
+ onChange?: (value: number[], index: number) => void;
5
+ }
6
+ export declare function rangeConfig(): RangeWidgetConfig;
@@ -0,0 +1,6 @@
1
+ export { RangeUI } from './range-ui';
2
+ export { RangeSkeleton } from './skeleton';
3
+ export { rangeConfig } from './config';
4
+ export { RangeItem } from './components/range-item';
5
+ export type { RangeWidgetState, RangeWidgetConfig, RangeDownloadConfig, RangeUIProps, RangeDataItem, RangeWidgetData, RangeItemProps, } from './types';
6
+ export { sanitizeRangeDataItem, sanitizeRangeDataItems } from './serializer';
@@ -0,0 +1,2 @@
1
+ import { RangeUIProps } from './types';
2
+ export declare function RangeUI(props: RangeUIProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { RangeDataItem } from './types';
2
+ /**
3
+ * Sanitizes RangeDataItem by converting ReactNode note values to undefined.
4
+ * This ensures only string values are stored in the widget state.
5
+ *
6
+ * @param item - The RangeDataItem to sanitize
7
+ * @returns A new RangeDataItem with ReactNode note values converted to undefined
8
+ */
9
+ export declare function sanitizeRangeDataItem(item: RangeDataItem): RangeDataItem;
10
+ /**
11
+ * Sanitizes an array of RangeDataItems by converting ReactNode note values to undefined.
12
+ *
13
+ * @param items - Array of RangeDataItems to sanitize
14
+ * @returns A new array with sanitized RangeDataItems
15
+ */
16
+ export declare function sanitizeRangeDataItems(items: RangeDataItem[] | undefined): RangeDataItem[] | undefined;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export declare function RangeSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ export declare const styles: Record<string, SxProps<Theme>>;
@@ -0,0 +1,33 @@
1
+ import { ReactNode } from 'react';
2
+ import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
3
+ import { WrapperState } from '../wrapper/types';
4
+ import { DownloadItem } from '../actions/download/types';
5
+ export interface RangeUIProps {
6
+ id: WidgetsStoreProps['id'];
7
+ }
8
+ export interface RangeDataItem {
9
+ min: number;
10
+ max: number;
11
+ value?: number[];
12
+ step?: number;
13
+ marks?: boolean | {
14
+ value: number;
15
+ label?: string;
16
+ }[];
17
+ disabled?: boolean;
18
+ color?: string;
19
+ note?: string | ReactNode;
20
+ }
21
+ export interface RangeItemProps {
22
+ id: WidgetsStoreProps['id'];
23
+ index: number;
24
+ }
25
+ export type RangeWidgetData = RangeDataItem[];
26
+ export type RangeWidgetState = BaseWidgetState<WrapperState<RangeWidgetConfig>> & {
27
+ data: RangeWidgetData;
28
+ };
29
+ export interface RangeWidgetConfig {
30
+ formatter?: (value: number) => string;
31
+ onChange?: (value: number[], index: number) => void;
32
+ }
33
+ export type RangeDownloadConfig = DownloadItem<RangeWidgetData>[];
@@ -0,0 +1,3 @@
1
+ export { Root } from './root';
2
+ export { mergeWidgetConfig } from './utils';
3
+ export type { RootProps, ConfigProps } from './types';
@@ -0,0 +1,2 @@
1
+ import { RootProps } from './types';
2
+ export declare function Root<T>(props: RootProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ root: {
4
+ display: "flex";
5
+ flexDirection: "column";
6
+ gap: (theme: Theme) => string;
7
+ };
8
+ };
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { WidgetsStoreProps, WidgetState } from '../stores/types';
3
+ export interface RootProps<T> extends WidgetsStoreProps {
4
+ children: ReactNode;
5
+ config?: T;
6
+ }
7
+ export interface ConfigProps {
8
+ refUI?: WidgetState['refUI'];
9
+ }
@@ -0,0 +1 @@
1
+ export declare function mergeWidgetConfig<T>(...options: [T | undefined, T | undefined]): T;
@@ -0,0 +1,5 @@
1
+ import { ScatterplotConfig, ScatterplotWidgetConfig, ScatterplotWidgetData } from './types';
2
+ import { DownloadItem } from '../actions';
3
+ import { ConfigProps } from '../root/types';
4
+ export declare function scatterplotDownloadConfig({ refUI, }: ConfigProps): DownloadItem<ScatterplotWidgetData>[];
5
+ export declare function scatterplotConfig(props: ScatterplotConfig): ScatterplotWidgetConfig;
@@ -0,0 +1,3 @@
1
+ export type { ScatterplotWidgetData, ScatterplotWidgetState, ScatterplotWidgetConfig, ScatterplotConfig, } from './types';
2
+ export { scatterplotConfig, scatterplotDownloadConfig } from './config';
3
+ export { ScatterplotSkeleton } from './skeleton';
@@ -0,0 +1 @@
1
+ export declare function ScatterplotSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,24 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ skeleton: {
4
+ graph: {
5
+ container: {
6
+ position: "relative";
7
+ display: "flex";
8
+ alignItems: "center";
9
+ justifyContent: "space-between";
10
+ flexDirection: "column";
11
+ gap: ({ spacing }: Theme) => string;
12
+ height: ({ spacing }: Theme) => string;
13
+ };
14
+ };
15
+ legend: {
16
+ display: "flex";
17
+ alignItems: "center";
18
+ gap: ({ spacing }: Theme) => string;
19
+ height: ({ spacing }: Theme) => string;
20
+ position: "absolute";
21
+ bottom: number;
22
+ };
23
+ };
24
+ };
@@ -0,0 +1,9 @@
1
+ import { EchartWidgetState } from '../echart';
2
+ import { EchartWidgetOptionProps, EchartWidgetProps } from '../echart/types';
3
+ import { ConfigProps } from '../root';
4
+ export type ScatterplotWidgetData = [number, number][][];
5
+ export type ScatterplotWidgetState = EchartWidgetState;
6
+ export type ScatterplotWidgetConfig = EchartWidgetProps & {
7
+ type: 'scatterplot';
8
+ };
9
+ export type ScatterplotConfig = ConfigProps & EchartWidgetOptionProps<ScatterplotWidgetData>;
@@ -0,0 +1,2 @@
1
+ export { SelectionSummary } from './selection-summary';
2
+ export type { SelectedProps, SelectionSummaryLabels } from './types';
@@ -0,0 +1,2 @@
1
+ import { SelectedProps } from './types';
2
+ export declare function SelectionSummary({ selections, onClear, labels, }: SelectedProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ root: {
4
+ display: "flex";
5
+ alignItems: "center";
6
+ flex: string;
7
+ gap: ({ spacing }: Theme) => string;
8
+ };
9
+ };
@@ -0,0 +1,13 @@
1
+ export interface SelectedProps {
2
+ selections: number;
3
+ onClear?: () => void;
4
+ labels?: Partial<SelectionSummaryLabels>;
5
+ }
6
+ export interface SelectionSummaryLabels {
7
+ /** Label for "All selected" state */
8
+ allSelected: string;
9
+ /** Label for number of selections */
10
+ selections: (count: number) => string;
11
+ /** Label for clear button */
12
+ clear: string;
13
+ }
@@ -0,0 +1,2 @@
1
+ export { SkeletonLoader } from './skeleton-loader';
2
+ export type { SkeletonLoaderProps } from './types';
@@ -0,0 +1,2 @@
1
+ import { SkeletonLoaderProps } from './types';
2
+ export declare function SkeletonLoader({ id, children, Skeleton, }: SkeletonLoaderProps): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
@@ -0,0 +1,7 @@
1
+ import { ElementType, ReactNode } from 'react';
2
+ import { WidgetState } from '../stores/types';
3
+ export interface SkeletonLoaderProps {
4
+ id: WidgetState['id'];
5
+ Skeleton: ElementType | null;
6
+ children: ReactNode;
7
+ }
@@ -0,0 +1,2 @@
1
+ import { ValueProps } from '../types';
2
+ export declare function MaxValue({ id, index, ...props }: ValueProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ValueProps } from '../types';
2
+ export declare function MinValue({ id, index, ...props }: ValueProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { ItemProps } from '../../formula/types';
2
+ export declare function Separator(props: Omit<ItemProps, 'children'>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { DownloadItem } from '../actions';
2
+ import { ConfigProps } from '../root/types';
3
+ import { SpreadWidgetConfig, SpreadWidgetData } from './types';
4
+ import { SeriesConfig } from '../formula/types';
5
+ export interface SpreadConfigProps {
6
+ formatter?: (value: number) => string;
7
+ series?: SeriesConfig[];
8
+ }
9
+ export declare function spreadDownloadConfig({ refUI, }: ConfigProps): DownloadItem<SpreadWidgetData>[];
10
+ export declare function spreadConfig(): SpreadWidgetConfig;
@@ -0,0 +1,9 @@
1
+ export { SpreadUI } from './spread-ui';
2
+ export { SpreadSkeleton } from './skeleton';
3
+ export { spreadConfig, spreadDownloadConfig } from './config';
4
+ export { MinValue } from './components/min-value';
5
+ export { MaxValue } from './components/max-value';
6
+ export { Separator } from './components/separator';
7
+ export { Item, Row, Prefix, Suffix, Series } from '../formula';
8
+ export type { RowProps, ValueProps, SpreadWidgetState, SpreadWidgetConfig, SpreadWidgetData, SpreadDownloadConfig, ItemProps, SpreadDataItem, SpreadUIProps, } from './types';
9
+ export type { SeriesConfig } from '../formula/types';
@@ -0,0 +1 @@
1
+ export declare function SpreadSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { SpreadUIProps } from './types';
2
+ export declare function SpreadUI(props: SpreadUIProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ root: {
4
+ display: "flex";
5
+ flexDirection: "column";
6
+ gap: (theme: Theme) => string;
7
+ };
8
+ item: {
9
+ '&[data-disabled="true"]': {
10
+ color: (theme: Theme) => string;
11
+ };
12
+ };
13
+ row: {
14
+ display: "flex";
15
+ alignItems: "center";
16
+ gap: (theme: Theme) => string;
17
+ '& + &': {
18
+ marginTop: (theme: Theme) => string;
19
+ };
20
+ };
21
+ };
@@ -0,0 +1,40 @@
1
+ import { TypographyProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
4
+ import { WrapperState } from '../wrapper/types';
5
+ import { DownloadItem } from '../actions/download/types';
6
+ import { SeriesConfig } from '../formula/types';
7
+ export interface SpreadUIProps {
8
+ id: WidgetsStoreProps['id'];
9
+ }
10
+ export interface SpreadDataItem {
11
+ min: number;
12
+ max: number;
13
+ prefix?: string | ReactNode;
14
+ suffix?: string | ReactNode;
15
+ color?: string;
16
+ }
17
+ export interface RowProps {
18
+ id: WidgetsStoreProps['id'];
19
+ children: ReactNode | ((props: {
20
+ index: number;
21
+ }) => ReactNode);
22
+ }
23
+ export interface ValueProps extends Omit<ItemProps, 'children'> {
24
+ id: WidgetsStoreProps['id'];
25
+ index?: number;
26
+ }
27
+ export interface ItemProps {
28
+ children: ReactNode;
29
+ disabled?: boolean;
30
+ TypographyProps?: TypographyProps;
31
+ }
32
+ export type SpreadWidgetData = SpreadDataItem[];
33
+ export type SpreadWidgetState = BaseWidgetState<WrapperState<SpreadWidgetConfig> & {
34
+ data: SpreadWidgetData;
35
+ }>;
36
+ export interface SpreadWidgetConfig {
37
+ formatter?: (value: number) => string;
38
+ series?: SeriesConfig[];
39
+ }
40
+ export type SpreadDownloadConfig = DownloadItem<SpreadWidgetData>[];
@@ -0,0 +1,2 @@
1
+ export { useWidgetStore } from './widget-store';
2
+ export type { BaseWidgetState, WidgetsStoreProps, WidgetState, WidgetStore, WidgetStoreActions, WidgetStoreState, } from './types';
@@ -0,0 +1,233 @@
1
+ import { RefObject } from 'react';
2
+ /**
3
+ * Sort direction for table columns
4
+ */
5
+ export type StoreSortDirection = 'asc' | 'desc';
6
+ /**
7
+ * Pagination mode for tables
8
+ */
9
+ export type StorePaginationMode = 'local' | 'remote';
10
+ /**
11
+ * Sort mode for tables
12
+ */
13
+ export type StoreSortMode = 'local' | 'remote';
14
+ /**
15
+ * Table pagination state stored in widget store
16
+ */
17
+ export interface TablePaginationStoreState {
18
+ /** Current page (0-indexed) */
19
+ page: number;
20
+ /** Rows per page */
21
+ rowsPerPage: number;
22
+ /** Available rows per page options */
23
+ rowsPerPageOptions: number[];
24
+ /** Pagination mode: local or remote */
25
+ mode: StorePaginationMode;
26
+ }
27
+ /**
28
+ * Table sort state stored in widget store
29
+ */
30
+ export interface TableSortStoreState {
31
+ /** Column ID being sorted */
32
+ columnId: string | null;
33
+ /** Sort direction */
34
+ direction: StoreSortDirection;
35
+ /** Sort mode: local or remote */
36
+ mode: StoreSortMode;
37
+ }
38
+ /**
39
+ * Table selection state stored in widget store
40
+ */
41
+ export interface TableSelectionStoreState {
42
+ /** Set of selected row IDs */
43
+ selectedIds: Set<string | number>;
44
+ }
45
+ /**
46
+ * Combined table state for widget store
47
+ */
48
+ export interface TableStoreState {
49
+ pagination?: TablePaginationStoreState;
50
+ sort?: TableSortStoreState;
51
+ selection?: TableSelectionStoreState;
52
+ }
53
+ export interface WidgetsStoreProps {
54
+ /** Unique identifier for the widget */
55
+ id: string;
56
+ /** Type of widget */
57
+ type: string;
58
+ /** Widget data - flexible to accommodate different widget types */
59
+ data: unknown;
60
+ /** Loading state */
61
+ isLoading: boolean;
62
+ /** Fetching state (e.g., for async data) */
63
+ isFetching: boolean;
64
+ /** Error message if any */
65
+ error?: string;
66
+ /** Whether widget is visible */
67
+ visible?: boolean;
68
+ /** Reference to the widget ui instance */
69
+ refUI?: RefObject<HTMLElement | null>;
70
+ /** Registered tools for the widget's transformation pipeline */
71
+ registeredTools?: ToolRegistration[];
72
+ }
73
+ /**
74
+ * Tool transformation function type
75
+ * Can be synchronous or asynchronous to support remote operations
76
+ */
77
+ export type ToolTransformFunction = (data: unknown, config?: Record<string, unknown>) => Promise<unknown> | unknown;
78
+ /**
79
+ * Tool registration for widget pipeline
80
+ *
81
+ * @example Basic tool registration
82
+ * ```typescript
83
+ * registerTool(widgetId, {
84
+ * id: 'searcher',
85
+ * order: 10,
86
+ * enabled: true,
87
+ * fn: (data) => filterData(data),
88
+ * })
89
+ * ```
90
+ *
91
+ * @example Tool with dependencies
92
+ * ```typescript
93
+ * registerTool(widgetId, {
94
+ * id: 'lock-selection',
95
+ * order: 20,
96
+ * enabled: true,
97
+ * fn: (data) => lockData(data),
98
+ * disables: ['searcher', 'relative-data'], // Disable these when active
99
+ * })
100
+ * ```
101
+ *
102
+ * Dependency Management:
103
+ * - Multiple tools can disable the same target (reference counting)
104
+ * - Target is only re-enabled when ALL disabling tools are inactive
105
+ * - Original enabled state is preserved and restored
106
+ * - Circular dependencies are detected and throw errors
107
+ */
108
+ export interface ToolRegistration {
109
+ /** Unique tool identifier (e.g., 'searcher', 'relative-data') */
110
+ id: string;
111
+ /** Execution priority - lower numbers execute first */
112
+ order: number;
113
+ /** Transformation function */
114
+ fn: ToolTransformFunction;
115
+ /** Whether tool is currently enabled */
116
+ enabled: boolean;
117
+ /** Tool-specific configuration */
118
+ config?: Record<string, unknown>;
119
+ /**
120
+ * Array of tool IDs to disable when this tool is active.
121
+ * During pipeline execution, if this tool is enabled, any tools listed
122
+ * in this array will be excluded from the pipeline.
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * disables: ['searcher', 'relative-data']
127
+ * ```
128
+ */
129
+ disables?: string[];
130
+ }
131
+ /**
132
+ * Base widget state interface
133
+ */
134
+ export type BaseWidgetState<T> = WidgetsStoreProps & T;
135
+ /**
136
+ * Union type for all widget states
137
+ */
138
+ export type WidgetState = BaseWidgetState<unknown>;
139
+ /**
140
+ * Widget store state with tool registration
141
+ */
142
+ export interface WidgetStoreState {
143
+ /** Map of widget id to widget state */
144
+ widgets: Record<string, WidgetState>;
145
+ }
146
+ /**
147
+ * Widget store actions
148
+ */
149
+ export interface WidgetStoreActions {
150
+ /**
151
+ * Add or update a widget in the store
152
+ * @param id - Widget ID
153
+ * @param widget - Widget state properties to merge (accepts any object structure)
154
+ * @template T - Type of the widget state for type-safe access
155
+ */
156
+ setWidget: <T = any>(id: WidgetState['id'], widget: Partial<T>) => void;
157
+ /**
158
+ * Remove a widget from the store
159
+ * @param id - Widget ID to remove
160
+ */
161
+ removeWidget: (id: WidgetState['id']) => void;
162
+ /**
163
+ * Clear all widgets
164
+ */
165
+ clearWidgets: () => void;
166
+ /**
167
+ * Get widget by ID
168
+ * @param id - Widget ID
169
+ * @returns Widget state or undefined if not found
170
+ */
171
+ getWidget: <T extends WidgetState = WidgetState>(id: WidgetState['id']) => T | undefined;
172
+ /**
173
+ * Set table pagination state for a widget
174
+ * @param id - Widget ID
175
+ * @param pagination - Partial pagination state to merge
176
+ */
177
+ setTablePagination: (id: WidgetState['id'], pagination: Partial<TablePaginationStoreState>) => void;
178
+ /**
179
+ * Set table sort state for a widget
180
+ * @param id - Widget ID
181
+ * @param sort - Partial sort state to merge
182
+ */
183
+ setTableSort: (id: WidgetState['id'], sort: Partial<TableSortStoreState>) => void;
184
+ /**
185
+ * Set table selection state for a widget
186
+ * @param id - Widget ID
187
+ * @param selection - Partial selection state to merge
188
+ */
189
+ setTableSelection: (id: WidgetState['id'], selection: Partial<TableSelectionStoreState>) => void;
190
+ /**
191
+ * Get table state for a widget
192
+ * @param id - Widget ID
193
+ * @returns Table state or undefined if not found
194
+ */
195
+ getTableState: (id: WidgetState['id']) => TableStoreState | undefined;
196
+ /**
197
+ * Register a tool with the widget's transformation pipeline
198
+ * @param widgetId - Widget ID
199
+ * @param tool - Tool registration object
200
+ */
201
+ registerTool: (widgetId: string, tool: ToolRegistration) => void;
202
+ /**
203
+ * Unregister a tool from the widget's transformation pipeline
204
+ * @param widgetId - Widget ID
205
+ * @param toolId - Tool ID to remove
206
+ */
207
+ unregisterTool: (widgetId: string, toolId: string) => void;
208
+ /**
209
+ * Update tool configuration
210
+ * @param widgetId - Widget ID
211
+ * @param toolId - Tool ID
212
+ * @param config - New configuration to merge
213
+ */
214
+ updateToolConfig: (widgetId: string, toolId: string, config: Record<string, unknown>) => void;
215
+ /**
216
+ * Set tool enabled state
217
+ * @param widgetId - Widget ID
218
+ * @param toolId - Tool ID
219
+ * @param enabled - Whether tool should be enabled
220
+ */
221
+ setToolEnabled: (widgetId: string, toolId: string, enabled: boolean) => void;
222
+ /**
223
+ * Execute the tool transformation pipeline
224
+ * Supports both synchronous and asynchronous tools
225
+ * @param widgetId - Widget ID
226
+ * @param sourceData - Original data to transform
227
+ */
228
+ executeToolPipeline: (widgetId: string, sourceData: unknown) => Promise<void>;
229
+ }
230
+ /**
231
+ * Complete widget store interface
232
+ */
233
+ export type WidgetStore = WidgetStoreState & WidgetStoreActions;