@carto/ps-react-ui 4.3.0-widgets.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (291) hide show
  1. package/dist/{cjs-D9ro6BXv.js → cjs-D4KH3azB.js} +2 -2
  2. package/dist/{cjs-D9ro6BXv.js.map → cjs-D4KH3azB.js.map} +1 -1
  3. package/dist/components.js +59 -64
  4. package/dist/components.js.map +1 -1
  5. package/dist/error-B2IJ9d2h.js +38 -0
  6. package/dist/error-B2IJ9d2h.js.map +1 -0
  7. package/dist/exports-Cr43OCul.js +51 -0
  8. package/dist/exports-Cr43OCul.js.map +1 -0
  9. package/dist/lasso-tool-BwRzEW7k.js +534 -0
  10. package/dist/lasso-tool-BwRzEW7k.js.map +1 -0
  11. package/dist/no-data-C54XJt13.js +61 -0
  12. package/dist/no-data-C54XJt13.js.map +1 -0
  13. package/dist/note-t51drNe0.js +124 -0
  14. package/dist/note-t51drNe0.js.map +1 -0
  15. package/dist/options-D9wflre6.js +49 -0
  16. package/dist/options-D9wflre6.js.map +1 -0
  17. package/dist/row-DrHwXNvF.js +35 -0
  18. package/dist/row-DrHwXNvF.js.map +1 -0
  19. package/dist/series-D3Pc-kYX.js +91 -0
  20. package/dist/series-D3Pc-kYX.js.map +1 -0
  21. package/dist/{smart-tooltip-BSlcAkBM.js → smart-tooltip-BEtBaIdz.js} +2 -2
  22. package/dist/{smart-tooltip-BSlcAkBM.js.map → smart-tooltip-BEtBaIdz.js.map} +1 -1
  23. package/dist/styles-CCZnY17y.js +117 -0
  24. package/dist/styles-CCZnY17y.js.map +1 -0
  25. package/dist/tooltip-BDnrRKrp.js +25 -0
  26. package/dist/tooltip-BDnrRKrp.js.map +1 -0
  27. package/dist/types/components/measurement-tools/styles.d.ts +13 -4
  28. package/dist/types/hooks/index.d.ts +2 -0
  29. package/dist/types/hooks/use-debounce.d.ts +19 -0
  30. package/dist/types/hooks/use-widget-ref.d.ts +17 -0
  31. package/dist/types/widgets/_shared/chart-config/config-factory.d.ts +5 -11
  32. package/dist/types/widgets/_shared/chart-config/index.d.ts +1 -1
  33. package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +54 -8
  34. package/dist/types/widgets/actions/change-column/change-column-icon.d.ts +1 -0
  35. package/dist/types/widgets/actions/change-column/change-column.d.ts +16 -0
  36. package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +9 -0
  37. package/dist/types/widgets/actions/change-column/types.d.ts +19 -0
  38. package/dist/types/widgets/actions/download/download.d.ts +1 -1
  39. package/dist/types/widgets/actions/download/exports.d.ts +1 -1
  40. package/dist/types/widgets/actions/download/types.d.ts +3 -11
  41. package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +1 -1
  42. package/dist/types/widgets/actions/fullscreen/styles.d.ts +6 -0
  43. package/dist/types/widgets/actions/fullscreen/types.d.ts +8 -9
  44. package/dist/types/widgets/actions/index.d.ts +14 -1
  45. package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +19 -0
  46. package/dist/types/widgets/actions/lock-selection/types.d.ts +36 -0
  47. package/dist/types/widgets/actions/relative-data/relative-data.d.ts +18 -0
  48. package/dist/types/widgets/actions/relative-data/style.d.ts +8 -0
  49. package/dist/types/widgets/actions/relative-data/types.d.ts +27 -0
  50. package/dist/types/widgets/actions/relative-data/utils.d.ts +9 -0
  51. package/dist/types/widgets/actions/relative-data/utils.test.d.ts +1 -0
  52. package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +18 -0
  53. package/dist/types/widgets/actions/searcher/searcher.d.ts +21 -0
  54. package/dist/types/widgets/actions/searcher/types.d.ts +64 -0
  55. package/dist/types/widgets/actions/shared/styles.d.ts +11 -0
  56. package/dist/types/widgets/actions/stack-toggle/grouped-bar-chart-icon.d.ts +1 -0
  57. package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +16 -0
  58. package/dist/types/widgets/actions/stack-toggle/types.d.ts +25 -0
  59. package/dist/types/widgets/actions/zoom-toggle/index.d.ts +2 -0
  60. package/dist/types/widgets/actions/zoom-toggle/style.d.ts +13 -0
  61. package/dist/types/widgets/actions/zoom-toggle/types.d.ts +41 -0
  62. package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +18 -0
  63. package/dist/types/widgets/bar/config.d.ts +5 -4
  64. package/dist/types/widgets/bar/index.d.ts +2 -2
  65. package/dist/types/widgets/bar/types.d.ts +6 -12
  66. package/dist/types/widgets/category/category-ui.d.ts +2 -0
  67. package/dist/types/widgets/category/components/category-bar.d.ts +7 -0
  68. package/dist/types/widgets/category/components/category-legend.d.ts +6 -0
  69. package/dist/types/widgets/category/components/category-row-multi.d.ts +11 -0
  70. package/dist/types/widgets/category/components/category-row-other.d.ts +6 -0
  71. package/dist/types/widgets/category/components/category-row-single.d.ts +11 -0
  72. package/dist/types/widgets/category/components/index.d.ts +10 -0
  73. package/dist/types/widgets/category/config.d.ts +16 -0
  74. package/dist/types/widgets/category/index.d.ts +6 -0
  75. package/dist/types/widgets/category/skeleton.d.ts +1 -0
  76. package/dist/types/widgets/category/style.d.ts +120 -0
  77. package/dist/types/widgets/category/types.d.ts +34 -0
  78. package/dist/types/widgets/echart/echart-ui.d.ts +1 -1
  79. package/dist/types/widgets/echart/index.d.ts +2 -2
  80. package/dist/types/widgets/echart/options.d.ts +2 -3
  81. package/dist/types/widgets/echart/types.d.ts +13 -10
  82. package/dist/types/widgets/echart/utils.d.ts +22 -16
  83. package/dist/types/widgets/error/error.d.ts +2 -0
  84. package/dist/types/widgets/error/index.d.ts +2 -0
  85. package/dist/types/widgets/error/types.d.ts +12 -0
  86. package/dist/types/widgets/formula/components/row.d.ts +1 -1
  87. package/dist/types/widgets/formula/config.d.ts +4 -2
  88. package/dist/types/widgets/formula/index.d.ts +2 -1
  89. package/dist/types/widgets/formula/types.d.ts +6 -18
  90. package/dist/types/widgets/histogram/config.d.ts +5 -4
  91. package/dist/types/widgets/histogram/index.d.ts +2 -2
  92. package/dist/types/widgets/histogram/types.d.ts +6 -12
  93. package/dist/types/widgets/index.d.ts +9 -4
  94. package/dist/types/widgets/loader/index.d.ts +3 -0
  95. package/dist/types/widgets/loader/loader.d.ts +2 -0
  96. package/dist/types/widgets/loader/types.d.ts +9 -0
  97. package/dist/types/widgets/loader/utils.d.ts +1 -0
  98. package/dist/types/widgets/markdown/config.d.ts +4 -2
  99. package/dist/types/widgets/markdown/index.d.ts +2 -2
  100. package/dist/types/widgets/markdown/markdown-ui.d.ts +1 -1
  101. package/dist/types/widgets/markdown/types.d.ts +6 -16
  102. package/dist/types/widgets/no-data/index.d.ts +2 -0
  103. package/dist/types/widgets/no-data/no-data.d.ts +35 -0
  104. package/dist/types/widgets/no-data/style.d.ts +6 -0
  105. package/dist/types/widgets/no-data/types.d.ts +67 -0
  106. package/dist/types/widgets/note/index.d.ts +2 -2
  107. package/dist/types/widgets/note/note.d.ts +2 -2
  108. package/dist/types/widgets/note/style.d.ts +12 -1
  109. package/dist/types/widgets/note/types.d.ts +4 -3
  110. package/dist/types/widgets/pie/config.d.ts +5 -4
  111. package/dist/types/widgets/pie/index.d.ts +2 -2
  112. package/dist/types/widgets/pie/types.d.ts +6 -12
  113. package/dist/types/widgets/range/config.d.ts +6 -2
  114. package/dist/types/widgets/range/index.d.ts +2 -1
  115. package/dist/types/widgets/range/types.d.ts +6 -17
  116. package/dist/types/widgets/scatterplot/config.d.ts +5 -4
  117. package/dist/types/widgets/scatterplot/index.d.ts +2 -2
  118. package/dist/types/widgets/scatterplot/types.d.ts +6 -12
  119. package/dist/types/widgets/selection-summary/index.d.ts +2 -0
  120. package/dist/types/widgets/selection-summary/selection-summary.d.ts +2 -0
  121. package/dist/types/widgets/{root → selection-summary}/style.d.ts +3 -2
  122. package/dist/types/widgets/selection-summary/types.d.ts +13 -0
  123. package/dist/types/widgets/spread/config.d.ts +10 -2
  124. package/dist/types/widgets/spread/index.d.ts +2 -1
  125. package/dist/types/widgets/spread/types.d.ts +6 -18
  126. package/dist/types/widgets/stores/index.d.ts +2 -0
  127. package/dist/types/widgets/stores/types.d.ts +108 -12
  128. package/dist/types/widgets/stores/widget-store.d.ts +2 -27
  129. package/dist/types/widgets/subheader/index.d.ts +2 -0
  130. package/dist/types/widgets/subheader/style.d.ts +19 -0
  131. package/dist/types/widgets/subheader/subheader.d.ts +2 -0
  132. package/dist/types/widgets/subheader/types.d.ts +10 -0
  133. package/dist/types/widgets/table/components/cell-header.d.ts +5 -0
  134. package/dist/types/widgets/table/components/cell.d.ts +16 -0
  135. package/dist/types/widgets/table/components/index.d.ts +4 -0
  136. package/dist/types/widgets/table/components/pagination-actions.d.ts +5 -0
  137. package/dist/types/widgets/table/components/pagination.d.ts +5 -0
  138. package/dist/types/widgets/table/components/row.d.ts +5 -0
  139. package/dist/types/widgets/table/config.d.ts +17 -0
  140. package/dist/types/widgets/table/helpers.d.ts +38 -0
  141. package/dist/types/widgets/table/helpers.test.d.ts +1 -0
  142. package/dist/types/widgets/table/hooks/index.d.ts +6 -0
  143. package/dist/types/widgets/table/hooks/use-pagination.d.ts +33 -0
  144. package/dist/types/widgets/table/hooks/use-pagination.test.d.ts +1 -0
  145. package/dist/types/widgets/table/hooks/use-selection.d.ts +30 -0
  146. package/dist/types/widgets/table/hooks/use-selection.test.d.ts +1 -0
  147. package/dist/types/widgets/table/hooks/use-sort.d.ts +22 -0
  148. package/dist/types/widgets/table/hooks/use-sort.test.d.ts +1 -0
  149. package/dist/types/widgets/table/index.d.ts +13 -0
  150. package/dist/types/widgets/table/serializer.d.ts +16 -0
  151. package/dist/types/widgets/table/skeleton.d.ts +10 -0
  152. package/dist/types/widgets/table/style.d.ts +33 -0
  153. package/dist/types/widgets/table/table-ui.d.ts +32 -0
  154. package/dist/types/widgets/table/types.d.ts +196 -0
  155. package/dist/types/widgets/timeseries/config.d.ts +5 -4
  156. package/dist/types/widgets/timeseries/index.d.ts +2 -2
  157. package/dist/types/widgets/timeseries/types.d.ts +6 -12
  158. package/dist/types/widgets/toolbar-actions/index.d.ts +2 -0
  159. package/dist/types/widgets/toolbar-actions/styles.d.ts +37 -0
  160. package/dist/types/widgets/toolbar-actions/toolbar-actions.d.ts +8 -0
  161. package/dist/types/widgets/toolbar-actions/types.d.ts +45 -0
  162. package/dist/types/widgets/wrapper/index.d.ts +2 -2
  163. package/dist/types/widgets/wrapper/styles.d.ts +6 -0
  164. package/dist/types/widgets/wrapper/types.d.ts +7 -5
  165. package/dist/types/widgets/wrapper/wrapper-ui.d.ts +1 -1
  166. package/dist/types/widgets/wrapper/wrapper.d.ts +1 -1
  167. package/dist/use-widget-ref-B0aNCANx.js +19 -0
  168. package/dist/use-widget-ref-B0aNCANx.js.map +1 -0
  169. package/dist/utils-D3-eQyDR.js +144 -0
  170. package/dist/utils-D3-eQyDR.js.map +1 -0
  171. package/dist/widget-store-CB6Trp_0.js +131 -0
  172. package/dist/widget-store-CB6Trp_0.js.map +1 -0
  173. package/dist/widgets/actions.js +869 -6
  174. package/dist/widgets/actions.js.map +1 -1
  175. package/dist/widgets/bar.js +185 -4
  176. package/dist/widgets/bar.js.map +1 -1
  177. package/dist/widgets/category.js +427 -0
  178. package/dist/widgets/category.js.map +1 -0
  179. package/dist/widgets/echart.js +112 -8
  180. package/dist/widgets/echart.js.map +1 -1
  181. package/dist/widgets/error.js +5 -0
  182. package/dist/widgets/error.js.map +1 -0
  183. package/dist/widgets/formula.js +112 -20
  184. package/dist/widgets/formula.js.map +1 -1
  185. package/dist/widgets/histogram.js +183 -4
  186. package/dist/widgets/histogram.js.map +1 -1
  187. package/dist/widgets/loader.js +57 -0
  188. package/dist/widgets/loader.js.map +1 -0
  189. package/dist/widgets/markdown.js +127 -0
  190. package/dist/widgets/markdown.js.map +1 -0
  191. package/dist/widgets/no-data.js +5 -0
  192. package/dist/widgets/no-data.js.map +1 -0
  193. package/dist/widgets/note.js +2 -2
  194. package/dist/widgets/pie.js +227 -4
  195. package/dist/widgets/pie.js.map +1 -1
  196. package/dist/widgets/range.js +210 -12
  197. package/dist/widgets/range.js.map +1 -1
  198. package/dist/widgets/scatterplot.js +230 -4
  199. package/dist/widgets/scatterplot.js.map +1 -1
  200. package/dist/widgets/selection-summary.js +40 -0
  201. package/dist/widgets/selection-summary.js.map +1 -0
  202. package/dist/widgets/skeleton-loader.js +21 -2
  203. package/dist/widgets/skeleton-loader.js.map +1 -1
  204. package/dist/widgets/spread.js +158 -18
  205. package/dist/widgets/spread.js.map +1 -1
  206. package/dist/widgets/stores.js +5 -0
  207. package/dist/widgets/stores.js.map +1 -0
  208. package/dist/widgets/subheader.js +52 -0
  209. package/dist/widgets/subheader.js.map +1 -0
  210. package/dist/widgets/table.js +672 -0
  211. package/dist/widgets/table.js.map +1 -0
  212. package/dist/widgets/timeseries.js +184 -4
  213. package/dist/widgets/timeseries.js.map +1 -1
  214. package/dist/widgets/toolbar-actions.js +6725 -0
  215. package/dist/widgets/toolbar-actions.js.map +1 -0
  216. package/dist/widgets/wrapper.js +292 -6
  217. package/dist/widgets/wrapper.js.map +1 -1
  218. package/dist/widgets.js +10 -83
  219. package/dist/widgets.js.map +1 -1
  220. package/package.json +51 -11
  221. package/dist/const-BLV7Tvte.js +0 -758
  222. package/dist/const-BLV7Tvte.js.map +0 -1
  223. package/dist/download-KroQ0SWg.js +0 -195
  224. package/dist/download-KroQ0SWg.js.map +0 -1
  225. package/dist/echart-CqfROFu3.js +0 -214
  226. package/dist/echart-CqfROFu3.js.map +0 -1
  227. package/dist/formula-ui-ChzvMEOG.js +0 -52
  228. package/dist/formula-ui-ChzvMEOG.js.map +0 -1
  229. package/dist/lasso-tool-BC-rsMMW.js +0 -552
  230. package/dist/lasso-tool-BC-rsMMW.js.map +0 -1
  231. package/dist/markdown-n_tOtoiT.js +0 -27
  232. package/dist/markdown-n_tOtoiT.js.map +0 -1
  233. package/dist/markdown-ui-BBrzzd7Y.js +0 -62
  234. package/dist/markdown-ui-BBrzzd7Y.js.map +0 -1
  235. package/dist/note-DF-n70TX.js +0 -101
  236. package/dist/note-DF-n70TX.js.map +0 -1
  237. package/dist/range-ui-CtUX11Xm.js +0 -146
  238. package/dist/range-ui-CtUX11Xm.js.map +0 -1
  239. package/dist/root-L_WZnJY5.js +0 -46
  240. package/dist/root-L_WZnJY5.js.map +0 -1
  241. package/dist/row-DQaSxmDV.js +0 -18
  242. package/dist/row-DQaSxmDV.js.map +0 -1
  243. package/dist/series-CsyEPq-X.js +0 -83
  244. package/dist/series-CsyEPq-X.js.map +0 -1
  245. package/dist/skeleton-BSPcEvfq.js +0 -27
  246. package/dist/skeleton-BSPcEvfq.js.map +0 -1
  247. package/dist/skeleton-C4rOYTy-.js +0 -78
  248. package/dist/skeleton-C4rOYTy-.js.map +0 -1
  249. package/dist/skeleton-C9Jqc241.js +0 -82
  250. package/dist/skeleton-C9Jqc241.js.map +0 -1
  251. package/dist/skeleton-D-zHBBIw.js +0 -64
  252. package/dist/skeleton-D-zHBBIw.js.map +0 -1
  253. package/dist/skeleton-DMP-IwaJ.js +0 -109
  254. package/dist/skeleton-DMP-IwaJ.js.map +0 -1
  255. package/dist/skeleton-DRorqowB.js +0 -22
  256. package/dist/skeleton-DRorqowB.js.map +0 -1
  257. package/dist/skeleton-DsZhv-AH.js +0 -89
  258. package/dist/skeleton-DsZhv-AH.js.map +0 -1
  259. package/dist/skeleton-Dx3FCer0.js +0 -13
  260. package/dist/skeleton-Dx3FCer0.js.map +0 -1
  261. package/dist/skeleton-QVDdb1c2.js +0 -21
  262. package/dist/skeleton-QVDdb1c2.js.map +0 -1
  263. package/dist/skeleton-loader-DWC1-EAx.js +0 -23
  264. package/dist/skeleton-loader-DWC1-EAx.js.map +0 -1
  265. package/dist/spread-ui-BjzH190y.js +0 -82
  266. package/dist/spread-ui-BjzH190y.js.map +0 -1
  267. package/dist/style-BGeCtQkP.js +0 -19
  268. package/dist/style-BGeCtQkP.js.map +0 -1
  269. package/dist/style-C7v1iwqD.js +0 -34
  270. package/dist/style-C7v1iwqD.js.map +0 -1
  271. package/dist/styles-cohnxh9F.js +0 -23
  272. package/dist/styles-cohnxh9F.js.map +0 -1
  273. package/dist/types/widgets/config-loader/index.d.ts +0 -2
  274. package/dist/types/widgets/config-loader/types.d.ts +0 -12
  275. package/dist/types/widgets/config-loader/use-config.d.ts +0 -5
  276. package/dist/types/widgets/root/index.d.ts +0 -2
  277. package/dist/types/widgets/root/root.d.ts +0 -2
  278. package/dist/types/widgets/root/types.d.ts +0 -15
  279. package/dist/types/widgets/widget/const.d.ts +0 -2
  280. package/dist/types/widgets/widget/types.d.ts +0 -47
  281. package/dist/types/widgets/widget/widget.d.ts +0 -2
  282. package/dist/use-config-BYEOiIcu.js +0 -43
  283. package/dist/use-config-BYEOiIcu.js.map +0 -1
  284. package/dist/widget-store-yDO2ul8g.js +0 -44
  285. package/dist/widget-store-yDO2ul8g.js.map +0 -1
  286. package/dist/widgets/config-loader.js +0 -5
  287. package/dist/widgets/config-loader.js.map +0 -1
  288. package/dist/widgets/root.js +0 -5
  289. package/dist/widgets/root.js.map +0 -1
  290. package/dist/wrapper-57csMybC.js +0 -265
  291. package/dist/wrapper-57csMybC.js.map +0 -1
@@ -2,7 +2,8 @@ import { Theme } from '@mui/material';
2
2
  export declare const styles: {
3
3
  root: {
4
4
  display: "flex";
5
- flexDirection: "column";
6
- gap: (theme: Theme) => string;
5
+ alignItems: "center";
6
+ flex: string;
7
+ gap: ({ spacing }: Theme) => string;
7
8
  };
8
9
  };
@@ -0,0 +1,13 @@
1
+ export interface WidgetSelectionSummaryProps {
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
+ }
@@ -1,2 +1,10 @@
1
- import { SpreadConfig, SpreadWidgetConfig } from './types';
2
- export declare function spreadConfig({ refUI, data, ...props }: SpreadConfig): SpreadWidgetConfig;
1
+ import { DownloadItem } from '../actions';
2
+ import { ConfigProps } from '../loader/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;
@@ -1,8 +1,9 @@
1
1
  export { SpreadUI } from './spread-ui';
2
2
  export { SpreadSkeleton } from './skeleton';
3
+ export { spreadConfig, spreadDownloadConfig } from './config';
3
4
  export { MinValue } from './components/min-value';
4
5
  export { MaxValue } from './components/max-value';
5
6
  export { Separator } from './components/separator';
6
7
  export { Item, Row, Prefix, Suffix, Series } from '../formula';
7
- export type { RowProps, ValueProps, SpreadWidgetState, ItemProps, SpreadDataItem, SpreadUIProps, } from './types';
8
+ export type { RowProps, ValueProps, SpreadWidgetState, SpreadWidgetConfig, SpreadWidgetData, SpreadDownloadConfig, ItemProps, SpreadDataItem, SpreadUIProps, } from './types';
8
9
  export type { SeriesConfig } from '../formula/types';
@@ -1,16 +1,9 @@
1
1
  import { TypographyProps } from '@mui/material';
2
2
  import { ReactNode } from 'react';
3
3
  import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
4
- import { DownloadState } from '../actions';
5
- import { DownloadConfigProps } from '../actions/download/types';
6
4
  import { WrapperState } from '../wrapper/types';
7
- import { BaseWidgetProps } from '../widget/types';
8
- import { BaseConfig } from '../config-loader';
5
+ import { DownloadItem } from '../actions/download/types';
9
6
  import { SeriesConfig } from '../formula/types';
10
- export interface SpreadProps extends BaseWidgetProps<SpreadWidgetConfig> {
11
- type: 'spread';
12
- data: SpreadWidgetData | undefined;
13
- }
14
7
  export interface SpreadUIProps {
15
8
  id: WidgetsStoreProps['id'];
16
9
  }
@@ -37,16 +30,11 @@ export interface ItemProps {
37
30
  TypographyProps?: TypographyProps;
38
31
  }
39
32
  export type SpreadWidgetData = SpreadDataItem[];
40
- export type SpreadWidgetState = BaseWidgetState<WrapperState<DownloadState<SpreadProps & {
33
+ export type SpreadWidgetState = BaseWidgetState<WrapperState<SpreadWidgetConfig> & {
34
+ data: SpreadWidgetData;
35
+ }>;
36
+ export interface SpreadWidgetConfig {
41
37
  formatter?: (value: number) => string;
42
38
  series?: SeriesConfig[];
43
- }, SpreadWidgetData>>>;
44
- export type SpreadWidgetConfig = BaseConfig & DownloadConfigProps<SpreadWidgetData> & {
45
- type: SpreadProps['type'];
46
- formatter?: SpreadWidgetState['formatter'];
47
- series?: SeriesConfig[];
48
- };
49
- export interface SpreadConfig extends Omit<BaseConfig, 'data'> {
50
- data?: SpreadWidgetData;
51
- series?: SeriesConfig[];
52
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';
@@ -4,22 +4,85 @@ export interface WidgetsStoreProps {
4
4
  id: string;
5
5
  /** Type of widget */
6
6
  type: string;
7
- /** Widget title/label */
8
- title?: string;
7
+ /** Widget data - flexible to accommodate different widget types */
8
+ data: unknown;
9
9
  /** Loading state */
10
10
  isLoading: boolean;
11
11
  /** Fetching state (e.g., for async data) */
12
- isFetching?: boolean;
12
+ isFetching: boolean;
13
13
  /** Error message if any */
14
- error?: string;
14
+ error?: {
15
+ title?: string;
16
+ message?: string;
17
+ };
15
18
  /** Whether widget is visible */
16
- visible: boolean;
17
- /** Widget data - flexible to accommodate different widget types */
18
- data?: unknown;
19
- /** Additional notes about the widget */
20
- note?: string;
19
+ visible?: boolean;
21
20
  /** Reference to the widget ui instance */
22
21
  refUI?: RefObject<HTMLElement | null>;
22
+ /** Registered tools for the widget's transformation pipeline */
23
+ registeredTools?: ToolRegistration[];
24
+ /** Formatter function for widget values */
25
+ formatter?: (value: number) => string;
26
+ /** Locale for number formatting (e.g., 'en-US', 'es-ES', 'fr-FR') */
27
+ locale?: string;
28
+ }
29
+ /**
30
+ * Tool transformation function type
31
+ * Can be synchronous or asynchronous to support remote operations
32
+ */
33
+ export type ToolTransformFunction = (data: unknown, config?: Record<string, unknown>) => Promise<unknown> | unknown;
34
+ /**
35
+ * Tool registration for widget pipeline
36
+ *
37
+ * @example Basic tool registration
38
+ * ```typescript
39
+ * registerTool(widgetId, {
40
+ * id: 'searcher',
41
+ * order: 10,
42
+ * enabled: true,
43
+ * fn: (data) => filterData(data),
44
+ * })
45
+ * ```
46
+ *
47
+ * @example Tool with dependencies
48
+ * ```typescript
49
+ * registerTool(widgetId, {
50
+ * id: 'lock-selection',
51
+ * order: 20,
52
+ * enabled: true,
53
+ * fn: (data) => lockData(data),
54
+ * disables: ['searcher', 'relative-data'], // Disable these when active
55
+ * })
56
+ * ```
57
+ *
58
+ * Dependency Management:
59
+ * - Multiple tools can disable the same target (reference counting)
60
+ * - Target is only re-enabled when ALL disabling tools are inactive
61
+ * - Original enabled state is preserved and restored
62
+ * - Circular dependencies are detected and throw errors
63
+ */
64
+ export interface ToolRegistration {
65
+ /** Unique tool identifier (e.g., 'searcher', 'relative-data') */
66
+ id: string;
67
+ /** Execution priority - lower numbers execute first */
68
+ order: number;
69
+ /** Transformation function */
70
+ fn: ToolTransformFunction;
71
+ /** Whether tool is currently enabled */
72
+ enabled: boolean;
73
+ /** Tool-specific configuration */
74
+ config?: Record<string, unknown>;
75
+ /**
76
+ * Array of tool IDs to disable when this tool is active.
77
+ * During pipeline execution, if this tool is enabled, any tools listed
78
+ * in this array will be excluded from the pipeline.
79
+ *
80
+ * @example
81
+ * ```typescript
82
+ * disables: ['searcher', 'relative-data']
83
+ * ```
84
+ */
85
+ disables?: string[];
23
86
  }
24
87
  /**
25
88
  * Base widget state interface
@@ -30,7 +93,7 @@ export type BaseWidgetState<T> = WidgetsStoreProps & T;
30
93
  */
31
94
  export type WidgetState = BaseWidgetState<unknown>;
32
95
  /**
33
- * Widget store state
96
+ * Widget store state with tool registration
34
97
  */
35
98
  export interface WidgetStoreState {
36
99
  /** Map of widget id to widget state */
@@ -44,9 +107,9 @@ export interface WidgetStoreActions {
44
107
  * Add or update a widget in the store
45
108
  * @param id - Widget ID
46
109
  * @param widget - Widget state properties to merge (accepts any object structure)
47
- * @template T - Optional type parameter for backward compatibility (unused)
110
+ * @template T - Type of the widget state for type-safe access
48
111
  */
49
- setWidget: <T extends WidgetState>(id: WidgetState['id'], widget: Partial<Omit<T, 'id'>>) => void;
112
+ setWidget: <T = any>(id: WidgetState['id'], widget: Partial<T>) => void;
50
113
  /**
51
114
  * Remove a widget from the store
52
115
  * @param id - Widget ID to remove
@@ -62,6 +125,39 @@ export interface WidgetStoreActions {
62
125
  * @returns Widget state or undefined if not found
63
126
  */
64
127
  getWidget: <T extends WidgetState = WidgetState>(id: WidgetState['id']) => T | undefined;
128
+ /**
129
+ * Register a tool with the widget's transformation pipeline
130
+ * @param widgetId - Widget ID
131
+ * @param tool - Tool registration object
132
+ */
133
+ registerTool: (widgetId: string, tool: ToolRegistration) => void;
134
+ /**
135
+ * Unregister a tool from the widget's transformation pipeline
136
+ * @param widgetId - Widget ID
137
+ * @param toolId - Tool ID to remove
138
+ */
139
+ unregisterTool: (widgetId: string, toolId: string) => void;
140
+ /**
141
+ * Update tool configuration
142
+ * @param widgetId - Widget ID
143
+ * @param toolId - Tool ID
144
+ * @param config - New configuration to merge
145
+ */
146
+ updateToolConfig: (widgetId: string, toolId: string, config: Record<string, unknown>) => void;
147
+ /**
148
+ * Set tool enabled state
149
+ * @param widgetId - Widget ID
150
+ * @param toolId - Tool ID
151
+ * @param enabled - Whether tool should be enabled
152
+ */
153
+ setToolEnabled: (widgetId: string, toolId: string, enabled: boolean) => void;
154
+ /**
155
+ * Execute the tool transformation pipeline
156
+ * Supports both synchronous and asynchronous tools
157
+ * @param widgetId - Widget ID
158
+ * @param sourceData - Original data to transform
159
+ */
160
+ executeToolPipeline: (widgetId: string, sourceData: unknown) => Promise<void>;
65
161
  }
66
162
  /**
67
163
  * Complete widget store interface
@@ -1,4 +1,4 @@
1
- import { WidgetState, WidgetStore } from './types';
1
+ import { WidgetStore } from './types';
2
2
  /**
3
3
  * Zustand store for managing widget state across the application.
4
4
  *
@@ -36,29 +36,4 @@ import { WidgetState, WidgetStore } from './types';
36
36
  * const formulaWidgets = getWidgetsByType('formula')
37
37
  * ```
38
38
  */
39
- export declare const useWidgetStore: import('zustand').UseBoundStore<Omit<import('zustand').StoreApi<WidgetStore>, "setState" | "devtools"> & {
40
- setState(partial: WidgetStore | Partial<WidgetStore> | ((state: WidgetStore) => WidgetStore | Partial<WidgetStore>), replace?: false | undefined, action?: (string | {
41
- [x: string]: unknown;
42
- [x: number]: unknown;
43
- [x: symbol]: unknown;
44
- type: string;
45
- }) | undefined): void;
46
- setState(state: WidgetStore | ((state: WidgetStore) => WidgetStore), replace: true, action?: (string | {
47
- [x: string]: unknown;
48
- [x: number]: unknown;
49
- [x: symbol]: unknown;
50
- type: string;
51
- }) | undefined): void;
52
- devtools: {
53
- cleanup: () => void;
54
- };
55
- }>;
56
- /** Hook to get a specific widget by ID
57
- * @param id - Widget ID
58
- * @returns Widget state or undefined if not found
59
- * @example
60
- * ```tsx
61
- * const widget = useWidget('widget-1')
62
- * ```
63
- */
64
- export declare const useWidget: <T extends WidgetState>(id: string) => T | undefined;
39
+ export declare const useWidgetStore: import('node_modules/zustand/esm/react.mjs').UseBoundStore<import('node_modules/zustand/esm/vanilla.mjs').StoreApi<WidgetStore>>;
@@ -0,0 +1,2 @@
1
+ export { WidgetSubHeader } from './subheader';
2
+ export type { WidgetSubHeaderProps } from './types';
@@ -0,0 +1,19 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ root: {
4
+ display: "flex";
5
+ alignItems: "center";
6
+ gap: ({ spacing }: Theme) => string;
7
+ minHeight: ({ spacing }: Theme) => string;
8
+ };
9
+ slotLeft: {
10
+ flexShrink: number;
11
+ };
12
+ slotRight: {
13
+ flexGrow: number;
14
+ display: "flex";
15
+ justifyContent: "flex-end";
16
+ alignItems: "center";
17
+ gap: ({ spacing }: Theme) => string;
18
+ };
19
+ };
@@ -0,0 +1,2 @@
1
+ import { WidgetSubHeaderProps } from './types';
2
+ export declare function WidgetSubHeader({ slotLeft, slotRight, sx, }: WidgetSubHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ export interface WidgetSubHeaderProps {
4
+ /** Content for the left slot */
5
+ slotLeft?: ReactNode;
6
+ /** Content for the right slot*/
7
+ slotRight?: ReactNode;
8
+ /** Custom styles */
9
+ sx?: SxProps<Theme>;
10
+ }
@@ -0,0 +1,5 @@
1
+ import { CellHeaderProps } from '../types';
2
+ /**
3
+ * Table cell header component with optional sorting and select-all checkbox
4
+ */
5
+ export declare function CellHeader({ column, sortState, onSort, isSelectAll, isAllSelected, isIndeterminate, onSelectAll, }: CellHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { TableColumn } from '../types';
2
+ /**
3
+ * Props for Cell component
4
+ */
5
+ export interface CellProps {
6
+ /** Column definition */
7
+ column: TableColumn;
8
+ /** Cell value */
9
+ value: unknown;
10
+ }
11
+ /**
12
+ * Table cell component with automatic markdown support for string values
13
+ * Markdown is rendered when the raw value is a string and no formatter is defined.
14
+ * If a formatter is used, its output is rendered directly without markdown parsing.
15
+ */
16
+ export declare function Cell({ column, value }: CellProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,4 @@
1
+ export { CellHeader } from './cell-header';
2
+ export { Row } from './row';
3
+ export { Pagination } from './pagination';
4
+ export { PaginationActions } from './pagination-actions';
@@ -0,0 +1,5 @@
1
+ import { PaginationActionsProps } from '../types';
2
+ /**
3
+ * Custom pagination actions with first/prev/next/last buttons
4
+ */
5
+ export declare function PaginationActions({ count, page, rowsPerPage, onPageChange, }: PaginationActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { PaginationProps } from '../types';
2
+ /**
3
+ * Table pagination component
4
+ */
5
+ export declare function Pagination({ page, rowsPerPage, total, rowsPerPageOptions, onPageChange, onRowsPerPageChange, }: PaginationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { RowProps } from '../types';
2
+ /**
3
+ * Table row component with selection and hover support
4
+ */
5
+ export declare function Row({ row, columns, isSelected, selectable, onClick, onSelect, onMouseEnter, onMouseLeave, }: RowProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,17 @@
1
+ import { ConfigProps } from '../loader/types';
2
+ import { TableDownloadConfig, TableWidgetConfig, TableColumn, Mode, SortDirection } from './types';
3
+ export declare const DEFAULT_MODE: Mode;
4
+ export declare const DEFAULT_PAGE = 0;
5
+ export declare const DEFAULT_ROWS_PER_PAGE = 10;
6
+ export declare const DEFAULT_ROWS_PER_PAGE_OPTIONS: number[];
7
+ export declare const DEFAULT_COLUMN_ID: null;
8
+ export declare const DEFAULT_DIRECTION: SortDirection;
9
+ /**
10
+ * Default table download configuration
11
+ * Supports PNG export (screenshot) and CSV export (data)
12
+ */
13
+ export declare function tableDownloadConfig({ refUI, }: ConfigProps): TableDownloadConfig;
14
+ /**
15
+ * Default table widget configuration
16
+ */
17
+ export declare function tableConfig(columns?: TableColumn[]): TableWidgetConfig;
@@ -0,0 +1,38 @@
1
+ import { ReactNode } from 'react';
2
+ /**
3
+ * Get formatted cell value for display
4
+ * Handles primitives, arrays, objects, and custom formatters
5
+ *
6
+ * @param cellValue - Raw cell value
7
+ * @param formatter - Optional formatter function
8
+ * @returns Formatted value for display
9
+ */
10
+ export declare function getCellValue<T>(cellValue: T): ReactNode;
11
+ /**
12
+ * Compare two values for sorting
13
+ * Handles strings, numbers, and other types
14
+ *
15
+ * @param a - First value
16
+ * @param b - Second value
17
+ * @param direction - Sort direction
18
+ * @returns Comparison result (-1, 0, 1)
19
+ */
20
+ export declare function compareValues(a: unknown, b: unknown, direction: 'asc' | 'desc'): number;
21
+ /**
22
+ * Sort data array by column
23
+ *
24
+ * @param data - Data array to sort
25
+ * @param columnId - Column ID to sort by
26
+ * @param direction - Sort direction
27
+ * @returns Sorted data array (new array, does not mutate original)
28
+ */
29
+ export declare function sortData<T extends Record<string, unknown>>(data: T[], columnId: string, direction: 'asc' | 'desc'): T[];
30
+ /**
31
+ * Paginate data array
32
+ *
33
+ * @param data - Data array to paginate
34
+ * @param page - Current page (0-indexed)
35
+ * @param rowsPerPage - Number of rows per page
36
+ * @returns Paginated data slice
37
+ */
38
+ export declare function paginateData<T>(data: T[], page: number, rowsPerPage: number): T[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export { usePagination } from './use-pagination';
2
+ export { useSort } from './use-sort';
3
+ export { useSelection } from './use-selection';
4
+ export type { UsePaginationResult } from './use-pagination';
5
+ export type { UseSortResult } from './use-sort';
6
+ export type { UseSelectionOptions, UseSelectionResult } from './use-selection';
@@ -0,0 +1,33 @@
1
+ import { TableRow } from '../types';
2
+ export interface UsePaginationResult<T> {
3
+ /** Whether pagination is enabled */
4
+ paginationEnabled: boolean;
5
+ /** Current page (0-indexed) */
6
+ page: number;
7
+ /** Rows per page */
8
+ rowsPerPage: number;
9
+ /** Total row count */
10
+ total: number;
11
+ /** Available rows per page options */
12
+ rowsPerPageOptions: number[];
13
+ /** Paginated data (for local mode) */
14
+ paginatedData: T[];
15
+ /** Set current page */
16
+ setPage: (page: number) => void;
17
+ /** Set rows per page */
18
+ setRowsPerPage: (rowsPerPage: number) => void;
19
+ /** Go to first page */
20
+ goToFirstPage: () => void;
21
+ /** Go to last page */
22
+ goToLastPage: () => void;
23
+ /** Go to next page */
24
+ goToNextPage: () => void;
25
+ /** Go to previous page */
26
+ goToPreviousPage: () => void;
27
+ }
28
+ /**
29
+ * Hook for managing table pagination
30
+ * Supports both local (client-side) and remote (server-side) pagination
31
+ * State is persisted in the widget store for the given widgetId
32
+ */
33
+ export declare function usePagination<T extends TableRow>(widgetId: string, data: T[]): UsePaginationResult<T>;
@@ -0,0 +1,30 @@
1
+ import { TableRow } from '../types';
2
+ export interface UseSelectionOptions {
3
+ /** Callback when selection changes */
4
+ onSelectionChange?: (selectedIds: (string | number)[]) => void;
5
+ }
6
+ export interface UseSelectionResult {
7
+ /** Array of selected row IDs */
8
+ selectedIds: (string | number)[];
9
+ /** Check if a row is selected */
10
+ isSelected: (id: string | number) => boolean;
11
+ /** Check if all provided rows are selected */
12
+ isAllSelected: (rows: TableRow[]) => boolean;
13
+ /** Check if some but not all rows are selected (for indeterminate state) */
14
+ isIndeterminate: (rows: TableRow[]) => boolean;
15
+ /** Toggle selection of a single row */
16
+ toggleRow: (id: string | number) => void;
17
+ /** Toggle selection of all provided rows */
18
+ toggleAll: (rows: TableRow[]) => void;
19
+ /** Select specific rows */
20
+ selectRows: (ids: (string | number)[]) => void;
21
+ /** Deselect specific rows */
22
+ deselectRows: (ids: (string | number)[]) => void;
23
+ /** Clear all selections */
24
+ clearSelection: () => void;
25
+ }
26
+ /**
27
+ * Hook for managing table row selection
28
+ * Selection persists across pagination and is stored in the widget store
29
+ */
30
+ export declare function useSelection(widgetId: string, options?: UseSelectionOptions): UseSelectionResult;
@@ -0,0 +1,22 @@
1
+ import { TableRow, SortDirection, SortState } from '../types';
2
+ export interface UseSortResult<T> extends SortState {
3
+ /** Whether sorting is enabled */
4
+ sortEnabled: boolean;
5
+ /** Current sort state */
6
+ columnId: string | null;
7
+ direction: SortDirection;
8
+ /** Sorted data (for local mode) */
9
+ sortedData: T[];
10
+ /** Toggle sort on a column */
11
+ toggleSort: (columnId: string) => void;
12
+ /** Set sort state directly */
13
+ setSort: (columnId: string | null, direction: SortDirection) => void;
14
+ /** Clear sort */
15
+ clearSort: () => void;
16
+ }
17
+ /**
18
+ * Hook for managing table sorting
19
+ * Supports both local (client-side) and remote (server-side) sorting
20
+ * State is persisted in the widget store for the given widgetId
21
+ */
22
+ export declare function useSort<T extends TableRow>(widgetId: string, data: T[]): UseSortResult<T>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ export { CellHeader } from './components/cell-header';
2
+ export { Row } from './components/row';
3
+ export { Pagination } from './components/pagination';
4
+ export { PaginationActions } from './components/pagination-actions';
5
+ export { Table } from './table-ui';
6
+ export { usePagination, useSort, useSelection } from './hooks';
7
+ export { tableConfig, tableDownloadConfig } from './config';
8
+ export { TableSkeleton } from './skeleton';
9
+ export { sanitizeTableRow, sanitizeTableData } from './serializer';
10
+ export { getCellValue, compareValues, sortData, paginateData } from './helpers';
11
+ export { styles as tableStyles } from './style';
12
+ export type { TableUIProps, TableColumn, TableRow, TableWidgetData, TablePaginationState, SortDirection, SortState, Mode, TableWidgetConfig, TableWidgetState, TableDownloadConfig, TableProps, CellHeaderProps, RowProps, PaginationProps, PaginationActionsProps, } from './types';
13
+ export type { UsePaginationResult, UseSortResult, UseSelectionOptions, UseSelectionResult, } from './hooks';
@@ -0,0 +1,16 @@
1
+ import { TableRow, TableWidgetData } from './types';
2
+ /**
3
+ * Sanitizes a table row by ensuring all values are serializable.
4
+ * Converts ReactNode and function values to undefined.
5
+ *
6
+ * @param row - The table row to sanitize
7
+ * @returns A sanitized table row
8
+ */
9
+ export declare function sanitizeTableRow(row: TableRow): TableRow;
10
+ /**
11
+ * Sanitizes table widget data by ensuring all rows are serializable.
12
+ *
13
+ * @param data - The table data to sanitize
14
+ * @returns Sanitized table data
15
+ */
16
+ export declare function sanitizeTableData(data: TableWidgetData | undefined): TableWidgetData | undefined;
@@ -0,0 +1,10 @@
1
+ export interface TableSkeletonProps {
2
+ /** Number of columns to display */
3
+ columns?: number;
4
+ /** Number of rows to display */
5
+ rows?: number;
6
+ }
7
+ /**
8
+ * Table skeleton loader component
9
+ */
10
+ export declare function TableSkeleton({ columns, rows }: TableSkeletonProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ container: {
4
+ width: string;
5
+ overflow: "auto";
6
+ };
7
+ table: {
8
+ minWidth: number;
9
+ };
10
+ headerCell: {
11
+ fontWeight: number;
12
+ backgroundColor: (theme: Theme) => string;
13
+ };
14
+ row: {
15
+ '&:last-child td, &:last-child th': {
16
+ border: number;
17
+ };
18
+ };
19
+ rowHover: {
20
+ '&:hover': {
21
+ backgroundColor: (theme: Theme) => string;
22
+ };
23
+ };
24
+ rowSelected: {
25
+ backgroundColor: (theme: Theme) => string;
26
+ '&:hover': {
27
+ backgroundColor: (theme: Theme) => string;
28
+ };
29
+ };
30
+ pagination: {
31
+ borderTop: (theme: Theme) => string;
32
+ };
33
+ };