@perses-dev/components 0.0.0-snapshot-panel-extra-content-2-2767e21 → 0.0.0-snapshot-scatter-chart-embed-8efdfab

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 (360) hide show
  1. package/dist/BarChart/BarChart.d.ts +2 -2
  2. package/dist/BarChart/BarChart.d.ts.map +1 -1
  3. package/dist/BarChart/BarChart.js +16 -10
  4. package/dist/BarChart/BarChart.js.map +1 -1
  5. package/dist/BarChart/index.js.map +1 -1
  6. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  7. package/dist/ColorPicker/index.js.map +1 -1
  8. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  9. package/dist/ContentWithLegend/index.js.map +1 -1
  10. package/dist/ContentWithLegend/model/content-with-legend-model.d.ts +1 -1
  11. package/dist/ContentWithLegend/model/content-with-legend-model.js +19 -19
  12. package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
  13. package/dist/DateTimeRangePicker/AbsoluteTimePicker.d.ts.map +1 -1
  14. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js +6 -22
  15. package/dist/DateTimeRangePicker/AbsoluteTimePicker.js.map +1 -1
  16. package/dist/DateTimeRangePicker/DateTimeRangePicker.js.map +1 -1
  17. package/dist/DateTimeRangePicker/TimeRangeSelector.js.map +1 -1
  18. package/dist/DateTimeRangePicker/index.js.map +1 -1
  19. package/dist/DateTimeRangePicker/utils.js.map +1 -1
  20. package/dist/Dialog/Dialog.js.map +1 -1
  21. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  22. package/dist/Dialog/index.js.map +1 -1
  23. package/dist/Drawer/Drawer.d.ts.map +1 -1
  24. package/dist/Drawer/Drawer.js +3 -2
  25. package/dist/Drawer/Drawer.js.map +1 -1
  26. package/dist/Drawer/index.js.map +1 -1
  27. package/dist/EChart/EChart.js +2 -2
  28. package/dist/EChart/EChart.js.map +1 -1
  29. package/dist/EChart/index.js.map +1 -1
  30. package/dist/ErrorAlert.js.map +1 -1
  31. package/dist/ErrorBoundary.js.map +1 -1
  32. package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
  33. package/dist/FontSizeSelector/index.js.map +1 -1
  34. package/dist/FormatControls/FormatControls.d.ts +9 -0
  35. package/dist/FormatControls/FormatControls.d.ts.map +1 -0
  36. package/dist/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +26 -26
  37. package/dist/FormatControls/FormatControls.js.map +1 -0
  38. package/dist/FormatControls/index.d.ts +2 -0
  39. package/dist/FormatControls/index.d.ts.map +1 -0
  40. package/dist/{UnitSelector → FormatControls}/index.js +1 -1
  41. package/dist/FormatControls/index.js.map +1 -0
  42. package/dist/GaugeChart/GaugeChart.d.ts +3 -3
  43. package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
  44. package/dist/GaugeChart/GaugeChart.js +12 -12
  45. package/dist/GaugeChart/GaugeChart.js.map +1 -1
  46. package/dist/GaugeChart/index.js.map +1 -1
  47. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  48. package/dist/InfoTooltip/index.js.map +1 -1
  49. package/dist/JSONEditor.d.ts +2 -1
  50. package/dist/JSONEditor.d.ts.map +1 -1
  51. package/dist/JSONEditor.js +9 -8
  52. package/dist/JSONEditor.js.map +1 -1
  53. package/dist/Legend/CompactLegend.js.map +1 -1
  54. package/dist/Legend/Legend.js +3 -3
  55. package/dist/Legend/Legend.js.map +1 -1
  56. package/dist/Legend/LegendColorBadge.js.map +1 -1
  57. package/dist/Legend/ListLegend.js.map +1 -1
  58. package/dist/Legend/ListLegendItem.js +2 -2
  59. package/dist/Legend/ListLegendItem.js.map +1 -1
  60. package/dist/Legend/TableLegend.js.map +1 -1
  61. package/dist/Legend/index.js.map +1 -1
  62. package/dist/Legend/legend-model.js.map +1 -1
  63. package/dist/LineChart/LineChart.d.ts +2 -2
  64. package/dist/LineChart/LineChart.d.ts.map +1 -1
  65. package/dist/LineChart/LineChart.js +20 -23
  66. package/dist/LineChart/LineChart.js.map +1 -1
  67. package/dist/LineChart/index.js.map +1 -1
  68. package/dist/ModeSelector/ModeSelector.js.map +1 -1
  69. package/dist/ModeSelector/index.js.map +1 -1
  70. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  71. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  72. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  73. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  74. package/dist/OptionsEditorLayout/index.js.map +1 -1
  75. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
  76. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +22 -6
  77. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  78. package/dist/RefreshIntervalPicker/index.js.map +1 -1
  79. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +2 -2
  80. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  81. package/dist/SettingsAutocomplete/index.js.map +1 -1
  82. package/dist/SortSelector/SortSelector.js.map +1 -1
  83. package/dist/SortSelector/index.js.map +1 -1
  84. package/dist/StatChart/StatChart.d.ts +2 -2
  85. package/dist/StatChart/StatChart.d.ts.map +1 -1
  86. package/dist/StatChart/StatChart.js +8 -8
  87. package/dist/StatChart/StatChart.js.map +1 -1
  88. package/dist/StatChart/calculateFontSize.js +7 -7
  89. package/dist/StatChart/calculateFontSize.js.map +1 -1
  90. package/dist/StatChart/index.js.map +1 -1
  91. package/dist/Table/InnerTable.js.map +1 -1
  92. package/dist/Table/Table.js.map +1 -1
  93. package/dist/Table/TableBody.js.map +1 -1
  94. package/dist/Table/TableCell.js +2 -2
  95. package/dist/Table/TableCell.js.map +1 -1
  96. package/dist/Table/TableCheckbox.js.map +1 -1
  97. package/dist/Table/TableHead.js.map +1 -1
  98. package/dist/Table/TableHeaderCell.js.map +1 -1
  99. package/dist/Table/TableRow.js.map +1 -1
  100. package/dist/Table/VirtualizedTable.js +6 -6
  101. package/dist/Table/VirtualizedTable.js.map +1 -1
  102. package/dist/Table/VirtualizedTableContainer.js.map +1 -1
  103. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  104. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +20 -20
  105. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  106. package/dist/Table/index.js.map +1 -1
  107. package/dist/Table/model/table-model.js +9 -9
  108. package/dist/Table/model/table-model.js.map +1 -1
  109. package/dist/ThresholdsEditor/ThresholdColorPicker.js +2 -2
  110. package/dist/ThresholdsEditor/ThresholdColorPicker.js.map +1 -1
  111. package/dist/ThresholdsEditor/ThresholdInput.js +1 -1
  112. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  113. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
  114. package/dist/ThresholdsEditor/ThresholdsEditor.js +19 -18
  115. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  116. package/dist/ThresholdsEditor/index.js.map +1 -1
  117. package/dist/TimeChart/TimeChart.d.ts +3 -3
  118. package/dist/TimeChart/TimeChart.d.ts.map +1 -1
  119. package/dist/TimeChart/TimeChart.js +109 -66
  120. package/dist/TimeChart/TimeChart.js.map +1 -1
  121. package/dist/TimeChart/index.js.map +1 -1
  122. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +3 -2
  123. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
  124. package/dist/TimeSeriesTooltip/LineChartTooltip.js +12 -10
  125. package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
  126. package/dist/TimeSeriesTooltip/SeriesInfo.js +2 -2
  127. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  128. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  129. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  130. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +3 -2
  131. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
  132. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +7 -6
  133. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  134. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  135. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts +1 -0
  136. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
  137. package/dist/TimeSeriesTooltip/TooltipHeader.js +11 -11
  138. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  139. package/dist/TimeSeriesTooltip/index.js.map +1 -1
  140. package/dist/TimeSeriesTooltip/nearby-series.d.ts +7 -7
  141. package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
  142. package/dist/TimeSeriesTooltip/nearby-series.js +42 -43
  143. package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
  144. package/dist/TimeSeriesTooltip/tooltip-model.d.ts +13 -22
  145. package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
  146. package/dist/TimeSeriesTooltip/tooltip-model.js +10 -10
  147. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  148. package/dist/TimeSeriesTooltip/utils.d.ts +1 -1
  149. package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
  150. package/dist/TimeSeriesTooltip/utils.js +5 -4
  151. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  152. package/dist/YAxisLabel.js.map +1 -1
  153. package/dist/cjs/BarChart/BarChart.js +24 -16
  154. package/dist/cjs/BarChart/index.js +10 -8
  155. package/dist/cjs/ColorPicker/ColorPicker.js +15 -13
  156. package/dist/cjs/ColorPicker/index.js +10 -8
  157. package/dist/cjs/ContentWithLegend/ContentWithLegend.js +12 -10
  158. package/dist/cjs/ContentWithLegend/index.js +10 -8
  159. package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +27 -23
  160. package/dist/cjs/DateTimeRangePicker/AbsoluteTimePicker.js +29 -43
  161. package/dist/cjs/DateTimeRangePicker/DateTimeRangePicker.js +12 -10
  162. package/dist/cjs/DateTimeRangePicker/TimeRangeSelector.js +13 -11
  163. package/dist/cjs/DateTimeRangePicker/index.js +12 -10
  164. package/dist/cjs/DateTimeRangePicker/utils.js +9 -5
  165. package/dist/cjs/Dialog/Dialog.js +15 -13
  166. package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +11 -9
  167. package/dist/cjs/Dialog/index.js +11 -9
  168. package/dist/cjs/Drawer/Drawer.js +7 -4
  169. package/dist/cjs/Drawer/index.js +10 -8
  170. package/dist/cjs/EChart/EChart.js +12 -10
  171. package/dist/cjs/EChart/index.js +10 -8
  172. package/dist/cjs/ErrorAlert.js +5 -3
  173. package/dist/cjs/ErrorBoundary.js +4 -2
  174. package/dist/cjs/FontSizeSelector/FontSizeSelector.js +8 -6
  175. package/dist/cjs/FontSizeSelector/index.js +10 -8
  176. package/dist/cjs/{UnitSelector/UnitSelector.js → FormatControls/FormatControls.js} +38 -36
  177. package/dist/cjs/{UnitSelector → FormatControls}/index.js +10 -8
  178. package/dist/cjs/GaugeChart/GaugeChart.js +22 -18
  179. package/dist/cjs/GaugeChart/index.js +10 -8
  180. package/dist/cjs/InfoTooltip/InfoTooltip.js +13 -11
  181. package/dist/cjs/InfoTooltip/index.js +10 -8
  182. package/dist/cjs/JSONEditor.js +19 -16
  183. package/dist/cjs/Legend/CompactLegend.js +9 -7
  184. package/dist/cjs/Legend/Legend.js +15 -13
  185. package/dist/cjs/Legend/LegendColorBadge.js +7 -5
  186. package/dist/cjs/Legend/ListLegend.js +10 -8
  187. package/dist/cjs/Legend/ListLegendItem.js +12 -10
  188. package/dist/cjs/Legend/TableLegend.js +7 -5
  189. package/dist/cjs/Legend/index.js +11 -9
  190. package/dist/cjs/Legend/legend-model.js +3 -1
  191. package/dist/cjs/LineChart/LineChart.js +29 -30
  192. package/dist/cjs/LineChart/index.js +10 -8
  193. package/dist/cjs/ModeSelector/ModeSelector.js +8 -6
  194. package/dist/cjs/ModeSelector/index.js +10 -8
  195. package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +6 -4
  196. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +16 -14
  197. package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +5 -3
  198. package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +11 -9
  199. package/dist/cjs/OptionsEditorLayout/index.js +13 -11
  200. package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +27 -9
  201. package/dist/cjs/RefreshIntervalPicker/index.js +10 -8
  202. package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +12 -10
  203. package/dist/cjs/SettingsAutocomplete/index.js +10 -8
  204. package/dist/cjs/SortSelector/SortSelector.js +8 -6
  205. package/dist/cjs/SortSelector/index.js +10 -8
  206. package/dist/cjs/StatChart/StatChart.js +20 -18
  207. package/dist/cjs/StatChart/calculateFontSize.js +10 -8
  208. package/dist/cjs/StatChart/index.js +10 -8
  209. package/dist/cjs/Table/InnerTable.js +5 -3
  210. package/dist/cjs/Table/Table.js +15 -13
  211. package/dist/cjs/Table/TableBody.js +5 -3
  212. package/dist/cjs/Table/TableCell.js +10 -8
  213. package/dist/cjs/Table/TableCheckbox.js +5 -3
  214. package/dist/cjs/Table/TableHead.js +5 -3
  215. package/dist/cjs/Table/TableHeaderCell.js +8 -6
  216. package/dist/cjs/Table/TableRow.js +5 -3
  217. package/dist/cjs/Table/VirtualizedTable.js +32 -30
  218. package/dist/cjs/Table/VirtualizedTableContainer.js +5 -3
  219. package/dist/cjs/Table/hooks/useTableKeyboardNav.js +3 -1
  220. package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +23 -21
  221. package/dist/cjs/Table/index.js +14 -10
  222. package/dist/cjs/Table/model/table-model.js +15 -11
  223. package/dist/cjs/ThresholdsEditor/ThresholdColorPicker.js +15 -13
  224. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +14 -12
  225. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +44 -41
  226. package/dist/cjs/ThresholdsEditor/index.js +10 -8
  227. package/dist/cjs/TimeChart/TimeChart.js +122 -77
  228. package/dist/cjs/TimeChart/index.js +10 -8
  229. package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +33 -29
  230. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +17 -15
  231. package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +15 -13
  232. package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +5 -3
  233. package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +25 -22
  234. package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +7 -5
  235. package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +36 -34
  236. package/dist/cjs/TimeSeriesTooltip/index.js +19 -17
  237. package/dist/cjs/TimeSeriesTooltip/nearby-series.js +68 -51
  238. package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +61 -24
  239. package/dist/cjs/TimeSeriesTooltip/utils.js +19 -14
  240. package/dist/cjs/YAxisLabel.js +6 -4
  241. package/dist/cjs/context/{ChartsThemeProvider.js → ChartsProvider.js} +38 -11
  242. package/dist/cjs/context/SnackbarProvider.js +6 -2
  243. package/dist/cjs/context/TimeZoneProvider.js +13 -7
  244. package/dist/cjs/context/index.js +32 -0
  245. package/dist/cjs/index.js +41 -41
  246. package/dist/cjs/model/graph.js +9 -3
  247. package/dist/cjs/model/index.js +12 -10
  248. package/dist/cjs/test/index.js +10 -8
  249. package/dist/cjs/test/render.js +7 -5
  250. package/dist/cjs/test-utils/index.js +10 -8
  251. package/dist/cjs/test-utils/theme.js +38 -19
  252. package/dist/cjs/theme/component-overrides/alert.js +3 -1
  253. package/dist/cjs/theme/component-overrides/paper.js +3 -1
  254. package/dist/cjs/theme/index.js +10 -8
  255. package/dist/cjs/theme/palette/background.js +6 -2
  256. package/dist/cjs/theme/palette/colors/blue.js +3 -1
  257. package/dist/cjs/theme/palette/colors/common.js +6 -2
  258. package/dist/cjs/theme/palette/colors/green.js +3 -1
  259. package/dist/cjs/theme/palette/colors/grey.js +3 -1
  260. package/dist/cjs/theme/palette/colors/index.js +17 -15
  261. package/dist/cjs/theme/palette/colors/orange.js +3 -1
  262. package/dist/cjs/theme/palette/colors/purple.js +3 -1
  263. package/dist/cjs/theme/palette/colors/red.js +3 -1
  264. package/dist/cjs/theme/palette/error.js +3 -1
  265. package/dist/cjs/theme/palette/grey.js +3 -1
  266. package/dist/cjs/theme/palette/index.js +10 -8
  267. package/dist/cjs/theme/palette/palette-options.js +3 -1
  268. package/dist/cjs/theme/palette/primary.js +3 -1
  269. package/dist/cjs/theme/palette/secondary.js +3 -1
  270. package/dist/cjs/theme/palette/success.js +3 -1
  271. package/dist/cjs/theme/palette/text.js +3 -1
  272. package/dist/cjs/theme/palette/warning.js +3 -1
  273. package/dist/cjs/theme/theme.js +5 -3
  274. package/dist/cjs/theme/typography.js +3 -1
  275. package/dist/cjs/utils/axis.js +11 -7
  276. package/dist/cjs/utils/chart-actions.js +68 -12
  277. package/dist/cjs/utils/combine-sx.js +3 -1
  278. package/dist/cjs/utils/component-ids.js +3 -1
  279. package/dist/cjs/utils/format.js +16 -8
  280. package/dist/cjs/utils/index.js +15 -13
  281. package/dist/cjs/utils/mathjs.js +3 -1
  282. package/dist/cjs/utils/theme-gen.js +16 -18
  283. package/dist/context/ChartsProvider.d.ts +19 -0
  284. package/dist/context/ChartsProvider.d.ts.map +1 -0
  285. package/dist/context/{ChartsThemeProvider.js → ChartsProvider.js} +24 -6
  286. package/dist/context/ChartsProvider.js.map +1 -0
  287. package/dist/context/SnackbarProvider.js.map +1 -1
  288. package/dist/context/TimeZoneProvider.js.map +1 -1
  289. package/dist/context/index.d.ts +4 -0
  290. package/dist/context/index.d.ts.map +1 -0
  291. package/dist/context/index.js +17 -0
  292. package/dist/context/index.js.map +1 -0
  293. package/dist/index.d.ts +2 -4
  294. package/dist/index.d.ts.map +1 -1
  295. package/dist/index.js +2 -4
  296. package/dist/index.js.map +1 -1
  297. package/dist/model/graph.js.map +1 -1
  298. package/dist/model/index.js.map +1 -1
  299. package/dist/test/index.js.map +1 -1
  300. package/dist/test/render.js.map +1 -1
  301. package/dist/test/setup-tests.js.map +1 -1
  302. package/dist/test-utils/index.js.map +1 -1
  303. package/dist/test-utils/theme.d.ts +2 -0
  304. package/dist/test-utils/theme.d.ts.map +1 -1
  305. package/dist/test-utils/theme.js +25 -16
  306. package/dist/test-utils/theme.js.map +1 -1
  307. package/dist/theme/component-overrides/alert.js.map +1 -1
  308. package/dist/theme/component-overrides/paper.js.map +1 -1
  309. package/dist/theme/index.d.ts +1 -0
  310. package/dist/theme/index.d.ts.map +1 -1
  311. package/dist/theme/index.js.map +1 -1
  312. package/dist/theme/palette/background.d.ts.map +1 -1
  313. package/dist/theme/palette/background.js +3 -1
  314. package/dist/theme/palette/background.js.map +1 -1
  315. package/dist/theme/palette/colors/blue.js.map +1 -1
  316. package/dist/theme/palette/colors/common.js.map +1 -1
  317. package/dist/theme/palette/colors/green.js.map +1 -1
  318. package/dist/theme/palette/colors/grey.js.map +1 -1
  319. package/dist/theme/palette/colors/index.js.map +1 -1
  320. package/dist/theme/palette/colors/orange.js.map +1 -1
  321. package/dist/theme/palette/colors/purple.js.map +1 -1
  322. package/dist/theme/palette/colors/red.js.map +1 -1
  323. package/dist/theme/palette/error.js.map +1 -1
  324. package/dist/theme/palette/grey.js.map +1 -1
  325. package/dist/theme/palette/index.js.map +1 -1
  326. package/dist/theme/palette/palette-options.js.map +1 -1
  327. package/dist/theme/palette/primary.js.map +1 -1
  328. package/dist/theme/palette/secondary.js.map +1 -1
  329. package/dist/theme/palette/success.js.map +1 -1
  330. package/dist/theme/palette/text.js.map +1 -1
  331. package/dist/theme/palette/warning.js.map +1 -1
  332. package/dist/theme/theme.js.map +1 -1
  333. package/dist/theme/typography.js.map +1 -1
  334. package/dist/utils/axis.d.ts +4 -4
  335. package/dist/utils/axis.d.ts.map +1 -1
  336. package/dist/utils/axis.js +4 -4
  337. package/dist/utils/axis.js.map +1 -1
  338. package/dist/utils/chart-actions.d.ts +6 -2
  339. package/dist/utils/chart-actions.d.ts.map +1 -1
  340. package/dist/utils/chart-actions.js +51 -7
  341. package/dist/utils/chart-actions.js.map +1 -1
  342. package/dist/utils/combine-sx.js.map +1 -1
  343. package/dist/utils/component-ids.js.map +1 -1
  344. package/dist/utils/format.js.map +1 -1
  345. package/dist/utils/index.js.map +1 -1
  346. package/dist/utils/mathjs.js.map +1 -1
  347. package/dist/utils/theme-gen.d.ts +2 -7
  348. package/dist/utils/theme-gen.d.ts.map +1 -1
  349. package/dist/utils/theme-gen.js +11 -15
  350. package/dist/utils/theme-gen.js.map +1 -1
  351. package/package.json +7 -6
  352. package/dist/UnitSelector/UnitSelector.d.ts +0 -9
  353. package/dist/UnitSelector/UnitSelector.d.ts.map +0 -1
  354. package/dist/UnitSelector/UnitSelector.js.map +0 -1
  355. package/dist/UnitSelector/index.d.ts +0 -2
  356. package/dist/UnitSelector/index.d.ts.map +0 -1
  357. package/dist/UnitSelector/index.js.map +0 -1
  358. package/dist/context/ChartsThemeProvider.d.ts +0 -10
  359. package/dist/context/ChartsThemeProvider.d.ts.map +0 -1
  360. package/dist/context/ChartsThemeProvider.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/YAxisLabel.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 { Box, Typography } from '@mui/material';\n\ninterface YAxisLabelProps {\n name: string;\n height: number;\n}\n\nexport function YAxisLabel({ name, height }: YAxisLabelProps) {\n return (\n <Box\n sx={{\n display: 'inline-block',\n maxWidth: height, // allows rotated text to truncate instead of causing overlap\n position: 'absolute',\n top: `calc(${height}px / 2)`,\n transform: 'translateX(-50%) rotate(-90deg)',\n transformOrigin: 'top',\n textAlign: 'center',\n zIndex: 1,\n }}\n >\n <Typography\n variant=\"body1\"\n aria-label=\"y axis label\"\n sx={{\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {name}\n </Typography>\n </Box>\n );\n}\n"],"names":["Box","Typography","YAxisLabel","name","height","sx","display","maxWidth","position","top","transform","transformOrigin","textAlign","zIndex","variant","aria-label","whiteSpace","overflow","textOverflow"],"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;AAAA,SAASA,GAAG,EAAEC,UAAU,QAAQ,eAAe,CAAC;AAOhD,OAAO,SAASC,UAAU,CAAC,EAAEC,IAAI,CAAA,EAAEC,MAAM,CAAA,EAAmB,EAAE;IAC5D,qBACE,KAACJ,GAAG;QACFK,EAAE,EAAE;YACFC,OAAO,EAAE,cAAc;YACvBC,QAAQ,EAAEH,MAAM;YAChBI,QAAQ,EAAE,UAAU;YACpBC,GAAG,EAAE,CAAC,KAAK,EAAEL,MAAM,CAAC,OAAO,CAAC;YAC5BM,SAAS,EAAE,iCAAiC;YAC5CC,eAAe,EAAE,KAAK;YACtBC,SAAS,EAAE,QAAQ;YACnBC,MAAM,EAAE,CAAC;SACV;kBAED,cAAA,KAACZ,UAAU;YACTa,OAAO,EAAC,OAAO;YACfC,YAAU,EAAC,cAAc;YACzBV,EAAE,EAAE;gBACFW,UAAU,EAAE,QAAQ;gBACpBC,QAAQ,EAAE,QAAQ;gBAClBC,YAAY,EAAE,UAAU;aACzB;sBAEAf,IAAI;UACM;MACT,CACN;AACJ,CAAC"}
1
+ {"version":3,"sources":["../src/YAxisLabel.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 { Box, Typography } from '@mui/material';\n\ninterface YAxisLabelProps {\n name: string;\n height: number;\n}\n\nexport function YAxisLabel({ name, height }: YAxisLabelProps) {\n return (\n <Box\n sx={{\n display: 'inline-block',\n maxWidth: height, // allows rotated text to truncate instead of causing overlap\n position: 'absolute',\n top: `calc(${height}px / 2)`,\n transform: 'translateX(-50%) rotate(-90deg)',\n transformOrigin: 'top',\n textAlign: 'center',\n zIndex: 1,\n }}\n >\n <Typography\n variant=\"body1\"\n aria-label=\"y axis label\"\n sx={{\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n }}\n >\n {name}\n </Typography>\n </Box>\n );\n}\n"],"names":["Box","Typography","YAxisLabel","name","height","sx","display","maxWidth","position","top","transform","transformOrigin","textAlign","zIndex","variant","aria-label","whiteSpace","overflow","textOverflow"],"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,GAAG,EAAEC,UAAU,QAAQ,gBAAgB;AAOhD,OAAO,SAASC,WAAW,EAAEC,KAAI,EAAEC,OAAM,EAAmB;IAC1D,qBACE,KAACJ;QACCK,IAAI;YACFC,SAAS;YACTC,UAAUH;YACVI,UAAU;YACVC,KAAK,CAAC,KAAK,EAAEL,OAAO,OAAO,CAAC;YAC5BM,WAAW;YACXC,iBAAiB;YACjBC,WAAW;YACXC,QAAQ;QACV;kBAEA,cAAA,KAACZ;YACCa,SAAQ;YACRC,cAAW;YACXV,IAAI;gBACFW,YAAY;gBACZC,UAAU;gBACVC,cAAc;YAChB;sBAECf;;;AAIT"}
@@ -16,9 +16,11 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "BarChart", {
18
18
  enumerable: true,
19
- get: ()=>BarChart
19
+ get: function() {
20
+ return BarChart;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
23
+ const _jsxruntime = require("react/jsx-runtime");
22
24
  const _react = require("react");
23
25
  const _core = require("@perses-dev/core");
24
26
  const _core1 = require("echarts/core");
@@ -26,8 +28,9 @@ const _charts = require("echarts/charts");
26
28
  const _components = require("echarts/components");
27
29
  const _renderers = require("echarts/renderers");
28
30
  const _material = require("@mui/material");
29
- const _chartsThemeProvider = require("../context/ChartsThemeProvider");
30
- const _echart = require("../EChart");
31
+ const _ChartsProvider = require("../context/ChartsProvider");
32
+ const _EChart = require("../EChart");
33
+ const _utils = require("../utils");
31
34
  (0, _core1.use)([
32
35
  _charts.BarChart,
33
36
  _components.GridComponent,
@@ -39,12 +42,12 @@ const _echart = require("../EChart");
39
42
  const BAR_WIN_WIDTH = 14;
40
43
  const BAR_GAP = 6;
41
44
  function BarChart(props) {
42
- const { width , height , data , unit ={
43
- kind: 'Decimal'
45
+ const { width , height , data , format ={
46
+ unit: 'decimal'
44
47
  } , mode ='value' } = props;
45
- const chartsTheme = (0, _chartsThemeProvider.useChartsTheme)();
48
+ const chartsTheme = (0, _ChartsProvider.useChartsTheme)();
46
49
  const option = (0, _react.useMemo)(()=>{
47
- if (data == null) return chartsTheme.noDataOption;
50
+ if (data == null || !data.length) return chartsTheme.noDataOption;
48
51
  const source = [];
49
52
  data.map((d)=>{
50
53
  source.push([
@@ -65,7 +68,7 @@ function BarChart(props) {
65
68
  source: source
66
69
  }
67
70
  ],
68
- xAxis: {},
71
+ xAxis: (0, _utils.getFormattedAxis)({}, format),
69
72
  yAxis: {
70
73
  type: 'category',
71
74
  splitLine: {
@@ -84,11 +87,11 @@ function BarChart(props) {
84
87
  formatter: (params)=>{
85
88
  if (mode === 'percentage') {
86
89
  return params.data[1] && (0, _core.formatValue)(params.data[1], {
87
- kind: 'Percent',
88
- decimal_places: unit.decimal_places
90
+ unit: 'percent',
91
+ decimalPlaces: format.decimalPlaces
89
92
  });
90
93
  }
91
- return params.data[1] && (0, _core.formatValue)(params.data[1], unit);
94
+ return params.data[1] && (0, _core.formatValue)(params.data[1], format);
92
95
  },
93
96
  barMinWidth: BAR_WIN_WIDTH,
94
97
  barCategoryGap: BAR_GAP
@@ -101,7 +104,12 @@ function BarChart(props) {
101
104
  tooltip: {
102
105
  appendToBody: true,
103
106
  confine: true,
104
- formatter: (params)=>params.data[1] && `<b>${params.name}</b> &emsp; ${(0, _core.formatValue)(params.data[1], unit)}`
107
+ formatter: (params)=>params.data[1] && `<b>${params.name}</b> &emsp; ${(0, _core.formatValue)(params.data[1], format)}`
108
+ },
109
+ // increase distance between grid and container to prevent y axis labels from getting cut off
110
+ grid: {
111
+ left: '5%',
112
+ right: '5%'
105
113
  }
106
114
  };
107
115
  }, [
@@ -109,15 +117,15 @@ function BarChart(props) {
109
117
  chartsTheme,
110
118
  width,
111
119
  mode,
112
- unit
120
+ format
113
121
  ]);
114
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
122
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
115
123
  sx: {
116
124
  width: width,
117
125
  height: height,
118
126
  overflow: 'auto'
119
127
  },
120
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_echart.EChart, {
128
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_EChart.EChart, {
121
129
  sx: {
122
130
  minHeight: height,
123
131
  height: data ? data.length * (BAR_WIN_WIDTH + BAR_GAP) : '100%'
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./BarChart"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./BarChart"), exports);
18
+ function _export_star(from, to) {
19
19
  Object.keys(from).forEach(function(k) {
20
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
- enumerable: true,
22
- get: function() {
23
- return from[k];
24
- }
25
- });
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
21
+ Object.defineProperty(to, k, {
22
+ enumerable: true,
23
+ get: function() {
24
+ return from[k];
25
+ }
26
+ });
27
+ }
26
28
  });
27
29
  return from;
28
30
  }
@@ -16,14 +16,16 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "ColorPicker", {
18
18
  enumerable: true,
19
- get: ()=>ColorPicker
19
+ get: function() {
20
+ return ColorPicker;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
23
+ const _jsxruntime = require("react/jsx-runtime");
22
24
  const _material = require("@mui/material");
23
- const _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
24
- const _reactColorful = require("react-colorful");
25
- const _circle = /*#__PURE__*/ _interopRequireDefault(require("mdi-material-ui/Circle"));
26
- function _interopRequireDefault(obj) {
25
+ const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
26
+ const _reactcolorful = require("react-colorful");
27
+ const _Circle = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Circle"));
28
+ function _interop_require_default(obj) {
27
29
  return obj && obj.__esModule ? obj : {
28
30
  default: obj
29
31
  };
@@ -36,7 +38,7 @@ function _getRequireWildcardCache(nodeInterop) {
36
38
  return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
37
39
  })(nodeInterop);
38
40
  }
39
- function _interopRequireWildcard(obj, nodeInterop) {
41
+ function _interop_require_wildcard(obj, nodeInterop) {
40
42
  if (!nodeInterop && obj && obj.__esModule) {
41
43
  return obj;
42
44
  }
@@ -83,29 +85,29 @@ const ColorPicker = ({ color , onChange , palette })=>{
83
85
  onChange && onChange(e.target.value);
84
86
  }
85
87
  };
86
- return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
88
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
87
89
  spacing: 1,
88
90
  children: [
89
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_reactColorful.HexColorPicker, {
91
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_reactcolorful.HexColorPicker, {
90
92
  color: color,
91
93
  onChange: handleColorChange
92
94
  }),
93
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Stack, {
95
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
94
96
  direction: "row",
95
97
  flexWrap: "wrap",
96
98
  justifyContent: "space-evenly",
97
99
  width: '200px',
98
- children: palette && palette.map((color, i)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.IconButton, {
100
+ children: palette && palette.map((color, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
99
101
  size: "small",
100
102
  "aria-label": `change color to ${color}`,
101
103
  sx: {
102
104
  color
103
105
  },
104
106
  onClick: ()=>handleColorChange(color),
105
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_circle.default, {})
107
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Circle.default, {})
106
108
  }, i))
107
109
  }),
108
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
110
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
109
111
  inputProps: {
110
112
  'aria-label': 'enter hex color'
111
113
  },
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./ColorPicker"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./ColorPicker"), exports);
18
+ function _export_star(from, to) {
19
19
  Object.keys(from).forEach(function(k) {
20
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
- enumerable: true,
22
- get: function() {
23
- return from[k];
24
- }
25
- });
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
21
+ Object.defineProperty(to, k, {
22
+ enumerable: true,
23
+ get: function() {
24
+ return from[k];
25
+ }
26
+ });
27
+ }
26
28
  });
27
29
  return from;
28
30
  }
@@ -16,22 +16,24 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "ContentWithLegend", {
18
18
  enumerable: true,
19
- get: ()=>ContentWithLegend
19
+ get: function() {
20
+ return ContentWithLegend;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
22
- const _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _react = /*#__PURE__*/ _interop_require_default(require("react"));
23
25
  const _material = require("@mui/material");
24
26
  const _core = require("@perses-dev/core");
25
- const _legend = require("../Legend");
26
- const _contentWithLegendModel = require("./model/content-with-legend-model");
27
- function _interopRequireDefault(obj) {
27
+ const _Legend = require("../Legend");
28
+ const _contentwithlegendmodel = require("./model/content-with-legend-model");
29
+ function _interop_require_default(obj) {
28
30
  return obj && obj.__esModule ? obj : {
29
31
  default: obj
30
32
  };
31
33
  }
32
34
  function ContentWithLegend({ children , legendProps , width , height , spacing =0 , legendSize , minChildrenWidth =100 , minChildrenHeight =100 }) {
33
35
  const theme = (0, _material.useTheme)();
34
- const { content , legend , margin } = (0, _contentWithLegendModel.getContentWithLegendLayout)({
36
+ const { content , legend , margin } = (0, _contentwithlegendmodel.getContentWithLegendLayout)({
35
37
  width,
36
38
  height,
37
39
  legendProps,
@@ -41,7 +43,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
41
43
  theme,
42
44
  legendSize: (0, _core.getLegendSize)(legendSize)
43
45
  });
44
- return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
46
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
45
47
  sx: {
46
48
  width,
47
49
  height,
@@ -49,7 +51,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
49
51
  overflow: 'hidden'
50
52
  },
51
53
  children: [
52
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
54
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
53
55
  sx: {
54
56
  width: content.width,
55
57
  height: content.height,
@@ -62,7 +64,7 @@ function ContentWithLegend({ children , legendProps , width , height , spacing =
62
64
  height: content.height
63
65
  }) : children
64
66
  }),
65
- legendProps && legend.show && /*#__PURE__*/ (0, _jsxRuntime.jsx)(_legend.Legend, {
67
+ legendProps && legend.show && /*#__PURE__*/ (0, _jsxruntime.jsx)(_Legend.Legend, {
66
68
  ...legendProps,
67
69
  height: legend.height,
68
70
  width: legend.width
@@ -14,15 +14,17 @@
14
14
  Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
- _exportStar(require("./ContentWithLegend"), exports);
18
- function _exportStar(from, to) {
17
+ _export_star(require("./ContentWithLegend"), exports);
18
+ function _export_star(from, to) {
19
19
  Object.keys(from).forEach(function(k) {
20
- if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) Object.defineProperty(to, k, {
21
- enumerable: true,
22
- get: function() {
23
- return from[k];
24
- }
25
- });
20
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
21
+ Object.defineProperty(to, k, {
22
+ enumerable: true,
23
+ get: function() {
24
+ return from[k];
25
+ }
26
+ });
27
+ }
26
28
  });
27
29
  return from;
28
30
  }
@@ -21,23 +21,27 @@ function _export(target, all) {
21
21
  });
22
22
  }
23
23
  _export(exports, {
24
- TABLE_LEGEND_SIZE: ()=>TABLE_LEGEND_SIZE,
25
- getContentWithLegendLayout: ()=>getContentWithLegendLayout
24
+ TABLE_LEGEND_SIZE: function() {
25
+ return TABLE_LEGEND_SIZE;
26
+ },
27
+ getContentWithLegendLayout: function() {
28
+ return getContentWithLegendLayout;
29
+ }
26
30
  });
27
31
  const _core = require("@perses-dev/core");
28
- const _table = require("../../Table");
32
+ const _Table = require("../../Table");
29
33
  const TABLE_LEGEND_SIZE = {
30
- Medium: {
34
+ medium: {
31
35
  // 5 rows plus header. Value to be multiplied by row height in pixels.
32
- Bottom: 6,
36
+ bottom: 6,
33
37
  // Pixel value
34
- Right: 250
38
+ right: 250
35
39
  },
36
- Small: {
40
+ small: {
37
41
  // 3 rows plus header. Value to be multiplied by row height in pixels.
38
- Bottom: 4,
42
+ bottom: 4,
39
43
  // Pixel value
40
- Right: 150
44
+ right: 150
41
45
  }
42
46
  };
43
47
  const PANEL_HEIGHT_LG_BREAKPOINT = 300;
@@ -68,36 +72,36 @@ function getContentWithLegendLayout({ width , height , legendProps , legendSize
68
72
  const mode = (0, _core.getLegendMode)(legendOptions.mode);
69
73
  let legendWidth;
70
74
  let legendHeight;
71
- if (mode === 'List') {
75
+ if (mode === 'list') {
72
76
  // TODO: normalize list to share similar height options as the table
73
77
  // when we add more size options.
74
- legendWidth = position === 'Right' ? 200 : width;
78
+ legendWidth = position === 'right' ? 200 : width;
75
79
  // TODO: account for number of legend items returned when adjusting legend spacing
76
80
  legendHeight = LEGEND_HEIGHT_SM;
77
- if (position === 'Right') {
81
+ if (position === 'right') {
78
82
  legendHeight = height;
79
83
  } else if (height >= PANEL_HEIGHT_LG_BREAKPOINT) {
80
84
  legendHeight = LEGEND_HEIGHT_LG;
81
85
  }
82
86
  } else {
83
- var ref;
87
+ var _legendProps_tableProps;
84
88
  // Table mode
85
- const tableLayout = (0, _table.getTableCellLayout)(theme, 'compact');
86
- const tableColumns = (legendProps === null || legendProps === void 0 ? void 0 : (ref = legendProps.tableProps) === null || ref === void 0 ? void 0 : ref.columns) || [];
89
+ const tableLayout = (0, _Table.getTableCellLayout)(theme, 'compact');
90
+ const tableColumns = (legendProps === null || legendProps === void 0 ? void 0 : (_legendProps_tableProps = legendProps.tableProps) === null || _legendProps_tableProps === void 0 ? void 0 : _legendProps_tableProps.columns) || [];
87
91
  const columnsWidth = tableColumns.reduce((total, col)=>{
88
92
  if (typeof col.width === 'number') {
89
93
  total += col.width;
90
94
  }
91
95
  return total;
92
96
  }, 0);
93
- legendWidth = position === 'Right' ? TABLE_LEGEND_SIZE[legendSize]['Right'] + columnsWidth : width;
97
+ legendWidth = position === 'right' ? TABLE_LEGEND_SIZE[legendSize]['right'] + columnsWidth : width;
94
98
  // Use the smaller of the size-based row count or the number of legend items + 1 for the header.
95
- const rowsToShow = Math.min(TABLE_LEGEND_SIZE[legendSize]['Bottom'], legendProps.data.length + 1);
96
- legendHeight = position === 'Bottom' ? rowsToShow * tableLayout.height : height;
99
+ const rowsToShow = Math.min(TABLE_LEGEND_SIZE[legendSize]['bottom'], legendProps.data.length + 1);
100
+ legendHeight = position === 'bottom' ? rowsToShow * tableLayout.height : height;
97
101
  }
98
- const contentWidth = position === 'Right' ? width - legendWidth - spacing : width;
99
- const contentHeight = position === 'Bottom' ? height - legendHeight - spacing : height;
100
- if (position === 'Right' && contentWidth < minChildrenWidth || position === 'Bottom' && contentHeight < minChildrenHeight) {
102
+ const contentWidth = position === 'right' ? width - legendWidth - spacing : width;
103
+ const contentHeight = position === 'bottom' ? height - legendHeight - spacing : height;
104
+ if (position === 'right' && contentWidth < minChildrenWidth || position === 'bottom' && contentHeight < minChildrenHeight) {
101
105
  // Legend does not fit. Just show the content.
102
106
  return noLegendLayout;
103
107
  }
@@ -112,8 +116,8 @@ function getContentWithLegendLayout({ width , height , legendProps , legendSize
112
116
  height: contentHeight
113
117
  },
114
118
  margin: {
115
- right: position === 'Right' ? spacing : 0,
116
- bottom: position === 'Bottom' ? spacing : 0
119
+ right: position === 'right' ? spacing : 0,
120
+ bottom: position === 'bottom' ? spacing : 0
117
121
  }
118
122
  };
119
123
  }
@@ -16,18 +16,20 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "AbsoluteTimePicker", {
18
18
  enumerable: true,
19
- get: ()=>AbsoluteTimePicker
19
+ get: function() {
20
+ return AbsoluteTimePicker;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
23
+ const _jsxruntime = require("react/jsx-runtime");
22
24
  const _react = require("react");
23
25
  const _material = require("@mui/material");
24
- const _xDatePickers = require("@mui/x-date-pickers");
25
- const _adapterDateFns = require("@mui/x-date-pickers/AdapterDateFns");
26
- const _timeZoneProvider = require("../context/TimeZoneProvider");
26
+ const _xdatepickers = require("@mui/x-date-pickers");
27
+ const _AdapterDateFns = require("@mui/x-date-pickers/AdapterDateFns");
28
+ const _TimeZoneProvider = require("../context/TimeZoneProvider");
27
29
  const _utils = require("./utils");
28
30
  const DATE_TIME_FORMAT = 'yyyy-MM-dd HH:mm:ss';
29
31
  const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
30
- const { formatWithUserTimeZone } = (0, _timeZoneProvider.useTimeZone)();
32
+ const { formatWithUserTimeZone } = (0, _TimeZoneProvider.useTimeZone)();
31
33
  // Time range values as dates that can be used as a time range.
32
34
  const [timeRange, setTimeRange] = (0, _react.useState)(initialTimeRange);
33
35
  // Time range values as strings used to populate the text inputs. May not
@@ -82,34 +84,29 @@ const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
82
84
  onChange(newDates);
83
85
  }
84
86
  };
85
- return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_xDatePickers.LocalizationProvider, {
86
- dateAdapter: _adapterDateFns.AdapterDateFns,
87
- children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
87
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_xdatepickers.LocalizationProvider, {
88
+ dateAdapter: _AdapterDateFns.AdapterDateFns,
89
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
88
90
  spacing: 2,
89
91
  sx: (theme)=>({
90
92
  padding: theme.spacing(1, 0, 2)
91
93
  }),
92
94
  children: [
93
- showStartCalendar && /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
95
+ showStartCalendar && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
94
96
  sx: (theme)=>({
95
97
  // TODO: create separate reusable calendar component
96
- '.MuiPickerStaticWrapper-content': {
98
+ '.MuiPickersLayout-contentWrapper': {
97
99
  backgroundColor: theme.palette.background.default
98
- },
99
- // reposition AM and PM buttons
100
- '.MuiIconButton-sizeMedium': {
101
- top: 80,
102
- bottom: 'auto',
103
- margin: theme.spacing(0, 3)
104
100
  }
105
101
  }),
106
102
  children: [
107
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
103
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
108
104
  variant: "h3",
109
105
  padding: 1,
106
+ paddingLeft: 2,
110
107
  children: "Select Start Time"
111
108
  }),
112
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_xDatePickers.StaticDateTimePicker, {
109
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_xdatepickers.StaticDateTimePicker, {
113
110
  displayStaticWrapperAs: "desktop",
114
111
  openTo: "day",
115
112
  disableHighlightToday: true,
@@ -120,32 +117,24 @@ const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
120
117
  },
121
118
  onAccept: ()=>{
122
119
  setShowStartCalendar(false);
123
- },
124
- renderInput: (params)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
125
- ...params
126
- })
120
+ }
127
121
  })
128
122
  ]
129
123
  }),
130
- !showStartCalendar && /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Box, {
124
+ !showStartCalendar && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
131
125
  sx: (theme)=>({
132
- '.MuiPickerStaticWrapper-content': {
126
+ '.MuiPickersLayout-contentWrapper': {
133
127
  backgroundColor: theme.palette.background.default
134
- },
135
- // reposition AM and PM buttons
136
- '.MuiIconButton-sizeMedium': {
137
- top: 80,
138
- bottom: 'auto',
139
- margin: theme.spacing(0, 3)
140
128
  }
141
129
  }),
142
130
  children: [
143
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Typography, {
131
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
144
132
  variant: "h3",
145
133
  padding: 1,
134
+ paddingLeft: 2,
146
135
  children: "Select End Time"
147
136
  }),
148
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_xDatePickers.StaticDateTimePicker, {
137
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_xdatepickers.StaticDateTimePicker, {
149
138
  displayStaticWrapperAs: "desktop",
150
139
  openTo: "day",
151
140
  disableHighlightToday: true,
@@ -159,21 +148,18 @@ const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
159
148
  if (newValue === null) return;
160
149
  setShowStartCalendar(true);
161
150
  onChangeEndTime(newValue);
162
- },
163
- renderInput: (params)=>/*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
164
- ...params
165
- })
151
+ }
166
152
  })
167
153
  ]
168
154
  }),
169
- /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
155
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
170
156
  direction: "row",
171
157
  alignItems: "center",
172
158
  gap: 1,
173
159
  pl: 1,
174
160
  pr: 1,
175
161
  children: [
176
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
162
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
177
163
  onChange: (event)=>{
178
164
  // TODO: add helperText, fix validation after we decide on form state solution
179
165
  onChangeStartTime(event.target.value);
@@ -185,7 +171,7 @@ const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
185
171
  // tel used to match MUI DateTimePicker, may change in future: https://github.com/mui/material-ui/issues/27590
186
172
  type: "tel"
187
173
  }),
188
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.TextField, {
174
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
189
175
  onChange: (event)=>{
190
176
  onChangeEndTime(event.target.value);
191
177
  },
@@ -197,20 +183,20 @@ const AbsoluteTimePicker = ({ initialTimeRange , onChange , onCancel })=>{
197
183
  })
198
184
  ]
199
185
  }),
200
- /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
186
+ /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
201
187
  direction: "row",
202
188
  sx: {
203
189
  padding: (theme)=>theme.spacing(0, 1)
204
190
  },
205
191
  gap: 1,
206
192
  children: [
207
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
193
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
208
194
  variant: "contained",
209
195
  onClick: ()=>onApply(),
210
196
  fullWidth: true,
211
197
  children: "Apply"
212
198
  }),
213
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Button, {
199
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
214
200
  variant: "outlined",
215
201
  onClick: ()=>onCancel(),
216
202
  fullWidth: true,
@@ -16,14 +16,16 @@ Object.defineProperty(exports, "__esModule", {
16
16
  });
17
17
  Object.defineProperty(exports, "DateTimeRangePicker", {
18
18
  enumerable: true,
19
- get: ()=>DateTimeRangePicker
19
+ get: function() {
20
+ return DateTimeRangePicker;
21
+ }
20
22
  });
21
- const _jsxRuntime = require("react/jsx-runtime");
23
+ const _jsxruntime = require("react/jsx-runtime");
22
24
  const _react = require("react");
23
25
  const _material = require("@mui/material");
24
26
  const _core = require("@perses-dev/core");
25
- const _absoluteTimePicker = require("./AbsoluteTimePicker");
26
- const _timeRangeSelector = require("./TimeRangeSelector");
27
+ const _AbsoluteTimePicker = require("./AbsoluteTimePicker");
28
+ const _TimeRangeSelector = require("./TimeRangeSelector");
27
29
  function DateTimeRangePicker(props) {
28
30
  const { value , onChange , timeOptions , height } = props;
29
31
  const [showCustomDateSelector, setShowCustomDateSelector] = (0, _react.useState)(false);
@@ -33,12 +35,12 @@ function DateTimeRangePicker(props) {
33
35
  }, [
34
36
  value
35
37
  ]);
36
- return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_material.Stack, {
38
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
37
39
  direction: "row",
38
40
  spacing: 1,
39
41
  height: height,
40
42
  children: [
41
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Popover, {
43
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Popover, {
42
44
  anchorEl: anchorEl.current,
43
45
  anchorOrigin: {
44
46
  vertical: 'bottom',
@@ -49,7 +51,7 @@ function DateTimeRangePicker(props) {
49
51
  sx: (theme)=>({
50
52
  padding: theme.spacing(2)
51
53
  }),
52
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_absoluteTimePicker.AbsoluteTimePicker, {
54
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_AbsoluteTimePicker.AbsoluteTimePicker, {
53
55
  initialTimeRange: convertedTimeRange,
54
56
  onChange: (value)=>{
55
57
  onChange(value);
@@ -58,11 +60,11 @@ function DateTimeRangePicker(props) {
58
60
  onCancel: ()=>setShowCustomDateSelector(false)
59
61
  })
60
62
  }),
61
- /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.FormControl, {
63
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.FormControl, {
62
64
  fullWidth: true,
63
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_material.Box, {
65
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
64
66
  ref: anchorEl,
65
- children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_timeRangeSelector.TimeRangeSelector, {
67
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeRangeSelector.TimeRangeSelector, {
66
68
  timeOptions: timeOptions,
67
69
  value: value,
68
70
  height: height,