@carto/ps-react-ui 4.3.0-widgets.0 → 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 (262) hide show
  1. package/dist/components.js +25 -23
  2. package/dist/components.js.map +1 -1
  3. package/dist/exports-Cr43OCul.js +51 -0
  4. package/dist/exports-Cr43OCul.js.map +1 -0
  5. package/dist/{lasso-tool-BC-rsMMW.js → lasso-tool-CYn3ivf-.js} +165 -183
  6. package/dist/lasso-tool-CYn3ivf-.js.map +1 -0
  7. package/dist/options-D9wflre6.js +49 -0
  8. package/dist/options-D9wflre6.js.map +1 -0
  9. package/dist/row-C_m1ovHv.js +35 -0
  10. package/dist/row-C_m1ovHv.js.map +1 -0
  11. package/dist/series-6xp-KQ0S.js +91 -0
  12. package/dist/series-6xp-KQ0S.js.map +1 -0
  13. package/dist/{smart-tooltip-BSlcAkBM.js → smart-tooltip-BEtBaIdz.js} +2 -2
  14. package/dist/{smart-tooltip-BSlcAkBM.js.map → smart-tooltip-BEtBaIdz.js.map} +1 -1
  15. package/dist/styles-dOu_pRNb.js +77 -0
  16. package/dist/styles-dOu_pRNb.js.map +1 -0
  17. package/dist/tooltip-BDnrRKrp.js +25 -0
  18. package/dist/tooltip-BDnrRKrp.js.map +1 -0
  19. package/dist/types/hooks/index.d.ts +2 -0
  20. package/dist/types/hooks/use-debounce.d.ts +19 -0
  21. package/dist/types/hooks/use-widget-ref.d.ts +17 -0
  22. package/dist/types/widgets/_shared/chart-config/config-factory.d.ts +5 -11
  23. package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +3 -8
  24. package/dist/types/widgets/actions/change-column/change-column-icon.d.ts +1 -0
  25. package/dist/types/widgets/actions/change-column/change-column.d.ts +16 -0
  26. package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +9 -0
  27. package/dist/types/widgets/actions/change-column/types.d.ts +19 -0
  28. package/dist/types/widgets/actions/download/download.d.ts +1 -1
  29. package/dist/types/widgets/actions/download/exports.d.ts +1 -1
  30. package/dist/types/widgets/actions/download/types.d.ts +3 -11
  31. package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +1 -1
  32. package/dist/types/widgets/actions/fullscreen/styles.d.ts +6 -0
  33. package/dist/types/widgets/actions/fullscreen/types.d.ts +8 -9
  34. package/dist/types/widgets/actions/index.d.ts +14 -1
  35. package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +19 -0
  36. package/dist/types/widgets/actions/lock-selection/types.d.ts +38 -0
  37. package/dist/types/widgets/actions/relative-data/relative-data.d.ts +18 -0
  38. package/dist/types/widgets/actions/relative-data/style.d.ts +8 -0
  39. package/dist/types/widgets/actions/relative-data/types.d.ts +27 -0
  40. package/dist/types/widgets/actions/relative-data/utils.d.ts +9 -0
  41. package/dist/types/widgets/actions/relative-data/utils.test.d.ts +1 -0
  42. package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +18 -0
  43. package/dist/types/widgets/actions/searcher/searcher.d.ts +21 -0
  44. package/dist/types/widgets/actions/searcher/types.d.ts +62 -0
  45. package/dist/types/widgets/actions/shared/styles.d.ts +11 -0
  46. package/dist/types/widgets/actions/stack-toggle/grouped-bar-chart-icon.d.ts +1 -0
  47. package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +16 -0
  48. package/dist/types/widgets/actions/stack-toggle/types.d.ts +25 -0
  49. package/dist/types/widgets/actions/zoom-toggle/index.d.ts +2 -0
  50. package/dist/types/widgets/actions/zoom-toggle/style.d.ts +13 -0
  51. package/dist/types/widgets/actions/zoom-toggle/types.d.ts +41 -0
  52. package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +18 -0
  53. package/dist/types/widgets/bar/config.d.ts +5 -4
  54. package/dist/types/widgets/bar/index.d.ts +2 -2
  55. package/dist/types/widgets/bar/types.d.ts +6 -12
  56. package/dist/types/widgets/category/category-ui.d.ts +2 -0
  57. package/dist/types/widgets/category/components/category-bar.d.ts +7 -0
  58. package/dist/types/widgets/category/components/category-legend.d.ts +6 -0
  59. package/dist/types/widgets/category/components/category-row-multi.d.ts +11 -0
  60. package/dist/types/widgets/category/components/category-row-other.d.ts +6 -0
  61. package/dist/types/widgets/category/components/category-row-single.d.ts +11 -0
  62. package/dist/types/widgets/category/components/index.d.ts +10 -0
  63. package/dist/types/widgets/category/config.d.ts +15 -0
  64. package/dist/types/widgets/category/index.d.ts +6 -0
  65. package/dist/types/widgets/category/skeleton.d.ts +1 -0
  66. package/dist/types/widgets/category/style.d.ts +121 -0
  67. package/dist/types/widgets/category/types.d.ts +33 -0
  68. package/dist/types/widgets/echart/echart-ui.d.ts +1 -1
  69. package/dist/types/widgets/echart/index.d.ts +2 -2
  70. package/dist/types/widgets/echart/options.d.ts +2 -3
  71. package/dist/types/widgets/echart/types.d.ts +11 -10
  72. package/dist/types/widgets/echart/utils.d.ts +22 -16
  73. package/dist/types/widgets/formula/components/row.d.ts +1 -1
  74. package/dist/types/widgets/formula/config.d.ts +4 -2
  75. package/dist/types/widgets/formula/index.d.ts +2 -1
  76. package/dist/types/widgets/formula/types.d.ts +6 -18
  77. package/dist/types/widgets/histogram/config.d.ts +5 -4
  78. package/dist/types/widgets/histogram/index.d.ts +2 -2
  79. package/dist/types/widgets/histogram/types.d.ts +6 -12
  80. package/dist/types/widgets/index.d.ts +2 -4
  81. package/dist/types/widgets/markdown/config.d.ts +4 -2
  82. package/dist/types/widgets/markdown/index.d.ts +2 -2
  83. package/dist/types/widgets/markdown/markdown-ui.d.ts +1 -1
  84. package/dist/types/widgets/markdown/types.d.ts +6 -16
  85. package/dist/types/widgets/note/note.d.ts +1 -1
  86. package/dist/types/widgets/note/style.d.ts +12 -1
  87. package/dist/types/widgets/note/types.d.ts +4 -3
  88. package/dist/types/widgets/pie/config.d.ts +5 -4
  89. package/dist/types/widgets/pie/index.d.ts +2 -2
  90. package/dist/types/widgets/pie/types.d.ts +6 -12
  91. package/dist/types/widgets/range/config.d.ts +6 -2
  92. package/dist/types/widgets/range/index.d.ts +2 -1
  93. package/dist/types/widgets/range/types.d.ts +6 -17
  94. package/dist/types/widgets/root/index.d.ts +2 -1
  95. package/dist/types/widgets/root/root.d.ts +1 -1
  96. package/dist/types/widgets/root/types.d.ts +6 -12
  97. package/dist/types/widgets/root/utils.d.ts +1 -0
  98. package/dist/types/widgets/scatterplot/config.d.ts +5 -4
  99. package/dist/types/widgets/scatterplot/index.d.ts +2 -2
  100. package/dist/types/widgets/scatterplot/types.d.ts +6 -12
  101. package/dist/types/widgets/selection-summary/index.d.ts +2 -0
  102. package/dist/types/widgets/selection-summary/selection-summary.d.ts +2 -0
  103. package/dist/types/widgets/selection-summary/style.d.ts +9 -0
  104. package/dist/types/widgets/selection-summary/types.d.ts +13 -0
  105. package/dist/types/widgets/spread/config.d.ts +10 -2
  106. package/dist/types/widgets/spread/index.d.ts +2 -1
  107. package/dist/types/widgets/spread/types.d.ts +6 -18
  108. package/dist/types/widgets/stores/index.d.ts +2 -0
  109. package/dist/types/widgets/stores/types.d.ts +175 -11
  110. package/dist/types/widgets/stores/widget-store.d.ts +2 -27
  111. package/dist/types/widgets/subheader/index.d.ts +2 -0
  112. package/dist/types/widgets/subheader/style.d.ts +19 -0
  113. package/dist/types/widgets/subheader/subheader.d.ts +2 -0
  114. package/dist/types/widgets/subheader/types.d.ts +10 -0
  115. package/dist/types/widgets/table/components/cell-header.d.ts +5 -0
  116. package/dist/types/widgets/table/components/cell.d.ts +16 -0
  117. package/dist/types/widgets/table/components/index.d.ts +4 -0
  118. package/dist/types/widgets/table/components/pagination-actions.d.ts +5 -0
  119. package/dist/types/widgets/table/components/pagination.d.ts +5 -0
  120. package/dist/types/widgets/table/components/row.d.ts +5 -0
  121. package/dist/types/widgets/table/config.d.ts +11 -0
  122. package/dist/types/widgets/table/helpers.d.ts +38 -0
  123. package/dist/types/widgets/table/helpers.test.d.ts +1 -0
  124. package/dist/types/widgets/table/hooks/index.d.ts +6 -0
  125. package/dist/types/widgets/table/hooks/use-pagination.d.ts +45 -0
  126. package/dist/types/widgets/table/hooks/use-pagination.test.d.ts +1 -0
  127. package/dist/types/widgets/table/hooks/use-selection.d.ts +32 -0
  128. package/dist/types/widgets/table/hooks/use-selection.test.d.ts +1 -0
  129. package/dist/types/widgets/table/hooks/use-sort.d.ts +29 -0
  130. package/dist/types/widgets/table/hooks/use-sort.test.d.ts +1 -0
  131. package/dist/types/widgets/table/index.d.ts +13 -0
  132. package/dist/types/widgets/table/serializer.d.ts +16 -0
  133. package/dist/types/widgets/table/skeleton.d.ts +10 -0
  134. package/dist/types/widgets/table/style.d.ts +33 -0
  135. package/dist/types/widgets/table/table-ui.d.ts +32 -0
  136. package/dist/types/widgets/table/types.d.ts +201 -0
  137. package/dist/types/widgets/timeseries/config.d.ts +5 -4
  138. package/dist/types/widgets/timeseries/index.d.ts +2 -2
  139. package/dist/types/widgets/timeseries/types.d.ts +6 -12
  140. package/dist/types/widgets/toolbar-actions/index.d.ts +2 -0
  141. package/dist/types/widgets/toolbar-actions/styles.d.ts +37 -0
  142. package/dist/types/widgets/toolbar-actions/toolbar-actions.d.ts +8 -0
  143. package/dist/types/widgets/toolbar-actions/types.d.ts +45 -0
  144. package/dist/types/widgets/wrapper/index.d.ts +2 -2
  145. package/dist/types/widgets/wrapper/styles.d.ts +6 -0
  146. package/dist/types/widgets/wrapper/types.d.ts +7 -5
  147. package/dist/types/widgets/wrapper/wrapper-ui.d.ts +1 -1
  148. package/dist/types/widgets/wrapper/wrapper.d.ts +1 -1
  149. package/dist/utils-Dv5Z47UQ.js +144 -0
  150. package/dist/utils-Dv5Z47UQ.js.map +1 -0
  151. package/dist/widget-store-DNyVElxd.js +190 -0
  152. package/dist/widget-store-DNyVElxd.js.map +1 -0
  153. package/dist/widgets/actions.js +825 -6
  154. package/dist/widgets/actions.js.map +1 -1
  155. package/dist/widgets/bar.js +189 -4
  156. package/dist/widgets/bar.js.map +1 -1
  157. package/dist/widgets/category.js +460 -0
  158. package/dist/widgets/category.js.map +1 -0
  159. package/dist/widgets/echart.js +120 -8
  160. package/dist/widgets/echart.js.map +1 -1
  161. package/dist/widgets/formula.js +117 -20
  162. package/dist/widgets/formula.js.map +1 -1
  163. package/dist/widgets/histogram.js +172 -4
  164. package/dist/widgets/histogram.js.map +1 -1
  165. package/dist/widgets/markdown.js +127 -0
  166. package/dist/widgets/markdown.js.map +1 -0
  167. package/dist/widgets/note.js +121 -2
  168. package/dist/widgets/note.js.map +1 -1
  169. package/dist/widgets/pie.js +213 -4
  170. package/dist/widgets/pie.js.map +1 -1
  171. package/dist/widgets/range.js +210 -12
  172. package/dist/widgets/range.js.map +1 -1
  173. package/dist/widgets/root.js +65 -2
  174. package/dist/widgets/root.js.map +1 -1
  175. package/dist/widgets/scatterplot.js +219 -4
  176. package/dist/widgets/scatterplot.js.map +1 -1
  177. package/dist/widgets/selection-summary.js +40 -0
  178. package/dist/widgets/selection-summary.js.map +1 -0
  179. package/dist/widgets/skeleton-loader.js +21 -2
  180. package/dist/widgets/skeleton-loader.js.map +1 -1
  181. package/dist/widgets/spread.js +162 -17
  182. package/dist/widgets/spread.js.map +1 -1
  183. package/dist/widgets/stores.js +5 -0
  184. package/dist/widgets/stores.js.map +1 -0
  185. package/dist/widgets/subheader.js +52 -0
  186. package/dist/widgets/subheader.js.map +1 -0
  187. package/dist/widgets/table.js +691 -0
  188. package/dist/widgets/table.js.map +1 -0
  189. package/dist/widgets/timeseries.js +171 -4
  190. package/dist/widgets/timeseries.js.map +1 -1
  191. package/dist/widgets/toolbar-actions.js +6106 -0
  192. package/dist/widgets/toolbar-actions.js.map +1 -0
  193. package/dist/widgets/wrapper.js +292 -6
  194. package/dist/widgets/wrapper.js.map +1 -1
  195. package/dist/widgets.js +2 -83
  196. package/dist/widgets.js.map +1 -1
  197. package/package.json +38 -6
  198. package/dist/const-BLV7Tvte.js +0 -758
  199. package/dist/const-BLV7Tvte.js.map +0 -1
  200. package/dist/download-KroQ0SWg.js +0 -195
  201. package/dist/download-KroQ0SWg.js.map +0 -1
  202. package/dist/echart-CqfROFu3.js +0 -214
  203. package/dist/echart-CqfROFu3.js.map +0 -1
  204. package/dist/formula-ui-ChzvMEOG.js +0 -52
  205. package/dist/formula-ui-ChzvMEOG.js.map +0 -1
  206. package/dist/lasso-tool-BC-rsMMW.js.map +0 -1
  207. package/dist/markdown-n_tOtoiT.js +0 -27
  208. package/dist/markdown-n_tOtoiT.js.map +0 -1
  209. package/dist/markdown-ui-BBrzzd7Y.js +0 -62
  210. package/dist/markdown-ui-BBrzzd7Y.js.map +0 -1
  211. package/dist/note-DF-n70TX.js +0 -101
  212. package/dist/note-DF-n70TX.js.map +0 -1
  213. package/dist/range-ui-CtUX11Xm.js +0 -146
  214. package/dist/range-ui-CtUX11Xm.js.map +0 -1
  215. package/dist/root-L_WZnJY5.js +0 -46
  216. package/dist/root-L_WZnJY5.js.map +0 -1
  217. package/dist/row-DQaSxmDV.js +0 -18
  218. package/dist/row-DQaSxmDV.js.map +0 -1
  219. package/dist/series-CsyEPq-X.js +0 -83
  220. package/dist/series-CsyEPq-X.js.map +0 -1
  221. package/dist/skeleton-BSPcEvfq.js +0 -27
  222. package/dist/skeleton-BSPcEvfq.js.map +0 -1
  223. package/dist/skeleton-C4rOYTy-.js +0 -78
  224. package/dist/skeleton-C4rOYTy-.js.map +0 -1
  225. package/dist/skeleton-C9Jqc241.js +0 -82
  226. package/dist/skeleton-C9Jqc241.js.map +0 -1
  227. package/dist/skeleton-D-zHBBIw.js +0 -64
  228. package/dist/skeleton-D-zHBBIw.js.map +0 -1
  229. package/dist/skeleton-DMP-IwaJ.js +0 -109
  230. package/dist/skeleton-DMP-IwaJ.js.map +0 -1
  231. package/dist/skeleton-DRorqowB.js +0 -22
  232. package/dist/skeleton-DRorqowB.js.map +0 -1
  233. package/dist/skeleton-DsZhv-AH.js +0 -89
  234. package/dist/skeleton-DsZhv-AH.js.map +0 -1
  235. package/dist/skeleton-Dx3FCer0.js +0 -13
  236. package/dist/skeleton-Dx3FCer0.js.map +0 -1
  237. package/dist/skeleton-QVDdb1c2.js +0 -21
  238. package/dist/skeleton-QVDdb1c2.js.map +0 -1
  239. package/dist/skeleton-loader-DWC1-EAx.js +0 -23
  240. package/dist/skeleton-loader-DWC1-EAx.js.map +0 -1
  241. package/dist/spread-ui-BjzH190y.js +0 -82
  242. package/dist/spread-ui-BjzH190y.js.map +0 -1
  243. package/dist/style-BGeCtQkP.js +0 -19
  244. package/dist/style-BGeCtQkP.js.map +0 -1
  245. package/dist/style-C7v1iwqD.js +0 -34
  246. package/dist/style-C7v1iwqD.js.map +0 -1
  247. package/dist/styles-cohnxh9F.js +0 -23
  248. package/dist/styles-cohnxh9F.js.map +0 -1
  249. package/dist/types/widgets/config-loader/index.d.ts +0 -2
  250. package/dist/types/widgets/config-loader/types.d.ts +0 -12
  251. package/dist/types/widgets/config-loader/use-config.d.ts +0 -5
  252. package/dist/types/widgets/widget/const.d.ts +0 -2
  253. package/dist/types/widgets/widget/types.d.ts +0 -47
  254. package/dist/types/widgets/widget/widget.d.ts +0 -2
  255. package/dist/use-config-BYEOiIcu.js +0 -43
  256. package/dist/use-config-BYEOiIcu.js.map +0 -1
  257. package/dist/widget-store-yDO2ul8g.js +0 -44
  258. package/dist/widget-store-yDO2ul8g.js.map +0 -1
  259. package/dist/widgets/config-loader.js +0 -5
  260. package/dist/widgets/config-loader.js.map +0 -1
  261. package/dist/wrapper-57csMybC.js +0 -265
  262. package/dist/wrapper-57csMybC.js.map +0 -1
@@ -0,0 +1,32 @@
1
+ import { TableRow } from '../types';
2
+ export interface UseSelectionOptions {
3
+ /** Initial selected IDs */
4
+ initialSelectedIds?: Set<string | number>;
5
+ /** Callback when selection changes */
6
+ onSelectionChange?: (selectedIds: Set<string | number>) => void;
7
+ }
8
+ export interface UseSelectionResult {
9
+ /** Set of selected row IDs */
10
+ selectedIds: Set<string | number>;
11
+ /** Check if a row is selected */
12
+ isSelected: (id: string | number) => boolean;
13
+ /** Check if all provided rows are selected */
14
+ isAllSelected: (rows: TableRow[]) => boolean;
15
+ /** Check if some but not all rows are selected (for indeterminate state) */
16
+ isIndeterminate: (rows: TableRow[]) => boolean;
17
+ /** Toggle selection of a single row */
18
+ toggleRow: (id: string | number) => void;
19
+ /** Toggle selection of all provided rows */
20
+ toggleAll: (rows: TableRow[]) => void;
21
+ /** Select specific rows */
22
+ selectRows: (ids: (string | number)[]) => void;
23
+ /** Deselect specific rows */
24
+ deselectRows: (ids: (string | number)[]) => void;
25
+ /** Clear all selections */
26
+ clearSelection: () => void;
27
+ }
28
+ /**
29
+ * Hook for managing table row selection
30
+ * Selection persists across pagination and is stored in the widget store
31
+ */
32
+ export declare function useSelection(widgetId: string, options?: UseSelectionOptions): UseSelectionResult;
@@ -0,0 +1,29 @@
1
+ import { TableRow, SortMode, SortDirection, SortState } from '../types';
2
+ export interface UseSortOptions {
3
+ /** Sort mode: local or remote */
4
+ mode: SortMode;
5
+ /** Initial sort column ID */
6
+ initialColumnId?: string | null;
7
+ /** Initial sort direction */
8
+ initialDirection?: SortDirection;
9
+ /** Callback when sort changes (for remote sorting) */
10
+ onSortChange?: (columnId: string, direction: SortDirection) => void;
11
+ }
12
+ export interface UseSortResult<T> {
13
+ /** Current sort state */
14
+ sortState: SortState;
15
+ /** Sorted data (for local mode) */
16
+ sortedData: T[];
17
+ /** Toggle sort on a column */
18
+ toggleSort: (columnId: string) => void;
19
+ /** Set sort state directly */
20
+ setSort: (columnId: string | null, direction: SortDirection) => void;
21
+ /** Clear sort */
22
+ clearSort: () => void;
23
+ }
24
+ /**
25
+ * Hook for managing table sorting
26
+ * Supports both local (client-side) and remote (server-side) sorting
27
+ * State is persisted in the widget store for the given widgetId
28
+ */
29
+ export declare function useSort<T extends TableRow>(widgetId: string, data: T[], options: UseSortOptions): 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, PaginationMode, SortMode, TableWidgetConfig, TableWidgetState, TableDownloadConfig, TableProps, CellHeaderProps, RowProps, PaginationProps, PaginationActionsProps, } from './types';
13
+ export type { UsePaginationOptions, UsePaginationResult, UseSortOptions, 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("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").TableHeadTypeMap<{}, "thead">>;
18
+ var CellHeader: typeof import(".").CellHeader;
19
+ var Body: import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").TableBodyTypeMap<{}, "tbody">>;
20
+ var Row: typeof import(".").Row;
21
+ var Cell: typeof TableCell;
22
+ var Container: typeof TableContainer;
23
+ var Paper: import("@mui/material/OverridableComponent").OverridableComponent<import("@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,201 @@
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 mode
67
+ */
68
+ export type PaginationMode = 'local' | 'remote';
69
+ /**
70
+ * Sort mode
71
+ */
72
+ export type SortMode = 'local' | 'remote';
73
+ /**
74
+ * Table widget configuration
75
+ */
76
+ export interface TableWidgetConfig {
77
+ /** Column definitions */
78
+ columns?: TableColumn[];
79
+ /** Enable row selection with checkboxes */
80
+ selectable?: boolean;
81
+ /** Pagination configuration */
82
+ pagination?: {
83
+ /** Pagination mode: local (client-side) or remote (server-side) */
84
+ mode: PaginationMode;
85
+ /** Available rows per page options */
86
+ rowsPerPageOptions?: number[];
87
+ /** Default rows per page */
88
+ defaultRowsPerPage?: number;
89
+ /** Total rows for remote pagination */
90
+ total?: number;
91
+ };
92
+ /** Sort configuration */
93
+ sort?: {
94
+ /** Sort mode: local (client-side) or remote (server-side) */
95
+ mode: SortMode;
96
+ /** Default sort column */
97
+ defaultColumnId?: string;
98
+ /** Default sort direction */
99
+ defaultDirection?: SortDirection;
100
+ };
101
+ /** Callback when a row is clicked */
102
+ onRowClick?: (row: TableRow) => void;
103
+ /** Callback when hovering over a row (null when leaving table) */
104
+ onRowHover?: (row: TableRow | null) => void;
105
+ /** Callback when selection changes */
106
+ onSelectionChange?: (selectedIds: Set<string | number>) => void;
107
+ /** Callback when page changes (for remote pagination) */
108
+ onPageChange?: (page: number, rowsPerPage: number) => void;
109
+ /** Callback when sort changes (for remote sorting) */
110
+ onSortChange?: (columnId: string, direction: SortDirection) => void;
111
+ }
112
+ /**
113
+ * Table widget state
114
+ */
115
+ export type TableWidgetState = BaseWidgetState<WrapperState<TableWidgetConfig> & {
116
+ data: TableWidgetData;
117
+ paginationState?: TablePaginationState;
118
+ sortState?: SortState;
119
+ selectedIds?: Set<string | number>;
120
+ }>;
121
+ /**
122
+ * Table download configuration
123
+ */
124
+ export type TableDownloadConfig = DownloadItem<TableWidgetData>[];
125
+ /**
126
+ * Props for the base Table component
127
+ */
128
+ export interface TableProps extends MuiTableProps {
129
+ /** Table element ref */
130
+ ref?: Ref<HTMLTableElement>;
131
+ }
132
+ /**
133
+ * Props for CellHeader component
134
+ */
135
+ export interface CellHeaderProps {
136
+ /** Column definition */
137
+ column: TableColumn;
138
+ /** Current sort state */
139
+ sortState?: SortState;
140
+ /** Callback when sort is triggered */
141
+ onSort?: (columnId: string) => void;
142
+ /** Whether this is a select-all checkbox header */
143
+ isSelectAll?: boolean;
144
+ /** Whether all rows are selected */
145
+ isAllSelected?: boolean;
146
+ /** Whether some rows are selected (indeterminate state) */
147
+ isIndeterminate?: boolean;
148
+ /** Callback for select-all toggle */
149
+ onSelectAll?: () => void;
150
+ }
151
+ /**
152
+ * Props for Row component
153
+ */
154
+ export interface RowProps {
155
+ /** Row data */
156
+ row: TableRow;
157
+ /** Column definitions */
158
+ columns: TableColumn[];
159
+ /** Whether row is selected */
160
+ isSelected?: boolean;
161
+ /** Whether selection is enabled */
162
+ selectable?: boolean;
163
+ /** Callback when row is clicked */
164
+ onClick?: (row: TableRow) => void;
165
+ /** Callback when row selection is toggled */
166
+ onSelect?: (row: TableRow) => void;
167
+ /** Callback when mouse enters row */
168
+ onMouseEnter?: (row: TableRow) => void;
169
+ /** Callback when mouse leaves row */
170
+ onMouseLeave?: () => void;
171
+ }
172
+ /**
173
+ * Props for Pagination component
174
+ */
175
+ export interface PaginationProps {
176
+ /** Current page (0-indexed) */
177
+ page: number;
178
+ /** Rows per page */
179
+ rowsPerPage: number;
180
+ /** Total row count */
181
+ total: number;
182
+ /** Available rows per page options */
183
+ rowsPerPageOptions?: number[];
184
+ /** Callback when page changes */
185
+ onPageChange: (page: number) => void;
186
+ /** Callback when rows per page changes */
187
+ onRowsPerPageChange: (rowsPerPage: number) => void;
188
+ }
189
+ /**
190
+ * Props for PaginationActions component
191
+ */
192
+ export interface PaginationActionsProps {
193
+ /** Current page (0-indexed) */
194
+ page: number;
195
+ /** Total row count */
196
+ count: number;
197
+ /** Rows per page */
198
+ rowsPerPage: number;
199
+ /** Callback when page changes */
200
+ onPageChange: (event: React.MouseEvent<HTMLButtonElement> | null, newPage: number) => void;
201
+ }
@@ -1,4 +1,5 @@
1
- import { TimeseriesConfig } from './types';
2
- export declare const timeseriesConfig: (config: TimeseriesConfig & {
3
- refUI?: import('react').Ref<HTMLElement | null>;
4
- }) => import('../_shared/chart-config/config-factory').ChartWidgetConfigResult<import('../echart').EchartWidgetData, TimeseriesConfig, "timeseries">;
1
+ import { TimeseriesConfig, TimeseriesWidgetConfig, TimeseriesWidgetData } from './types';
2
+ import { DownloadItem } from '../actions';
3
+ import { ConfigProps } from '../root/types';
4
+ export declare function timeseriesDownloadConfig({ refUI, }: ConfigProps): DownloadItem<TimeseriesWidgetData>[];
5
+ export declare function timeseriesConfig(props: TimeseriesConfig): TimeseriesWidgetConfig;
@@ -1,3 +1,3 @@
1
- export type { TimeseriesProps, TimeseriesWidgetData, TimeseriesWidgetState, TimeseriesWidgetConfig, TimeseriesConfig, } from './types';
2
- export { timeseriesConfig } from './config';
1
+ export type { TimeseriesWidgetData, TimeseriesWidgetState, TimeseriesWidgetConfig, TimeseriesConfig, } from './types';
2
+ export { timeseriesConfig, timeseriesDownloadConfig } from './config';
3
3
  export { TimeseriesSkeleton } from './skeleton';
@@ -1,15 +1,9 @@
1
- import { BaseWidgetProps } from '../widget/types';
2
- import { BaseConfig } from '../config-loader';
3
- import { EchartWidgetConfig, EchartWidgetData, EchartWidgetState } from '../echart';
4
- export interface TimeseriesProps extends Omit<BaseWidgetProps<TimeseriesWidgetConfig>, 'data'> {
5
- type: 'timeseries';
6
- data: TimeseriesWidgetData | undefined;
7
- }
1
+ import { EchartWidgetData, EchartWidgetState } from '../echart';
2
+ import { EchartWidgetOptionProps, EchartWidgetProps } from '../echart/types';
3
+ import { ConfigProps } from '../root';
8
4
  export type TimeseriesWidgetData = EchartWidgetData;
9
5
  export type TimeseriesWidgetState = EchartWidgetState;
10
- export type TimeseriesWidgetConfig = TimeseriesConfig & EchartWidgetConfig<TimeseriesWidgetData> & {
11
- type: TimeseriesProps['type'];
6
+ export type TimeseriesWidgetConfig = EchartWidgetProps & {
7
+ type: 'timeseries';
12
8
  };
13
- export interface TimeseriesConfig extends Omit<BaseConfig, 'data'> {
14
- data?: TimeseriesWidgetData;
15
- }
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
+ }
@@ -1,6 +1,6 @@
1
1
  export { Actions } from './components/actions';
2
2
  export { Options } from './components/options';
3
3
  export { Title } from './components/title';
4
- export { WrapperWidget } from './wrapper';
4
+ export { WidgetWrapper } from './wrapper';
5
5
  export { WrapperUI } from './wrapper-ui';
6
- export type { WrapperProps, WrapperUIProps, WrapperState } from './types';
6
+ export type { WrapperActionsProps, WrapperOption, WrapperOptionsProps, WrapperProps, WrapperState, WrapperUIProps, } from './types';
@@ -80,4 +80,10 @@ export declare const styles: {
80
80
  pointerEvents: "auto";
81
81
  };
82
82
  };
83
+ detail: {
84
+ display: "flex";
85
+ flexDirection: "column";
86
+ gap: ({ spacing }: Theme) => string;
87
+ paddingTop: ({ spacing }: Theme) => string;
88
+ };
83
89
  };
@@ -1,17 +1,19 @@
1
1
  import { ReactNode, SyntheticEvent } from 'react';
2
2
  import { SxProps, Theme } from '@mui/material';
3
3
  import { BaseWidgetState } from '../stores/types';
4
- export interface WrapperProps extends Pick<WrapperUIProps, 'sx' | 'actions' | 'options' | 'labels' | 'children' | 'onChangeCollapsed'> {
4
+ export interface WrapperProps extends Pick<WrapperUIProps, 'sx' | 'actions' | 'options' | 'labels' | 'children' | 'onChangeCollapsed'>, Pick<WrapperState, 'disabled' | 'title'> {
5
5
  id: WrapperState['id'];
6
- Component?: ReactNode;
6
+ defaultCollapsed?: boolean;
7
7
  }
8
- export type WrapperState<T = unknown> = BaseWidgetState<T & Pick<WrapperUIProps, 'collapsed' | 'disabled' | 'title'>>;
9
- export interface WrapperUIProps extends WrapperActionsProps, Omit<WrapperOptionsProps, 'labels' | ''> {
10
- children: ReactNode;
8
+ export type WrapperState<T = unknown> = BaseWidgetState<T & {
11
9
  title: string;
12
10
  disabled?: boolean;
13
11
  collapsed?: boolean;
14
12
  isLoading?: boolean;
13
+ }>;
14
+ export interface WrapperUIProps extends WrapperActionsProps, Omit<WrapperOptionsProps, 'labels' | ''> {
15
+ id: WrapperState['id'];
16
+ children: ReactNode;
15
17
  sx?: SxProps<Theme>;
16
18
  labels?: {
17
19
  options?: WrapperOptionsProps['labels'];
@@ -1,2 +1,2 @@
1
1
  import { WrapperUIProps } from './types';
2
- export declare function WrapperUI({ children, title, actions, disabled, isLoading, collapsed, sx, labels, options, onChangeCollapsed, }: WrapperUIProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function WrapperUI({ children, id, actions, sx, labels, options, onChangeCollapsed, }: WrapperUIProps): import("react/jsx-runtime").JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { WrapperProps } from './types';
2
- export declare function WrapperWidget({ id, sx, actions, options, labels, Component, children, onChangeCollapsed, }: WrapperProps): 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;
2
+ export declare function WidgetWrapper({ id, title, defaultCollapsed, disabled, sx, actions, options, labels, children, onChangeCollapsed, }: WrapperProps): import("react/jsx-runtime").JSX.Element;