@carto/ps-react-ui 4.2.7 → 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 (267) hide show
  1. package/dist/cjs-D4KH3azB.js +85 -0
  2. package/dist/cjs-D4KH3azB.js.map +1 -0
  3. package/dist/components.js +770 -1415
  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-BEtBaIdz.js +39 -0
  22. package/dist/smart-tooltip-BEtBaIdz.js.map +1 -0
  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 +38 -0
  32. package/dist/types/widgets/_shared/chart-config/csv-modifiers.d.ts +19 -0
  33. package/dist/types/widgets/_shared/chart-config/index.d.ts +7 -0
  34. package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +85 -0
  35. package/dist/types/widgets/_shared/skeleton/index.d.ts +4 -0
  36. package/dist/types/widgets/_shared/skeleton/styles.d.ts +19 -0
  37. package/dist/types/widgets/actions/change-column/change-column-icon.d.ts +1 -0
  38. package/dist/types/widgets/actions/change-column/change-column.d.ts +16 -0
  39. package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +9 -0
  40. package/dist/types/widgets/actions/change-column/types.d.ts +19 -0
  41. package/dist/types/widgets/actions/download/download.d.ts +2 -0
  42. package/dist/types/widgets/actions/download/exports.d.ts +6 -0
  43. package/dist/types/widgets/actions/download/types.d.ts +21 -0
  44. package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +2 -0
  45. package/dist/types/widgets/actions/fullscreen/styles.d.ts +16 -0
  46. package/dist/types/widgets/actions/fullscreen/types.d.ts +20 -0
  47. package/dist/types/widgets/actions/index.d.ts +18 -0
  48. package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +19 -0
  49. package/dist/types/widgets/actions/lock-selection/types.d.ts +36 -0
  50. package/dist/types/widgets/actions/relative-data/relative-data.d.ts +18 -0
  51. package/dist/types/widgets/actions/relative-data/style.d.ts +8 -0
  52. package/dist/types/widgets/actions/relative-data/types.d.ts +27 -0
  53. package/dist/types/widgets/actions/relative-data/utils.d.ts +9 -0
  54. package/dist/types/widgets/actions/relative-data/utils.test.d.ts +1 -0
  55. package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +18 -0
  56. package/dist/types/widgets/actions/searcher/searcher.d.ts +21 -0
  57. package/dist/types/widgets/actions/searcher/types.d.ts +64 -0
  58. package/dist/types/widgets/actions/shared/styles.d.ts +11 -0
  59. package/dist/types/widgets/actions/stack-toggle/grouped-bar-chart-icon.d.ts +1 -0
  60. package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +16 -0
  61. package/dist/types/widgets/actions/stack-toggle/types.d.ts +25 -0
  62. package/dist/types/widgets/actions/zoom-toggle/index.d.ts +2 -0
  63. package/dist/types/widgets/actions/zoom-toggle/style.d.ts +13 -0
  64. package/dist/types/widgets/actions/zoom-toggle/types.d.ts +41 -0
  65. package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +18 -0
  66. package/dist/types/widgets/bar/config.d.ts +5 -0
  67. package/dist/types/widgets/bar/index.d.ts +3 -0
  68. package/dist/types/widgets/bar/skeleton.d.ts +1 -0
  69. package/dist/types/widgets/bar/style.d.ts +37 -0
  70. package/dist/types/widgets/bar/types.d.ts +9 -0
  71. package/dist/types/widgets/category/category-ui.d.ts +2 -0
  72. package/dist/types/widgets/category/components/category-bar.d.ts +7 -0
  73. package/dist/types/widgets/category/components/category-legend.d.ts +6 -0
  74. package/dist/types/widgets/category/components/category-row-multi.d.ts +11 -0
  75. package/dist/types/widgets/category/components/category-row-other.d.ts +6 -0
  76. package/dist/types/widgets/category/components/category-row-single.d.ts +11 -0
  77. package/dist/types/widgets/category/components/index.d.ts +10 -0
  78. package/dist/types/widgets/category/config.d.ts +16 -0
  79. package/dist/types/widgets/category/index.d.ts +6 -0
  80. package/dist/types/widgets/category/skeleton.d.ts +1 -0
  81. package/dist/types/widgets/category/style.d.ts +120 -0
  82. package/dist/types/widgets/category/types.d.ts +34 -0
  83. package/dist/types/widgets/echart/const.d.ts +1 -0
  84. package/dist/types/widgets/echart/echart-ui.d.ts +2 -0
  85. package/dist/types/widgets/echart/echart.d.ts +2 -0
  86. package/dist/types/widgets/echart/index.d.ts +5 -0
  87. package/dist/types/widgets/echart/options.d.ts +2 -0
  88. package/dist/types/widgets/echart/types.d.ts +34 -0
  89. package/dist/types/widgets/echart/utils.d.ts +80 -0
  90. package/dist/types/widgets/error/error.d.ts +2 -0
  91. package/dist/types/widgets/error/index.d.ts +2 -0
  92. package/dist/types/widgets/error/types.d.ts +12 -0
  93. package/dist/types/widgets/formula/components/item.d.ts +2 -0
  94. package/dist/types/widgets/formula/components/prefix.d.ts +2 -0
  95. package/dist/types/widgets/formula/components/row.d.ts +2 -0
  96. package/dist/types/widgets/formula/components/series.d.ts +2 -0
  97. package/dist/types/widgets/formula/components/suffix.d.ts +2 -0
  98. package/dist/types/widgets/formula/components/value.d.ts +2 -0
  99. package/dist/types/widgets/formula/config.d.ts +4 -0
  100. package/dist/types/widgets/formula/formula-ui.d.ts +2 -0
  101. package/dist/types/widgets/formula/index.d.ts +11 -0
  102. package/dist/types/widgets/formula/serializer.d.ts +16 -0
  103. package/dist/types/widgets/formula/skeleton.d.ts +1 -0
  104. package/dist/types/widgets/formula/style.d.ts +21 -0
  105. package/dist/types/widgets/formula/types.d.ts +42 -0
  106. package/dist/types/widgets/histogram/config.d.ts +5 -0
  107. package/dist/types/widgets/histogram/index.d.ts +3 -0
  108. package/dist/types/widgets/histogram/skeleton.d.ts +1 -0
  109. package/dist/types/widgets/histogram/style.d.ts +15 -0
  110. package/dist/types/widgets/histogram/types.d.ts +9 -0
  111. package/dist/types/widgets/index.d.ts +9 -1
  112. package/dist/types/widgets/loader/index.d.ts +3 -0
  113. package/dist/types/widgets/loader/loader.d.ts +2 -0
  114. package/dist/types/widgets/loader/types.d.ts +9 -0
  115. package/dist/types/widgets/loader/utils.d.ts +1 -0
  116. package/dist/types/widgets/markdown/config.d.ts +4 -0
  117. package/dist/types/widgets/markdown/index.d.ts +5 -0
  118. package/dist/types/widgets/markdown/markdown-ui.d.ts +2 -0
  119. package/dist/types/widgets/markdown/markdown.d.ts +2 -0
  120. package/dist/types/widgets/markdown/skeleton.d.ts +1 -0
  121. package/dist/types/widgets/markdown/style.d.ts +2 -0
  122. package/dist/types/widgets/markdown/types.d.ts +18 -0
  123. package/dist/types/widgets/no-data/index.d.ts +2 -0
  124. package/dist/types/widgets/no-data/no-data.d.ts +35 -0
  125. package/dist/types/widgets/no-data/style.d.ts +6 -0
  126. package/dist/types/widgets/no-data/types.d.ts +67 -0
  127. package/dist/types/widgets/note/index.d.ts +2 -0
  128. package/dist/types/widgets/note/note.d.ts +2 -0
  129. package/dist/types/widgets/note/style.d.ts +28 -0
  130. package/dist/types/widgets/note/types.d.ts +8 -0
  131. package/dist/types/widgets/pie/config.d.ts +5 -0
  132. package/dist/types/widgets/pie/index.d.ts +3 -0
  133. package/dist/types/widgets/pie/skeleton.d.ts +1 -0
  134. package/dist/types/widgets/pie/style.d.ts +15 -0
  135. package/dist/types/widgets/pie/types.d.ts +9 -0
  136. package/dist/types/widgets/range/components/range-item.d.ts +2 -0
  137. package/dist/types/widgets/range/config.d.ts +6 -0
  138. package/dist/types/widgets/range/index.d.ts +6 -0
  139. package/dist/types/widgets/range/range-ui.d.ts +2 -0
  140. package/dist/types/widgets/range/serializer.d.ts +16 -0
  141. package/dist/types/widgets/range/serializer.test.d.ts +1 -0
  142. package/dist/types/widgets/range/skeleton.d.ts +1 -0
  143. package/dist/types/widgets/range/style.d.ts +2 -0
  144. package/dist/types/widgets/range/types.d.ts +33 -0
  145. package/dist/types/widgets/scatterplot/config.d.ts +5 -0
  146. package/dist/types/widgets/scatterplot/index.d.ts +3 -0
  147. package/dist/types/widgets/scatterplot/skeleton.d.ts +1 -0
  148. package/dist/types/widgets/scatterplot/style.d.ts +24 -0
  149. package/dist/types/widgets/scatterplot/types.d.ts +9 -0
  150. package/dist/types/widgets/selection-summary/index.d.ts +2 -0
  151. package/dist/types/widgets/selection-summary/selection-summary.d.ts +2 -0
  152. package/dist/types/widgets/selection-summary/style.d.ts +9 -0
  153. package/dist/types/widgets/selection-summary/types.d.ts +13 -0
  154. package/dist/types/widgets/skeleton-loader/index.d.ts +2 -0
  155. package/dist/types/widgets/skeleton-loader/skeleton-loader.d.ts +2 -0
  156. package/dist/types/widgets/skeleton-loader/types.d.ts +7 -0
  157. package/dist/types/widgets/spread/components/max-value.d.ts +2 -0
  158. package/dist/types/widgets/spread/components/min-value.d.ts +2 -0
  159. package/dist/types/widgets/spread/components/separator.d.ts +2 -0
  160. package/dist/types/widgets/spread/config.d.ts +10 -0
  161. package/dist/types/widgets/spread/index.d.ts +9 -0
  162. package/dist/types/widgets/spread/skeleton.d.ts +1 -0
  163. package/dist/types/widgets/spread/spread-ui.d.ts +2 -0
  164. package/dist/types/widgets/spread/style.d.ts +21 -0
  165. package/dist/types/widgets/spread/types.d.ts +40 -0
  166. package/dist/types/widgets/stores/index.d.ts +2 -0
  167. package/dist/types/widgets/stores/types.d.ts +165 -0
  168. package/dist/types/widgets/stores/widget-store.d.ts +39 -0
  169. package/dist/types/widgets/stores/widget-store.test.d.ts +1 -0
  170. package/dist/types/widgets/subheader/index.d.ts +2 -0
  171. package/dist/types/widgets/subheader/style.d.ts +19 -0
  172. package/dist/types/widgets/subheader/subheader.d.ts +2 -0
  173. package/dist/types/widgets/subheader/types.d.ts +10 -0
  174. package/dist/types/widgets/table/components/cell-header.d.ts +5 -0
  175. package/dist/types/widgets/table/components/cell.d.ts +16 -0
  176. package/dist/types/widgets/table/components/index.d.ts +4 -0
  177. package/dist/types/widgets/table/components/pagination-actions.d.ts +5 -0
  178. package/dist/types/widgets/table/components/pagination.d.ts +5 -0
  179. package/dist/types/widgets/table/components/row.d.ts +5 -0
  180. package/dist/types/widgets/table/config.d.ts +17 -0
  181. package/dist/types/widgets/table/helpers.d.ts +38 -0
  182. package/dist/types/widgets/table/helpers.test.d.ts +1 -0
  183. package/dist/types/widgets/table/hooks/index.d.ts +6 -0
  184. package/dist/types/widgets/table/hooks/use-pagination.d.ts +33 -0
  185. package/dist/types/widgets/table/hooks/use-pagination.test.d.ts +1 -0
  186. package/dist/types/widgets/table/hooks/use-selection.d.ts +30 -0
  187. package/dist/types/widgets/table/hooks/use-selection.test.d.ts +1 -0
  188. package/dist/types/widgets/table/hooks/use-sort.d.ts +22 -0
  189. package/dist/types/widgets/table/hooks/use-sort.test.d.ts +1 -0
  190. package/dist/types/widgets/table/index.d.ts +13 -0
  191. package/dist/types/widgets/table/serializer.d.ts +16 -0
  192. package/dist/types/widgets/table/skeleton.d.ts +10 -0
  193. package/dist/types/widgets/table/style.d.ts +33 -0
  194. package/dist/types/widgets/table/table-ui.d.ts +32 -0
  195. package/dist/types/widgets/table/types.d.ts +196 -0
  196. package/dist/types/widgets/timeseries/config.d.ts +5 -0
  197. package/dist/types/widgets/timeseries/index.d.ts +3 -0
  198. package/dist/types/widgets/timeseries/skeleton.d.ts +1 -0
  199. package/dist/types/widgets/timeseries/style.d.ts +38 -0
  200. package/dist/types/widgets/timeseries/types.d.ts +9 -0
  201. package/dist/types/widgets/toolbar-actions/index.d.ts +2 -0
  202. package/dist/types/widgets/toolbar-actions/styles.d.ts +37 -0
  203. package/dist/types/widgets/toolbar-actions/toolbar-actions.d.ts +8 -0
  204. package/dist/types/widgets/toolbar-actions/types.d.ts +45 -0
  205. package/dist/types/widgets/wrapper/components/actions.d.ts +2 -0
  206. package/dist/types/widgets/wrapper/components/options.d.ts +2 -0
  207. package/dist/types/widgets/wrapper/components/title.d.ts +6 -0
  208. package/dist/types/widgets/wrapper/index.d.ts +6 -0
  209. package/dist/types/widgets/wrapper/styles.d.ts +89 -0
  210. package/dist/types/widgets/wrapper/types.d.ts +37 -0
  211. package/dist/types/widgets/wrapper/wrapper-ui.d.ts +2 -0
  212. package/dist/types/widgets/wrapper/wrapper.d.ts +2 -0
  213. package/dist/use-widget-ref-B0aNCANx.js +19 -0
  214. package/dist/use-widget-ref-B0aNCANx.js.map +1 -0
  215. package/dist/utils-D3-eQyDR.js +144 -0
  216. package/dist/utils-D3-eQyDR.js.map +1 -0
  217. package/dist/widget-store-CB6Trp_0.js +131 -0
  218. package/dist/widget-store-CB6Trp_0.js.map +1 -0
  219. package/dist/widgets/actions.js +872 -0
  220. package/dist/widgets/actions.js.map +1 -0
  221. package/dist/widgets/bar.js +188 -0
  222. package/dist/widgets/bar.js.map +1 -0
  223. package/dist/widgets/category.js +427 -0
  224. package/dist/widgets/category.js.map +1 -0
  225. package/dist/widgets/echart.js +115 -0
  226. package/dist/widgets/echart.js.map +1 -0
  227. package/dist/widgets/error.js +5 -0
  228. package/dist/widgets/error.js.map +1 -0
  229. package/dist/widgets/formula.js +119 -0
  230. package/dist/widgets/formula.js.map +1 -0
  231. package/dist/widgets/histogram.js +186 -0
  232. package/dist/widgets/histogram.js.map +1 -0
  233. package/dist/widgets/loader.js +57 -0
  234. package/dist/widgets/loader.js.map +1 -0
  235. package/dist/widgets/markdown.js +127 -0
  236. package/dist/widgets/markdown.js.map +1 -0
  237. package/dist/widgets/no-data.js +5 -0
  238. package/dist/widgets/no-data.js.map +1 -0
  239. package/dist/widgets/note.js +5 -0
  240. package/dist/widgets/note.js.map +1 -0
  241. package/dist/widgets/pie.js +230 -0
  242. package/dist/widgets/pie.js.map +1 -0
  243. package/dist/widgets/range.js +217 -0
  244. package/dist/widgets/range.js.map +1 -0
  245. package/dist/widgets/scatterplot.js +233 -0
  246. package/dist/widgets/scatterplot.js.map +1 -0
  247. package/dist/widgets/selection-summary.js +40 -0
  248. package/dist/widgets/selection-summary.js.map +1 -0
  249. package/dist/widgets/skeleton-loader.js +24 -0
  250. package/dist/widgets/skeleton-loader.js.map +1 -0
  251. package/dist/widgets/spread.js +161 -0
  252. package/dist/widgets/spread.js.map +1 -0
  253. package/dist/widgets/stores.js +5 -0
  254. package/dist/widgets/stores.js.map +1 -0
  255. package/dist/widgets/subheader.js +52 -0
  256. package/dist/widgets/subheader.js.map +1 -0
  257. package/dist/widgets/table.js +672 -0
  258. package/dist/widgets/table.js.map +1 -0
  259. package/dist/widgets/timeseries.js +187 -0
  260. package/dist/widgets/timeseries.js.map +1 -0
  261. package/dist/widgets/toolbar-actions.js +6725 -0
  262. package/dist/widgets/toolbar-actions.js.map +1 -0
  263. package/dist/widgets/wrapper.js +295 -0
  264. package/dist/widgets/wrapper.js.map +1 -0
  265. package/dist/widgets.js +12 -1
  266. package/dist/widgets.js.map +1 -1
  267. package/package.json +114 -4
@@ -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
+ };
@@ -0,0 +1,32 @@
1
+ import { TableCell, TableProps as MuiTableProps } from '@mui/material';
2
+ import { Ref } from 'react';
3
+ import { TableUIProps } from './types';
4
+ /**
5
+ * Props for the base Table component
6
+ */
7
+ export interface TableComponentProps extends MuiTableProps {
8
+ /** Table element ref */
9
+ ref?: Ref<HTMLTableElement>;
10
+ }
11
+ /**
12
+ * Base Table component with compound component pattern
13
+ * Provides Table.Head, Table.Body, Table.Row, Table.Cell, Table.CellHeader, Table.Pagination
14
+ */
15
+ declare function Table({ children, ref, stickyHeader, ...props }: TableComponentProps): import("react/jsx-runtime").JSX.Element;
16
+ declare namespace Table {
17
+ var Head: import("node_modules/@mui/material/OverridableComponent").OverridableComponent<import("node_modules/@mui/material").TableHeadTypeMap<{}, "thead">>;
18
+ var CellHeader: typeof import(".").CellHeader;
19
+ var Body: import("node_modules/@mui/material/OverridableComponent").OverridableComponent<import("node_modules/@mui/material").TableBodyTypeMap<{}, "tbody">>;
20
+ var Row: typeof import(".").Row;
21
+ var Cell: typeof TableCell;
22
+ var Container: typeof TableContainer;
23
+ var Paper: import("node_modules/@mui/material/OverridableComponent").OverridableComponent<import("node_modules/@mui/material").PaperTypeMap<{}, "div">>;
24
+ var Pagination: typeof import(".").Pagination;
25
+ var PaginationActions: typeof import(".").PaginationActions;
26
+ }
27
+ export { Table };
28
+ /**
29
+ * TableContainer widget component
30
+ * Integrates with widget store and provides ref registration using custom hook
31
+ */
32
+ declare function TableContainer(props: TableUIProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,196 @@
1
+ import { ReactNode, Ref } from 'react';
2
+ import { TableProps as MuiTableProps } from '@mui/material';
3
+ import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
4
+ import { WrapperState } from '../wrapper/types';
5
+ import { DownloadItem } from '../actions/download/types';
6
+ /**
7
+ * Table UI component props
8
+ */
9
+ export interface TableUIProps {
10
+ id: WidgetsStoreProps['id'];
11
+ children?: ReactNode;
12
+ }
13
+ /**
14
+ * Table column definition
15
+ */
16
+ export interface TableColumn {
17
+ /** Unique column identifier, matches key in row data */
18
+ id: string;
19
+ /** Column header label */
20
+ label: string | ReactNode;
21
+ /** Text alignment */
22
+ align?: 'left' | 'center' | 'right';
23
+ /** Column width (number for px, string for CSS value) */
24
+ width?: number | string;
25
+ /** Enable sorting for this column */
26
+ sortable?: boolean;
27
+ /** Custom cell value formatter */
28
+ formatter?: (value: unknown) => ReactNode;
29
+ }
30
+ /**
31
+ * Table row data - extends Record for flexible data
32
+ */
33
+ export interface TableRow extends Record<string, unknown> {
34
+ /** Unique row identifier */
35
+ id: string | number;
36
+ }
37
+ /**
38
+ * Table widget data type - array of row records
39
+ */
40
+ export type TableWidgetData = TableRow[];
41
+ /**
42
+ * Pagination state
43
+ */
44
+ export interface TablePaginationState {
45
+ /** Current page (0-indexed) */
46
+ page: number;
47
+ /** Rows per page */
48
+ rowsPerPage: number;
49
+ /** Total number of rows (for remote pagination) */
50
+ total: number;
51
+ }
52
+ /**
53
+ * Sort direction
54
+ */
55
+ export type SortDirection = 'asc' | 'desc';
56
+ /**
57
+ * Sort state for single-column sorting
58
+ */
59
+ export interface SortState {
60
+ /** Column ID being sorted */
61
+ columnId: string | null;
62
+ /** Sort direction */
63
+ direction: SortDirection;
64
+ }
65
+ /**
66
+ * Pagination and sort mode
67
+ */
68
+ export type Mode = 'local' | 'remote';
69
+ /**
70
+ * Table widget configuration
71
+ */
72
+ export interface TableWidgetConfig {
73
+ /** Column definitions */
74
+ columns?: TableColumn[];
75
+ /** Enable row selection with checkboxes */
76
+ selectable?: boolean;
77
+ /** Currently selected row IDs */
78
+ selected: (string | number)[];
79
+ /** Pagination and sort mode: local (client-side) or remote (server-side) */
80
+ mode: Mode;
81
+ /** Pagination configuration */
82
+ pagination?: {
83
+ /** Current page (0-indexed) */
84
+ page?: number;
85
+ /** Available rows per page options */
86
+ rowsPerPageOptions?: number[];
87
+ /** Default rows per page */
88
+ rowsPerPage?: number;
89
+ /** Total rows for remote pagination */
90
+ total?: number;
91
+ };
92
+ /** Sort configuration */
93
+ sort?: {
94
+ /** Default sort column */
95
+ columnId: string | null;
96
+ /** Default sort direction */
97
+ direction?: SortDirection;
98
+ };
99
+ /** Callback when a row is clicked */
100
+ onRowClick?: (row: TableRow) => void;
101
+ /** Callback when hovering over a row (null when leaving table) */
102
+ onRowHover?: (row: TableRow | null) => void;
103
+ /** Callback when selection changes */
104
+ onSelectionChange?: (selected: (string | number)[]) => void;
105
+ /** Callback when page changes (for remote pagination) */
106
+ onPageChange?: (page: number, rowsPerPage: number) => void;
107
+ /** Callback when sort changes (for remote sorting) */
108
+ onSortChange?: (columnId: string, direction: SortDirection) => void;
109
+ }
110
+ /**
111
+ * Table widget state - includes both configuration and runtime state
112
+ */
113
+ export type TableWidgetState = BaseWidgetState<WrapperState<TableWidgetConfig & {}> & {
114
+ data: TableWidgetData;
115
+ }>;
116
+ /**
117
+ * Table download configuration
118
+ */
119
+ export type TableDownloadConfig = DownloadItem<TableWidgetData>[];
120
+ /**
121
+ * Props for the base Table component
122
+ */
123
+ export interface TableProps extends MuiTableProps {
124
+ /** Table element ref */
125
+ ref?: Ref<HTMLTableElement>;
126
+ }
127
+ /**
128
+ * Props for CellHeader component
129
+ */
130
+ export interface CellHeaderProps {
131
+ /** Column definition */
132
+ column: TableColumn;
133
+ /** Current sort state */
134
+ sortState?: SortState;
135
+ /** Callback when sort is triggered */
136
+ onSort?: (columnId: string) => void;
137
+ /** Whether this is a select-all checkbox header */
138
+ isSelectAll?: boolean;
139
+ /** Whether all rows are selected */
140
+ isAllSelected?: boolean;
141
+ /** Whether some rows are selected (indeterminate state) */
142
+ isIndeterminate?: boolean;
143
+ /** Callback for select-all toggle */
144
+ onSelectAll?: () => void;
145
+ }
146
+ /**
147
+ * Props for Row component
148
+ */
149
+ export interface RowProps {
150
+ /** Row data */
151
+ row: TableRow;
152
+ /** Column definitions */
153
+ columns: TableColumn[];
154
+ /** Whether row is selected */
155
+ isSelected?: boolean;
156
+ /** Whether selection is enabled */
157
+ selectable?: boolean;
158
+ /** Callback when row is clicked */
159
+ onClick?: (row: TableRow) => void;
160
+ /** Callback when row selection is toggled */
161
+ onSelect?: (row: TableRow) => void;
162
+ /** Callback when mouse enters row */
163
+ onMouseEnter?: (row: TableRow) => void;
164
+ /** Callback when mouse leaves row */
165
+ onMouseLeave?: () => void;
166
+ }
167
+ /**
168
+ * Props for Pagination component
169
+ */
170
+ export interface PaginationProps {
171
+ /** Current page (0-indexed) */
172
+ page: number;
173
+ /** Rows per page */
174
+ rowsPerPage: number;
175
+ /** Total row count */
176
+ total: number;
177
+ /** Available rows per page options */
178
+ rowsPerPageOptions?: number[];
179
+ /** Callback when page changes */
180
+ onPageChange: (page: number) => void;
181
+ /** Callback when rows per page changes */
182
+ onRowsPerPageChange: (rowsPerPage: number) => void;
183
+ }
184
+ /**
185
+ * Props for PaginationActions component
186
+ */
187
+ export interface PaginationActionsProps {
188
+ /** Current page (0-indexed) */
189
+ page: number;
190
+ /** Total row count */
191
+ count: number;
192
+ /** Rows per page */
193
+ rowsPerPage: number;
194
+ /** Callback when page changes */
195
+ onPageChange: (event: React.MouseEvent<HTMLButtonElement> | null, newPage: number) => void;
196
+ }
@@ -0,0 +1,5 @@
1
+ import { TimeseriesConfig, TimeseriesWidgetConfig, TimeseriesWidgetData } from './types';
2
+ import { DownloadItem } from '../actions';
3
+ import { ConfigProps } from '../loader/types';
4
+ export declare function timeseriesDownloadConfig({ refUI, }: ConfigProps): DownloadItem<TimeseriesWidgetData>[];
5
+ export declare function timeseriesConfig(props: TimeseriesConfig): TimeseriesWidgetConfig;
@@ -0,0 +1,3 @@
1
+ export type { TimeseriesWidgetData, TimeseriesWidgetState, TimeseriesWidgetConfig, TimeseriesConfig, } from './types';
2
+ export { timeseriesConfig, timeseriesDownloadConfig } from './config';
3
+ export { TimeseriesSkeleton } from './skeleton';
@@ -0,0 +1 @@
1
+ export declare function TimeseriesSkeleton(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,38 @@
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
+ grid: {
15
+ display: "flex";
16
+ justifyContent: "space-between";
17
+ flex: "1 1 auto";
18
+ alignItems: "flex-end";
19
+ width: "100%";
20
+ };
21
+ };
22
+ histogram: {
23
+ item: {
24
+ flex: number;
25
+ maxWidth: ({ spacing }: Theme) => string;
26
+ '& + &': {
27
+ marginLeft: string;
28
+ };
29
+ };
30
+ };
31
+ legend: {
32
+ display: "flex";
33
+ alignItems: "center";
34
+ gap: ({ spacing }: Theme) => string;
35
+ height: ({ spacing }: Theme) => string;
36
+ };
37
+ };
38
+ };
@@ -0,0 +1,9 @@
1
+ import { EchartWidgetData, EchartWidgetState } from '../echart';
2
+ import { EchartWidgetOptionProps, EchartWidgetProps } from '../echart/types';
3
+ import { ConfigProps } from '../loader';
4
+ export type TimeseriesWidgetData = EchartWidgetData;
5
+ export type TimeseriesWidgetState = EchartWidgetState;
6
+ export type TimeseriesWidgetConfig = EchartWidgetProps & {
7
+ type: 'timeseries';
8
+ };
9
+ export type TimeseriesConfig = ConfigProps & EchartWidgetOptionProps<TimeseriesWidgetData>;
@@ -0,0 +1,2 @@
1
+ export type { ToolbarAction, ToolbarActionsLabels, ToolbarActionsProps, } from './types';
2
+ export { ToolbarActions } from './toolbar-actions';
@@ -0,0 +1,37 @@
1
+ import { Theme } from '@mui/material';
2
+ export declare const styles: {
3
+ root: {
4
+ display: "flex";
5
+ alignItems: "center";
6
+ width: string;
7
+ overflow: "hidden";
8
+ borderRadius: ({ spacing }: Theme) => string;
9
+ gap: ({ spacing }: Theme) => string;
10
+ };
11
+ preview: {
12
+ display: "flex";
13
+ alignItems: "center";
14
+ gap: ({ spacing }: Theme) => string;
15
+ };
16
+ actionsContainer: {
17
+ position: "absolute";
18
+ display: "flex";
19
+ alignItems: "center";
20
+ backgroundColor: ({ palette }: Theme) => string;
21
+ padding: ({ spacing }: Theme) => string;
22
+ gap: ({ spacing }: Theme) => string;
23
+ };
24
+ iconButton: {
25
+ width: ({ spacing }: Theme) => string;
26
+ height: ({ spacing }: Theme) => string;
27
+ borderRadius: number;
28
+ '.MuiTouchRipple-ripple .MuiTouchRipple-child': {
29
+ borderRadius: number;
30
+ };
31
+ };
32
+ triggerButton: {
33
+ '&[data-active="true"]': {
34
+ backgroundColor: ({ palette }: Theme) => string;
35
+ };
36
+ };
37
+ };
@@ -0,0 +1,8 @@
1
+ import { JSX } from 'react';
2
+ import { ToolbarActionsProps } from './types';
3
+ /**
4
+ * A floating toolbar component that displays action buttons.
5
+ * Shows a trigger button when there are 3+ actions, which expands
6
+ * to reveal all actions with a close button.
7
+ */
8
+ export declare function ToolbarActions({ children: _children, full, direction, labels, sx, IconButtonProps, TooltipProps, }: ToolbarActionsProps): JSX.Element | null;
@@ -0,0 +1,45 @@
1
+ import { IconButtonProps, SxProps, Theme, TooltipProps } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ /**
4
+ * Represents a single action in the toolbar
5
+ */
6
+ export interface ToolbarAction {
7
+ /** Unique identifier for the action */
8
+ id: string;
9
+ /** Icon to display for the action */
10
+ icon: ReactNode;
11
+ /** Label displayed in tooltip */
12
+ label: string;
13
+ /** Callback when action is clicked */
14
+ onClick: () => void;
15
+ /** Whether the action is disabled */
16
+ disabled?: boolean;
17
+ }
18
+ /**
19
+ * Labels for toolbar UI elements
20
+ */
21
+ export interface ToolbarActionsLabels {
22
+ /** Tooltip for the trigger button */
23
+ trigger?: string;
24
+ /** Tooltip for the close button */
25
+ close?: string;
26
+ }
27
+ /**
28
+ * Props for the ToolbarActions component
29
+ */
30
+ export interface ToolbarActionsProps {
31
+ /** Array of React elements (typically IconButtons) to display in the toolbar */
32
+ children: ReactNode[] | ReactNode;
33
+ /** Direction in which the toolbar expands */
34
+ direction?: 'left' | 'right';
35
+ /** Whether the toolbar is in full mode */
36
+ full?: boolean;
37
+ /** Custom labels for UI elements */
38
+ labels?: ToolbarActionsLabels;
39
+ /** Custom styles for the root container */
40
+ sx?: SxProps<Theme>;
41
+ /** Props passed to action IconButtons */
42
+ IconButtonProps?: Omit<IconButtonProps, 'onClick' | 'disabled'>;
43
+ /** Props passed to Tooltips */
44
+ TooltipProps?: Omit<TooltipProps, 'title' | 'children'>;
45
+ }
@@ -0,0 +1,2 @@
1
+ import { WrapperActionsProps } from '../types';
2
+ export declare function Actions({ actions }: WrapperActionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { WrapperOptionsProps } from '../types';
2
+ export declare function Options({ labels, options }: WrapperOptionsProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from 'react';
2
+ import { WrapperOptionsProps } from '../types';
3
+ export declare function Title({ label, children, }: {
4
+ children: ReactNode;
5
+ label?: NonNullable<WrapperOptionsProps['labels']>['title'];
6
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ export { Actions } from './components/actions';
2
+ export { Options } from './components/options';
3
+ export { Title } from './components/title';
4
+ export { WidgetWrapper } from './wrapper';
5
+ export { WrapperUI } from './wrapper-ui';
6
+ export type { WrapperActionsProps, WrapperOption, WrapperOptionsProps, WrapperProps, WrapperState, WrapperUIProps, } from './types';