@perses-dev/components 0.49.0 → 0.50.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (357) hide show
  1. package/dist/AlignSelector/AlignSelector.d.ts +2 -1
  2. package/dist/AlignSelector/AlignSelector.d.ts.map +1 -1
  3. package/dist/AlignSelector/AlignSelector.js +0 -3
  4. package/dist/AlignSelector/AlignSelector.js.map +1 -1
  5. package/dist/BarChart/BarChart.d.ts +2 -1
  6. package/dist/BarChart/BarChart.d.ts.map +1 -1
  7. package/dist/BarChart/BarChart.js +10 -5
  8. package/dist/BarChart/BarChart.js.map +1 -1
  9. package/dist/ColorPicker/ColorPicker.d.ts +2 -1
  10. package/dist/ColorPicker/ColorPicker.d.ts.map +1 -1
  11. package/dist/ColorPicker/ColorPicker.js +3 -3
  12. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  13. package/dist/ColorPicker/OptionsColorPicker.d.ts +2 -1
  14. package/dist/ColorPicker/OptionsColorPicker.d.ts.map +1 -1
  15. package/dist/ColorPicker/OptionsColorPicker.js +2 -2
  16. package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
  17. package/dist/ContentWithLegend/ContentWithLegend.d.ts +2 -1
  18. package/dist/ContentWithLegend/ContentWithLegend.d.ts.map +1 -1
  19. package/dist/ContentWithLegend/ContentWithLegend.js +8 -5
  20. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  21. package/dist/DensitySelector/DensitySelector.d.ts +2 -1
  22. package/dist/DensitySelector/DensitySelector.d.ts.map +1 -1
  23. package/dist/DensitySelector/DensitySelector.js.map +1 -1
  24. package/dist/Dialog/Dialog.d.ts +8 -8
  25. package/dist/Dialog/Dialog.d.ts.map +1 -1
  26. package/dist/Dialog/Dialog.js +0 -1
  27. package/dist/Dialog/Dialog.js.map +1 -1
  28. package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts +2 -1
  29. package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
  30. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  31. package/dist/DragAndDrop/DragAndDropList.d.ts +24 -0
  32. package/dist/DragAndDrop/DragAndDropList.d.ts.map +1 -0
  33. package/dist/DragAndDrop/DragAndDropList.js +153 -0
  34. package/dist/DragAndDrop/DragAndDropList.js.map +1 -0
  35. package/dist/DragAndDrop/DragButton.d.ts +13 -0
  36. package/dist/DragAndDrop/DragButton.d.ts.map +1 -0
  37. package/dist/DragAndDrop/DragButton.js +97 -0
  38. package/dist/DragAndDrop/DragButton.js.map +1 -0
  39. package/dist/DragAndDrop/DropIndicator.d.ts +3 -0
  40. package/dist/DragAndDrop/DropIndicator.d.ts.map +1 -0
  41. package/dist/DragAndDrop/DropIndicator.js +44 -0
  42. package/dist/DragAndDrop/DropIndicator.js.map +1 -0
  43. package/dist/DragAndDrop/index.d.ts +4 -0
  44. package/dist/DragAndDrop/index.d.ts.map +1 -0
  45. package/dist/DragAndDrop/index.js +17 -0
  46. package/dist/DragAndDrop/index.js.map +1 -0
  47. package/dist/DragAndDrop/model.d.ts +11 -0
  48. package/dist/DragAndDrop/model.d.ts.map +1 -0
  49. package/dist/DragAndDrop/model.js +17 -0
  50. package/dist/DragAndDrop/model.js.map +1 -0
  51. package/dist/Drawer/Drawer.d.ts +2 -1
  52. package/dist/Drawer/Drawer.d.ts.map +1 -1
  53. package/dist/Drawer/Drawer.js.map +1 -1
  54. package/dist/EChart/EChart.d.ts +2 -2
  55. package/dist/EChart/EChart.d.ts.map +1 -1
  56. package/dist/EChart/EChart.js +2 -2
  57. package/dist/EChart/EChart.js.map +1 -1
  58. package/dist/ErrorAlert.d.ts +2 -1
  59. package/dist/ErrorAlert.d.ts.map +1 -1
  60. package/dist/ErrorAlert.js.map +1 -1
  61. package/dist/FontSizeSelector/FontSizeSelector.d.ts +2 -1
  62. package/dist/FontSizeSelector/FontSizeSelector.d.ts.map +1 -1
  63. package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
  64. package/dist/FormEditor/FormActions.d.ts +16 -0
  65. package/dist/FormEditor/FormActions.d.ts.map +1 -0
  66. package/dist/FormEditor/FormActions.js +75 -0
  67. package/dist/FormEditor/FormActions.js.map +1 -0
  68. package/dist/FormEditor/index.d.ts +2 -0
  69. package/dist/FormEditor/index.d.ts.map +1 -0
  70. package/dist/FormEditor/index.js +15 -0
  71. package/dist/FormEditor/index.js.map +1 -0
  72. package/dist/FormatControls/FormatControls.d.ts +2 -1
  73. package/dist/FormatControls/FormatControls.d.ts.map +1 -1
  74. package/dist/FormatControls/FormatControls.js +2 -2
  75. package/dist/FormatControls/FormatControls.js.map +1 -1
  76. package/dist/GaugeChart/GaugeChart.d.ts +2 -1
  77. package/dist/GaugeChart/GaugeChart.d.ts.map +1 -1
  78. package/dist/GaugeChart/GaugeChart.js +1 -1
  79. package/dist/GaugeChart/GaugeChart.js.map +1 -1
  80. package/dist/InfoTooltip/InfoTooltip.d.ts +3 -3
  81. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
  82. package/dist/InfoTooltip/InfoTooltip.js +0 -1
  83. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  84. package/dist/JSONEditor.d.ts +2 -1
  85. package/dist/JSONEditor.d.ts.map +1 -1
  86. package/dist/JSONEditor.js.map +1 -1
  87. package/dist/Legend/CompactLegend.d.ts +2 -1
  88. package/dist/Legend/CompactLegend.d.ts.map +1 -1
  89. package/dist/Legend/CompactLegend.js.map +1 -1
  90. package/dist/Legend/Legend.d.ts +2 -1
  91. package/dist/Legend/Legend.d.ts.map +1 -1
  92. package/dist/Legend/Legend.js +8 -4
  93. package/dist/Legend/Legend.js.map +1 -1
  94. package/dist/Legend/LegendColorBadge.d.ts +2 -2
  95. package/dist/Legend/LegendColorBadge.d.ts.map +1 -1
  96. package/dist/Legend/LegendColorBadge.js +2 -2
  97. package/dist/Legend/LegendColorBadge.js.map +1 -1
  98. package/dist/Legend/ListLegend.d.ts +2 -1
  99. package/dist/Legend/ListLegend.d.ts.map +1 -1
  100. package/dist/Legend/ListLegend.js.map +1 -1
  101. package/dist/Legend/ListLegendItem.d.ts +5 -5
  102. package/dist/Legend/ListLegendItem.d.ts.map +1 -1
  103. package/dist/Legend/ListLegendItem.js +5 -8
  104. package/dist/Legend/ListLegendItem.js.map +1 -1
  105. package/dist/Legend/TableLegend.d.ts +2 -1
  106. package/dist/Legend/TableLegend.d.ts.map +1 -1
  107. package/dist/Legend/TableLegend.js +1 -0
  108. package/dist/Legend/TableLegend.js.map +1 -1
  109. package/dist/Legend/legend-model.d.ts.map +1 -1
  110. package/dist/Legend/legend-model.js.map +1 -1
  111. package/dist/LineChart/LineChart.d.ts +1 -1
  112. package/dist/LineChart/LineChart.d.ts.map +1 -1
  113. package/dist/LineChart/LineChart.js +2 -3
  114. package/dist/LineChart/LineChart.js.map +1 -1
  115. package/dist/LinksEditor/LinksEditor.d.ts +2 -2
  116. package/dist/LinksEditor/LinksEditor.d.ts.map +1 -1
  117. package/dist/LinksEditor/LinksEditor.js +1 -1
  118. package/dist/LinksEditor/LinksEditor.js.map +1 -1
  119. package/dist/ModeSelector/ModeSelector.d.ts +2 -1
  120. package/dist/ModeSelector/ModeSelector.d.ts.map +1 -1
  121. package/dist/ModeSelector/ModeSelector.js.map +1 -1
  122. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +2 -2
  123. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -1
  124. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  125. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +2 -1
  126. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
  127. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  128. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +2 -2
  129. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -1
  130. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  131. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +2 -2
  132. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
  133. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  134. package/dist/Overlay/Overlay.d.ts +4 -3
  135. package/dist/Overlay/Overlay.d.ts.map +1 -1
  136. package/dist/Overlay/Overlay.js.map +1 -1
  137. package/dist/PieChart/PieChart.d.ts +2 -1
  138. package/dist/PieChart/PieChart.d.ts.map +1 -1
  139. package/dist/PieChart/PieChart.js +4 -2
  140. package/dist/PieChart/PieChart.js.map +1 -1
  141. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts +2 -1
  142. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
  143. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  144. package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts +2 -2
  145. package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts.map +1 -1
  146. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +5 -3
  147. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  148. package/dist/SortSelector/SortSelector.d.ts +2 -1
  149. package/dist/SortSelector/SortSelector.d.ts.map +1 -1
  150. package/dist/SortSelector/SortSelector.js.map +1 -1
  151. package/dist/SortSelector/SortSelectorButtons.d.ts +2 -1
  152. package/dist/SortSelector/SortSelectorButtons.d.ts.map +1 -1
  153. package/dist/SortSelector/SortSelectorButtons.js +2 -5
  154. package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
  155. package/dist/StatChart/StatChart.d.ts +2 -1
  156. package/dist/StatChart/StatChart.d.ts.map +1 -1
  157. package/dist/StatChart/StatChart.js.map +1 -1
  158. package/dist/StatChart/calculateFontSize.d.ts.map +1 -1
  159. package/dist/StatChart/calculateFontSize.js.map +1 -1
  160. package/dist/StatusHistoryChart/StatusHistoryChart.d.ts +14 -0
  161. package/dist/StatusHistoryChart/StatusHistoryChart.d.ts.map +1 -0
  162. package/dist/StatusHistoryChart/StatusHistoryChart.js +149 -0
  163. package/dist/StatusHistoryChart/StatusHistoryChart.js.map +1 -0
  164. package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts +12 -0
  165. package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts.map +1 -0
  166. package/dist/StatusHistoryChart/StatusHistoryTooltip.js +47 -0
  167. package/dist/StatusHistoryChart/StatusHistoryTooltip.js.map +1 -0
  168. package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts +2 -0
  169. package/dist/StatusHistoryChart/get-formatted-axis-label.d.ts.map +1 -0
  170. package/dist/StatusHistoryChart/get-formatted-axis-label.js +41 -0
  171. package/dist/StatusHistoryChart/get-formatted-axis-label.js.map +1 -0
  172. package/dist/StatusHistoryChart/index.d.ts +3 -0
  173. package/dist/StatusHistoryChart/index.d.ts.map +1 -0
  174. package/dist/StatusHistoryChart/index.js +16 -0
  175. package/dist/StatusHistoryChart/index.js.map +1 -0
  176. package/dist/StatusHistoryChart/utils/get-color.d.ts +6 -0
  177. package/dist/StatusHistoryChart/utils/get-color.d.ts.map +1 -0
  178. package/dist/StatusHistoryChart/utils/get-color.js +100 -0
  179. package/dist/StatusHistoryChart/utils/get-color.js.map +1 -0
  180. package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts +3 -0
  181. package/dist/StatusHistoryChart/utils/get-tooltip-position.d.ts.map +1 -0
  182. package/dist/StatusHistoryChart/utils/get-tooltip-position.js +27 -0
  183. package/dist/StatusHistoryChart/utils/get-tooltip-position.js.map +1 -0
  184. package/dist/Table/Table.d.ts +2 -1
  185. package/dist/Table/Table.d.ts.map +1 -1
  186. package/dist/Table/Table.js +3 -2
  187. package/dist/Table/Table.js.map +1 -1
  188. package/dist/Table/TableCell.d.ts +2 -2
  189. package/dist/Table/TableCell.d.ts.map +1 -1
  190. package/dist/Table/TableCell.js +19 -2
  191. package/dist/Table/TableCell.js.map +1 -1
  192. package/dist/Table/TableCheckbox.d.ts +2 -1
  193. package/dist/Table/TableCheckbox.d.ts.map +1 -1
  194. package/dist/Table/TableCheckbox.js.map +1 -1
  195. package/dist/Table/TableHeaderCell.d.ts +2 -1
  196. package/dist/Table/TableHeaderCell.d.ts.map +1 -1
  197. package/dist/Table/TableHeaderCell.js.map +1 -1
  198. package/dist/Table/VirtualizedTable.d.ts +3 -3
  199. package/dist/Table/VirtualizedTable.d.ts.map +1 -1
  200. package/dist/Table/VirtualizedTable.js +4 -4
  201. package/dist/Table/VirtualizedTable.js.map +1 -1
  202. package/dist/Table/hooks/useTableKeyboardNav.d.ts +2 -2
  203. package/dist/Table/hooks/useTableKeyboardNav.d.ts.map +1 -1
  204. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  205. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts +10 -12
  206. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.map +1 -1
  207. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  208. package/dist/Table/index.d.ts +1 -2
  209. package/dist/Table/index.d.ts.map +1 -1
  210. package/dist/Table/index.js +1 -1
  211. package/dist/Table/index.js.map +1 -1
  212. package/dist/Table/model/table-model.d.ts +7 -1
  213. package/dist/Table/model/table-model.d.ts.map +1 -1
  214. package/dist/Table/model/table-model.js +1 -0
  215. package/dist/Table/model/table-model.js.map +1 -1
  216. package/dist/ThresholdsEditor/ThresholdInput.d.ts +2 -2
  217. package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -1
  218. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  219. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +2 -1
  220. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
  221. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  222. package/dist/TimeChart/TimeChart.js +1 -1
  223. package/dist/TimeChart/TimeChart.js.map +1 -1
  224. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts +2 -1
  225. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -1
  226. package/dist/TimeRangeSelector/DateTimeRangePicker.js +0 -2
  227. package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
  228. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +2 -1
  229. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -1
  230. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
  231. package/dist/TimeRangeSelector/utils.d.ts.map +1 -1
  232. package/dist/TimeRangeSelector/utils.js.map +1 -1
  233. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts +2 -2
  234. package/dist/TimeSeriesTooltip/LineChartTooltip.d.ts.map +1 -1
  235. package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
  236. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts +2 -1
  237. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
  238. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  239. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +2 -1
  240. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -1
  241. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  242. package/dist/TimeSeriesTooltip/SeriesMarker.d.ts +2 -1
  243. package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -1
  244. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  245. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +2 -2
  246. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
  247. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  248. package/dist/TimeSeriesTooltip/TooltipContent.d.ts +2 -1
  249. package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -1
  250. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  251. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
  252. package/dist/TimeSeriesTooltip/TooltipHeader.js +2 -4
  253. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  254. package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
  255. package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
  256. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  257. package/dist/TimeSeriesTooltip/utils.d.ts +1 -21
  258. package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
  259. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  260. package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
  261. package/dist/TransformsEditor/TransformEditor.d.ts +2 -1
  262. package/dist/TransformsEditor/TransformEditor.d.ts.map +1 -1
  263. package/dist/TransformsEditor/TransformEditor.js +10 -9
  264. package/dist/TransformsEditor/TransformEditor.js.map +1 -1
  265. package/dist/TransformsEditor/TransformEditorContainer.d.ts +2 -1
  266. package/dist/TransformsEditor/TransformEditorContainer.d.ts.map +1 -1
  267. package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
  268. package/dist/TransformsEditor/TransformsEditor.d.ts +2 -1
  269. package/dist/TransformsEditor/TransformsEditor.d.ts.map +1 -1
  270. package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
  271. package/dist/YAxisLabel.d.ts +2 -1
  272. package/dist/YAxisLabel.d.ts.map +1 -1
  273. package/dist/YAxisLabel.js +4 -2
  274. package/dist/YAxisLabel.js.map +1 -1
  275. package/dist/cjs/AlignSelector/AlignSelector.js +0 -3
  276. package/dist/cjs/BarChart/BarChart.js +11 -6
  277. package/dist/cjs/ColorPicker/ColorPicker.js +3 -44
  278. package/dist/cjs/ColorPicker/OptionsColorPicker.js +2 -2
  279. package/dist/cjs/ContentWithLegend/ContentWithLegend.js +8 -10
  280. package/dist/cjs/Dialog/Dialog.js +0 -1
  281. package/dist/cjs/DragAndDrop/DragAndDropList.js +159 -0
  282. package/dist/cjs/DragAndDrop/DragButton.js +121 -0
  283. package/dist/cjs/DragAndDrop/DropIndicator.js +52 -0
  284. package/dist/cjs/DragAndDrop/index.js +32 -0
  285. package/dist/cjs/DragAndDrop/model.js +25 -0
  286. package/dist/cjs/EChart/EChart.js +2 -43
  287. package/dist/cjs/FormEditor/FormActions.js +83 -0
  288. package/dist/cjs/FormEditor/index.js +30 -0
  289. package/dist/cjs/FormatControls/FormatControls.js +2 -2
  290. package/dist/cjs/GaugeChart/GaugeChart.js +2 -2
  291. package/dist/cjs/InfoTooltip/InfoTooltip.js +0 -6
  292. package/dist/cjs/Legend/Legend.js +8 -4
  293. package/dist/cjs/Legend/LegendColorBadge.js +2 -7
  294. package/dist/cjs/Legend/ListLegendItem.js +3 -46
  295. package/dist/cjs/Legend/TableLegend.js +1 -0
  296. package/dist/cjs/LineChart/LineChart.js +4 -5
  297. package/dist/cjs/LinksEditor/LinksEditor.js +1 -42
  298. package/dist/cjs/PieChart/PieChart.js +4 -2
  299. package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +5 -3
  300. package/dist/cjs/SortSelector/SortSelectorButtons.js +2 -5
  301. package/dist/cjs/StatusHistoryChart/StatusHistoryChart.js +157 -0
  302. package/dist/cjs/StatusHistoryChart/StatusHistoryTooltip.js +55 -0
  303. package/dist/cjs/StatusHistoryChart/get-formatted-axis-label.js +48 -0
  304. package/dist/cjs/StatusHistoryChart/index.js +31 -0
  305. package/dist/cjs/StatusHistoryChart/utils/get-color.js +125 -0
  306. package/dist/cjs/StatusHistoryChart/utils/get-tooltip-position.js +35 -0
  307. package/dist/cjs/Table/Table.js +2 -1
  308. package/dist/cjs/Table/TableCell.js +19 -2
  309. package/dist/cjs/Table/VirtualizedTable.js +4 -4
  310. package/dist/cjs/Table/index.js +1 -7
  311. package/dist/cjs/Table/model/table-model.js +4 -0
  312. package/dist/cjs/TimeChart/TimeChart.js +1 -1
  313. package/dist/cjs/TimeRangeSelector/DateTimeRangePicker.js +0 -2
  314. package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +2 -4
  315. package/dist/cjs/TransformsEditor/TransformEditor.js +10 -9
  316. package/dist/cjs/YAxisLabel.js +4 -2
  317. package/dist/cjs/controls/TextField.js +54 -0
  318. package/dist/cjs/controls/index.js +30 -0
  319. package/dist/cjs/index.js +4 -0
  320. package/dist/cjs/theme/theme.js +3 -4
  321. package/dist/cjs/utils/format.js +18 -0
  322. package/dist/context/ChartsProvider.d.ts +2 -2
  323. package/dist/context/ChartsProvider.d.ts.map +1 -1
  324. package/dist/context/ChartsProvider.js.map +1 -1
  325. package/dist/context/TimeZoneProvider.d.ts +4 -4
  326. package/dist/context/TimeZoneProvider.d.ts.map +1 -1
  327. package/dist/context/TimeZoneProvider.js.map +1 -1
  328. package/dist/controls/TextField.d.ts +9 -0
  329. package/dist/controls/TextField.d.ts.map +1 -0
  330. package/dist/controls/TextField.js +41 -0
  331. package/dist/controls/TextField.js.map +1 -0
  332. package/dist/controls/index.d.ts +2 -0
  333. package/dist/controls/index.d.ts.map +1 -0
  334. package/dist/controls/index.js +15 -0
  335. package/dist/controls/index.js.map +1 -0
  336. package/dist/index.d.ts +4 -0
  337. package/dist/index.d.ts.map +1 -1
  338. package/dist/index.js +4 -0
  339. package/dist/index.js.map +1 -1
  340. package/dist/test/render.d.ts +3 -3
  341. package/dist/test/render.d.ts.map +1 -1
  342. package/dist/test/render.js.map +1 -1
  343. package/dist/theme/theme.d.ts.map +1 -1
  344. package/dist/theme/theme.js +2 -3
  345. package/dist/theme/theme.js.map +1 -1
  346. package/dist/utils/axis.d.ts +1 -7
  347. package/dist/utils/axis.d.ts.map +1 -1
  348. package/dist/utils/axis.js.map +1 -1
  349. package/dist/utils/chart-actions.d.ts.map +1 -1
  350. package/dist/utils/chart-actions.js.map +1 -1
  351. package/dist/utils/component-ids.d.ts.map +1 -1
  352. package/dist/utils/component-ids.js.map +1 -1
  353. package/dist/utils/format.d.ts +10 -4
  354. package/dist/utils/format.d.ts.map +1 -1
  355. package/dist/utils/format.js +15 -0
  356. package/dist/utils/format.js.map +1 -1
  357. package/package.json +10 -8
@@ -0,0 +1,83 @@
1
+ // Copyright 2024 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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "FormActions", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return FormActions;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ function FormActions({ action, submitText = 'Save', cancelText = 'Cancel', isReadonly, isValid, onActionChange, onSubmit, onDelete, onCancel, ...props }) {
26
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Stack, {
27
+ direction: "row",
28
+ gap: 1,
29
+ sx: {
30
+ marginLeft: 'auto'
31
+ },
32
+ ...props,
33
+ children: action === 'read' ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
34
+ children: [
35
+ onActionChange && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
36
+ disabled: isReadonly,
37
+ variant: "contained",
38
+ onClick: ()=>onActionChange('update'),
39
+ children: "Edit"
40
+ }),
41
+ onDelete && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
42
+ color: "error",
43
+ disabled: isReadonly,
44
+ variant: "outlined",
45
+ onClick: onDelete,
46
+ children: "Delete"
47
+ }),
48
+ onCancel && (onSubmit || onDelete) && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {
49
+ orientation: "vertical",
50
+ flexItem: true,
51
+ sx: {
52
+ borderColor: (theme)=>theme.palette.grey['500'],
53
+ '&.MuiDivider-root': {
54
+ marginLeft: 2,
55
+ marginRight: 1
56
+ }
57
+ }
58
+ }),
59
+ onCancel && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
60
+ color: "secondary",
61
+ variant: "outlined",
62
+ onClick: onCancel,
63
+ children: cancelText
64
+ })
65
+ ]
66
+ }) : /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
67
+ children: [
68
+ onSubmit && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
69
+ variant: "contained",
70
+ disabled: !isValid,
71
+ onClick: onSubmit,
72
+ children: submitText
73
+ }),
74
+ onCancel && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
75
+ color: "secondary",
76
+ variant: "outlined",
77
+ onClick: onCancel,
78
+ children: cancelText
79
+ })
80
+ ]
81
+ })
82
+ });
83
+ }
@@ -0,0 +1,30 @@
1
+ // Copyright 2024 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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ _export_star(require("./FormActions"), exports);
18
+ function _export_star(from, to) {
19
+ Object.keys(from).forEach(function(k) {
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
+ }
28
+ });
29
+ return from;
30
+ }
@@ -74,7 +74,7 @@ function FormatControls({ value, onChange, disabled = false }) {
74
74
  unit: newValue.id
75
75
  });
76
76
  };
77
- const handleDecimalPlacesChange = (_, { decimalPlaces })=>{
77
+ const handleDecimalPlacesChange = ({ decimalPlaces })=>{
78
78
  if (hasDecimalPlaces) {
79
79
  onChange({
80
80
  ...value,
@@ -121,7 +121,7 @@ function FormatControls({ value, onChange, disabled = false }) {
121
121
  value: getOptionByDecimalPlaces(value.decimalPlaces),
122
122
  options: DECIMAL_PLACES_OPTIONS,
123
123
  getOptionLabel: (o)=>o.label,
124
- onChange: handleDecimalPlacesChange,
124
+ onChange: (_, value)=>handleDecimalPlacesChange(value),
125
125
  disabled: !hasDecimalPlaces,
126
126
  disableClearable: true
127
127
  })
@@ -34,7 +34,7 @@ const _core1 = require("echarts/core");
34
34
  const _charts = require("echarts/charts");
35
35
  const _components = require("echarts/components");
36
36
  const _renderers = require("echarts/renderers");
37
- const _ChartsProvider = require("../context/ChartsProvider");
37
+ const _context = require("../context");
38
38
  const _EChart = require("../EChart");
39
39
  (0, _core1.use)([
40
40
  _charts.GaugeChart,
@@ -48,7 +48,7 @@ const PROGRESS_WIDTH = 16;
48
48
  const GAUGE_SMALL_BREAKPOINT = 170;
49
49
  function GaugeChart(props) {
50
50
  const { width, height, data, format, axisLine, max } = props;
51
- const chartsTheme = (0, _ChartsProvider.useChartsTheme)();
51
+ const chartsTheme = (0, _context.useChartsTheme)();
52
52
  // useDeepMemo ensures value size util does not rerun everytime you hover on the chart
53
53
  const option = (0, _core.useDeepMemo)(()=>{
54
54
  var _chartsTheme_echartsTheme_textStyle;
@@ -21,13 +21,7 @@ Object.defineProperty(exports, "InfoTooltip", {
21
21
  }
22
22
  });
23
23
  const _jsxruntime = require("react/jsx-runtime");
24
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
25
24
  const _material = require("@mui/material");
26
- function _interop_require_default(obj) {
27
- return obj && obj.__esModule ? obj : {
28
- default: obj
29
- };
30
- }
31
25
  const InfoTooltip = ({ id, title, description, placement, children, enterDelay, enterNextDelay })=>{
32
26
  // Wrap children in a span to cover the following use cases:
33
27
  // - Disabled buttons. MUI console.errors on putting these inside a tooltip.
@@ -102,9 +102,11 @@ function Legend({ width, height, options, data, selectedItems, onSelectedItemsCh
102
102
  }
103
103
  if (options.position === 'right') {
104
104
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
105
- sx: {
105
+ style: {
106
106
  width: width,
107
- height: height,
107
+ height: height
108
+ },
109
+ sx: {
108
110
  position: 'absolute',
109
111
  top: 0,
110
112
  right: 0
@@ -114,9 +116,11 @@ function Legend({ width, height, options, data, selectedItems, onSelectedItemsCh
114
116
  }
115
117
  // Position bottom
116
118
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
117
- sx: {
119
+ style: {
118
120
  width: width,
119
- height: height,
121
+ height: height
122
+ },
123
+ sx: {
120
124
  position: 'absolute',
121
125
  bottom: 0
122
126
  },
@@ -21,15 +21,10 @@ Object.defineProperty(exports, "LegendColorBadge", {
21
21
  }
22
22
  });
23
23
  const _jsxruntime = require("react/jsx-runtime");
24
- const _react = /*#__PURE__*/ _interop_require_default(require("react"));
24
+ const _react = require("react");
25
25
  const _material = require("@mui/material");
26
26
  const _utils = require("../utils");
27
- function _interop_require_default(obj) {
28
- return obj && obj.__esModule ? obj : {
29
- default: obj
30
- };
31
- }
32
- const LegendColorBadge = /*#__PURE__*/ _react.default.memo(function LegendColorBadge({ color, sx, ...others }) {
27
+ const LegendColorBadge = /*#__PURE__*/ (0, _react.memo)(function LegendColorBadge({ color, sx, ...others }) {
33
28
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
34
29
  ...others,
35
30
  sx: (0, _utils.combineSx)({
@@ -21,51 +21,10 @@ Object.defineProperty(exports, "ListLegendItem", {
21
21
  }
22
22
  });
23
23
  const _jsxruntime = require("react/jsx-runtime");
24
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
24
+ const _react = require("react");
25
25
  const _material = require("@mui/material");
26
26
  const _utils = require("../utils");
27
27
  const _LegendColorBadge = require("./LegendColorBadge");
28
- function _getRequireWildcardCache(nodeInterop) {
29
- if (typeof WeakMap !== "function") return null;
30
- var cacheBabelInterop = new WeakMap();
31
- var cacheNodeInterop = new WeakMap();
32
- return (_getRequireWildcardCache = function(nodeInterop) {
33
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
34
- })(nodeInterop);
35
- }
36
- function _interop_require_wildcard(obj, nodeInterop) {
37
- if (!nodeInterop && obj && obj.__esModule) {
38
- return obj;
39
- }
40
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
41
- return {
42
- default: obj
43
- };
44
- }
45
- var cache = _getRequireWildcardCache(nodeInterop);
46
- if (cache && cache.has(obj)) {
47
- return cache.get(obj);
48
- }
49
- var newObj = {
50
- __proto__: null
51
- };
52
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
53
- for(var key in obj){
54
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
55
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
56
- if (desc && (desc.get || desc.set)) {
57
- Object.defineProperty(newObj, key, desc);
58
- } else {
59
- newObj[key] = obj[key];
60
- }
61
- }
62
- }
63
- newObj.default = obj;
64
- if (cache) {
65
- cache.set(obj, newObj);
66
- }
67
- return newObj;
68
- }
69
28
  const ListLegendItemBase = /*#__PURE__*/ (0, _react.forwardRef)(function ListLegendItem({ item, sx, truncateLabel, onClick, isVisuallySelected, onMouseOver, onMouseOut, index, ...others }, ref) {
70
29
  const [noWrap, setNoWrap] = (0, _react.useState)(truncateLabel);
71
30
  function handleTextMouseOver() {
@@ -83,16 +42,14 @@ const ListLegendItemBase = /*#__PURE__*/ (0, _react.forwardRef)(function ListLeg
83
42
  onClick(e, item.id);
84
43
  (_item_onClick = item.onClick) === null || _item_onClick === void 0 ? void 0 : _item_onClick.call(item, e);
85
44
  };
86
- return /*#__PURE__*/ (0, _react.createElement)(_material.ListItem, {
45
+ return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.ListItemButton, {
87
46
  ...others,
88
- component: "div",
89
47
  role: "listitem",
90
48
  sx: (0, _utils.combineSx)({
91
49
  padding: 0,
92
50
  cursor: 'pointer'
93
51
  }, sx),
94
52
  dense: true,
95
- key: item.id,
96
53
  onClick: handleClick,
97
54
  onMouseOver: (e)=>onMouseOver === null || onMouseOver === void 0 ? void 0 : onMouseOver(e, {
98
55
  id: item.id,
@@ -125,4 +82,4 @@ const ListLegendItemBase = /*#__PURE__*/ (0, _react.forwardRef)(function ListLeg
125
82
  ]
126
83
  });
127
84
  });
128
- const ListLegendItem = /*#__PURE__*/ _react.default.memo(ListLegendItemBase);
85
+ const ListLegendItem = /*#__PURE__*/ (0, _react.memo)(ListLegendItemBase);
@@ -75,6 +75,7 @@ function TableLegend({ items, selectedItems: initRowSelection, onSelectedItemsCh
75
75
  data: items,
76
76
  columns: columns,
77
77
  density: "compact",
78
+ defaultColumnWidth: "auto",
78
79
  getRowId: getRowId,
79
80
  getCheckboxColor: getCheckboxColor,
80
81
  checkboxSelection: true,
@@ -28,9 +28,8 @@ const _charts = require("echarts/charts");
28
28
  const _components = require("echarts/components");
29
29
  const _renderers = require("echarts/renderers");
30
30
  const _EChart = require("../EChart");
31
- const _ChartsProvider = require("../context/ChartsProvider");
31
+ const _context = require("../context");
32
32
  const _TimeSeriesTooltip = require("../TimeSeriesTooltip");
33
- const _TimeZoneProvider = require("../context/TimeZoneProvider");
34
33
  const _utils = require("../utils");
35
34
  (0, _core.use)([
36
35
  _charts.LineChart,
@@ -47,11 +46,11 @@ const _utils = require("../utils");
47
46
  ]);
48
47
  const LineChart = /*#__PURE__*/ (0, _react.forwardRef)(function LineChart({ height, data, yAxis, format, grid, legend, tooltipConfig = _TimeSeriesTooltip.DEFAULT_TOOLTIP_CONFIG, noDataVariant = 'message', syncGroup, onDataZoom, onDoubleClick, __experimentalEChartsOptionsOverride }, ref) {
49
48
  var _option_tooltip;
50
- const chartsTheme = (0, _ChartsProvider.useChartsTheme)();
49
+ const chartsTheme = (0, _context.useChartsTheme)();
51
50
  const chartRef = (0, _react.useRef)();
52
51
  const [showTooltip, setShowTooltip] = (0, _react.useState)(true);
53
52
  const [tooltipPinnedCoords, setTooltipPinnedCoords] = (0, _react.useState)(null);
54
- const { timeZone } = (0, _TimeZoneProvider.useTimeZone)();
53
+ const { timeZone } = (0, _context.useTimeZone)();
55
54
  const [isDragging, setIsDragging] = (0, _react.useState)(false);
56
55
  const [startX, setStartX] = (0, _react.useState)(0);
57
56
  (0, _react.useImperativeHandle)(ref, ()=>{
@@ -172,7 +171,7 @@ const LineChart = /*#__PURE__*/ (0, _react.forwardRef)(function LineChart({ heig
172
171
  noDataVariant
173
172
  ]);
174
173
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
175
- sx: {
174
+ style: {
176
175
  height
177
176
  },
178
177
  onClick: (e)=>{
@@ -21,7 +21,7 @@ Object.defineProperty(exports, "LinksEditor", {
21
21
  }
22
22
  });
23
23
  const _jsxruntime = require("react/jsx-runtime");
24
- const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
24
+ const _react = require("react");
25
25
  const _material = require("@mui/material");
26
26
  const _reacthookform = require("react-hook-form");
27
27
  const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
@@ -31,47 +31,6 @@ function _interop_require_default(obj) {
31
31
  default: obj
32
32
  };
33
33
  }
34
- function _getRequireWildcardCache(nodeInterop) {
35
- if (typeof WeakMap !== "function") return null;
36
- var cacheBabelInterop = new WeakMap();
37
- var cacheNodeInterop = new WeakMap();
38
- return (_getRequireWildcardCache = function(nodeInterop) {
39
- return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
40
- })(nodeInterop);
41
- }
42
- function _interop_require_wildcard(obj, nodeInterop) {
43
- if (!nodeInterop && obj && obj.__esModule) {
44
- return obj;
45
- }
46
- if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
47
- return {
48
- default: obj
49
- };
50
- }
51
- var cache = _getRequireWildcardCache(nodeInterop);
52
- if (cache && cache.has(obj)) {
53
- return cache.get(obj);
54
- }
55
- var newObj = {
56
- __proto__: null
57
- };
58
- var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
59
- for(var key in obj){
60
- if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
61
- var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
62
- if (desc && (desc.get || desc.set)) {
63
- Object.defineProperty(newObj, key, desc);
64
- } else {
65
- newObj[key] = obj[key];
66
- }
67
- }
68
- }
69
- newObj.default = obj;
70
- if (cache) {
71
- cache.set(obj, newObj);
72
- }
73
- return newObj;
74
- }
75
34
  function LinksEditor({ control, ...props }) {
76
35
  const { fields, append, remove } = (0, _reacthookform.useFieldArray)({
77
36
  control: control,
@@ -81,9 +81,11 @@ function PieChart(props) {
81
81
  }
82
82
  };
83
83
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
84
- sx: {
84
+ style: {
85
85
  width: width,
86
- height: height,
86
+ height: height
87
+ },
88
+ sx: {
87
89
  overflow: 'auto'
88
90
  },
89
91
  children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_EChart.EChart, {
@@ -39,7 +39,7 @@ function SettingsAutocomplete({ options, renderInput = (params)=>/*#__PURE__*/ (
39
39
  getOptionLabel: getOptionLabel,
40
40
  options: options,
41
41
  renderInput: renderInput,
42
- renderOption: (props, option)=>{
42
+ renderOption: ({ key, ...props }, option)=>{
43
43
  return /*#__PURE__*/ (0, _jsxruntime.jsx)("li", {
44
44
  ...props,
45
45
  children: /*#__PURE__*/ (0, _jsxruntime.jsxs)("div", {
@@ -52,12 +52,14 @@ function SettingsAutocomplete({ options, renderInput = (params)=>/*#__PURE__*/ (
52
52
  option.description && /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
53
53
  variant: "body2",
54
54
  component: "div",
55
- color: (theme)=>theme.palette.text.secondary,
55
+ sx: {
56
+ color: (theme)=>theme.palette.text.secondary
57
+ },
56
58
  children: option.description
57
59
  })
58
60
  ]
59
61
  })
60
- });
62
+ }, key);
61
63
  },
62
64
  filterOptions: (0, _material.createFilterOptions)({
63
65
  // Include the label and the description in search.
@@ -28,9 +28,6 @@ function SortSelectorButtons({ onChange, value, ...props }) {
28
28
  };
29
29
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.ButtonGroup, {
30
30
  "aria-label": "Sort",
31
- sx: {
32
- margin: 1
33
- },
34
31
  ...props,
35
32
  children: [
36
33
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
@@ -41,12 +38,12 @@ function SortSelectorButtons({ onChange, value, ...props }) {
41
38
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
42
39
  onClick: ()=>handleSortChange('asc'),
43
40
  variant: value === 'asc' ? 'contained' : 'outlined',
44
- children: "Ascending"
41
+ children: "Asc"
45
42
  }),
46
43
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
47
44
  onClick: ()=>handleSortChange('desc'),
48
45
  variant: value === 'desc' ? 'contained' : 'outlined',
49
- children: "Descending"
46
+ children: "Desc"
50
47
  })
51
48
  ]
52
49
  });
@@ -0,0 +1,157 @@
1
+ // Copyright 2024 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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "StatusHistoryChart", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return StatusHistoryChart;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _material = require("@mui/material");
25
+ const _charts = require("echarts/charts");
26
+ const _components = require("echarts/components");
27
+ const _core = require("echarts/core");
28
+ const _renderers = require("echarts/renderers");
29
+ const _react = require("react");
30
+ const _context = require("../context");
31
+ const _EChart = require("../EChart");
32
+ const _getcolor = require("./utils/get-color");
33
+ const _getformattedaxislabel = require("./get-formatted-axis-label");
34
+ const _StatusHistoryTooltip = require("./StatusHistoryTooltip");
35
+ (0, _core.use)([
36
+ _charts.HeatmapChart,
37
+ _components.VisualMapComponent,
38
+ _components.GridComponent,
39
+ _components.DatasetComponent,
40
+ _components.TitleComponent,
41
+ _components.TooltipComponent,
42
+ _renderers.CanvasRenderer
43
+ ]);
44
+ function StatusHistoryChart(props) {
45
+ const { height, data, xAxisCategories, yAxisCategories, timeScale } = props;
46
+ const { timeZone } = (0, _context.useTimeZone)();
47
+ const chartsTheme = (0, _context.useChartsTheme)();
48
+ const theme = (0, _material.useTheme)();
49
+ const uniqueValues = (0, _react.useMemo)(()=>[
50
+ ...new Set(data.map((item)=>item[2]))
51
+ ].filter((value)=>value !== undefined), [
52
+ data
53
+ ]);
54
+ // get colors from theme and generate colors if not provided
55
+ const pieces = (0, _react.useMemo)(()=>{
56
+ const themeColors = Array.isArray(chartsTheme.echartsTheme.color) ? chartsTheme.echartsTheme.color.filter((color)=>typeof color === 'string') : [];
57
+ return uniqueValues.map((value, index)=>({
58
+ value,
59
+ color: (0, _getcolor.getColorsForValues)(uniqueValues, themeColors)[index]
60
+ }));
61
+ }, [
62
+ uniqueValues,
63
+ chartsTheme.echartsTheme.color
64
+ ]);
65
+ var _timeScale_rangeMs;
66
+ const option = {
67
+ tooltip: {
68
+ appendToBody: true,
69
+ formatter: (params)=>{
70
+ return (0, _StatusHistoryTooltip.generateTooltipHTML)({
71
+ data: params.data,
72
+ marker: params.marker,
73
+ xAxisCategories,
74
+ yAxisCategories,
75
+ theme
76
+ });
77
+ }
78
+ },
79
+ grid: {
80
+ top: '5%',
81
+ bottom: '5%'
82
+ },
83
+ xAxis: {
84
+ type: 'category',
85
+ data: xAxisCategories,
86
+ axisLine: {
87
+ show: false
88
+ },
89
+ splitArea: {
90
+ show: false
91
+ },
92
+ axisLabel: {
93
+ hideOverlap: true,
94
+ formatter: (0, _getformattedaxislabel.getFormattedStatusHistoryAxisLabel)((_timeScale_rangeMs = timeScale === null || timeScale === void 0 ? void 0 : timeScale.rangeMs) !== null && _timeScale_rangeMs !== void 0 ? _timeScale_rangeMs : 0, timeZone)
95
+ }
96
+ },
97
+ yAxis: {
98
+ type: 'category',
99
+ data: yAxisCategories,
100
+ axisLine: {
101
+ show: false
102
+ },
103
+ splitArea: {
104
+ show: false,
105
+ interval: 0
106
+ },
107
+ splitLine: {
108
+ show: false
109
+ },
110
+ axisLabel: {
111
+ interval: 0
112
+ }
113
+ },
114
+ visualMap: {
115
+ show: false,
116
+ type: 'piecewise',
117
+ pieces
118
+ },
119
+ series: [
120
+ {
121
+ name: 'Status history',
122
+ type: 'heatmap',
123
+ coordinateSystem: 'cartesian2d',
124
+ data: data,
125
+ label: {
126
+ show: false
127
+ },
128
+ itemStyle: {
129
+ borderWidth: 1,
130
+ borderType: 'solid',
131
+ borderColor: '#ffffff'
132
+ },
133
+ emphasis: {
134
+ itemStyle: {
135
+ opacity: 0.5
136
+ }
137
+ }
138
+ }
139
+ ]
140
+ };
141
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
142
+ style: {
143
+ height: height
144
+ },
145
+ sx: {
146
+ overflow: 'auto'
147
+ },
148
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_EChart.EChart, {
149
+ sx: {
150
+ width: '100%',
151
+ height: height
152
+ },
153
+ option: option,
154
+ theme: chartsTheme.echartsTheme
155
+ })
156
+ });
157
+ }
@@ -0,0 +1,55 @@
1
+ // Copyright 2024 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
+ "use strict";
14
+ Object.defineProperty(exports, "__esModule", {
15
+ value: true
16
+ });
17
+ Object.defineProperty(exports, "generateTooltipHTML", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return generateTooltipHTML;
21
+ }
22
+ });
23
+ const _material = require("@mui/material");
24
+ const _utils = require("../utils");
25
+ function generateTooltipHTML({ data, marker, xAxisCategories, yAxisCategories, theme }) {
26
+ const [x, y, value] = data;
27
+ const xAxisLabel = xAxisCategories[x];
28
+ const { formattedDate, formattedTime } = (0, _utils.getDateAndTime)(xAxisLabel);
29
+ const tooltipHeader = (0, _material.css)`
30
+ border-bottom: 1px solid ${theme.palette.grey[500]};
31
+ padding-bottom: 8px;
32
+ `;
33
+ const tooltipContentStyles = (0, _material.css)`
34
+ display: flex;
35
+ justify-content: space-between;
36
+ padding-top: 8px;
37
+ `;
38
+ const labelStyles = (0, _material.css)`
39
+ margin-right: 16px;
40
+ `;
41
+ return `
42
+ <div>
43
+ <div style="${tooltipHeader.styles}">${formattedDate} ${formattedTime}</div>
44
+ <div style="${tooltipContentStyles.styles}">
45
+ <div style="${labelStyles.styles}">
46
+ ${marker}
47
+ <strong>${yAxisCategories[y]}</strong>
48
+ </div>
49
+ <div>
50
+ ${value}
51
+ </div>
52
+ </div>
53
+ </div>
54
+ `;
55
+ }