@perses-dev/components 0.0.0-snapshot-scatterplot-fix-imports-95e1b59 → 0.0.0-snapshot-histogram-types-78c5104

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 (523) hide show
  1. package/dist/AlignSelector/AlignSelector.d.ts +9 -0
  2. package/dist/AlignSelector/AlignSelector.d.ts.map +1 -0
  3. package/dist/AlignSelector/AlignSelector.js +42 -0
  4. package/dist/AlignSelector/AlignSelector.js.map +1 -0
  5. package/dist/AlignSelector/index.d.ts +2 -0
  6. package/dist/AlignSelector/index.d.ts.map +1 -0
  7. package/dist/AlignSelector/index.js +15 -0
  8. package/dist/AlignSelector/index.js.map +1 -0
  9. package/dist/BarChart/BarChart.d.ts +2 -1
  10. package/dist/BarChart/BarChart.d.ts.map +1 -1
  11. package/dist/BarChart/BarChart.js +11 -6
  12. package/dist/BarChart/BarChart.js.map +1 -1
  13. package/dist/ColorPicker/ColorPicker.d.ts +3 -1
  14. package/dist/ColorPicker/ColorPicker.d.ts.map +1 -1
  15. package/dist/ColorPicker/ColorPicker.js +28 -13
  16. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  17. package/dist/ColorPicker/OptionsColorPicker.d.ts +9 -0
  18. package/dist/ColorPicker/OptionsColorPicker.d.ts.map +1 -0
  19. package/dist/{ThresholdsEditor/ThresholdColorPicker.js → ColorPicker/OptionsColorPicker.js} +16 -13
  20. package/dist/ColorPicker/OptionsColorPicker.js.map +1 -0
  21. package/dist/ColorPicker/index.d.ts +1 -0
  22. package/dist/ColorPicker/index.d.ts.map +1 -1
  23. package/dist/ColorPicker/index.js +1 -0
  24. package/dist/ColorPicker/index.js.map +1 -1
  25. package/dist/ContentWithLegend/ContentWithLegend.d.ts +2 -1
  26. package/dist/ContentWithLegend/ContentWithLegend.d.ts.map +1 -1
  27. package/dist/ContentWithLegend/ContentWithLegend.js +8 -5
  28. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  29. package/dist/ContentWithLegend/model/content-with-legend-model.js +2 -3
  30. package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
  31. package/dist/DensitySelector/DensitySelector.d.ts +8 -0
  32. package/dist/DensitySelector/DensitySelector.d.ts.map +1 -0
  33. package/dist/DensitySelector/DensitySelector.js +46 -0
  34. package/dist/DensitySelector/DensitySelector.js.map +1 -0
  35. package/dist/DensitySelector/index.d.ts +2 -0
  36. package/dist/DensitySelector/index.d.ts.map +1 -0
  37. package/dist/DensitySelector/index.js +15 -0
  38. package/dist/DensitySelector/index.js.map +1 -0
  39. package/dist/Dialog/Dialog.d.ts +9 -14
  40. package/dist/Dialog/Dialog.d.ts.map +1 -1
  41. package/dist/Dialog/Dialog.js +7 -3
  42. package/dist/Dialog/Dialog.js.map +1 -1
  43. package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts +2 -1
  44. package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
  45. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  46. package/dist/DragAndDrop/DragAndDropList.d.ts +24 -0
  47. package/dist/DragAndDrop/DragAndDropList.d.ts.map +1 -0
  48. package/dist/DragAndDrop/DragAndDropList.js +153 -0
  49. package/dist/DragAndDrop/DragAndDropList.js.map +1 -0
  50. package/dist/DragAndDrop/DragButton.d.ts +13 -0
  51. package/dist/DragAndDrop/DragButton.d.ts.map +1 -0
  52. package/dist/DragAndDrop/DragButton.js +99 -0
  53. package/dist/DragAndDrop/DragButton.js.map +1 -0
  54. package/dist/DragAndDrop/DropIndicator.d.ts +3 -0
  55. package/dist/DragAndDrop/DropIndicator.d.ts.map +1 -0
  56. package/dist/DragAndDrop/DropIndicator.js +44 -0
  57. package/dist/DragAndDrop/DropIndicator.js.map +1 -0
  58. package/dist/DragAndDrop/index.d.ts +4 -0
  59. package/dist/DragAndDrop/index.d.ts.map +1 -0
  60. package/dist/DragAndDrop/index.js +17 -0
  61. package/dist/DragAndDrop/index.js.map +1 -0
  62. package/dist/DragAndDrop/model.d.ts +11 -0
  63. package/dist/DragAndDrop/model.d.ts.map +1 -0
  64. package/dist/DragAndDrop/model.js +17 -0
  65. package/dist/DragAndDrop/model.js.map +1 -0
  66. package/dist/Drawer/Drawer.d.ts +2 -1
  67. package/dist/Drawer/Drawer.d.ts.map +1 -1
  68. package/dist/Drawer/Drawer.js +1 -1
  69. package/dist/Drawer/Drawer.js.map +1 -1
  70. package/dist/EChart/EChart.d.ts +3 -2
  71. package/dist/EChart/EChart.d.ts.map +1 -1
  72. package/dist/EChart/EChart.js +26 -9
  73. package/dist/EChart/EChart.js.map +1 -1
  74. package/dist/ErrorAlert.d.ts +2 -1
  75. package/dist/ErrorAlert.d.ts.map +1 -1
  76. package/dist/ErrorAlert.js.map +1 -1
  77. package/dist/FontSizeSelector/FontSizeSelector.d.ts +2 -1
  78. package/dist/FontSizeSelector/FontSizeSelector.d.ts.map +1 -1
  79. package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
  80. package/dist/FormEditor/FormActions.d.ts +16 -0
  81. package/dist/FormEditor/FormActions.d.ts.map +1 -0
  82. package/dist/FormEditor/FormActions.js +75 -0
  83. package/dist/FormEditor/FormActions.js.map +1 -0
  84. package/dist/FormEditor/index.d.ts +2 -0
  85. package/dist/FormEditor/index.d.ts.map +1 -0
  86. package/dist/FormEditor/index.js +15 -0
  87. package/dist/FormEditor/index.js.map +1 -0
  88. package/dist/FormatControls/FormatControls.d.ts +2 -1
  89. package/dist/FormatControls/FormatControls.d.ts.map +1 -1
  90. package/dist/FormatControls/FormatControls.js +2 -2
  91. package/dist/FormatControls/FormatControls.js.map +1 -1
  92. package/dist/GaugeChart/GaugeChart.d.ts +2 -1
  93. package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
  94. package/dist/GaugeChart/GaugeChart.js +4 -7
  95. package/dist/GaugeChart/GaugeChart.js.map +1 -1
  96. package/dist/InfoTooltip/InfoTooltip.d.ts +3 -3
  97. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
  98. package/dist/InfoTooltip/InfoTooltip.js +5 -5
  99. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  100. package/dist/JSONEditor.d.ts +2 -1
  101. package/dist/JSONEditor.d.ts.map +1 -1
  102. package/dist/JSONEditor.js +5 -6
  103. package/dist/JSONEditor.js.map +1 -1
  104. package/dist/Legend/CompactLegend.d.ts +2 -1
  105. package/dist/Legend/CompactLegend.d.ts.map +1 -1
  106. package/dist/Legend/CompactLegend.js.map +1 -1
  107. package/dist/Legend/Legend.d.ts +2 -1
  108. package/dist/Legend/Legend.d.ts.map +1 -1
  109. package/dist/Legend/Legend.js +8 -4
  110. package/dist/Legend/Legend.js.map +1 -1
  111. package/dist/Legend/LegendColorBadge.d.ts +2 -2
  112. package/dist/Legend/LegendColorBadge.d.ts.map +1 -1
  113. package/dist/Legend/LegendColorBadge.js +2 -2
  114. package/dist/Legend/LegendColorBadge.js.map +1 -1
  115. package/dist/Legend/ListLegend.d.ts +2 -1
  116. package/dist/Legend/ListLegend.d.ts.map +1 -1
  117. package/dist/Legend/ListLegend.js.map +1 -1
  118. package/dist/Legend/ListLegendItem.d.ts +5 -5
  119. package/dist/Legend/ListLegendItem.d.ts.map +1 -1
  120. package/dist/Legend/ListLegendItem.js +8 -12
  121. package/dist/Legend/ListLegendItem.js.map +1 -1
  122. package/dist/Legend/TableLegend.d.ts +2 -1
  123. package/dist/Legend/TableLegend.d.ts.map +1 -1
  124. package/dist/Legend/TableLegend.js +1 -0
  125. package/dist/Legend/TableLegend.js.map +1 -1
  126. package/dist/Legend/legend-model.d.ts.map +1 -1
  127. package/dist/Legend/legend-model.js.map +1 -1
  128. package/dist/LineChart/LineChart.d.ts +1 -1
  129. package/dist/LineChart/LineChart.d.ts.map +1 -1
  130. package/dist/LineChart/LineChart.js +6 -11
  131. package/dist/LineChart/LineChart.js.map +1 -1
  132. package/dist/LinksEditor/LinksEditor.d.ts +8 -0
  133. package/dist/LinksEditor/LinksEditor.d.ts.map +1 -0
  134. package/dist/LinksEditor/LinksEditor.js +161 -0
  135. package/dist/LinksEditor/LinksEditor.js.map +1 -0
  136. package/dist/LinksEditor/index.d.ts +2 -0
  137. package/dist/LinksEditor/index.d.ts.map +1 -0
  138. package/dist/LinksEditor/index.js +15 -0
  139. package/dist/LinksEditor/index.js.map +1 -0
  140. package/dist/ModeSelector/ModeSelector.d.ts +2 -1
  141. package/dist/ModeSelector/ModeSelector.d.ts.map +1 -1
  142. package/dist/ModeSelector/ModeSelector.js.map +1 -1
  143. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +2 -2
  144. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -1
  145. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  146. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +2 -1
  147. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
  148. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  149. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +2 -2
  150. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -1
  151. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  152. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +2 -2
  153. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
  154. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  155. package/dist/Overlay/Overlay.d.ts +16 -0
  156. package/dist/Overlay/Overlay.d.ts.map +1 -0
  157. package/dist/Overlay/Overlay.js +52 -0
  158. package/dist/Overlay/Overlay.js.map +1 -0
  159. package/dist/Overlay/index.d.ts +2 -0
  160. package/dist/Overlay/index.d.ts.map +1 -0
  161. package/dist/Overlay/index.js +15 -0
  162. package/dist/Overlay/index.js.map +1 -0
  163. package/dist/PieChart/PieChart.d.ts +14 -0
  164. package/dist/PieChart/PieChart.d.ts.map +1 -0
  165. package/dist/PieChart/PieChart.js +92 -0
  166. package/dist/PieChart/PieChart.js.map +1 -0
  167. package/dist/PieChart/index.d.ts +2 -0
  168. package/dist/PieChart/index.d.ts.map +1 -0
  169. package/dist/PieChart/index.js +15 -0
  170. package/dist/PieChart/index.js.map +1 -0
  171. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts +2 -1
  172. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
  173. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  174. package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts +2 -2
  175. package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts.map +1 -1
  176. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +6 -5
  177. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  178. package/dist/SortSelector/SortSelector.d.ts +2 -1
  179. package/dist/SortSelector/SortSelector.d.ts.map +1 -1
  180. package/dist/SortSelector/SortSelector.js.map +1 -1
  181. package/dist/SortSelector/SortSelectorButtons.d.ts +9 -0
  182. package/dist/SortSelector/SortSelectorButtons.d.ts.map +1 -0
  183. package/dist/SortSelector/SortSelectorButtons.js +42 -0
  184. package/dist/SortSelector/SortSelectorButtons.js.map +1 -0
  185. package/dist/SortSelector/index.d.ts +1 -0
  186. package/dist/SortSelector/index.d.ts.map +1 -1
  187. package/dist/SortSelector/index.js +2 -1
  188. package/dist/SortSelector/index.js.map +1 -1
  189. package/dist/StatChart/StatChart.d.ts +6 -5
  190. package/dist/StatChart/StatChart.d.ts.map +1 -1
  191. package/dist/StatChart/StatChart.js +16 -18
  192. package/dist/StatChart/StatChart.js.map +1 -1
  193. package/dist/StatChart/calculateFontSize.d.ts.map +1 -1
  194. package/dist/StatChart/calculateFontSize.js +2 -4
  195. package/dist/StatChart/calculateFontSize.js.map +1 -1
  196. package/dist/StatChart/utils/formatStatChartValue.d.ts +3 -0
  197. package/dist/StatChart/utils/formatStatChartValue.d.ts.map +1 -0
  198. package/dist/StatChart/utils/formatStatChartValue.js +26 -0
  199. package/dist/StatChart/utils/formatStatChartValue.js.map +1 -0
  200. package/dist/StatusHistoryChart/StatusHistoryChart.d.ts +27 -0
  201. package/dist/StatusHistoryChart/StatusHistoryChart.d.ts.map +1 -0
  202. package/dist/StatusHistoryChart/StatusHistoryChart.js +132 -0
  203. package/dist/StatusHistoryChart/StatusHistoryChart.js.map +1 -0
  204. package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts +13 -0
  205. package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts.map +1 -0
  206. package/dist/StatusHistoryChart/StatusHistoryTooltip.js +47 -0
  207. package/dist/StatusHistoryChart/StatusHistoryTooltip.js.map +1 -0
  208. package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts +2 -0
  209. package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts.map +1 -0
  210. package/dist/StatusHistoryChart/get-formatted-axis-label.js +41 -0
  211. package/dist/StatusHistoryChart/get-formatted-axis-label.js.map +1 -0
  212. package/dist/StatusHistoryChart/index.d.ts +3 -0
  213. package/dist/StatusHistoryChart/index.d.ts.map +1 -0
  214. package/dist/StatusHistoryChart/index.js +16 -0
  215. package/dist/StatusHistoryChart/index.js.map +1 -0
  216. package/dist/StatusHistoryChart/utils/get-color.d.ts +6 -0
  217. package/dist/StatusHistoryChart/utils/get-color.d.ts.map +1 -0
  218. package/dist/StatusHistoryChart/utils/get-color.js +100 -0
  219. package/dist/StatusHistoryChart/utils/get-color.js.map +1 -0
  220. package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts +3 -0
  221. package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts.map +1 -0
  222. package/dist/StatusHistoryChart/utils/get-tooltip-position.js +27 -0
  223. package/dist/StatusHistoryChart/utils/get-tooltip-position.js.map +1 -0
  224. package/dist/Table/InnerTable.d.ts.map +1 -1
  225. package/dist/Table/InnerTable.js +2 -1
  226. package/dist/Table/InnerTable.js.map +1 -1
  227. package/dist/Table/Table.d.ts +2 -1
  228. package/dist/Table/Table.d.ts.map +1 -1
  229. package/dist/Table/Table.js +23 -10
  230. package/dist/Table/Table.js.map +1 -1
  231. package/dist/Table/TableCell.d.ts +5 -2
  232. package/dist/Table/TableCell.d.ts.map +1 -1
  233. package/dist/Table/TableCell.js +31 -7
  234. package/dist/Table/TableCell.js.map +1 -1
  235. package/dist/Table/TableCheckbox.d.ts +2 -1
  236. package/dist/Table/TableCheckbox.d.ts.map +1 -1
  237. package/dist/Table/TableCheckbox.js.map +1 -1
  238. package/dist/Table/TableFoot.d.ts +4 -0
  239. package/dist/Table/TableFoot.d.ts.map +1 -0
  240. package/dist/Table/TableFoot.js +23 -0
  241. package/dist/Table/TableFoot.js.map +1 -0
  242. package/dist/Table/TableHeaderCell.d.ts +3 -2
  243. package/dist/Table/TableHeaderCell.d.ts.map +1 -1
  244. package/dist/Table/TableHeaderCell.js.map +1 -1
  245. package/dist/Table/VirtualizedTable.d.ts +6 -4
  246. package/dist/Table/VirtualizedTable.d.ts.map +1 -1
  247. package/dist/Table/VirtualizedTable.js +49 -15
  248. package/dist/Table/VirtualizedTable.js.map +1 -1
  249. package/dist/Table/hooks/useTableKeyboardNav.d.ts +2 -2
  250. package/dist/Table/hooks/useTableKeyboardNav.d.ts.map +1 -1
  251. package/dist/Table/hooks/useTableKeyboardNav.js +1 -1
  252. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  253. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts +10 -12
  254. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.map +1 -1
  255. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +7 -13
  256. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  257. package/dist/Table/index.d.ts +1 -2
  258. package/dist/Table/index.d.ts.map +1 -1
  259. package/dist/Table/index.js +1 -1
  260. package/dist/Table/index.js.map +1 -1
  261. package/dist/Table/model/table-model.d.ts +40 -4
  262. package/dist/Table/model/table-model.d.ts.map +1 -1
  263. package/dist/Table/model/table-model.js +31 -23
  264. package/dist/Table/model/table-model.js.map +1 -1
  265. package/dist/ThresholdsEditor/ThresholdInput.d.ts +2 -2
  266. package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -1
  267. package/dist/ThresholdsEditor/ThresholdInput.js +2 -2
  268. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  269. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +2 -1
  270. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
  271. package/dist/ThresholdsEditor/ThresholdsEditor.js +19 -27
  272. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  273. package/dist/TimeChart/TimeChart.d.ts.map +1 -1
  274. package/dist/TimeChart/TimeChart.js +9 -12
  275. package/dist/TimeChart/TimeChart.js.map +1 -1
  276. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts +19 -0
  277. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -0
  278. package/dist/{DateTimeRangePicker/AbsoluteTimePicker.js → TimeRangeSelector/DateTimeRangePicker.js} +44 -29
  279. package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -0
  280. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +36 -0
  281. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -0
  282. package/dist/TimeRangeSelector/TimeRangeSelector.js +119 -0
  283. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -0
  284. package/dist/{DateTimeRangePicker → TimeRangeSelector}/index.d.ts +1 -2
  285. package/dist/TimeRangeSelector/index.d.ts.map +1 -0
  286. package/dist/{DateTimeRangePicker → TimeRangeSelector}/index.js +2 -3
  287. package/dist/TimeRangeSelector/index.js.map +1 -0
  288. package/dist/TimeRangeSelector/utils.d.ts +25 -0
  289. package/dist/TimeRangeSelector/utils.d.ts.map +1 -0
  290. package/dist/{DateTimeRangePicker → TimeRangeSelector}/utils.js +23 -2
  291. package/dist/TimeRangeSelector/utils.js.map +1 -0
  292. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +2 -2
  293. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
  294. package/dist/TimeSeriesTooltip/LineChartTooltip.js +6 -14
  295. package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
  296. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts +2 -1
  297. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
  298. package/dist/TimeSeriesTooltip/SeriesInfo.js +1 -2
  299. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  300. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +2 -1
  301. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -1
  302. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  303. package/dist/TimeSeriesTooltip/SeriesMarker.d.ts +2 -1
  304. package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -1
  305. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  306. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +2 -2
  307. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
  308. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +2 -6
  309. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  310. package/dist/TimeSeriesTooltip/TooltipContent.d.ts +2 -1
  311. package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -1
  312. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  313. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
  314. package/dist/TimeSeriesTooltip/TooltipHeader.js +6 -14
  315. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  316. package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
  317. package/dist/TimeSeriesTooltip/nearby-series.js +15 -25
  318. package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
  319. package/dist/TimeSeriesTooltip/tooltip-model.d.ts +8 -1
  320. package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
  321. package/dist/TimeSeriesTooltip/tooltip-model.js +13 -2
  322. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  323. package/dist/TimeSeriesTooltip/utils.d.ts +2 -22
  324. package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
  325. package/dist/TimeSeriesTooltip/utils.js +29 -27
  326. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  327. package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
  328. package/dist/TransformsEditor/TransformEditor.d.ts +9 -0
  329. package/dist/TransformsEditor/TransformEditor.d.ts.map +1 -0
  330. package/dist/TransformsEditor/TransformEditor.js +289 -0
  331. package/dist/TransformsEditor/TransformEditor.js.map +1 -0
  332. package/dist/TransformsEditor/TransformEditorContainer.d.ts +10 -0
  333. package/dist/TransformsEditor/TransformEditorContainer.d.ts.map +1 -0
  334. package/dist/TransformsEditor/TransformEditorContainer.js +118 -0
  335. package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -0
  336. package/dist/TransformsEditor/TransformsEditor.d.ts +9 -0
  337. package/dist/TransformsEditor/TransformsEditor.d.ts.map +1 -0
  338. package/dist/TransformsEditor/TransformsEditor.js +90 -0
  339. package/dist/TransformsEditor/TransformsEditor.js.map +1 -0
  340. package/dist/TransformsEditor/index.d.ts +2 -0
  341. package/dist/TransformsEditor/index.d.ts.map +1 -0
  342. package/dist/TransformsEditor/index.js +15 -0
  343. package/dist/TransformsEditor/index.js.map +1 -0
  344. package/dist/ValueMappingEditor/ValueMappingEditor.d.ts +10 -0
  345. package/dist/ValueMappingEditor/ValueMappingEditor.d.ts.map +1 -0
  346. package/dist/ValueMappingEditor/ValueMappingEditor.js +374 -0
  347. package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -0
  348. package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts +8 -0
  349. package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts.map +1 -0
  350. package/dist/ValueMappingEditor/ValueMappingsEditor.js +118 -0
  351. package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -0
  352. package/dist/ValueMappingEditor/index.d.ts +2 -0
  353. package/dist/ValueMappingEditor/index.d.ts.map +1 -0
  354. package/dist/ValueMappingEditor/index.js +15 -0
  355. package/dist/ValueMappingEditor/index.js.map +1 -0
  356. package/dist/YAxisLabel.d.ts +2 -1
  357. package/dist/YAxisLabel.d.ts.map +1 -1
  358. package/dist/YAxisLabel.js +4 -2
  359. package/dist/YAxisLabel.js.map +1 -1
  360. package/dist/cjs/AlignSelector/AlignSelector.js +50 -0
  361. package/dist/cjs/AlignSelector/index.js +30 -0
  362. package/dist/cjs/BarChart/BarChart.js +12 -7
  363. package/dist/cjs/ColorPicker/ColorPicker.js +28 -54
  364. package/dist/cjs/{ThresholdsEditor/ThresholdColorPicker.js → ColorPicker/OptionsColorPicker.js} +18 -15
  365. package/dist/cjs/ColorPicker/index.js +1 -0
  366. package/dist/cjs/ContentWithLegend/ContentWithLegend.js +8 -10
  367. package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +2 -3
  368. package/dist/cjs/DensitySelector/DensitySelector.js +54 -0
  369. package/dist/cjs/DensitySelector/index.js +30 -0
  370. package/dist/cjs/Dialog/Dialog.js +7 -3
  371. package/dist/cjs/DragAndDrop/DragAndDropList.js +159 -0
  372. package/dist/cjs/DragAndDrop/DragButton.js +123 -0
  373. package/dist/cjs/DragAndDrop/DropIndicator.js +52 -0
  374. package/dist/cjs/DragAndDrop/index.js +32 -0
  375. package/dist/cjs/DragAndDrop/model.js +25 -0
  376. package/dist/cjs/Drawer/Drawer.js +1 -1
  377. package/dist/cjs/EChart/EChart.js +25 -49
  378. package/dist/cjs/FormEditor/FormActions.js +83 -0
  379. package/dist/cjs/FormEditor/index.js +30 -0
  380. package/dist/cjs/FormatControls/FormatControls.js +2 -2
  381. package/dist/cjs/GaugeChart/GaugeChart.js +5 -8
  382. package/dist/cjs/InfoTooltip/InfoTooltip.js +5 -10
  383. package/dist/cjs/JSONEditor.js +4 -5
  384. package/dist/cjs/Legend/Legend.js +8 -4
  385. package/dist/cjs/Legend/LegendColorBadge.js +2 -7
  386. package/dist/cjs/Legend/ListLegendItem.js +6 -50
  387. package/dist/cjs/Legend/TableLegend.js +1 -0
  388. package/dist/cjs/LineChart/LineChart.js +8 -13
  389. package/dist/cjs/LinksEditor/LinksEditor.js +174 -0
  390. package/dist/cjs/LinksEditor/index.js +30 -0
  391. package/dist/cjs/Overlay/Overlay.js +71 -0
  392. package/dist/cjs/Overlay/index.js +30 -0
  393. package/dist/cjs/PieChart/PieChart.js +100 -0
  394. package/dist/cjs/PieChart/index.js +30 -0
  395. package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +6 -5
  396. package/dist/cjs/SortSelector/SortSelectorButtons.js +50 -0
  397. package/dist/cjs/SortSelector/index.js +2 -1
  398. package/dist/cjs/StatChart/StatChart.js +19 -21
  399. package/dist/cjs/StatChart/calculateFontSize.js +2 -4
  400. package/dist/cjs/StatChart/utils/formatStatChartValue.js +34 -0
  401. package/dist/cjs/StatusHistoryChart/StatusHistoryChart.js +140 -0
  402. package/dist/cjs/StatusHistoryChart/StatusHistoryTooltip.js +55 -0
  403. package/dist/cjs/StatusHistoryChart/get-formatted-axis-label.js +48 -0
  404. package/dist/cjs/StatusHistoryChart/index.js +31 -0
  405. package/dist/cjs/StatusHistoryChart/utils/get-color.js +125 -0
  406. package/dist/cjs/StatusHistoryChart/utils/get-tooltip-position.js +35 -0
  407. package/dist/cjs/Table/InnerTable.js +2 -1
  408. package/dist/cjs/Table/Table.js +21 -8
  409. package/dist/cjs/Table/TableCell.js +31 -7
  410. package/dist/cjs/Table/TableFoot.js +31 -0
  411. package/dist/cjs/Table/VirtualizedTable.js +48 -14
  412. package/dist/cjs/Table/hooks/useTableKeyboardNav.js +1 -1
  413. package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +7 -13
  414. package/dist/cjs/Table/index.js +1 -7
  415. package/dist/cjs/Table/model/table-model.js +37 -23
  416. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +2 -2
  417. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +27 -35
  418. package/dist/cjs/TimeChart/TimeChart.js +8 -11
  419. package/dist/cjs/{DateTimeRangePicker/AbsoluteTimePicker.js → TimeRangeSelector/DateTimeRangePicker.js} +39 -32
  420. package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +127 -0
  421. package/dist/cjs/{DateTimeRangePicker → TimeRangeSelector}/index.js +2 -3
  422. package/dist/cjs/{DateTimeRangePicker → TimeRangeSelector}/utils.js +24 -1
  423. package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +5 -13
  424. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +1 -2
  425. package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +1 -5
  426. package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +6 -14
  427. package/dist/cjs/TimeSeriesTooltip/nearby-series.js +15 -25
  428. package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +22 -2
  429. package/dist/cjs/TimeSeriesTooltip/utils.js +28 -26
  430. package/dist/cjs/TransformsEditor/TransformEditor.js +297 -0
  431. package/dist/cjs/TransformsEditor/TransformEditorContainer.js +131 -0
  432. package/dist/cjs/TransformsEditor/TransformsEditor.js +103 -0
  433. package/dist/cjs/TransformsEditor/index.js +30 -0
  434. package/dist/cjs/ValueMappingEditor/ValueMappingEditor.js +387 -0
  435. package/dist/cjs/ValueMappingEditor/ValueMappingsEditor.js +131 -0
  436. package/dist/cjs/ValueMappingEditor/index.js +30 -0
  437. package/dist/cjs/YAxisLabel.js +4 -2
  438. package/dist/cjs/context/TimeZoneProvider.js +1 -1
  439. package/dist/cjs/controls/TextField.js +54 -0
  440. package/dist/cjs/controls/index.js +30 -0
  441. package/dist/cjs/index.js +12 -1
  442. package/dist/cjs/model/timeOption.js +19 -1
  443. package/dist/cjs/theme/index.js +1 -0
  444. package/dist/cjs/theme/palette/background.js +2 -0
  445. package/dist/cjs/theme/theme.js +6 -6
  446. package/dist/cjs/utils/chart-actions.js +2 -3
  447. package/dist/cjs/utils/format.js +19 -1
  448. package/dist/cjs/utils/theme-gen.js +5 -7
  449. package/dist/context/ChartsProvider.d.ts +2 -2
  450. package/dist/context/ChartsProvider.d.ts.map +1 -1
  451. package/dist/context/ChartsProvider.js.map +1 -1
  452. package/dist/context/SnackbarProvider.js.map +1 -1
  453. package/dist/context/TimeZoneProvider.d.ts +4 -4
  454. package/dist/context/TimeZoneProvider.d.ts.map +1 -1
  455. package/dist/context/TimeZoneProvider.js +1 -1
  456. package/dist/context/TimeZoneProvider.js.map +1 -1
  457. package/dist/controls/TextField.d.ts +9 -0
  458. package/dist/controls/TextField.d.ts.map +1 -0
  459. package/dist/controls/TextField.js +41 -0
  460. package/dist/controls/TextField.js.map +1 -0
  461. package/dist/controls/index.d.ts +2 -0
  462. package/dist/controls/index.d.ts.map +1 -0
  463. package/dist/controls/index.js +15 -0
  464. package/dist/controls/index.js.map +1 -0
  465. package/dist/index.d.ts +12 -1
  466. package/dist/index.d.ts.map +1 -1
  467. package/dist/index.js +12 -1
  468. package/dist/index.js.map +1 -1
  469. package/dist/model/timeOption.d.ts +2 -1
  470. package/dist/model/timeOption.d.ts.map +1 -1
  471. package/dist/model/timeOption.js +13 -2
  472. package/dist/model/timeOption.js.map +1 -1
  473. package/dist/test/render.d.ts +3 -3
  474. package/dist/test/render.d.ts.map +1 -1
  475. package/dist/test/render.js.map +1 -1
  476. package/dist/theme/component-overrides/alert.js.map +1 -1
  477. package/dist/theme/index.d.ts +2 -0
  478. package/dist/theme/index.d.ts.map +1 -1
  479. package/dist/theme/index.js +1 -0
  480. package/dist/theme/index.js.map +1 -1
  481. package/dist/theme/palette/background.d.ts.map +1 -1
  482. package/dist/theme/palette/background.js +2 -0
  483. package/dist/theme/palette/background.js.map +1 -1
  484. package/dist/theme/theme.d.ts +2 -2
  485. package/dist/theme/theme.d.ts.map +1 -1
  486. package/dist/theme/theme.js +5 -5
  487. package/dist/theme/theme.js.map +1 -1
  488. package/dist/utils/axis.d.ts +1 -7
  489. package/dist/utils/axis.d.ts.map +1 -1
  490. package/dist/utils/axis.js.map +1 -1
  491. package/dist/utils/chart-actions.d.ts.map +1 -1
  492. package/dist/utils/chart-actions.js +2 -3
  493. package/dist/utils/chart-actions.js.map +1 -1
  494. package/dist/utils/component-ids.d.ts.map +1 -1
  495. package/dist/utils/component-ids.js.map +1 -1
  496. package/dist/utils/format.d.ts +10 -4
  497. package/dist/utils/format.d.ts.map +1 -1
  498. package/dist/utils/format.js +16 -1
  499. package/dist/utils/format.js.map +1 -1
  500. package/dist/utils/theme-gen.js +5 -7
  501. package/dist/utils/theme-gen.js.map +1 -1
  502. package/package.json +14 -13
  503. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts +0 -9
  504. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +0 -1
  505. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +0 -1
  506. package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts +0 -11
  507. package/dist/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +0 -1
  508. package/dist/DateTimeRangePicker/DateTimeRangePicker.js +0 -80
  509. package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +0 -1
  510. package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts +0 -13
  511. package/dist/DateTimeRangePicker/TimeRangeSelector.d.ts.map +0 -1
  512. package/dist/DateTimeRangePicker/TimeRangeSelector.js +0 -67
  513. package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +0 -1
  514. package/dist/DateTimeRangePicker/index.d.ts.map +0 -1
  515. package/dist/DateTimeRangePicker/index.js.map +0 -1
  516. package/dist/DateTimeRangePicker/utils.d.ts +0 -7
  517. package/dist/DateTimeRangePicker/utils.d.ts.map +0 -1
  518. package/dist/DateTimeRangePicker/utils.js.map +0 -1
  519. package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts +0 -3
  520. package/dist/ThresholdsEditor/ThresholdColorPicker.d.ts.map +0 -1
  521. package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +0 -1
  522. package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +0 -88
  523. package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +0 -80
@@ -29,7 +29,7 @@ const StyledMuiTableCell = styled(MuiTableCell)(({ theme })=>({
29
29
  borderRadius: 0
30
30
  }
31
31
  }));
32
- export function TableCell({ children, density, variant, width, focusState = 'none', onFocusTrigger, isFirstColumn, isLastColumn, description, ...otherProps }) {
32
+ export function TableCell({ children, density, variant, width, defaultColumnHeight, focusState = 'none', onFocusTrigger, isFirstColumn, isLastColumn, description, align, color, backgroundColor, ...otherProps }) {
33
33
  const theme = useTheme();
34
34
  const elRef = useRef();
35
35
  const isHeader = variant === 'head';
@@ -41,9 +41,8 @@ export function TableCell({ children, density, variant, width, focusState = 'non
41
41
  focusState
42
42
  ]);
43
43
  const handleFocus = (e)=>{
44
- var _e_currentTarget;
45
44
  // From https://zellwk.com/blog/keyboard-focusable-elements/
46
- const nestedFocusTarget = (_e_currentTarget = e.currentTarget) === null || _e_currentTarget === void 0 ? void 0 : _e_currentTarget.querySelector('a[href], button, input, textarea, select, details,[role="button"]');
45
+ const nestedFocusTarget = e.currentTarget?.querySelector('a[href], button, input, textarea, select, details,[role="button"]');
47
46
  if (nestedFocusTarget) {
48
47
  // If the cell has a focusable child, focus it instead. Mostly used for
49
48
  // checkbox cells, but could have other uses.
@@ -56,7 +55,7 @@ export function TableCell({ children, density, variant, width, focusState = 'non
56
55
  // plays with the triggering of focus with keyboard interactions.
57
56
  // These report that a focus event happened, so we can adjust the current
58
57
  // tabindex and focuses to the right cell.
59
- onFocusTrigger === null || onFocusTrigger === void 0 ? void 0 : onFocusTrigger(e);
58
+ onFocusTrigger?.(e);
60
59
  };
61
60
  return /*#__PURE__*/ _jsx(StyledMuiTableCell, {
62
61
  ...otherProps,
@@ -68,16 +67,35 @@ export function TableCell({ children, density, variant, width, focusState = 'non
68
67
  onFocus: handleFocus,
69
68
  onClick: handleInteractionFocusTrigger,
70
69
  onKeyUp: handleInteractionFocusTrigger,
70
+ style: {
71
+ width: width
72
+ },
71
73
  sx: {
72
- width: width,
73
- borderBottom: isHeader ? (theme)=>`solid 1px ${theme.palette.grey[100]}` : `solid 1px ${theme.palette.grey[50]}`
74
+ position: 'relative',
75
+ borderBottom: isHeader ? `solid 1px ${theme.palette.grey[100]}` : `solid 1px ${theme.palette.grey[50]}`,
76
+ '&:hover #original-cell': {
77
+ position: 'absolute',
78
+ top: 0,
79
+ left: 0,
80
+ zIndex: 10,
81
+ width: 'fit-content',
82
+ minWidth: '100%',
83
+ whiteSpace: 'nowrap',
84
+ overflow: 'visible',
85
+ backgroundColor: `${backgroundColor ?? theme.palette.background.default} !important`,
86
+ outline: `solid 1px ${theme.palette.info.main}`,
87
+ outlineOffset: '-1px'
88
+ }
74
89
  },
75
90
  ref: elRef,
76
91
  children: /*#__PURE__*/ _jsx(Box, {
92
+ id: "original-cell",
77
93
  sx: {
78
94
  ...getTableCellLayout(theme, density, {
95
+ isHeader,
79
96
  isLastColumn,
80
- isFirstColumn
97
+ isFirstColumn,
98
+ defaultColumnHeight
81
99
  }),
82
100
  position: 'relative',
83
101
  // Text truncation. Currently enforced on all cells. We may control
@@ -90,7 +108,13 @@ export function TableCell({ children, density, variant, width, focusState = 'non
90
108
  // in headers.
91
109
  flexDirection: 'inherit'
92
110
  },
111
+ style: {
112
+ backgroundColor: backgroundColor ?? 'inherit',
113
+ color: color ?? 'inherit'
114
+ },
93
115
  title: description,
116
+ "aria-label": description,
117
+ textAlign: align,
94
118
  children: children
95
119
  })
96
120
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableCell.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TableCell as MuiTableCell, styled, TableCellProps as MuiTableCellProps, Box, useTheme } from '@mui/material';\nimport { useEffect, useRef } from 'react';\nimport { TableCellAlignment, TableDensity, getTableCellLayout } from './model/table-model';\n\nconst StyledMuiTableCell = styled(MuiTableCell)(({ theme }) => ({\n padding: 0,\n backgroundColor: 'inherit',\n\n '&.MuiTableCell-head': {\n // Important to avoid scrolling behind the header showing through.\n backgroundColor: theme.palette.background.default,\n },\n '&:focus-visible': {\n outline: `solid 1px ${theme.palette.primary.main}`,\n // Move inward a little to avoid getting cut off when focusing on items\n // at the edge of the table.\n outlineOffset: '-1px',\n borderRadius: 0,\n },\n}));\n\nexport interface TableCellProps extends Omit<MuiTableCellProps, 'tabIndex' | 'align'> {\n density: TableDensity;\n\n // These values are used to adjust the spacing for the first/last columns.\n isLastColumn: boolean;\n isFirstColumn: boolean;\n\n align?: TableCellAlignment;\n\n /**\n * Additional information to be displayed when hovering over the cell. This\n * may be the full cell value (e.g. to enable the user to see the full value\n * if it is ellipsized to fit into the space) or some other descriptive text\n * that is useful for the user.\n *\n * The hover behavior is currently managed with the `title` attribute, but this\n * may be changed to a tooltip in the future.\n */\n description?: string;\n\n /**\n * How the cell should behave related to focus.\n * - `trigger-focus`: the cell should be auto-focused when it renders.\n * - `focus-next`: the cell should have tabindex=\"0\", so that it will be\n * focused the next time someone tabs with a keyboard.\n * - `none`: the cell should have tabindex=\"-1\", so it is not focused by\n * keyboard interactions at this time.\n */\n focusState?: 'trigger-focus' | 'focus-next' | 'none';\n onFocusTrigger?: (e: React.MouseEvent<HTMLTableCellElement> | React.KeyboardEvent<HTMLTableCellElement>) => void;\n}\n\nexport function TableCell({\n children,\n density,\n variant,\n width,\n focusState = 'none',\n onFocusTrigger,\n isFirstColumn,\n isLastColumn,\n description,\n ...otherProps\n}: TableCellProps) {\n const theme = useTheme();\n\n const elRef = useRef<HTMLTableCellElement>();\n\n const isHeader = variant === 'head';\n\n useEffect(() => {\n if (focusState === 'trigger-focus' && elRef.current) {\n elRef.current.focus();\n }\n }, [focusState]);\n\n const handleFocus: React.FocusEventHandler<HTMLTableCellElement> = (e) => {\n // From https://zellwk.com/blog/keyboard-focusable-elements/\n const nestedFocusTarget = e.currentTarget?.querySelector<HTMLElement>(\n 'a[href], button, input, textarea, select, details,[role=\"button\"]'\n );\n if (nestedFocusTarget) {\n // If the cell has a focusable child, focus it instead. Mostly used for\n // checkbox cells, but could have other uses.\n nestedFocusTarget.focus();\n }\n };\n\n const handleInteractionFocusTrigger: TableCellProps['onFocusTrigger'] = (e) => {\n // We use `onClick` and `onKeyUp` events instead of `onFocus` because of\n // some ordering issues with when the browser calls events and how this\n // plays with the triggering of focus with keyboard interactions.\n // These report that a focus event happened, so we can adjust the current\n // tabindex and focuses to the right cell.\n onFocusTrigger?.(e);\n };\n\n return (\n <StyledMuiTableCell\n {...otherProps}\n // Modify the tab index based on the currently focused cell. It's important\n // to avoid having tabindex 0 on everything because it essentially traps\n // a keyboard user in the table until they hit \"tab\" for every single\n // cell.\n tabIndex={focusState !== 'none' ? 0 : -1}\n onFocus={handleFocus}\n onClick={handleInteractionFocusTrigger}\n onKeyUp={handleInteractionFocusTrigger}\n sx={{\n width: width,\n borderBottom: isHeader\n ? (theme) => `solid 1px ${theme.palette.grey[100]}`\n : `solid 1px ${theme.palette.grey[50]}`,\n }}\n ref={elRef}\n >\n <Box\n sx={{\n ...getTableCellLayout(theme, density, { isLastColumn, isFirstColumn }),\n position: 'relative',\n\n // Text truncation. Currently enforced on all cells. We may control\n // this with a prop on column config in the future.\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n\n // Need to inherit from the MUI cell because this manages some ordering\n // that the `TableSortLabel` uses to determine the location of the icon\n // in headers.\n flexDirection: 'inherit',\n }}\n title={description}\n >\n {children}\n </Box>\n </StyledMuiTableCell>\n );\n}\n"],"names":["TableCell","MuiTableCell","styled","Box","useTheme","useEffect","useRef","getTableCellLayout","StyledMuiTableCell","theme","padding","backgroundColor","palette","background","default","outline","primary","main","outlineOffset","borderRadius","children","density","variant","width","focusState","onFocusTrigger","isFirstColumn","isLastColumn","description","otherProps","elRef","isHeader","current","focus","handleFocus","e","nestedFocusTarget","currentTarget","querySelector","handleInteractionFocusTrigger","tabIndex","onFocus","onClick","onKeyUp","sx","borderBottom","grey","ref","position","whiteSpace","overflow","textOverflow","flexDirection","title"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,aAAaC,YAAY,EAAEC,MAAM,EAAuCC,GAAG,EAAEC,QAAQ,QAAQ,gBAAgB;AACtH,SAASC,SAAS,EAAEC,MAAM,QAAQ,QAAQ;AAC1C,SAA2CC,kBAAkB,QAAQ,sBAAsB;AAE3F,MAAMC,qBAAqBN,OAAOD,cAAc,CAAC,EAAEQ,KAAK,EAAE,GAAM,CAAA;QAC9DC,SAAS;QACTC,iBAAiB;QAEjB,uBAAuB;YACrB,kEAAkE;YAClEA,iBAAiBF,MAAMG,OAAO,CAACC,UAAU,CAACC,OAAO;QACnD;QACA,mBAAmB;YACjBC,SAAS,CAAC,UAAU,EAAEN,MAAMG,OAAO,CAACI,OAAO,CAACC,IAAI,CAAC,CAAC;YAClD,uEAAuE;YACvE,4BAA4B;YAC5BC,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BAAcD;gBAAc,EAAE;gBACtEsB,UAAU;gBAEV,mEAAmE;gBACnE,mDAAmD;gBACnDC,YAAY;gBACZC,UAAU;gBACVC,cAAc;gBAEd,uEAAuE;gBACvE,uEAAuE;gBACvE,cAAc;gBACdC,eAAe;YACjB;YACAC,OAAOzB;sBAENR;;;AAIT"}
1
+ {"version":3,"sources":["../../src/Table/TableCell.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TableCell as MuiTableCell, styled, TableCellProps as MuiTableCellProps, Box, useTheme } from '@mui/material';\nimport { ReactElement, useEffect, useRef } from 'react';\nimport { TableCellAlignment, TableDensity, getTableCellLayout } from './model/table-model';\n\nconst StyledMuiTableCell = styled(MuiTableCell)(({ theme }) => ({\n padding: 0,\n backgroundColor: 'inherit',\n\n '&.MuiTableCell-head': {\n // Important to avoid scrolling behind the header showing through.\n backgroundColor: theme.palette.background.default,\n },\n '&:focus-visible': {\n outline: `solid 1px ${theme.palette.primary.main}`,\n // Move inward a little to avoid getting cut off when focusing on items\n // at the edge of the table.\n outlineOffset: '-1px',\n borderRadius: 0,\n },\n}));\n\nexport interface TableCellProps extends Omit<MuiTableCellProps, 'tabIndex' | 'align'> {\n density: TableDensity;\n defaultColumnHeight?: 'auto' | number;\n\n // These values are used to adjust the spacing for the first/last columns.\n isLastColumn: boolean;\n isFirstColumn: boolean;\n\n align?: TableCellAlignment;\n\n /**\n * Additional information to be displayed when hovering over the cell. This\n * may be the full cell value (e.g. to enable the user to see the full value\n * if it is ellipsized to fit into the space) or some other descriptive text\n * that is useful for the user.\n *\n * The hover behavior is currently managed with the `title` attribute, but this\n * may be changed to a tooltip in the future.\n */\n description?: string;\n\n /**\n * How the cell should behave related to focus.\n * - `trigger-focus`: the cell should be auto-focused when it renders.\n * - `focus-next`: the cell should have tabindex=\"0\", so that it will be\n * focused the next time someone tabs with a keyboard.\n * - `none`: the cell should have tabindex=\"-1\", so it is not focused by\n * keyboard interactions at this time.\n */\n focusState?: 'trigger-focus' | 'focus-next' | 'none';\n onFocusTrigger?: (e: React.MouseEvent<HTMLTableCellElement> | React.KeyboardEvent<HTMLTableCellElement>) => void;\n color?: string;\n backgroundColor?: string;\n}\n\nexport function TableCell({\n children,\n density,\n variant,\n width,\n defaultColumnHeight,\n focusState = 'none',\n onFocusTrigger,\n isFirstColumn,\n isLastColumn,\n description,\n align,\n color,\n backgroundColor,\n ...otherProps\n}: TableCellProps): ReactElement {\n const theme = useTheme();\n\n const elRef = useRef<HTMLTableCellElement>();\n\n const isHeader = variant === 'head';\n\n useEffect(() => {\n if (focusState === 'trigger-focus' && elRef.current) {\n elRef.current.focus();\n }\n }, [focusState]);\n\n const handleFocus: React.FocusEventHandler<HTMLTableCellElement> = (e) => {\n // From https://zellwk.com/blog/keyboard-focusable-elements/\n const nestedFocusTarget = e.currentTarget?.querySelector<HTMLElement>(\n 'a[href], button, input, textarea, select, details,[role=\"button\"]'\n );\n if (nestedFocusTarget) {\n // If the cell has a focusable child, focus it instead. Mostly used for\n // checkbox cells, but could have other uses.\n nestedFocusTarget.focus();\n }\n };\n\n const handleInteractionFocusTrigger: TableCellProps['onFocusTrigger'] = (e) => {\n // We use `onClick` and `onKeyUp` events instead of `onFocus` because of\n // some ordering issues with when the browser calls events and how this\n // plays with the triggering of focus with keyboard interactions.\n // These report that a focus event happened, so we can adjust the current\n // tabindex and focuses to the right cell.\n onFocusTrigger?.(e);\n };\n\n return (\n <StyledMuiTableCell\n {...otherProps}\n // Modify the tab index based on the currently focused cell. It's important\n // to avoid having tabindex 0 on everything because it essentially traps\n // a keyboard user in the table until they hit \"tab\" for every single\n // cell.\n tabIndex={focusState !== 'none' ? 0 : -1}\n onFocus={handleFocus}\n onClick={handleInteractionFocusTrigger}\n onKeyUp={handleInteractionFocusTrigger}\n style={{ width: width }}\n sx={{\n position: 'relative',\n borderBottom: isHeader ? `solid 1px ${theme.palette.grey[100]}` : `solid 1px ${theme.palette.grey[50]}`,\n '&:hover #original-cell': {\n position: 'absolute',\n top: 0,\n left: 0,\n zIndex: 10,\n width: 'fit-content',\n minWidth: '100%',\n whiteSpace: 'nowrap',\n overflow: 'visible',\n backgroundColor: `${backgroundColor ?? theme.palette.background.default} !important`,\n outline: `solid 1px ${theme.palette.info.main}`,\n outlineOffset: '-1px',\n },\n }}\n ref={elRef}\n >\n <Box\n id=\"original-cell\"\n sx={{\n ...getTableCellLayout(theme, density, { isHeader, isLastColumn, isFirstColumn, defaultColumnHeight }),\n position: 'relative',\n\n // Text truncation. Currently enforced on all cells. We may control\n // this with a prop on column config in the future.\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n\n // Need to inherit from the MUI cell because this manages some ordering\n // that the `TableSortLabel` uses to determine the location of the icon\n // in headers.\n flexDirection: 'inherit',\n }}\n style={{\n backgroundColor: backgroundColor ?? 'inherit',\n color: color ?? 'inherit',\n }}\n title={description}\n aria-label={description}\n textAlign={align}\n >\n {children}\n </Box>\n </StyledMuiTableCell>\n );\n}\n"],"names":["TableCell","MuiTableCell","styled","Box","useTheme","useEffect","useRef","getTableCellLayout","StyledMuiTableCell","theme","padding","backgroundColor","palette","background","default","outline","primary","main","outlineOffset","borderRadius","children","density","variant","width","defaultColumnHeight","focusState","onFocusTrigger","isFirstColumn","isLastColumn","description","align","color","otherProps","elRef","isHeader","current","focus","handleFocus","e","nestedFocusTarget","currentTarget","querySelector","handleInteractionFocusTrigger","tabIndex","onFocus","onClick","onKeyUp","style","sx","position","borderBottom","grey","top","left","zIndex","minWidth","whiteSpace","overflow","info","ref","id","textOverflow","flexDirection","title","aria-label","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AiBA,mBAAmB;gBACpCoB,OAAOA,SAAS;YAClB;YACAgC,OAAOlC;YACPmC,cAAYnC;YACZoC,WAAWnC;sBAEVV;;;AAIT"}
@@ -1,8 +1,9 @@
1
1
  import { CheckboxProps } from '@mui/material';
2
+ import { ReactElement } from 'react';
2
3
  import { TableDensity } from './model/table-model';
3
4
  export interface TableCheckboxProps extends Pick<CheckboxProps, 'checked' | 'indeterminate' | 'onChange'> {
4
5
  color?: string;
5
6
  density: TableDensity;
6
7
  }
7
- export declare function TableCheckbox({ color, density, ...otherProps }: TableCheckboxProps): import("react/jsx-runtime").JSX.Element;
8
+ export declare function TableCheckbox({ color, density, ...otherProps }: TableCheckboxProps): ReactElement;
8
9
  //# sourceMappingURL=TableCheckbox.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableCheckbox.d.ts","sourceRoot":"","sources":["../../src/Table/TableCheckbox.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAY,aAAa,EAAS,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,eAAe,GAAG,UAAU,CAAC;IACvG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,EAAE,kBAAkB,2CAsClF"}
1
+ {"version":3,"file":"TableCheckbox.d.ts","sourceRoot":"","sources":["../../src/Table/TableCheckbox.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAY,aAAa,EAAS,MAAM,eAAe,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,eAAe,GAAG,UAAU,CAAC;IACvG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,YAAY,CAAC;CACvB;AAED,wBAAgB,aAAa,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,UAAU,EAAE,EAAE,kBAAkB,GAAG,YAAY,CAsCjG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableCheckbox.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Checkbox, CheckboxProps, alpha } from '@mui/material';\nimport { TableDensity } from './model/table-model';\n\nexport interface TableCheckboxProps extends Pick<CheckboxProps, 'checked' | 'indeterminate' | 'onChange'> {\n color?: string;\n density: TableDensity;\n}\n\nexport function TableCheckbox({ color, density, ...otherProps }: TableCheckboxProps) {\n const isCompact = density === 'compact';\n\n return (\n <Checkbox\n size={isCompact ? 'small' : 'medium'}\n {...otherProps}\n // Disable ripple and set background color below because of some issues\n // with re-rendering with the keyboard interactions that causes the ripple\n // animation to stutter.\n focusRipple={false}\n // Tab index is handled by the overall keyboard interactions for the table\n // to avoid trapping a keyboard user in a table by requiring them to tab\n // through every single checkbox.\n tabIndex={-1}\n sx={{\n color: color,\n\n padding: (theme) => theme.spacing(isCompact ? 0.25 : 0.5),\n\n // Centering.\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n\n '&.Mui-checked': {\n color: color,\n },\n\n '&.Mui-focusVisible': {\n background: color ? alpha(color, 0.5) : undefined,\n },\n\n '& .MuiSvgIcon-root': { fontSize: isCompact ? 16 : 18 },\n }}\n />\n );\n}\n"],"names":["Checkbox","alpha","TableCheckbox","color","density","otherProps","isCompact","size","focusRipple","tabIndex","sx","padding","theme","spacing","position","top","left","transform","background","undefined","fontSize"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,QAAQ,EAAiBC,KAAK,QAAQ,gBAAgB;AAQ/D,OAAO,SAASC,cAAc,EAAEC,KAAK,EAAEC,OAAO,EAAE,GAAGC,YAAgC;IACjF,MAAMC,YAAYF,YAAY;IAE9B,qBACE,KAACJ;QACCO,MAAMD,YAAY,UAAU;QAC3B,GAAGD,UAAU;QACd,uEAAuE;QACvE,0EAA0E;QAC1E,wBAAwB;QACxBG,aAAa;QACb,0EAA0E;QAC1E,wEAAwE;QACxE,iCAAiC;QACjCC,UAAU,CAAC;QACXC,IAAI;YACFP,OAAOA;YAEPQ,SAAS,CAACC,QAAUA,MAAMC,OAAO,CAACP,YAAY,OAAO;YAErD,aAAa;YACbQ,UAAU;YACVC,KAAK;YACLC,MAAM;YACNC,WAAW;YAEX,iBAAiB;gBACfd,OAAOA;YACT;YAEA,sBAAsB;gBACpBe,YAAYf,QAAQF,MAAME,OAAO,OAAOgB;YAC1C;YAEA,sBAAsB;gBAAEC,UAAUd,YAAY,KAAK;YAAG;QACxD;;AAGN"}
1
+ {"version":3,"sources":["../../src/Table/TableCheckbox.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Checkbox, CheckboxProps, alpha } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TableDensity } from './model/table-model';\n\nexport interface TableCheckboxProps extends Pick<CheckboxProps, 'checked' | 'indeterminate' | 'onChange'> {\n color?: string;\n density: TableDensity;\n}\n\nexport function TableCheckbox({ color, density, ...otherProps }: TableCheckboxProps): ReactElement {\n const isCompact = density === 'compact';\n\n return (\n <Checkbox\n size={isCompact ? 'small' : 'medium'}\n {...otherProps}\n // Disable ripple and set background color below because of some issues\n // with re-rendering with the keyboard interactions that causes the ripple\n // animation to stutter.\n focusRipple={false}\n // Tab index is handled by the overall keyboard interactions for the table\n // to avoid trapping a keyboard user in a table by requiring them to tab\n // through every single checkbox.\n tabIndex={-1}\n sx={{\n color: color,\n\n padding: (theme) => theme.spacing(isCompact ? 0.25 : 0.5),\n\n // Centering.\n position: 'absolute',\n top: '50%',\n left: '50%',\n transform: 'translate(-50%, -50%)',\n\n '&.Mui-checked': {\n color: color,\n },\n\n '&.Mui-focusVisible': {\n background: color ? alpha(color, 0.5) : undefined,\n },\n\n '& .MuiSvgIcon-root': { fontSize: isCompact ? 16 : 18 },\n }}\n />\n );\n}\n"],"names":["Checkbox","alpha","TableCheckbox","color","density","otherProps","isCompact","size","focusRipple","tabIndex","sx","padding","theme","spacing","position","top","left","transform","background","undefined","fontSize"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,QAAQ,EAAiBC,KAAK,QAAQ,gBAAgB;AAS/D,OAAO,SAASC,cAAc,EAAEC,KAAK,EAAEC,OAAO,EAAE,GAAGC,YAAgC;IACjF,MAAMC,YAAYF,YAAY;IAE9B,qBACE,KAACJ;QACCO,MAAMD,YAAY,UAAU;QAC3B,GAAGD,UAAU;QACd,uEAAuE;QACvE,0EAA0E;QAC1E,wBAAwB;QACxBG,aAAa;QACb,0EAA0E;QAC1E,wEAAwE;QACxE,iCAAiC;QACjCC,UAAU,CAAC;QACXC,IAAI;YACFP,OAAOA;YAEPQ,SAAS,CAACC,QAAUA,MAAMC,OAAO,CAACP,YAAY,OAAO;YAErD,aAAa;YACbQ,UAAU;YACVC,KAAK;YACLC,MAAM;YACNC,WAAW;YAEX,iBAAiB;gBACfd,OAAOA;YACT;YAEA,sBAAsB;gBACpBe,YAAYf,QAAQF,MAAME,OAAO,OAAOgB;YAC1C;YAEA,sBAAsB;gBAAEC,UAAUd,YAAY,KAAK;YAAG;QACxD;;AAGN"}
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { TableFooterProps as MuiTableFooterProps } from '@mui/material';
3
+ export declare const TableFoot: import("react").ForwardRefExoticComponent<Omit<MuiTableFooterProps, "ref"> & import("react").RefAttributes<HTMLTableSectionElement>>;
4
+ //# sourceMappingURL=TableFoot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableFoot.d.ts","sourceRoot":"","sources":["../../src/Table/TableFoot.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAiC,gBAAgB,IAAI,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGvG,eAAO,MAAM,SAAS,sIAEpB,CAAC"}
@@ -0,0 +1,23 @@
1
+ // Copyright 2025 The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ import { jsx as _jsx } from "react/jsx-runtime";
14
+ import { TableFooter as MuiTableFooter } from '@mui/material';
15
+ import { forwardRef } from 'react';
16
+ export const TableFoot = /*#__PURE__*/ forwardRef(function TableFoot(props, ref) {
17
+ return /*#__PURE__*/ _jsx(MuiTableFooter, {
18
+ ...props,
19
+ ref: ref
20
+ });
21
+ });
22
+
23
+ //# sourceMappingURL=TableFoot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/Table/TableFoot.tsx"],"sourcesContent":["// Copyright 2025 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TableFooter as MuiTableFooter, TableFooterProps as MuiTableFooterProps } from '@mui/material';\nimport { forwardRef } from 'react';\n\nexport const TableFoot = forwardRef<HTMLTableSectionElement, MuiTableFooterProps>(function TableFoot(props, ref) {\n return <MuiTableFooter {...props} ref={ref} />;\n});\n"],"names":["TableFooter","MuiTableFooter","forwardRef","TableFoot","props","ref"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,eAAeC,cAAc,QAAiD,gBAAgB;AACvG,SAASC,UAAU,QAAQ,QAAQ;AAEnC,OAAO,MAAMC,0BAAYD,WAAyD,SAASC,UAAUC,KAAK,EAAEC,GAAG;IAC7G,qBAAO,KAACJ;QAAgB,GAAGG,KAAK;QAAEC,KAAKA;;AACzC,GAAG"}
@@ -1,5 +1,6 @@
1
- import { SortDirection } from './model/table-model';
1
+ import { ReactElement } from 'react';
2
2
  import { TableCellProps } from './TableCell';
3
+ import { SortDirection } from './model/table-model';
3
4
  export interface TableHeaderCellProps extends TableCellProps {
4
5
  /**
5
6
  * Handler called when a sort event is triggered.
@@ -18,5 +19,5 @@ export interface TableHeaderCellProps extends TableCellProps {
18
19
  */
19
20
  nextSortDirection?: SortDirection;
20
21
  }
21
- export declare function TableHeaderCell({ onSort, sortDirection, nextSortDirection, children, ...cellProps }: TableHeaderCellProps): import("react/jsx-runtime").JSX.Element;
22
+ export declare function TableHeaderCell({ onSort, sortDirection, nextSortDirection, children, ...cellProps }: TableHeaderCellProps): ReactElement;
22
23
  //# sourceMappingURL=TableHeaderCell.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TableHeaderCell.d.ts","sourceRoot":"","sources":["../../src/Table/TableHeaderCell.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAa,cAAc,EAAE,MAAM,aAAa,CAAC;AAExD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAEhD;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,aAAa,CAAC;CACnC;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,oBAAoB,2CA4CtB"}
1
+ {"version":3,"file":"TableHeaderCell.d.ts","sourceRoot":"","sources":["../../src/Table/TableHeaderCell.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAa,cAAc,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,WAAW,oBAAqB,SAAQ,cAAc;IAC1D;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,SAAS,CAAC;IAEhD;;OAEG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,aAAa,CAAC;CACnC;AAED,wBAAgB,eAAe,CAAC,EAC9B,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,QAAQ,EACR,GAAG,SAAS,EACb,EAAE,oBAAoB,GAAG,YAAY,CA4CrC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/TableHeaderCell.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TableSortLabel, Typography, tableSortLabelClasses } from '@mui/material';\nimport { SortDirection } from './model/table-model';\nimport { TableCell, TableCellProps } from './TableCell';\n\nexport interface TableHeaderCellProps extends TableCellProps {\n /**\n * Handler called when a sort event is triggered.\n * When specified, the header will include sorting interactions and indicators.\n */\n onSort?: ((event: unknown) => void) | undefined;\n\n /**\n * The current direction the header is sorted.\n */\n sortDirection?: SortDirection;\n\n /**\n * The next direction the header will be sorted when another sort action\n * is triggered via click/keyboard. This impacts some UI interactions (e.g.\n * the direction of the sort arrow on hover f the column is currently\n * unsorted.)\n */\n nextSortDirection?: SortDirection;\n}\n\nexport function TableHeaderCell({\n onSort,\n sortDirection,\n nextSortDirection,\n children,\n ...cellProps\n}: TableHeaderCellProps) {\n const showSortLabel = !!onSort;\n\n const headerText = (\n <Typography noWrap variant=\"inherit\" component=\"div\" color=\"inherit\">\n {children}\n </Typography>\n );\n\n const isActive = !!sortDirection;\n const direction = isActive ? sortDirection : nextSortDirection;\n\n return (\n <TableCell {...cellProps}>\n {showSortLabel ? (\n <TableSortLabel\n onClick={onSort}\n direction={direction}\n active={isActive}\n sx={{\n // Overrides a default vertical alignment in the CSS that changes\n // the header vertical rhythm in a way that's inconsistent with\n // non-sorting headers.\n verticalAlign: 'unset',\n\n // Makes it possible to ellipsize the text if it's too long.\n maxWidth: '100%',\n\n // Make the arrow visible when focused using the keyboard to assist\n // with a11y.\n '&:focus-visible': {\n [`& .${tableSortLabelClasses.icon}`]: {\n opacity: isActive ? 1 : 0.5,\n },\n },\n }}\n >\n {headerText}\n </TableSortLabel>\n ) : (\n headerText\n )}\n </TableCell>\n );\n}\n"],"names":["TableSortLabel","Typography","tableSortLabelClasses","TableCell","TableHeaderCell","onSort","sortDirection","nextSortDirection","children","cellProps","showSortLabel","headerText","noWrap","variant","component","color","isActive","direction","onClick","active","sx","verticalAlign","maxWidth","icon","opacity"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,cAAc,EAAEC,UAAU,EAAEC,qBAAqB,QAAQ,gBAAgB;AAElF,SAASC,SAAS,QAAwB,cAAc;AAuBxD,OAAO,SAASC,gBAAgB,EAC9BC,MAAM,EACNC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACR,GAAGC,WACkB;IACrB,MAAMC,gBAAgB,CAAC,CAACL;IAExB,MAAMM,2BACJ,KAACV;QAAWW,MAAM;QAACC,SAAQ;QAAUC,WAAU;QAAMC,OAAM;kBACxDP;;IAIL,MAAMQ,WAAW,CAAC,CAACV;IACnB,MAAMW,YAAYD,WAAWV,gBAAgBC;IAE7C,qBACE,KAACJ;QAAW,GAAGM,SAAS;kBACrBC,8BACC,KAACV;YACCkB,SAASb;YACTY,WAAWA;YACXE,QAAQH;YACRI,IAAI;gBACF,iEAAiE;gBACjE,+DAA+D;gBAC/D,uBAAuB;gBACvBC,eAAe;gBAEf,4DAA4D;gBAC5DC,UAAU;gBAEV,mEAAmE;gBACnE,aAAa;gBACb,mBAAmB;oBACjB,CAAC,CAAC,GAAG,EAAEpB,sBAAsBqB,IAAI,CAAC,CAAC,CAAC,EAAE;wBACpCC,SAASR,WAAW,IAAI;oBAC1B;gBACF;YACF;sBAECL;aAGHA;;AAIR"}
1
+ {"version":3,"sources":["../../src/Table/TableHeaderCell.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { TableSortLabel, Typography, tableSortLabelClasses } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TableCell, TableCellProps } from './TableCell';\nimport { SortDirection } from './model/table-model';\n\nexport interface TableHeaderCellProps extends TableCellProps {\n /**\n * Handler called when a sort event is triggered.\n * When specified, the header will include sorting interactions and indicators.\n */\n onSort?: ((event: unknown) => void) | undefined;\n\n /**\n * The current direction the header is sorted.\n */\n sortDirection?: SortDirection;\n\n /**\n * The next direction the header will be sorted when another sort action\n * is triggered via click/keyboard. This impacts some UI interactions (e.g.\n * the direction of the sort arrow on hover f the column is currently\n * unsorted.)\n */\n nextSortDirection?: SortDirection;\n}\n\nexport function TableHeaderCell({\n onSort,\n sortDirection,\n nextSortDirection,\n children,\n ...cellProps\n}: TableHeaderCellProps): ReactElement {\n const showSortLabel = !!onSort;\n\n const headerText = (\n <Typography noWrap variant=\"inherit\" component=\"div\" color=\"inherit\">\n {children}\n </Typography>\n );\n\n const isActive = !!sortDirection;\n const direction = isActive ? sortDirection : nextSortDirection;\n\n return (\n <TableCell {...cellProps}>\n {showSortLabel ? (\n <TableSortLabel\n onClick={onSort}\n direction={direction}\n active={isActive}\n sx={{\n // Overrides a default vertical alignment in the CSS that changes\n // the header vertical rhythm in a way that's inconsistent with\n // non-sorting headers.\n verticalAlign: 'unset',\n\n // Makes it possible to ellipsize the text if it's too long.\n maxWidth: '100%',\n\n // Make the arrow visible when focused using the keyboard to assist\n // with a11y.\n '&:focus-visible': {\n [`& .${tableSortLabelClasses.icon}`]: {\n opacity: isActive ? 1 : 0.5,\n },\n },\n }}\n >\n {headerText}\n </TableSortLabel>\n ) : (\n headerText\n )}\n </TableCell>\n );\n}\n"],"names":["TableSortLabel","Typography","tableSortLabelClasses","TableCell","TableHeaderCell","onSort","sortDirection","nextSortDirection","children","cellProps","showSortLabel","headerText","noWrap","variant","component","color","isActive","direction","onClick","active","sx","verticalAlign","maxWidth","icon","opacity"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,cAAc,EAAEC,UAAU,EAAEC,qBAAqB,QAAQ,gBAAgB;AAElF,SAASC,SAAS,QAAwB,cAAc;AAwBxD,OAAO,SAASC,gBAAgB,EAC9BC,MAAM,EACNC,aAAa,EACbC,iBAAiB,EACjBC,QAAQ,EACR,GAAGC,WACkB;IACrB,MAAMC,gBAAgB,CAAC,CAACL;IAExB,MAAMM,2BACJ,KAACV;QAAWW,MAAM;QAACC,SAAQ;QAAUC,WAAU;QAAMC,OAAM;kBACxDP;;IAIL,MAAMQ,WAAW,CAAC,CAACV;IACnB,MAAMW,YAAYD,WAAWV,gBAAgBC;IAE7C,qBACE,KAACJ;QAAW,GAAGM,SAAS;kBACrBC,8BACC,KAACV;YACCkB,SAASb;YACTY,WAAWA;YACXE,QAAQH;YACRI,IAAI;gBACF,iEAAiE;gBACjE,+DAA+D;gBAC/D,uBAAuB;gBACvBC,eAAe;gBAEf,4DAA4D;gBAC5DC,UAAU;gBAEV,mEAAmE;gBACnE,aAAa;gBACb,mBAAmB;oBACjB,CAAC,CAAC,GAAG,EAAEpB,sBAAsBqB,IAAI,EAAE,CAAC,EAAE;wBACpCC,SAASR,WAAW,IAAI;oBAC1B;gBACF;YACF;sBAECL;aAGHA;;AAIR"}
@@ -1,11 +1,13 @@
1
- /// <reference types="react" />
2
1
  import { Column, HeaderGroup, Row } from '@tanstack/react-table';
3
- import { TableProps } from './model/table-model';
4
- export type VirtualizedTableProps<TableData> = Required<Pick<TableProps<TableData>, 'height' | 'width' | 'density'>> & Pick<TableProps<TableData>, 'onRowMouseOver' | 'onRowMouseOut'> & {
2
+ import { ReactElement } from 'react';
3
+ import { TableCellConfigs, TableProps } from './model/table-model';
4
+ export type VirtualizedTableProps<TableData> = Required<Pick<TableProps<TableData>, 'height' | 'width' | 'density' | 'defaultColumnWidth' | 'defaultColumnHeight'>> & Pick<TableProps<TableData>, 'onRowMouseOver' | 'onRowMouseOut' | 'pagination' | 'onPaginationChange'> & {
5
5
  onRowClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, id: string) => void;
6
6
  rows: Array<Row<TableData>>;
7
7
  columns: Array<Column<TableData, unknown>>;
8
8
  headers: Array<HeaderGroup<TableData>>;
9
+ cellConfigs?: TableCellConfigs;
10
+ rowCount: number;
9
11
  };
10
- export declare function VirtualizedTable<TableData>({ width, height, density, onRowClick, onRowMouseOver, onRowMouseOut, rows, columns, headers, }: VirtualizedTableProps<TableData>): import("react/jsx-runtime").JSX.Element;
12
+ export declare function VirtualizedTable<TableData>({ width, height, density, defaultColumnWidth, defaultColumnHeight, onRowClick, onRowMouseOver, onRowMouseOut, rows, columns, headers, cellConfigs, pagination, onPaginationChange, rowCount, }: VirtualizedTableProps<TableData>): ReactElement;
11
13
  //# sourceMappingURL=VirtualizedTable.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"VirtualizedTable.d.ts","sourceRoot":"","sources":["../../src/Table/VirtualizedTable.tsx"],"names":[],"mappings":";AAaA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,EAAc,MAAM,uBAAuB,CAAC;AAW7E,OAAO,EAAE,UAAU,EAAqB,MAAM,qBAAqB,CAAC;AAQpE,MAAM,MAAM,qBAAqB,CAAC,SAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC,GAClH,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,gBAAgB,GAAG,eAAe,CAAC,GAAG;IAChE,UAAU,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,cAAc,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClF,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,CAAC;IAC5B,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3C,OAAO,EAAE,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,CAAC;CACxC,CAAC;AAKJ,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,EAC1C,KAAK,EACL,MAAM,EACN,OAAO,EACP,UAAU,EACV,cAAc,EACd,aAAa,EACb,IAAI,EACJ,OAAO,EACP,OAAO,GACR,EAAE,qBAAqB,CAAC,SAAS,CAAC,2CA4KlC"}
1
+ {"version":3,"file":"VirtualizedTable.d.ts","sourceRoot":"","sources":["../../src/Table/VirtualizedTable.tsx"],"names":[],"mappings":"AAaA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Fragment } from "react/jsx-runtime";
14
14
  import { flexRender } from '@tanstack/react-table';
15
- import { Box } from '@mui/material';
15
+ import { Box, TablePagination, TableRow as MuiTableRow } from '@mui/material';
16
16
  import { TableVirtuoso } from 'react-virtuoso';
17
17
  import { useRef, useMemo } from 'react';
18
18
  import { TableRow } from './TableRow';
@@ -23,10 +23,11 @@ import { TableHeaderCell } from './TableHeaderCell';
23
23
  import { TableCell } from './TableCell';
24
24
  import { VirtualizedTableContainer } from './VirtualizedTableContainer';
25
25
  import { useVirtualizedTableKeyboardNav } from './hooks/useVirtualizedTableKeyboardNav';
26
+ import { TableFoot } from './TableFoot';
26
27
  // Separating out the virtualized table because we may want a paginated table
27
28
  // in the future that does not need virtualization, and we'd likely lay them
28
29
  // out differently.
29
- export function VirtualizedTable({ width, height, density, onRowClick, onRowMouseOver, onRowMouseOut, rows, columns, headers }) {
30
+ export function VirtualizedTable({ width, height, density, defaultColumnWidth, defaultColumnHeight, onRowClick, onRowMouseOver, onRowMouseOut, rows, columns, headers, cellConfigs, pagination, onPaginationChange, rowCount }) {
30
31
  const virtuosoRef = useRef(null);
31
32
  // Use a ref for these values because they are only needed for keyboard
32
33
  // focus interactions and setting them on state will lead to a significant
@@ -63,6 +64,7 @@ export function VirtualizedTable({ width, height, density, onRowClick, onRowMous
63
64
  });
64
65
  },
65
66
  TableHead,
67
+ TableFoot,
66
68
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
67
69
  TableRow: ({ item, ...props })=>{
68
70
  const index = props['data-index'];
@@ -79,10 +81,10 @@ export function VirtualizedTable({ width, height, density, onRowClick, onRowMous
79
81
  onClick: (e)=>onRowClick(e, row.id),
80
82
  density: density,
81
83
  onMouseOver: (e)=>{
82
- onRowMouseOver === null || onRowMouseOver === void 0 ? void 0 : onRowMouseOver(e, rowEventOpts);
84
+ onRowMouseOver?.(e, rowEventOpts);
83
85
  },
84
86
  onMouseOut: (e)=>{
85
- onRowMouseOut === null || onRowMouseOut === void 0 ? void 0 : onRowMouseOut(e, rowEventOpts);
87
+ onRowMouseOut?.(e, rowEventOpts);
86
88
  }
87
89
  });
88
90
  },
@@ -97,8 +99,22 @@ export function VirtualizedTable({ width, height, density, onRowClick, onRowMous
97
99
  rows,
98
100
  width
99
101
  ]);
102
+ const handleChangePage = (_event, newPage)=>{
103
+ if (!pagination || !onPaginationChange) return;
104
+ onPaginationChange({
105
+ ...pagination,
106
+ pageIndex: newPage
107
+ });
108
+ };
109
+ const handleChangeRowsPerPage = (event)=>{
110
+ if (!pagination || !onPaginationChange) return;
111
+ onPaginationChange({
112
+ pageIndex: 0,
113
+ pageSize: parseInt(event.target.value, 10)
114
+ });
115
+ };
100
116
  return /*#__PURE__*/ _jsx(Box, {
101
- sx: {
117
+ style: {
102
118
  width,
103
119
  height
104
120
  },
@@ -116,7 +132,6 @@ export function VirtualizedTable({ width, height, density, onRowClick, onRowMous
116
132
  return /*#__PURE__*/ _jsx(TableRow, {
117
133
  density: density,
118
134
  children: headerGroup.headers.map((header, i, headers)=>{
119
- var _column_columnDef_meta, _column_columnDef_meta1;
120
135
  const column = header.column;
121
136
  const position = {
122
137
  row: 0,
@@ -128,11 +143,12 @@ export function VirtualizedTable({ width, height, density, onRowClick, onRowMous
128
143
  onSort: column.getCanSort() ? column.getToggleSortingHandler() : undefined,
129
144
  sortDirection: typeof isSorted === 'string' ? isSorted : undefined,
130
145
  nextSortDirection: typeof nextSorting === 'string' ? nextSorting : undefined,
131
- width: column.getSize() || 'auto',
132
- align: (_column_columnDef_meta = column.columnDef.meta) === null || _column_columnDef_meta === void 0 ? void 0 : _column_columnDef_meta.align,
146
+ width: column.getSize() || defaultColumnWidth,
147
+ defaultColumnHeight: defaultColumnHeight,
148
+ align: column.columnDef.meta?.align,
133
149
  variant: "head",
134
150
  density: density,
135
- description: (_column_columnDef_meta1 = column.columnDef.meta) === null || _column_columnDef_meta1 === void 0 ? void 0 : _column_columnDef_meta1.headerDescription,
151
+ description: column.columnDef.meta?.headerDescription,
136
152
  focusState: getFocusState(position),
137
153
  onFocusTrigger: ()=>keyboardNav.onCellFocus(position),
138
154
  isFirstColumn: i === 0,
@@ -144,6 +160,19 @@ export function VirtualizedTable({ width, height, density, onRowClick, onRowMous
144
160
  })
145
161
  });
146
162
  },
163
+ fixedFooterContent: pagination ? ()=>/*#__PURE__*/ _jsx(MuiTableRow, {
164
+ sx: {
165
+ backgroundColor: (theme)=>theme.palette.background.default
166
+ },
167
+ children: /*#__PURE__*/ _jsx(TablePagination, {
168
+ colSpan: columns.length,
169
+ count: rowCount,
170
+ page: pagination.pageIndex,
171
+ rowsPerPage: pagination.pageSize,
172
+ onPageChange: handleChangePage,
173
+ onRowsPerPageChange: handleChangeRowsPerPage
174
+ })
175
+ }) : undefined,
147
176
  itemContent: (index)=>{
148
177
  const row = rows[index];
149
178
  if (!row) {
@@ -151,16 +180,16 @@ export function VirtualizedTable({ width, height, density, onRowClick, onRowMous
151
180
  }
152
181
  return /*#__PURE__*/ _jsx(_Fragment, {
153
182
  children: row.getVisibleCells().map((cell, i, cells)=>{
154
- var _cell_column_columnDef_meta, _cell_column_columnDef_meta1;
155
183
  const position = {
156
184
  // Add 1 to the row index because the header is row 0
157
185
  row: index + 1,
158
186
  column: i
159
187
  };
160
188
  const cellContext = cell.getContext();
189
+ const cellConfig = cellConfigs?.[cellContext.cell.id];
161
190
  const cellRenderFn = cell.column.columnDef.cell;
162
- const cellContent = typeof cellRenderFn == 'function' ? cellRenderFn(cellContext) : null;
163
- const cellDescriptionDef = (_cell_column_columnDef_meta = cell.column.columnDef.meta) === null || _cell_column_columnDef_meta === void 0 ? void 0 : _cell_column_columnDef_meta.cellDescription;
191
+ const cellContent = typeof cellRenderFn === 'function' ? cellRenderFn(cellContext) : null;
192
+ const cellDescriptionDef = cell.column.columnDef.meta?.cellDescription;
164
193
  let description = undefined;
165
194
  if (typeof cellDescriptionDef === 'function') {
166
195
  // If the cell description is a function, set the value using
@@ -173,15 +202,20 @@ export function VirtualizedTable({ width, height, density, onRowClick, onRowMous
173
202
  description = cellContent;
174
203
  }
175
204
  return /*#__PURE__*/ _jsx(TableCell, {
176
- width: cell.column.getSize() || 'auto',
177
- align: (_cell_column_columnDef_meta1 = cell.column.columnDef.meta) === null || _cell_column_columnDef_meta1 === void 0 ? void 0 : _cell_column_columnDef_meta1.align,
205
+ "data-testid": cell.id,
206
+ title: description || cellConfig?.text || cellContent,
207
+ width: cell.column.getSize() || defaultColumnWidth,
208
+ defaultColumnHeight: defaultColumnHeight,
209
+ align: cell.column.columnDef.meta?.align,
178
210
  density: density,
179
211
  focusState: getFocusState(position),
180
212
  onFocusTrigger: ()=>keyboardNav.onCellFocus(position),
181
213
  isFirstColumn: i === 0,
182
214
  isLastColumn: i === cells.length - 1,
183
215
  description: description,
184
- children: cellContent
216
+ color: cellConfig?.textColor ?? undefined,
217
+ backgroundColor: cellConfig?.backgroundColor ?? undefined,
218
+ children: cellConfig?.text || cellContent
185
219
  }, cell.id);
186
220
  })
187
221
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/VirtualizedTable.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Column, HeaderGroup, Row, flexRender } from '@tanstack/react-table';\nimport { Box } from '@mui/material';\nimport { TableVirtuoso, TableComponents, TableVirtuosoHandle, TableVirtuosoProps } from 'react-virtuoso';\nimport { useRef, useMemo } from 'react';\nimport { TableRow } from './TableRow';\nimport { TableBody } from './TableBody';\nimport { InnerTable } from './InnerTable';\nimport { TableHead } from './TableHead';\nimport { TableHeaderCell } from './TableHeaderCell';\nimport { TableCell, TableCellProps } from './TableCell';\nimport { VirtualizedTableContainer } from './VirtualizedTableContainer';\nimport { TableProps, TableRowEventOpts } from './model/table-model';\nimport { useVirtualizedTableKeyboardNav } from './hooks/useVirtualizedTableKeyboardNav';\n\ntype TableCellPosition = {\n row: number;\n column: number;\n};\n\nexport type VirtualizedTableProps<TableData> = Required<Pick<TableProps<TableData>, 'height' | 'width' | 'density'>> &\n Pick<TableProps<TableData>, 'onRowMouseOver' | 'onRowMouseOut'> & {\n onRowClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, id: string) => void;\n rows: Array<Row<TableData>>;\n columns: Array<Column<TableData, unknown>>;\n headers: Array<HeaderGroup<TableData>>;\n };\n\n// Separating out the virtualized table because we may want a paginated table\n// in the future that does not need virtualization, and we'd likely lay them\n// out differently.\nexport function VirtualizedTable<TableData>({\n width,\n height,\n density,\n onRowClick,\n onRowMouseOver,\n onRowMouseOut,\n rows,\n columns,\n headers,\n}: VirtualizedTableProps<TableData>) {\n const virtuosoRef = useRef<TableVirtuosoHandle>(null);\n\n // Use a ref for these values because they are only needed for keyboard\n // focus interactions and setting them on state will lead to a significant\n // amount of unnecessary re-renders.\n const visibleRange = useRef({\n startIndex: 0,\n endIndex: 0,\n });\n const setVisibleRange: TableVirtuosoProps<TableData, unknown>['rangeChanged'] = (newVisibleRange) => {\n visibleRange.current = newVisibleRange;\n };\n\n const keyboardNav = useVirtualizedTableKeyboardNav({\n visibleRange: visibleRange,\n virtualTable: virtuosoRef,\n\n // We add 1 here for the header.\n maxRows: rows.length + 1,\n maxColumns: columns.length,\n });\n\n const getFocusState = (cellPosition: TableCellPosition): TableCellProps['focusState'] => {\n if (cellPosition.row === keyboardNav.activeCell.row && cellPosition.column === keyboardNav.activeCell.column) {\n return keyboardNav.isActive ? 'trigger-focus' : 'focus-next';\n }\n\n return 'none';\n };\n\n const VirtuosoTableComponents: TableComponents<TableData> = useMemo(() => {\n return {\n Scroller: VirtualizedTableContainer,\n Table: (props) => {\n return <InnerTable {...props} width={width} density={density} onKeyDown={keyboardNav.onTableKeyDown} />;\n },\n TableHead,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TableRow: ({ item, ...props }) => {\n const index = props['data-index'];\n const row = rows[index];\n if (!row) {\n return null;\n }\n\n const rowEventOpts: TableRowEventOpts = { id: row.id, index: row.index };\n\n return (\n <TableRow\n {...props}\n onClick={(e) => onRowClick(e, row.id)}\n density={density}\n onMouseOver={(e) => {\n onRowMouseOver?.(e, rowEventOpts);\n }}\n onMouseOut={(e) => {\n onRowMouseOut?.(e, rowEventOpts);\n }}\n />\n );\n },\n TableBody,\n };\n }, [density, keyboardNav.onTableKeyDown, onRowClick, onRowMouseOut, onRowMouseOver, rows, width]);\n\n return (\n <Box sx={{ width, height }}>\n <TableVirtuoso\n ref={virtuosoRef}\n totalCount={rows.length}\n components={VirtuosoTableComponents}\n // Note: this value is impacted by overscan. See this issue if overscan\n // is added.\n // https://github.com/petyosi/react-virtuoso/issues/118#issuecomment-642156138\n rangeChanged={setVisibleRange}\n fixedHeaderContent={() => {\n return (\n <>\n {headers.map((headerGroup) => {\n return (\n <TableRow key={headerGroup.id} density={density}>\n {headerGroup.headers.map((header, i, headers) => {\n const column = header.column;\n const position: TableCellPosition = {\n row: 0,\n column: i,\n };\n\n const isSorted = column.getIsSorted();\n const nextSorting = column.getNextSortingOrder();\n\n return (\n <TableHeaderCell\n key={header.id}\n onSort={column.getCanSort() ? column.getToggleSortingHandler() : undefined}\n sortDirection={typeof isSorted === 'string' ? isSorted : undefined}\n nextSortDirection={typeof nextSorting === 'string' ? nextSorting : undefined}\n width={column.getSize() || 'auto'}\n align={column.columnDef.meta?.align}\n variant=\"head\"\n density={density}\n description={column.columnDef.meta?.headerDescription}\n focusState={getFocusState(position)}\n onFocusTrigger={() => keyboardNav.onCellFocus(position)}\n isFirstColumn={i === 0}\n isLastColumn={i === headers.length - 1}\n >\n {flexRender(column.columnDef.header, header.getContext())}\n </TableHeaderCell>\n );\n })}\n </TableRow>\n );\n })}\n </>\n );\n }}\n itemContent={(index) => {\n const row = rows[index];\n if (!row) {\n return null;\n }\n\n return (\n <>\n {row.getVisibleCells().map((cell, i, cells) => {\n const position: TableCellPosition = {\n // Add 1 to the row index because the header is row 0\n row: index + 1,\n column: i,\n };\n\n const cellContext = cell.getContext();\n const cellRenderFn = cell.column.columnDef.cell;\n const cellContent = typeof cellRenderFn == 'function' ? cellRenderFn(cellContext) : null;\n\n const cellDescriptionDef = cell.column.columnDef.meta?.cellDescription;\n let description: string | undefined = undefined;\n if (typeof cellDescriptionDef === 'function') {\n // If the cell description is a function, set the value using\n // the function.\n description = cellDescriptionDef(cellContext);\n } else if (cellDescriptionDef && typeof cellContent === 'string') {\n // If the cell description is `true` AND the cell content is\n // a string (and thus viable as a `title` attribute), use the\n // cell content.\n description = cellContent;\n }\n\n return (\n <TableCell\n key={cell.id}\n width={cell.column.getSize() || 'auto'}\n align={cell.column.columnDef.meta?.align}\n density={density}\n focusState={getFocusState(position)}\n onFocusTrigger={() => keyboardNav.onCellFocus(position)}\n isFirstColumn={i === 0}\n isLastColumn={i === cells.length - 1}\n description={description}\n >\n {cellContent}\n </TableCell>\n );\n })}\n </>\n );\n }}\n />\n </Box>\n );\n}\n"],"names":["flexRender","Box","TableVirtuoso","useRef","useMemo","TableRow","TableBody","InnerTable","TableHead","TableHeaderCell","TableCell","VirtualizedTableContainer","useVirtualizedTableKeyboardNav","VirtualizedTable","width","height","density","onRowClick","onRowMouseOver","onRowMouseOut","rows","columns","headers","virtuosoRef","visibleRange","startIndex","endIndex","setVisibleRange","newVisibleRange","current","keyboardNav","virtualTable","maxRows","length","maxColumns","getFocusState","cellPosition","row","activeCell","column","isActive","VirtuosoTableComponents","Scroller","Table","props","onKeyDown","onTableKeyDown","item","index","rowEventOpts","id","onClick","e","onMouseOver","onMouseOut","sx","ref","totalCount","components","rangeChanged","fixedHeaderContent","map","headerGroup","header","i","position","isSorted","getIsSorted","nextSorting","getNextSortingOrder","onSort","getCanSort","getToggleSortingHandler","undefined","sortDirection","nextSortDirection","getSize","align","columnDef","meta","variant","description","headerDescription","focusState","onFocusTrigger","onCellFocus","isFirstColumn","isLastColumn","getContext","itemContent","getVisibleCells","cell","cells","cellContext","cellRenderFn","cellContent","cellDescriptionDef","cellDescription"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAAmCA,UAAU,QAAQ,wBAAwB;AAC7E,SAASC,GAAG,QAAQ,gBAAgB;AACpC,SAASC,aAAa,QAAkE,iBAAiB;AACzG,SAASC,MAAM,EAAEC,OAAO,QAAQ,QAAQ;AACxC,SAASC,QAAQ,QAAQ,aAAa;AACtC,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAASC,SAAS,QAAwB,cAAc;AACxD,SAASC,yBAAyB,QAAQ,8BAA8B;AAExE,SAASC,8BAA8B,QAAQ,yCAAyC;AAexF,6EAA6E;AAC7E,4EAA4E;AAC5E,mBAAmB;AACnB,OAAO,SAASC,iBAA4B,EAC1CC,KAAK,EACLC,MAAM,EACNC,OAAO,EACPC,UAAU,EACVC,cAAc,EACdC,aAAa,EACbC,IAAI,EACJC,OAAO,EACPC,OAAO,EAC0B;IACjC,MAAMC,cAAcpB,OAA4B;IAEhD,uEAAuE;IACvE,0EAA0E;IAC1E,oCAAoC;IACpC,MAAMqB,eAAerB,OAAO;QAC1BsB,YAAY;QACZC,UAAU;IACZ;IACA,MAAMC,kBAA0E,CAACC;QAC/EJ,aAAaK,OAAO,GAAGD;IACzB;IAEA,MAAME,cAAclB,+BAA+B;QACjDY,cAAcA;QACdO,cAAcR;QAEd,gCAAgC;QAChCS,SAASZ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oBACR,OAAO;gBACT;gBAEA,qBACE;8BACGA,IAAIqD,eAAe,GAAG7B,GAAG,CAAC,CAAC8B,MAAM3B,GAAG4B;4BAWRD,6BAiBhBA;wBA3BX,MAAM1B,WAA8B;4BAClC,qDAAqD;4BACrD5B,KAAKW,QAAQ;4BACbT,QAAQyB;wBACV;wBAEA,MAAM6B,cAAcF,KAAKH,UAAU;wBACnC,MAAMM,eAAeH,KAAKpD,MAAM,CAACuC,SAAS,CAACa,IAAI;wBAC/C,MAAMI,cAAc,OAAOD,gBAAgB,aAAaA,aAAaD,eAAe;wBAEpF,MAAMG,sBAAqBL,8BAAAA,KAAKpD,MAAM,CAACuC,SAAS,CAACC,IAAI,cAA1BY,kDAAAA,4BAA4BM,eAAe;wBACtE,IAAIhB,cAAkCR;wBACtC,IAAI,OAAOuB,uBAAuB,YAAY;4BAC5C,6DAA6D;4BAC7D,gBAAgB;4BAChBf,cAAce,mBAAmBH;wBACnC,OAAO,IAAIG,sBAAsB,OAAOD,gBAAgB,UAAU;4BAChE,4DAA4D;4BAC5D,6DAA6D;4BAC7D,gBAAgB;4BAChBd,cAAcc;wBAChB;wBAEA,qBACE,KAACrF;4BAECI,OAAO6E,KAAKpD,MAAM,CAACqC,OAAO,MAAM;4BAChCC,KAAK,GAAEc,+BAAAA,KAAKpD,MAAM,CAACuC,SAAS,CAACC,IAAI,cAA1BY,mDAAAA,6BAA4Bd,KAAK;4BACxC7D,SAASA;4BACTmE,YAAYhD,cAAc8B;4BAC1BmB,gBAAgB,IAAMtD,YAAYuD,WAAW,CAACpB;4BAC9CqB,eAAetB,MAAM;4BACrBuB,cAAcvB,MAAM4B,MAAM3D,MAAM,GAAG;4BACnCgD,aAAaA;sCAEZc;2BAVIJ,KAAKzC,EAAE;oBAalB;;YAGN;;;AAIR"}
1
+ {"version":3,"sources":["../../src/Table/VirtualizedTable.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Column, HeaderGroup, Row, flexRender } from '@tanstack/react-table';\nimport { Box, TablePagination, TableRow as MuiTableRow } from '@mui/material';\nimport { TableVirtuoso, TableComponents, TableVirtuosoHandle, TableVirtuosoProps } from 'react-virtuoso';\nimport { useRef, useMemo, ReactElement } from 'react';\nimport { TableRow } from './TableRow';\nimport { TableBody } from './TableBody';\nimport { InnerTable } from './InnerTable';\nimport { TableHead } from './TableHead';\nimport { TableHeaderCell } from './TableHeaderCell';\nimport { TableCell, TableCellProps } from './TableCell';\nimport { VirtualizedTableContainer } from './VirtualizedTableContainer';\nimport { TableCellConfigs, TableProps, TableRowEventOpts } from './model/table-model';\nimport { useVirtualizedTableKeyboardNav } from './hooks/useVirtualizedTableKeyboardNav';\nimport { TableFoot } from './TableFoot';\n\ntype TableCellPosition = {\n row: number;\n column: number;\n};\n\nexport type VirtualizedTableProps<TableData> = Required<\n Pick<TableProps<TableData>, 'height' | 'width' | 'density' | 'defaultColumnWidth' | 'defaultColumnHeight'>\n> &\n Pick<TableProps<TableData>, 'onRowMouseOver' | 'onRowMouseOut' | 'pagination' | 'onPaginationChange'> & {\n onRowClick: (e: React.MouseEvent<HTMLDivElement, MouseEvent>, id: string) => void;\n rows: Array<Row<TableData>>;\n columns: Array<Column<TableData, unknown>>;\n headers: Array<HeaderGroup<TableData>>;\n cellConfigs?: TableCellConfigs;\n rowCount: number;\n };\n\n// Separating out the virtualized table because we may want a paginated table\n// in the future that does not need virtualization, and we'd likely lay them\n// out differently.\nexport function VirtualizedTable<TableData>({\n width,\n height,\n density,\n defaultColumnWidth,\n defaultColumnHeight,\n onRowClick,\n onRowMouseOver,\n onRowMouseOut,\n rows,\n columns,\n headers,\n cellConfigs,\n pagination,\n onPaginationChange,\n rowCount,\n}: VirtualizedTableProps<TableData>): ReactElement {\n const virtuosoRef = useRef<TableVirtuosoHandle>(null);\n\n // Use a ref for these values because they are only needed for keyboard\n // focus interactions and setting them on state will lead to a significant\n // amount of unnecessary re-renders.\n const visibleRange = useRef({\n startIndex: 0,\n endIndex: 0,\n });\n const setVisibleRange: TableVirtuosoProps<TableData, unknown>['rangeChanged'] = (newVisibleRange) => {\n visibleRange.current = newVisibleRange;\n };\n\n const keyboardNav = useVirtualizedTableKeyboardNav({\n visibleRange: visibleRange,\n virtualTable: virtuosoRef,\n\n // We add 1 here for the header.\n maxRows: rows.length + 1,\n maxColumns: columns.length,\n });\n\n const getFocusState = (cellPosition: TableCellPosition): TableCellProps['focusState'] => {\n if (cellPosition.row === keyboardNav.activeCell.row && cellPosition.column === keyboardNav.activeCell.column) {\n return keyboardNav.isActive ? 'trigger-focus' : 'focus-next';\n }\n\n return 'none';\n };\n\n const VirtuosoTableComponents: TableComponents<TableData> = useMemo(() => {\n return {\n Scroller: VirtualizedTableContainer,\n Table: (props): ReactElement => {\n return <InnerTable {...props} width={width} density={density} onKeyDown={keyboardNav.onTableKeyDown} />;\n },\n TableHead,\n TableFoot,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n TableRow: ({ item, ...props }): ReactElement | null => {\n const index = props['data-index'];\n const row = rows[index];\n if (!row) {\n return null;\n }\n\n const rowEventOpts: TableRowEventOpts = { id: row.id, index: row.index };\n\n return (\n <TableRow\n {...props}\n onClick={(e) => onRowClick(e, row.id)}\n density={density}\n onMouseOver={(e) => {\n onRowMouseOver?.(e, rowEventOpts);\n }}\n onMouseOut={(e) => {\n onRowMouseOut?.(e, rowEventOpts);\n }}\n />\n );\n },\n TableBody,\n };\n }, [density, keyboardNav.onTableKeyDown, onRowClick, onRowMouseOut, onRowMouseOver, rows, width]);\n\n const handleChangePage = (_event: React.MouseEvent<HTMLButtonElement> | null, newPage: number): void => {\n if (!pagination || !onPaginationChange) return;\n onPaginationChange({ ...pagination, pageIndex: newPage });\n };\n\n const handleChangeRowsPerPage = (event: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>): void => {\n if (!pagination || !onPaginationChange) return;\n onPaginationChange({ pageIndex: 0, pageSize: parseInt(event.target.value, 10) });\n };\n\n return (\n <Box style={{ width, height }}>\n <TableVirtuoso\n ref={virtuosoRef}\n totalCount={rows.length}\n components={VirtuosoTableComponents}\n // Note: this value is impacted by overscan. See this issue if overscan\n // is added.\n // https://github.com/petyosi/react-virtuoso/issues/118#issuecomment-642156138\n rangeChanged={setVisibleRange}\n fixedHeaderContent={() => {\n return (\n <>\n {headers.map((headerGroup) => {\n return (\n <TableRow key={headerGroup.id} density={density}>\n {headerGroup.headers.map((header, i, headers) => {\n const column = header.column;\n const position: TableCellPosition = {\n row: 0,\n column: i,\n };\n\n const isSorted = column.getIsSorted();\n const nextSorting = column.getNextSortingOrder();\n\n return (\n <TableHeaderCell\n key={header.id}\n onSort={column.getCanSort() ? column.getToggleSortingHandler() : undefined}\n sortDirection={typeof isSorted === 'string' ? isSorted : undefined}\n nextSortDirection={typeof nextSorting === 'string' ? nextSorting : undefined}\n width={column.getSize() || defaultColumnWidth}\n defaultColumnHeight={defaultColumnHeight}\n align={column.columnDef.meta?.align}\n variant=\"head\"\n density={density}\n description={column.columnDef.meta?.headerDescription}\n focusState={getFocusState(position)}\n onFocusTrigger={() => keyboardNav.onCellFocus(position)}\n isFirstColumn={i === 0}\n isLastColumn={i === headers.length - 1}\n >\n {flexRender(column.columnDef.header, header.getContext())}\n </TableHeaderCell>\n );\n })}\n </TableRow>\n );\n })}\n </>\n );\n }}\n fixedFooterContent={\n pagination\n ? (): ReactElement => (\n <MuiTableRow sx={{ backgroundColor: (theme) => theme.palette.background.default }}>\n <TablePagination\n colSpan={columns.length}\n count={rowCount}\n page={pagination.pageIndex}\n rowsPerPage={pagination.pageSize}\n onPageChange={handleChangePage}\n onRowsPerPageChange={handleChangeRowsPerPage}\n />\n </MuiTableRow>\n )\n : undefined\n }\n itemContent={(index) => {\n const row = rows[index];\n if (!row) {\n return null;\n }\n\n return (\n <>\n {row.getVisibleCells().map((cell, i, cells) => {\n const position: TableCellPosition = {\n // Add 1 to the row index because the header is row 0\n row: index + 1,\n column: i,\n };\n\n const cellContext = cell.getContext();\n const cellConfig = cellConfigs?.[cellContext.cell.id];\n\n const cellRenderFn = cell.column.columnDef.cell;\n const cellContent = typeof cellRenderFn === 'function' ? cellRenderFn(cellContext) : null;\n\n const cellDescriptionDef = cell.column.columnDef.meta?.cellDescription;\n let description: string | undefined = undefined;\n if (typeof cellDescriptionDef === 'function') {\n // If the cell description is a function, set the value using\n // the function.\n description = cellDescriptionDef(cellContext);\n } else if (cellDescriptionDef && typeof cellContent === 'string') {\n // If the cell description is `true` AND the cell content is\n // a string (and thus viable as a `title` attribute), use the\n // cell content.\n description = cellContent;\n }\n\n return (\n <TableCell\n key={cell.id}\n data-testid={cell.id}\n title={description || cellConfig?.text || cellContent}\n width={cell.column.getSize() || defaultColumnWidth}\n defaultColumnHeight={defaultColumnHeight}\n align={cell.column.columnDef.meta?.align}\n density={density}\n focusState={getFocusState(position)}\n onFocusTrigger={() => keyboardNav.onCellFocus(position)}\n isFirstColumn={i === 0}\n isLastColumn={i === cells.length - 1}\n description={description}\n color={cellConfig?.textColor ?? undefined}\n backgroundColor={cellConfig?.backgroundColor ?? undefined}\n >\n {cellConfig?.text || cellContent}\n </TableCell>\n );\n })}\n </>\n );\n }}\n />\n </Box>\n );\n}\n"],"names":["flexRender","Box","TablePagination","TableRow","MuiTableRow","TableVirtuoso","useRef","useMemo","TableBody","InnerTable","TableHead","TableHeaderCell","TableCell","VirtualizedTableContainer","useVirtualizedTableKeyboardNav","TableFoot","VirtualizedTable","width","height","density","defaultColumnWidth","defaultColumnHeight","onRowClick","onRowMouseOver","onRowMouseOut","rows","columns","headers","cellConfigs","pagination","onPaginationChange","rowCount","virtuosoRef","visibleRange","startIndex","endIndex","setVisibleRange","newVisibleRange","current","keyboardNav","virtualTable","maxRows","length","maxColumns","getFocusState","cellPosition","row","activeCell","column","isActive","VirtuosoTableComponents","Scroller","Table","props","onKeyDown","onTableKeyDown","item","index","rowEventOpts","id","onClick","e","onMouseOver","onMouseOut","handleChangePage","_event","newPage","pageIndex","handleChangeRowsPerPage","event","pageSize","parseInt","target","value","style","ref","totalCount","components","rangeChanged","fixedHeaderContent","map","headerGroup","header","i","position","isSorted","getIsSorted","nextSorting","getNextSortingOrder","onSort","getCanSort","getToggleSortingHandler","undefined","sortDirection","nextSortDirection","getSize","align","columnDef","meta","variant","description","headerDescription","focusState","onFocusTrigger","onCellFocus","isFirstColumn","isLastColumn","getContext","fixedFooterContent","sx","backgroundColor","theme","palette","background","default","colSpan","count","page","rowsPerPage","onPageChange","onRowsPerPageChange","itemContent","getVisibleCells","cell","cells","cellContext","cellConfig","cellRenderFn","cellContent","cellDescriptionDef","cellDescription","data-testid","title","text","color","textColor"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAAmCA,UAAU,QAAQ,wBAAwB;AAC7E,SAASC,GAAG,EAAEC,eAAe,EAAEC,YAAYC,WAAW,QAAQ,gBAAgB;AAC9E,SAASC,aAAa,QAAkE,iBAAiB;AACzG,SAASC,MAAM,EAAEC,OAAO,QAAsB,QAAQ;AACtD,SAASJ,QAAQ,QAAQ,aAAa;AACtC,SAASK,SAAS,QAAQ,cAAc;AACxC,SAASC,UAAU,QAAQ,eAAe;AAC1C,SAASC,SAAS,QAAQ,cAAc;AACxC,SAASC,eAAe,QAAQ,oBAAoB;AACpD,SAASC,SAAS,QAAwB,cAAc;AACxD,SAASC,yBAAyB,QAAQ,8BAA8B;AAExE,SAASC,8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EventHandler } from 'react';
2
2
  export interface UseTableKeyboardNavProps {
3
3
  maxRows: number;
4
4
  maxColumns: number;
@@ -25,7 +25,7 @@ type TableCellPosition = {
25
25
  export declare function useTableKeyboardNav({ maxRows, maxColumns, onActiveCellChange }: UseTableKeyboardNavProps): {
26
26
  activeCell: TableCellPosition;
27
27
  isActive: boolean;
28
- onTableKeyDown: import("react").KeyboardEventHandler<HTMLTableElement>;
28
+ onTableKeyDown: KeyboardEventHandler<HTMLTableElement>;
29
29
  onCellFocus: (cellPosition: TableCellPosition) => void;
30
30
  };
31
31
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"useTableKeyboardNav.d.ts","sourceRoot":"","sources":["../../../src/Table/hooks/useTableKeyboardNav.tsx"],"names":[],"mappings":";AAeA,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,CACnB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,EACxC,iBAAiB,EAAE,iBAAiB,EACpC,qBAAqB,EAAE,iBAAiB,GAAG,SAAS,KACjD,iBAAiB,GAAG,SAAS,CAAC;CACpC;AAED,KAAK,iBAAiB,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAaF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,EAAE,wBAAwB;;;;gCAIhE,iBAAiB;EAiEzD"}
1
+ {"version":3,"file":"useTableKeyboardNav.d.ts","sourceRoot":"","sources":["../../../src/Table/hooks/useTableKeyboardNav.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAyB,MAAM,OAAO,CAAC;AAEpE,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IAEnB;;;;;;;OAOG;IACH,kBAAkB,CAAC,EAAE,CACnB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC,gBAAgB,CAAC,EACxC,iBAAiB,EAAE,iBAAiB,EACpC,qBAAqB,EAAE,iBAAiB,GAAG,SAAS,KACjD,iBAAiB,GAAG,SAAS,CAAC;CACpC;AAED,KAAK,iBAAiB,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAaF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,EAAE,wBAAwB,GAAG;IAC1G,UAAU,EAAE,iBAAiB,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;IAClB,cAAc,EAAE,oBAAoB,CAAC,gBAAgB,CAAC,CAAC;IACvD,WAAW,EAAE,CAAC,YAAY,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACxD,CAqEA"}
@@ -73,7 +73,7 @@ function isArrowKey(key) {
73
73
  column: nextColumn,
74
74
  row: nextRow
75
75
  };
76
- const newPosition = (onActiveCellChange === null || onActiveCellChange === void 0 ? void 0 : onActiveCellChange(e, curActiveCell, defaultNewPosition)) || defaultNewPosition;
76
+ const newPosition = onActiveCellChange?.(e, curActiveCell, defaultNewPosition) || defaultNewPosition;
77
77
  if (newPosition.row === curActiveCell.row && newPosition.column === curActiveCell.column) {
78
78
  // Return original to avoid creating a new object if nothing
79
79
  // changed.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/Table/hooks/useTableKeyboardNav.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { useCallback, useState } from 'react';\n\nexport interface UseTableKeyboardNavProps {\n maxRows: number;\n maxColumns: number;\n\n /**\n * Function used to modify the active table cell based on the keyboard event,\n * the current position, and the default recommended next position (this value\n * will be `undefined` in cases where there is no default handler like `PageUp`\n * and `PageDown`). This can be used to modify the next position that will be\n * used and/or to handle side effects related to the new position (e.g.\n * pagination, scrolling the active cell into view).\n */\n onActiveCellChange?: (\n e: React.KeyboardEvent<HTMLTableElement>,\n currentActiveCell: TableCellPosition,\n defaultNextActiveCell: TableCellPosition | undefined\n ) => TableCellPosition | undefined;\n}\n\ntype TableCellPosition = {\n row: number;\n column: number;\n};\n\nconst DEFAULT_ACTIVE_CELL: TableCellPosition = {\n row: 0,\n column: 0,\n};\n\nconst ARROW_KEYS = ['ArrowRight', 'ArrowLeft', 'ArrowUp', 'ArrowDown'];\n\nfunction isArrowKey(key: string) {\n return ARROW_KEYS.includes(key);\n}\n\n/**\n * Hook for managing keyboard navigation for table components. It is intended\n * to be wrapped by implementation-specific tables to account for differences\n * like pagination, infinite scroll, and virtualization. See `useVirtualizedKeyboardNav`\n * for an example.\n */\nexport function useTableKeyboardNav({ maxRows, maxColumns, onActiveCellChange }: UseTableKeyboardNavProps) {\n const [activeCell, setActiveCell] = useState<TableCellPosition>(DEFAULT_ACTIVE_CELL);\n const [isActive, setIsActive] = useState(false);\n\n const handleCellFocus = (cellPosition: TableCellPosition) => {\n if (cellPosition.column === activeCell.column && cellPosition.row === activeCell.row && isActive) {\n return;\n }\n setIsActive(true);\n setActiveCell(cellPosition);\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLTableElement> = useCallback(\n (e) => {\n // Including some of the basic a11y keyboard interaction patterns from:\n // https://www.w3.org/WAI/ARIA/apg/patterns/grid/\n // TODO: add other keyboard combos.\n const key = e.key;\n\n if (isArrowKey(key) || key === 'Home' || key === 'End' || key === 'PageDown' || key === 'PageUp') {\n setActiveCell((curActiveCell) => {\n let nextRow: number = curActiveCell.row;\n let nextColumn: number = curActiveCell.column;\n\n if (key === 'ArrowRight' && nextColumn < maxColumns - 1) {\n e.preventDefault();\n nextColumn += 1;\n } else if (key === 'ArrowLeft' && nextColumn > 0) {\n e.preventDefault();\n nextColumn -= 1;\n } else if (key === 'ArrowDown' && nextRow < maxRows - 1) {\n e.preventDefault();\n nextRow += 1;\n } else if (key === 'ArrowUp' && nextRow > 0) {\n e.preventDefault();\n nextRow -= 1;\n } else if (key === 'Home') {\n e.preventDefault();\n nextRow = 0;\n nextColumn = 0;\n } else if (key === 'End') {\n e.preventDefault();\n nextRow = maxRows - 1;\n nextColumn = maxColumns - 1;\n }\n\n const defaultNewPosition = { column: nextColumn, row: nextRow };\n\n const newPosition = onActiveCellChange?.(e, curActiveCell, defaultNewPosition) || defaultNewPosition;\n\n if (newPosition.row === curActiveCell.row && newPosition.column === curActiveCell.column) {\n // Return original to avoid creating a new object if nothing\n // changed.\n return curActiveCell;\n }\n\n return newPosition;\n });\n }\n },\n [maxColumns, maxRows, onActiveCellChange]\n );\n\n return {\n activeCell,\n isActive,\n onTableKeyDown: handleKeyDown,\n onCellFocus: handleCellFocus,\n };\n}\n"],"names":["useCallback","useState","DEFAULT_ACTIVE_CELL","row","column","ARROW_KEYS","isArrowKey","key","includes","useTableKeyboardNav","maxRows","maxColumns","onActiveCellChange","activeCell","setActiveCell","isActive","setIsActive","handleCellFocus","cellPosition","handleKeyDown","e","curActiveCell","nextRow","nextColumn","preventDefault","defaultNewPosition","newPosition","onTableKeyDown","onCellFocus"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AA0B9C,MAAMC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a;gBACf,OAAO,IAAIhB,QAAQ,OAAO;oBACxBa,EAAEI,cAAc;oBAChBF,UAAUZ,UAAU;oBACpBa,aAAaZ,aAAa;gBAC5B;gBAEA,MAAMc,qBAAqB;oBAAErB,QAAQmB;oBAAYpB,KAAKmB;gBAAQ;gBAE9D,MAAMI,cAAcd,CAAAA,+BAAAA,yCAAAA,mBAAqBQ,GAAGC,eAAeI,wBAAuBA;gBAElF,IAAIC,YAAYvB,GAAG,KAAKkB,cAAclB,GAAG,IAAIuB,YAAYtB,MAAM,KAAKiB,cAAcjB,MAAM,EAAE;oBACxF,4DAA4D;oBAC5D,WAAW;oBACX,OAAOiB;gBACT;gBAEA,OAAOK;YACT;QACF;IACF,GACA;QAACf;QAAYD;QAASE;KAAmB;IAG3C,OAAO;QACLC;QACAE;QACAY,gBAAgBR;QAChBS,aAAaX;IACf;AACF"}
1
+ {"version":3,"sources":["../../../src/Table/hooks/useTableKeyboardNav.tsx"],"sourcesContent":["// Copyright 2023 The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { KeyboardEventHandler, useCallback, useState } from 'react';\n\nexport interface UseTableKeyboardNavProps {\n maxRows: number;\n maxColumns: number;\n\n /**\n * Function used to modify the active table cell based on the keyboard event,\n * the current position, and the default recommended next position (this value\n * will be `undefined` in cases where there is no default handler like `PageUp`\n * and `PageDown`). This can be used to modify the next position that will be\n * used and/or to handle side effects related to the new position (e.g.\n * pagination, scrolling the active cell into view).\n */\n onActiveCellChange?: (\n e: React.KeyboardEvent<HTMLTableElement>,\n currentActiveCell: TableCellPosition,\n defaultNextActiveCell: TableCellPosition | undefined\n ) => TableCellPosition | undefined;\n}\n\ntype TableCellPosition = {\n row: number;\n column: number;\n};\n\nconst DEFAULT_ACTIVE_CELL: TableCellPosition = {\n row: 0,\n column: 0,\n};\n\nconst ARROW_KEYS = ['ArrowRight', 'ArrowLeft', 'ArrowUp', 'ArrowDown'];\n\nfunction isArrowKey(key: string): boolean {\n return ARROW_KEYS.includes(key);\n}\n\n/**\n * Hook for managing keyboard navigation for table components. It is intended\n * to be wrapped by implementation-specific tables to account for differences\n * like pagination, infinite scroll, and virtualization. See `useVirtualizedKeyboardNav`\n * for an example.\n */\nexport function useTableKeyboardNav({ maxRows, maxColumns, onActiveCellChange }: UseTableKeyboardNavProps): {\n activeCell: TableCellPosition;\n isActive: boolean;\n onTableKeyDown: KeyboardEventHandler<HTMLTableElement>;\n onCellFocus: (cellPosition: TableCellPosition) => void;\n} {\n const [activeCell, setActiveCell] = useState<TableCellPosition>(DEFAULT_ACTIVE_CELL);\n const [isActive, setIsActive] = useState(false);\n\n const handleCellFocus = (cellPosition: TableCellPosition): void => {\n if (cellPosition.column === activeCell.column && cellPosition.row === activeCell.row && isActive) {\n return;\n }\n setIsActive(true);\n setActiveCell(cellPosition);\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLTableElement> = useCallback(\n (e) => {\n // Including some of the basic a11y keyboard interaction patterns from:\n // https://www.w3.org/WAI/ARIA/apg/patterns/grid/\n // TODO: add other keyboard combos.\n const key = e.key;\n\n if (isArrowKey(key) || key === 'Home' || key === 'End' || key === 'PageDown' || key === 'PageUp') {\n setActiveCell((curActiveCell) => {\n let nextRow: number = curActiveCell.row;\n let nextColumn: number = curActiveCell.column;\n\n if (key === 'ArrowRight' && nextColumn < maxColumns - 1) {\n e.preventDefault();\n nextColumn += 1;\n } else if (key === 'ArrowLeft' && nextColumn > 0) {\n e.preventDefault();\n nextColumn -= 1;\n } else if (key === 'ArrowDown' && nextRow < maxRows - 1) {\n e.preventDefault();\n nextRow += 1;\n } else if (key === 'ArrowUp' && nextRow > 0) {\n e.preventDefault();\n nextRow -= 1;\n } else if (key === 'Home') {\n e.preventDefault();\n nextRow = 0;\n nextColumn = 0;\n } else if (key === 'End') {\n e.preventDefault();\n nextRow = maxRows - 1;\n nextColumn = maxColumns - 1;\n }\n\n const defaultNewPosition = { column: nextColumn, row: nextRow };\n\n const newPosition = onActiveCellChange?.(e, curActiveCell, defaultNewPosition) || defaultNewPosition;\n\n if (newPosition.row === curActiveCell.row && newPosition.column === curActiveCell.column) {\n // Return original to avoid creating a new object if nothing\n // changed.\n return curActiveCell;\n }\n\n return newPosition;\n });\n }\n },\n [maxColumns, maxRows, onActiveCellChange]\n );\n\n return {\n activeCell,\n isActive,\n onTableKeyDown: handleKeyDown,\n onCellFocus: handleCellFocus,\n };\n}\n"],"names":["useCallback","useState","DEFAULT_ACTIVE_CELL","row","column","ARROW_KEYS","isArrowKey","key","includes","useTableKeyboardNav","maxRows","maxColumns","onActiveCellChange","activeCell","setActiveCell","isActive","setIsActive","handleCellFocus","cellPosition","handleKeyDown","e","curActiveCell","nextRow","nextColumn","preventDefault","defaultNewPosition","newPosition","onTableKeyDown","onCellFocus"],"mappings":"AAAA,oCAAoC;AACpC,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAA+BA,WAAW,EAAEC,QAAQ,QAAQ,QAAQ;AA0BpE,MAAMC,sBAAyC;IAC7CC,KAAK;IACLC,QAAQ;AACV;AAEA,MAAMC,aAAa;IAAC;IAAc;IAAa;IAAW;CAAY;AAEtE,SAASC,WAAWC,GAAW;IAC7B,OAAOF,WAAWG,QAAQ,CAACD;AAC7B;AAEA;;;;;CAKC,GACD,OAAO,SAASE,oBAAoB,EAAEC,OAAO,EAAEC,UAAU,EAAEC,kBAAkB,EAA4B;IAMvG,MAAM,CAACC,YAAYC,cAAc,GAAG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