@perses-dev/components 0.53.0-rc.0 → 0.53.0-rc.2

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 (534) hide show
  1. package/dist/AlignSelector/AlignSelector.js +1 -1
  2. package/dist/AlignSelector/AlignSelector.js.map +1 -1
  3. package/dist/AlignSelector/index.js +1 -1
  4. package/dist/AlignSelector/index.js.map +1 -1
  5. package/dist/ColorPicker/ColorPicker.js +1 -1
  6. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  7. package/dist/ColorPicker/OptionsColorPicker.js +1 -1
  8. package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
  9. package/dist/ColorPicker/index.js +1 -1
  10. package/dist/ColorPicker/index.js.map +1 -1
  11. package/dist/ContentWithLegend/ContentWithLegend.js +1 -1
  12. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  13. package/dist/ContentWithLegend/index.js +1 -1
  14. package/dist/ContentWithLegend/index.js.map +1 -1
  15. package/dist/ContentWithLegend/model/content-with-legend-model.js +1 -1
  16. package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
  17. package/dist/DensitySelector/DensitySelector.js +1 -1
  18. package/dist/DensitySelector/DensitySelector.js.map +1 -1
  19. package/dist/DensitySelector/index.js +1 -1
  20. package/dist/DensitySelector/index.js.map +1 -1
  21. package/dist/Dialog/Dialog.js +1 -1
  22. package/dist/Dialog/Dialog.js.map +1 -1
  23. package/dist/Dialog/DiscardChangesConfirmationDialog.js +1 -1
  24. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  25. package/dist/Dialog/index.js +1 -1
  26. package/dist/Dialog/index.js.map +1 -1
  27. package/dist/DragAndDrop/DragAndDropList.js +1 -1
  28. package/dist/DragAndDrop/DragAndDropList.js.map +1 -1
  29. package/dist/DragAndDrop/DragButton.js +1 -1
  30. package/dist/DragAndDrop/DragButton.js.map +1 -1
  31. package/dist/DragAndDrop/DropIndicator.js +1 -1
  32. package/dist/DragAndDrop/DropIndicator.js.map +1 -1
  33. package/dist/DragAndDrop/index.js +1 -1
  34. package/dist/DragAndDrop/index.js.map +1 -1
  35. package/dist/DragAndDrop/model.js +1 -1
  36. package/dist/DragAndDrop/model.js.map +1 -1
  37. package/dist/Drawer/Drawer.js +1 -1
  38. package/dist/Drawer/Drawer.js.map +1 -1
  39. package/dist/Drawer/index.js +1 -1
  40. package/dist/Drawer/index.js.map +1 -1
  41. package/dist/EChart/EChart.js +1 -1
  42. package/dist/EChart/EChart.js.map +1 -1
  43. package/dist/EChart/index.js +1 -1
  44. package/dist/EChart/index.js.map +1 -1
  45. package/dist/ErrorAlert.js +1 -1
  46. package/dist/ErrorAlert.js.map +1 -1
  47. package/dist/ErrorBoundary.js +1 -1
  48. package/dist/ErrorBoundary.js.map +1 -1
  49. package/dist/FontSizeSelector/FontSizeSelector.js +1 -1
  50. package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
  51. package/dist/FontSizeSelector/index.js +1 -1
  52. package/dist/FontSizeSelector/index.js.map +1 -1
  53. package/dist/FormEditor/FormActions.js +1 -1
  54. package/dist/FormEditor/FormActions.js.map +1 -1
  55. package/dist/FormEditor/index.js +1 -1
  56. package/dist/FormEditor/index.js.map +1 -1
  57. package/dist/FormatControls/FormatControls.d.ts.map +1 -1
  58. package/dist/FormatControls/FormatControls.js +10 -23
  59. package/dist/FormatControls/FormatControls.js.map +1 -1
  60. package/dist/FormatControls/UnitSelector.d.ts +9 -0
  61. package/dist/FormatControls/UnitSelector.d.ts.map +1 -0
  62. package/dist/FormatControls/UnitSelector.js +47 -0
  63. package/dist/FormatControls/UnitSelector.js.map +1 -0
  64. package/dist/FormatControls/index.d.ts +1 -0
  65. package/dist/FormatControls/index.d.ts.map +1 -1
  66. package/dist/FormatControls/index.js +2 -1
  67. package/dist/FormatControls/index.js.map +1 -1
  68. package/dist/InfoTooltip/InfoTooltip.js +1 -1
  69. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  70. package/dist/InfoTooltip/index.js +1 -1
  71. package/dist/InfoTooltip/index.js.map +1 -1
  72. package/dist/JSONEditor.js +1 -1
  73. package/dist/JSONEditor.js.map +1 -1
  74. package/dist/Legend/CompactLegend.js +1 -1
  75. package/dist/Legend/CompactLegend.js.map +1 -1
  76. package/dist/Legend/Legend.js +1 -1
  77. package/dist/Legend/Legend.js.map +1 -1
  78. package/dist/Legend/LegendColorBadge.js +1 -1
  79. package/dist/Legend/LegendColorBadge.js.map +1 -1
  80. package/dist/Legend/ListLegend.js +1 -1
  81. package/dist/Legend/ListLegend.js.map +1 -1
  82. package/dist/Legend/ListLegendItem.js +1 -1
  83. package/dist/Legend/ListLegendItem.js.map +1 -1
  84. package/dist/Legend/TableLegend.js +1 -1
  85. package/dist/Legend/TableLegend.js.map +1 -1
  86. package/dist/Legend/index.js +1 -1
  87. package/dist/Legend/index.js.map +1 -1
  88. package/dist/Legend/legend-model.js +1 -1
  89. package/dist/Legend/legend-model.js.map +1 -1
  90. package/dist/LinksEditor/LinkEditorForm.js +1 -1
  91. package/dist/LinksEditor/LinkEditorForm.js.map +1 -1
  92. package/dist/LinksEditor/LinksEditor.js +1 -1
  93. package/dist/LinksEditor/LinksEditor.js.map +1 -1
  94. package/dist/LinksEditor/index.js +1 -1
  95. package/dist/LinksEditor/index.js.map +1 -1
  96. package/dist/ModeSelector/ModeSelector.js +1 -1
  97. package/dist/ModeSelector/ModeSelector.js.map +1 -1
  98. package/dist/ModeSelector/index.js +1 -1
  99. package/dist/ModeSelector/index.js.map +1 -1
  100. package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
  101. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  102. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
  103. package/dist/OptionsEditorLayout/OptionsEditorControl.js +5 -2
  104. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  105. package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
  106. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  107. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
  108. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  109. package/dist/OptionsEditorLayout/index.js +1 -1
  110. package/dist/OptionsEditorLayout/index.js.map +1 -1
  111. package/dist/Overlay/Overlay.js +1 -1
  112. package/dist/Overlay/Overlay.js.map +1 -1
  113. package/dist/Overlay/index.js +1 -1
  114. package/dist/Overlay/index.js.map +1 -1
  115. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +1 -1
  116. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  117. package/dist/RefreshIntervalPicker/index.js +1 -1
  118. package/dist/RefreshIntervalPicker/index.js.map +1 -1
  119. package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts +1 -1
  120. package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts.map +1 -1
  121. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +16 -3
  122. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  123. package/dist/SettingsAutocomplete/index.js +1 -1
  124. package/dist/SettingsAutocomplete/index.js.map +1 -1
  125. package/dist/SortSelector/SortSelector.js +1 -1
  126. package/dist/SortSelector/SortSelector.js.map +1 -1
  127. package/dist/SortSelector/SortSelectorButtons.js +1 -1
  128. package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
  129. package/dist/SortSelector/index.js +1 -1
  130. package/dist/SortSelector/index.js.map +1 -1
  131. package/dist/Table/InnerTable.js +1 -1
  132. package/dist/Table/InnerTable.js.map +1 -1
  133. package/dist/Table/Table.d.ts +1 -1
  134. package/dist/Table/Table.d.ts.map +1 -1
  135. package/dist/Table/Table.js +31 -7
  136. package/dist/Table/Table.js.map +1 -1
  137. package/dist/Table/TableBody.js +1 -1
  138. package/dist/Table/TableBody.js.map +1 -1
  139. package/dist/Table/TableCell.d.ts +4 -2
  140. package/dist/Table/TableCell.d.ts.map +1 -1
  141. package/dist/Table/TableCell.js +27 -5
  142. package/dist/Table/TableCell.js.map +1 -1
  143. package/dist/Table/TableCheckbox.js +1 -1
  144. package/dist/Table/TableCheckbox.js.map +1 -1
  145. package/dist/Table/TableFoot.js +1 -1
  146. package/dist/Table/TableFoot.js.map +1 -1
  147. package/dist/Table/TableHead.js +1 -1
  148. package/dist/Table/TableHead.js.map +1 -1
  149. package/dist/Table/TableHeaderCell.js +1 -1
  150. package/dist/Table/TableHeaderCell.js.map +1 -1
  151. package/dist/Table/TableRow.js +1 -1
  152. package/dist/Table/TableRow.js.map +1 -1
  153. package/dist/Table/VirtualizedTable.d.ts.map +1 -1
  154. package/dist/Table/VirtualizedTable.js +19 -3
  155. package/dist/Table/VirtualizedTable.js.map +1 -1
  156. package/dist/Table/VirtualizedTableContainer.js +1 -1
  157. package/dist/Table/VirtualizedTableContainer.js.map +1 -1
  158. package/dist/Table/hooks/useTableKeyboardNav.js +1 -1
  159. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  160. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +1 -1
  161. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  162. package/dist/Table/index.js +1 -1
  163. package/dist/Table/index.js.map +1 -1
  164. package/dist/Table/model/table-model.d.ts +16 -6
  165. package/dist/Table/model/table-model.d.ts.map +1 -1
  166. package/dist/Table/model/table-model.js +4 -3
  167. package/dist/Table/model/table-model.js.map +1 -1
  168. package/dist/ThresholdsEditor/ThresholdInput.js +1 -1
  169. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  170. package/dist/ThresholdsEditor/ThresholdsEditor.js +1 -1
  171. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  172. package/dist/ThresholdsEditor/index.js +1 -1
  173. package/dist/ThresholdsEditor/index.js.map +1 -1
  174. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts +2 -1
  175. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -1
  176. package/dist/TimeRangeSelector/DateTimeRangePicker.js +21 -33
  177. package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
  178. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +6 -1
  179. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -1
  180. package/dist/TimeRangeSelector/TimeRangeSelector.js +140 -19
  181. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
  182. package/dist/TimeRangeSelector/index.js +1 -1
  183. package/dist/TimeRangeSelector/index.js.map +1 -1
  184. package/dist/TimeRangeSelector/utils.js +1 -1
  185. package/dist/TimeRangeSelector/utils.js.map +1 -1
  186. package/dist/TimeSeriesTooltip/SeriesInfo.js +1 -1
  187. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  188. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +1 -1
  189. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  190. package/dist/TimeSeriesTooltip/SeriesMarker.js +1 -1
  191. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  192. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +4 -0
  193. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
  194. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +3 -2
  195. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  196. package/dist/TimeSeriesTooltip/TooltipContent.js +1 -1
  197. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  198. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
  199. package/dist/TimeSeriesTooltip/TooltipHeader.js +6 -3
  200. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  201. package/dist/TimeSeriesTooltip/index.js +1 -1
  202. package/dist/TimeSeriesTooltip/index.js.map +1 -1
  203. package/dist/TimeSeriesTooltip/nearby-series.d.ts +3 -14
  204. package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
  205. package/dist/TimeSeriesTooltip/nearby-series.js +80 -58
  206. package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
  207. package/dist/TimeSeriesTooltip/tooltip-model.js +1 -1
  208. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  209. package/dist/TimeSeriesTooltip/utils.js +1 -1
  210. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  211. package/dist/TimeZoneSelector.d.ts +16 -0
  212. package/dist/TimeZoneSelector.d.ts.map +1 -0
  213. package/dist/TimeZoneSelector.js +58 -0
  214. package/dist/TimeZoneSelector.js.map +1 -0
  215. package/dist/ToolbarIconButton/ToolbarIconButton.js +1 -1
  216. package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
  217. package/dist/ToolbarIconButton/index.js +1 -1
  218. package/dist/ToolbarIconButton/index.js.map +1 -1
  219. package/dist/TransformsEditor/TransformEditor.js +1 -1
  220. package/dist/TransformsEditor/TransformEditor.js.map +1 -1
  221. package/dist/TransformsEditor/TransformEditorContainer.js +1 -1
  222. package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
  223. package/dist/TransformsEditor/TransformsEditor.js +1 -1
  224. package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
  225. package/dist/TransformsEditor/index.js +1 -1
  226. package/dist/TransformsEditor/index.js.map +1 -1
  227. package/dist/ValueMappingEditor/ValueMappingEditor.js +1 -1
  228. package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
  229. package/dist/ValueMappingEditor/ValueMappingsEditor.js +1 -1
  230. package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -1
  231. package/dist/ValueMappingEditor/index.js +1 -1
  232. package/dist/ValueMappingEditor/index.js.map +1 -1
  233. package/dist/YAxisLabel.js +1 -1
  234. package/dist/YAxisLabel.js.map +1 -1
  235. package/dist/cjs/AlignSelector/AlignSelector.js +1 -1
  236. package/dist/cjs/AlignSelector/index.js +1 -1
  237. package/dist/cjs/ColorPicker/ColorPicker.js +1 -1
  238. package/dist/cjs/ColorPicker/OptionsColorPicker.js +1 -1
  239. package/dist/cjs/ColorPicker/index.js +1 -1
  240. package/dist/cjs/ContentWithLegend/ContentWithLegend.js +1 -1
  241. package/dist/cjs/ContentWithLegend/index.js +1 -1
  242. package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +1 -1
  243. package/dist/cjs/DensitySelector/DensitySelector.js +1 -1
  244. package/dist/cjs/DensitySelector/index.js +1 -1
  245. package/dist/cjs/Dialog/Dialog.js +1 -1
  246. package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +1 -1
  247. package/dist/cjs/Dialog/index.js +1 -1
  248. package/dist/cjs/DragAndDrop/DragAndDropList.js +1 -1
  249. package/dist/cjs/DragAndDrop/DragButton.js +1 -1
  250. package/dist/cjs/DragAndDrop/DropIndicator.js +1 -1
  251. package/dist/cjs/DragAndDrop/index.js +1 -1
  252. package/dist/cjs/DragAndDrop/model.js +1 -1
  253. package/dist/cjs/Drawer/Drawer.js +1 -1
  254. package/dist/cjs/Drawer/index.js +1 -1
  255. package/dist/cjs/EChart/EChart.js +1 -1
  256. package/dist/cjs/EChart/index.js +1 -1
  257. package/dist/cjs/ErrorAlert.js +1 -1
  258. package/dist/cjs/ErrorBoundary.js +1 -1
  259. package/dist/cjs/FontSizeSelector/FontSizeSelector.js +1 -1
  260. package/dist/cjs/FontSizeSelector/index.js +1 -1
  261. package/dist/cjs/FormEditor/FormActions.js +1 -1
  262. package/dist/cjs/FormEditor/index.js +1 -1
  263. package/dist/cjs/FormatControls/FormatControls.js +9 -22
  264. package/dist/cjs/FormatControls/UnitSelector.js +55 -0
  265. package/dist/cjs/FormatControls/index.js +2 -1
  266. package/dist/cjs/InfoTooltip/InfoTooltip.js +1 -1
  267. package/dist/cjs/InfoTooltip/index.js +1 -1
  268. package/dist/cjs/JSONEditor.js +1 -1
  269. package/dist/cjs/Legend/CompactLegend.js +1 -1
  270. package/dist/cjs/Legend/Legend.js +1 -1
  271. package/dist/cjs/Legend/LegendColorBadge.js +1 -1
  272. package/dist/cjs/Legend/ListLegend.js +1 -1
  273. package/dist/cjs/Legend/ListLegendItem.js +1 -1
  274. package/dist/cjs/Legend/TableLegend.js +1 -1
  275. package/dist/cjs/Legend/index.js +1 -1
  276. package/dist/cjs/Legend/legend-model.js +1 -1
  277. package/dist/cjs/LinksEditor/LinkEditorForm.js +1 -1
  278. package/dist/cjs/LinksEditor/LinksEditor.js +1 -1
  279. package/dist/cjs/LinksEditor/index.js +1 -1
  280. package/dist/cjs/ModeSelector/ModeSelector.js +1 -1
  281. package/dist/cjs/ModeSelector/index.js +1 -1
  282. package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
  283. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +5 -2
  284. package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
  285. package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +1 -1
  286. package/dist/cjs/OptionsEditorLayout/index.js +1 -1
  287. package/dist/cjs/Overlay/Overlay.js +1 -1
  288. package/dist/cjs/Overlay/index.js +1 -1
  289. package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +1 -1
  290. package/dist/cjs/RefreshIntervalPicker/index.js +1 -1
  291. package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +16 -3
  292. package/dist/cjs/SettingsAutocomplete/index.js +1 -1
  293. package/dist/cjs/SortSelector/SortSelector.js +1 -1
  294. package/dist/cjs/SortSelector/SortSelectorButtons.js +1 -1
  295. package/dist/cjs/SortSelector/index.js +1 -1
  296. package/dist/cjs/Table/InnerTable.js +1 -1
  297. package/dist/cjs/Table/Table.js +29 -5
  298. package/dist/cjs/Table/TableBody.js +1 -1
  299. package/dist/cjs/Table/TableCell.js +25 -3
  300. package/dist/cjs/Table/TableCheckbox.js +1 -1
  301. package/dist/cjs/Table/TableFoot.js +1 -1
  302. package/dist/cjs/Table/TableHead.js +1 -1
  303. package/dist/cjs/Table/TableHeaderCell.js +1 -1
  304. package/dist/cjs/Table/TableRow.js +1 -1
  305. package/dist/cjs/Table/VirtualizedTable.js +19 -3
  306. package/dist/cjs/Table/VirtualizedTableContainer.js +1 -1
  307. package/dist/cjs/Table/hooks/useTableKeyboardNav.js +1 -1
  308. package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +1 -1
  309. package/dist/cjs/Table/index.js +1 -1
  310. package/dist/cjs/Table/model/table-model.js +4 -3
  311. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +1 -1
  312. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +1 -1
  313. package/dist/cjs/ThresholdsEditor/index.js +1 -1
  314. package/dist/cjs/TimeRangeSelector/DateTimeRangePicker.js +20 -32
  315. package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +139 -18
  316. package/dist/cjs/TimeRangeSelector/index.js +1 -1
  317. package/dist/cjs/TimeRangeSelector/utils.js +1 -1
  318. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +1 -1
  319. package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +1 -1
  320. package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +1 -1
  321. package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +3 -2
  322. package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +1 -1
  323. package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +6 -3
  324. package/dist/cjs/TimeSeriesTooltip/index.js +1 -1
  325. package/dist/cjs/TimeSeriesTooltip/nearby-series.js +80 -58
  326. package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +1 -1
  327. package/dist/cjs/TimeSeriesTooltip/utils.js +1 -1
  328. package/dist/cjs/TimeZoneSelector.js +63 -0
  329. package/dist/cjs/ToolbarIconButton/ToolbarIconButton.js +1 -1
  330. package/dist/cjs/ToolbarIconButton/index.js +1 -1
  331. package/dist/cjs/TransformsEditor/TransformEditor.js +1 -1
  332. package/dist/cjs/TransformsEditor/TransformEditorContainer.js +1 -1
  333. package/dist/cjs/TransformsEditor/TransformsEditor.js +1 -1
  334. package/dist/cjs/TransformsEditor/index.js +1 -1
  335. package/dist/cjs/ValueMappingEditor/ValueMappingEditor.js +1 -1
  336. package/dist/cjs/ValueMappingEditor/ValueMappingsEditor.js +1 -1
  337. package/dist/cjs/ValueMappingEditor/index.js +1 -1
  338. package/dist/cjs/YAxisLabel.js +1 -1
  339. package/dist/cjs/context/ChartsProvider.js +1 -1
  340. package/dist/cjs/context/ItemActionsProvider.js +111 -0
  341. package/dist/cjs/context/SelectionProvider.js +128 -0
  342. package/dist/cjs/context/SnackbarProvider.js +1 -1
  343. package/dist/cjs/context/TimeZoneProvider.js +1 -1
  344. package/dist/cjs/context/index.js +3 -1
  345. package/dist/cjs/controls/TextField.js +1 -1
  346. package/dist/cjs/controls/index.js +1 -1
  347. package/dist/cjs/index.js +2 -1
  348. package/dist/cjs/model/graph.js +1 -1
  349. package/dist/cjs/model/index.js +2 -1
  350. package/dist/cjs/model/theme.js +1 -1
  351. package/dist/cjs/model/timeOption.js +1 -1
  352. package/dist/cjs/model/timeZoneOption.js +34 -0
  353. package/dist/cjs/test/index.js +1 -1
  354. package/dist/cjs/test/render.js +1 -1
  355. package/dist/cjs/test/setup-tests.js +1 -1
  356. package/dist/cjs/test-utils/index.js +1 -1
  357. package/dist/cjs/test-utils/theme.js +1 -1
  358. package/dist/cjs/theme/component-overrides/alert.js +1 -1
  359. package/dist/cjs/theme/component-overrides/paper.js +1 -1
  360. package/dist/cjs/theme/index.js +1 -1
  361. package/dist/cjs/theme/palette/background.js +1 -1
  362. package/dist/cjs/theme/palette/colors/blue.js +1 -1
  363. package/dist/cjs/theme/palette/colors/common.js +1 -1
  364. package/dist/cjs/theme/palette/colors/green.js +1 -1
  365. package/dist/cjs/theme/palette/colors/grey.js +1 -1
  366. package/dist/cjs/theme/palette/colors/index.js +1 -1
  367. package/dist/cjs/theme/palette/colors/orange.js +1 -1
  368. package/dist/cjs/theme/palette/colors/purple.js +1 -1
  369. package/dist/cjs/theme/palette/colors/red.js +1 -1
  370. package/dist/cjs/theme/palette/colors/types.js +1 -1
  371. package/dist/cjs/theme/palette/error.js +1 -1
  372. package/dist/cjs/theme/palette/grey.js +1 -1
  373. package/dist/cjs/theme/palette/index.js +1 -1
  374. package/dist/cjs/theme/palette/palette-options.js +1 -1
  375. package/dist/cjs/theme/palette/primary.js +1 -1
  376. package/dist/cjs/theme/palette/secondary.js +1 -1
  377. package/dist/cjs/theme/palette/success.js +1 -1
  378. package/dist/cjs/theme/palette/text.js +1 -1
  379. package/dist/cjs/theme/palette/warning.js +1 -1
  380. package/dist/cjs/theme/theme.js +1 -1
  381. package/dist/cjs/theme/types/ThemeExtension.d.js +1 -1
  382. package/dist/cjs/theme/typography.js +1 -1
  383. package/dist/cjs/utils/axis.js +80 -5
  384. package/dist/cjs/utils/browser-storage.js +1 -1
  385. package/dist/cjs/utils/chart-actions.js +1 -1
  386. package/dist/cjs/utils/combine-sx.js +1 -1
  387. package/dist/cjs/utils/component-ids.js +1 -1
  388. package/dist/cjs/utils/data-field-interpolation.js +230 -0
  389. package/dist/cjs/utils/format.js +1 -1
  390. package/dist/cjs/utils/index.js +5 -2
  391. package/dist/cjs/utils/mathjs.js +1 -1
  392. package/dist/cjs/utils/memo.js +1 -1
  393. package/dist/cjs/utils/selection-interpolation.js +69 -0
  394. package/dist/cjs/utils/theme-gen.js +1 -1
  395. package/dist/cjs/utils/variable-interpolation.js +192 -0
  396. package/dist/context/ChartsProvider.js +1 -1
  397. package/dist/context/ChartsProvider.js.map +1 -1
  398. package/dist/context/ItemActionsProvider.d.ts +25 -0
  399. package/dist/context/ItemActionsProvider.d.ts.map +1 -0
  400. package/dist/context/ItemActionsProvider.js +95 -0
  401. package/dist/context/ItemActionsProvider.js.map +1 -0
  402. package/dist/context/SelectionProvider.d.ts +34 -0
  403. package/dist/context/SelectionProvider.d.ts.map +1 -0
  404. package/dist/context/SelectionProvider.js +120 -0
  405. package/dist/context/SelectionProvider.js.map +1 -0
  406. package/dist/context/SnackbarProvider.js +1 -1
  407. package/dist/context/SnackbarProvider.js.map +1 -1
  408. package/dist/context/TimeZoneProvider.js +1 -1
  409. package/dist/context/TimeZoneProvider.js.map +1 -1
  410. package/dist/context/index.d.ts +2 -0
  411. package/dist/context/index.d.ts.map +1 -1
  412. package/dist/context/index.js +3 -1
  413. package/dist/context/index.js.map +1 -1
  414. package/dist/controls/TextField.js +1 -1
  415. package/dist/controls/TextField.js.map +1 -1
  416. package/dist/controls/index.js +1 -1
  417. package/dist/controls/index.js.map +1 -1
  418. package/dist/index.d.ts +1 -0
  419. package/dist/index.d.ts.map +1 -1
  420. package/dist/index.js +2 -1
  421. package/dist/index.js.map +1 -1
  422. package/dist/model/graph.js +1 -1
  423. package/dist/model/graph.js.map +1 -1
  424. package/dist/model/index.d.ts +1 -0
  425. package/dist/model/index.d.ts.map +1 -1
  426. package/dist/model/index.js +2 -1
  427. package/dist/model/index.js.map +1 -1
  428. package/dist/model/theme.d.ts +1 -0
  429. package/dist/model/theme.d.ts.map +1 -1
  430. package/dist/model/theme.js +1 -1
  431. package/dist/model/theme.js.map +1 -1
  432. package/dist/model/timeOption.js +1 -1
  433. package/dist/model/timeOption.js.map +1 -1
  434. package/dist/model/timeZoneOption.d.ts +10 -0
  435. package/dist/model/timeZoneOption.d.ts.map +1 -0
  436. package/dist/model/timeZoneOption.js +29 -0
  437. package/dist/model/timeZoneOption.js.map +1 -0
  438. package/dist/test/index.js +1 -1
  439. package/dist/test/index.js.map +1 -1
  440. package/dist/test/render.js +1 -1
  441. package/dist/test/render.js.map +1 -1
  442. package/dist/test/setup-tests.js +1 -1
  443. package/dist/test/setup-tests.js.map +1 -1
  444. package/dist/test-utils/index.js +1 -1
  445. package/dist/test-utils/index.js.map +1 -1
  446. package/dist/test-utils/theme.js +1 -1
  447. package/dist/test-utils/theme.js.map +1 -1
  448. package/dist/theme/component-overrides/alert.js +1 -1
  449. package/dist/theme/component-overrides/alert.js.map +1 -1
  450. package/dist/theme/component-overrides/paper.js +1 -1
  451. package/dist/theme/component-overrides/paper.js.map +1 -1
  452. package/dist/theme/index.js +1 -1
  453. package/dist/theme/index.js.map +1 -1
  454. package/dist/theme/palette/background.js +1 -1
  455. package/dist/theme/palette/background.js.map +1 -1
  456. package/dist/theme/palette/colors/blue.js +1 -1
  457. package/dist/theme/palette/colors/blue.js.map +1 -1
  458. package/dist/theme/palette/colors/common.js +1 -1
  459. package/dist/theme/palette/colors/common.js.map +1 -1
  460. package/dist/theme/palette/colors/green.js +1 -1
  461. package/dist/theme/palette/colors/green.js.map +1 -1
  462. package/dist/theme/palette/colors/grey.js +1 -1
  463. package/dist/theme/palette/colors/grey.js.map +1 -1
  464. package/dist/theme/palette/colors/index.js +1 -1
  465. package/dist/theme/palette/colors/index.js.map +1 -1
  466. package/dist/theme/palette/colors/orange.js +1 -1
  467. package/dist/theme/palette/colors/orange.js.map +1 -1
  468. package/dist/theme/palette/colors/purple.js +1 -1
  469. package/dist/theme/palette/colors/purple.js.map +1 -1
  470. package/dist/theme/palette/colors/red.js +1 -1
  471. package/dist/theme/palette/colors/red.js.map +1 -1
  472. package/dist/theme/palette/colors/types.js +1 -1
  473. package/dist/theme/palette/colors/types.js.map +1 -1
  474. package/dist/theme/palette/error.js +1 -1
  475. package/dist/theme/palette/error.js.map +1 -1
  476. package/dist/theme/palette/grey.js +1 -1
  477. package/dist/theme/palette/grey.js.map +1 -1
  478. package/dist/theme/palette/index.js +1 -1
  479. package/dist/theme/palette/index.js.map +1 -1
  480. package/dist/theme/palette/palette-options.js +1 -1
  481. package/dist/theme/palette/palette-options.js.map +1 -1
  482. package/dist/theme/palette/primary.js +1 -1
  483. package/dist/theme/palette/primary.js.map +1 -1
  484. package/dist/theme/palette/secondary.js +1 -1
  485. package/dist/theme/palette/secondary.js.map +1 -1
  486. package/dist/theme/palette/success.js +1 -1
  487. package/dist/theme/palette/success.js.map +1 -1
  488. package/dist/theme/palette/text.js +1 -1
  489. package/dist/theme/palette/text.js.map +1 -1
  490. package/dist/theme/palette/warning.js +1 -1
  491. package/dist/theme/palette/warning.js.map +1 -1
  492. package/dist/theme/theme.js +1 -1
  493. package/dist/theme/theme.js.map +1 -1
  494. package/dist/theme/types/ThemeExtension.d.js +1 -1
  495. package/dist/theme/types/ThemeExtension.d.js.map +1 -1
  496. package/dist/theme/typography.js +1 -1
  497. package/dist/theme/typography.js.map +1 -1
  498. package/dist/utils/axis.d.ts +18 -0
  499. package/dist/utils/axis.d.ts.map +1 -1
  500. package/dist/utils/axis.js +79 -3
  501. package/dist/utils/axis.js.map +1 -1
  502. package/dist/utils/browser-storage.js +1 -1
  503. package/dist/utils/browser-storage.js.map +1 -1
  504. package/dist/utils/chart-actions.js +1 -1
  505. package/dist/utils/chart-actions.js.map +1 -1
  506. package/dist/utils/combine-sx.js +1 -1
  507. package/dist/utils/combine-sx.js.map +1 -1
  508. package/dist/utils/component-ids.js +1 -1
  509. package/dist/utils/component-ids.js.map +1 -1
  510. package/dist/utils/data-field-interpolation.d.ts +84 -0
  511. package/dist/utils/data-field-interpolation.d.ts.map +1 -0
  512. package/dist/utils/data-field-interpolation.js +239 -0
  513. package/dist/utils/data-field-interpolation.js.map +1 -0
  514. package/dist/utils/format.js +1 -1
  515. package/dist/utils/format.js.map +1 -1
  516. package/dist/utils/index.d.ts +4 -1
  517. package/dist/utils/index.d.ts.map +1 -1
  518. package/dist/utils/index.js +5 -2
  519. package/dist/utils/index.js.map +1 -1
  520. package/dist/utils/mathjs.js +1 -1
  521. package/dist/utils/mathjs.js.map +1 -1
  522. package/dist/utils/memo.js +1 -1
  523. package/dist/utils/memo.js.map +1 -1
  524. package/dist/utils/selection-interpolation.d.ts +32 -0
  525. package/dist/utils/selection-interpolation.d.ts.map +1 -0
  526. package/dist/utils/selection-interpolation.js +77 -0
  527. package/dist/utils/selection-interpolation.js.map +1 -0
  528. package/dist/utils/theme-gen.js +1 -1
  529. package/dist/utils/theme-gen.js.map +1 -1
  530. package/dist/utils/variable-interpolation.d.ts +71 -0
  531. package/dist/utils/variable-interpolation.d.ts.map +1 -0
  532. package/dist/utils/variable-interpolation.js +176 -0
  533. package/dist/utils/variable-interpolation.js.map +1 -0
  534. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ValueMappingEditor/ValueMappingEditor.tsx"],"sourcesContent":["// Copyright 2024 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 {\n Grid2Props as GridProps,\n IconButton,\n MenuItem,\n Stack,\n StackProps,\n TextField,\n Tooltip,\n Typography,\n Grid2 as Grid,\n} from '@mui/material';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport { ValueMapping } from '@perses-dev/core';\nimport { FC } from 'react';\nimport { OptionsColorPicker } from '../ColorPicker/OptionsColorPicker';\n\ninterface ValueMappingConditionEditorProps extends Omit<StackProps, 'onChange'> {\n mapping: ValueMapping;\n onChange: (condition: ValueMapping) => void;\n}\n\nconst ConditionEditor: FC<ValueMappingConditionEditorProps> = ({ mapping, onChange, ...props }) => {\n switch (mapping.kind) {\n case 'Value':\n return (\n <Stack gap={1} direction=\"row\" {...props}>\n <TextField\n label=\"Value\"\n placeholder=\"Exact value\"\n value={mapping.spec?.value ?? ''}\n onChange={(e) =>\n onChange({\n ...mapping,\n spec: { ...mapping.spec, value: e.target.value },\n })\n }\n fullWidth\n />\n </Stack>\n );\n case 'Range':\n return (\n <Stack gap={1} direction=\"row\" {...props}>\n <TextField\n label=\"From\"\n placeholder=\"Start of range\"\n value={mapping.spec?.from ?? ''}\n onChange={(e) =>\n onChange({\n ...mapping,\n spec: { ...mapping.spec, from: e.target.value === '' ? undefined : +e.target.value },\n })\n }\n fullWidth\n />\n <TextField\n label=\"To\"\n placeholder=\"End of range (inclusive)\"\n value={mapping.spec?.to ?? ''}\n onChange={(e) =>\n onChange({\n ...mapping,\n spec: { ...mapping.spec, to: e.target.value === '' ? undefined : +e.target.value },\n })\n }\n fullWidth\n />\n </Stack>\n );\n case 'Regex':\n return (\n <Stack gap={1} direction=\"row\" {...props}>\n <TextField\n label=\"Regular Expression\"\n placeholder=\"JavaScript regular expression\"\n value={mapping.spec?.pattern ?? ''}\n onChange={(e) => onChange({ ...mapping, spec: { ...mapping.spec, pattern: e.target.value } })}\n fullWidth\n />\n </Stack>\n );\n case 'Misc':\n return (\n <Stack gap={1} direction=\"row\" {...props}>\n <TextField\n select\n label=\"Value\"\n value={mapping.spec?.value ?? ''}\n onChange={(e) => onChange({ ...mapping, spec: { value: e.target.value } } as ValueMapping)}\n SelectProps={{\n renderValue: (selected) => {\n switch (selected) {\n case 'empty':\n return 'Empty';\n case 'null':\n return 'Null';\n case 'NaN':\n return 'NaN';\n case 'true':\n return 'True';\n case 'false':\n return 'False';\n default:\n return String(selected);\n }\n },\n }}\n fullWidth\n >\n <MenuItem value=\"empty\">\n <Stack>\n <Typography>Empty</Typography>\n <Typography variant=\"caption\">Matches empty string</Typography>\n </Stack>\n </MenuItem>\n <MenuItem value=\"null\">\n <Stack>\n <Typography>Null</Typography>\n <Typography variant=\"caption\">Matches null or undefined</Typography>\n </Stack>\n </MenuItem>\n <MenuItem value=\"NaN\">\n <Stack>\n <Typography>NaN</Typography>\n <Typography variant=\"caption\">Matches Not a Number value</Typography>\n </Stack>\n </MenuItem>\n <MenuItem value=\"true\">\n <Stack>\n <Typography>True</Typography>\n <Typography variant=\"caption\">Matches true boolean</Typography>\n </Stack>\n </MenuItem>\n <MenuItem value=\"false\">\n <Stack>\n <Typography>False</Typography>\n <Typography variant=\"caption\">Matches false boolean</Typography>\n </Stack>\n </MenuItem>\n </TextField>\n </Stack>\n );\n default:\n return null;\n }\n};\nexport interface ValueMappingEditorProps extends Omit<GridProps, 'onChange'> {\n mapping: ValueMapping;\n onChange: (mapping: ValueMapping) => void;\n onDelete: () => void;\n}\n\nexport const ValueMappingEditor: FC<ValueMappingEditorProps> = ({ mapping, onChange, onDelete, ...props }) => {\n const handleColorChange = (color?: string): void => {\n onChange({\n ...mapping,\n spec: {\n ...mapping.spec,\n result: {\n ...mapping.spec.result,\n color,\n },\n },\n } as ValueMapping);\n };\n return (\n <Grid container spacing={2} {...props}>\n <Grid size={{ xs: 5 }}>\n <Stack direction=\"row\" gap={1} width=\"100%\">\n <TextField\n select\n label=\"Type\"\n value={mapping.kind}\n onChange={(e) => onChange({ ...mapping, kind: e.target.value } as ValueMapping)}\n required\n sx={{ width: '120px' }}\n >\n <MenuItem value=\"Value\">\n <Stack>\n <Typography>Value</Typography>\n {mapping.kind !== 'Value' && <Typography variant=\"caption\">Matches an exact text value</Typography>}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Range\">\n <Stack>\n <Typography>Range</Typography>\n {mapping.kind !== 'Range' && (\n <Typography variant=\"caption\">Matches against a numerical range</Typography>\n )}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Regex\">\n <Stack>\n <Typography>Regex</Typography>\n {mapping.kind !== 'Regex' && (\n <Typography variant=\"caption\">Matches against a regular expression</Typography>\n )}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Misc\">\n <Stack>\n <Typography>Misc</Typography>\n {mapping.kind !== 'Misc' && (\n <Typography variant=\"caption\">Matches against empty, null and NaN values</Typography>\n )}\n </Stack>\n </MenuItem>\n </TextField>\n <ConditionEditor\n width=\"100%\"\n mapping={mapping}\n onChange={(updatedMapping) => onChange({ ...mapping, ...updatedMapping })}\n />\n </Stack>\n </Grid>\n <Grid size={{ xs: 4 }}>\n <TextField\n label=\"Display text\"\n value={mapping.spec?.result?.value ?? ''}\n onChange={(e) =>\n onChange({\n ...mapping,\n spec: {\n ...mapping.spec,\n result: {\n ...mapping.spec?.result,\n value: e.target.value,\n },\n },\n } as ValueMapping)\n }\n fullWidth\n />\n </Grid>\n <Grid size={{ xs: 1 }}>\n <Stack direction=\"row\" justifyContent=\"center\" gap={1}>\n {mapping.spec?.result?.color ? (\n <OptionsColorPicker\n label=\"Color\"\n color={mapping.spec.result.color ?? '#000'}\n onColorChange={handleColorChange}\n onClear={() => handleColorChange(undefined)}\n />\n ) : (\n <IconButton onClick={() => handleColorChange('#000')}>\n <PlusIcon />\n </IconButton>\n )}\n </Stack>\n </Grid>\n <Grid size={{ xs: 1 }} textAlign=\"end\">\n <Tooltip title=\"Remove mapping settings\" placement=\"top\">\n <IconButton size=\"small\" sx={{ marginLeft: 'auto' }} onClick={onDelete}>\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n </Grid>\n </Grid>\n );\n};\n"],"names":["IconButton","MenuItem","Stack","TextField","Tooltip","Typography","Grid2","Grid","DeleteIcon","PlusIcon","OptionsColorPicker","ConditionEditor","mapping","onChange","props","kind","gap","direction","label","placeholder","value","spec","e","target","fullWidth","from","undefined","to","pattern","select","SelectProps","renderValue","selected","String","variant","ValueMappingEditor","onDelete","handleColorChange","color","result","container","spacing","size","xs","width","required","sx","updatedMapping","justifyContent","onColorChange","onClear","onClick","textAlign","title","placement","marginLeft"],"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,SAEEA,UAAU,EACVC,QAAQ,EACRC,KAAK,EAELC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,SAASC,IAAI,QACR,gBAAgB;AACvB,OAAOC,gBAAgB,gCAAgC;AACvD,OAAOC,cAAc,uBAAuB;AAG5C,SAASC,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cAAA,KAAC5B;;;;;;AAMb,EAAE"}
1
+ {"version":3,"sources":["../../src/ValueMappingEditor/ValueMappingEditor.tsx"],"sourcesContent":["// Copyright 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 {\n Grid2Props as GridProps,\n IconButton,\n MenuItem,\n Stack,\n StackProps,\n TextField,\n Tooltip,\n Typography,\n Grid2 as Grid,\n} from '@mui/material';\nimport DeleteIcon from 'mdi-material-ui/DeleteOutline';\nimport PlusIcon from 'mdi-material-ui/Plus';\nimport { ValueMapping } from '@perses-dev/core';\nimport { FC } from 'react';\nimport { OptionsColorPicker } from '../ColorPicker/OptionsColorPicker';\n\ninterface ValueMappingConditionEditorProps extends Omit<StackProps, 'onChange'> {\n mapping: ValueMapping;\n onChange: (condition: ValueMapping) => void;\n}\n\nconst ConditionEditor: FC<ValueMappingConditionEditorProps> = ({ mapping, onChange, ...props }) => {\n switch (mapping.kind) {\n case 'Value':\n return (\n <Stack gap={1} direction=\"row\" {...props}>\n <TextField\n label=\"Value\"\n placeholder=\"Exact value\"\n value={mapping.spec?.value ?? ''}\n onChange={(e) =>\n onChange({\n ...mapping,\n spec: { ...mapping.spec, value: e.target.value },\n })\n }\n fullWidth\n />\n </Stack>\n );\n case 'Range':\n return (\n <Stack gap={1} direction=\"row\" {...props}>\n <TextField\n label=\"From\"\n placeholder=\"Start of range\"\n value={mapping.spec?.from ?? ''}\n onChange={(e) =>\n onChange({\n ...mapping,\n spec: { ...mapping.spec, from: e.target.value === '' ? undefined : +e.target.value },\n })\n }\n fullWidth\n />\n <TextField\n label=\"To\"\n placeholder=\"End of range (inclusive)\"\n value={mapping.spec?.to ?? ''}\n onChange={(e) =>\n onChange({\n ...mapping,\n spec: { ...mapping.spec, to: e.target.value === '' ? undefined : +e.target.value },\n })\n }\n fullWidth\n />\n </Stack>\n );\n case 'Regex':\n return (\n <Stack gap={1} direction=\"row\" {...props}>\n <TextField\n label=\"Regular Expression\"\n placeholder=\"JavaScript regular expression\"\n value={mapping.spec?.pattern ?? ''}\n onChange={(e) => onChange({ ...mapping, spec: { ...mapping.spec, pattern: e.target.value } })}\n fullWidth\n />\n </Stack>\n );\n case 'Misc':\n return (\n <Stack gap={1} direction=\"row\" {...props}>\n <TextField\n select\n label=\"Value\"\n value={mapping.spec?.value ?? ''}\n onChange={(e) => onChange({ ...mapping, spec: { value: e.target.value } } as ValueMapping)}\n SelectProps={{\n renderValue: (selected) => {\n switch (selected) {\n case 'empty':\n return 'Empty';\n case 'null':\n return 'Null';\n case 'NaN':\n return 'NaN';\n case 'true':\n return 'True';\n case 'false':\n return 'False';\n default:\n return String(selected);\n }\n },\n }}\n fullWidth\n >\n <MenuItem value=\"empty\">\n <Stack>\n <Typography>Empty</Typography>\n <Typography variant=\"caption\">Matches empty string</Typography>\n </Stack>\n </MenuItem>\n <MenuItem value=\"null\">\n <Stack>\n <Typography>Null</Typography>\n <Typography variant=\"caption\">Matches null or undefined</Typography>\n </Stack>\n </MenuItem>\n <MenuItem value=\"NaN\">\n <Stack>\n <Typography>NaN</Typography>\n <Typography variant=\"caption\">Matches Not a Number value</Typography>\n </Stack>\n </MenuItem>\n <MenuItem value=\"true\">\n <Stack>\n <Typography>True</Typography>\n <Typography variant=\"caption\">Matches true boolean</Typography>\n </Stack>\n </MenuItem>\n <MenuItem value=\"false\">\n <Stack>\n <Typography>False</Typography>\n <Typography variant=\"caption\">Matches false boolean</Typography>\n </Stack>\n </MenuItem>\n </TextField>\n </Stack>\n );\n default:\n return null;\n }\n};\nexport interface ValueMappingEditorProps extends Omit<GridProps, 'onChange'> {\n mapping: ValueMapping;\n onChange: (mapping: ValueMapping) => void;\n onDelete: () => void;\n}\n\nexport const ValueMappingEditor: FC<ValueMappingEditorProps> = ({ mapping, onChange, onDelete, ...props }) => {\n const handleColorChange = (color?: string): void => {\n onChange({\n ...mapping,\n spec: {\n ...mapping.spec,\n result: {\n ...mapping.spec.result,\n color,\n },\n },\n } as ValueMapping);\n };\n return (\n <Grid container spacing={2} {...props}>\n <Grid size={{ xs: 5 }}>\n <Stack direction=\"row\" gap={1} width=\"100%\">\n <TextField\n select\n label=\"Type\"\n value={mapping.kind}\n onChange={(e) => onChange({ ...mapping, kind: e.target.value } as ValueMapping)}\n required\n sx={{ width: '120px' }}\n >\n <MenuItem value=\"Value\">\n <Stack>\n <Typography>Value</Typography>\n {mapping.kind !== 'Value' && <Typography variant=\"caption\">Matches an exact text value</Typography>}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Range\">\n <Stack>\n <Typography>Range</Typography>\n {mapping.kind !== 'Range' && (\n <Typography variant=\"caption\">Matches against a numerical range</Typography>\n )}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Regex\">\n <Stack>\n <Typography>Regex</Typography>\n {mapping.kind !== 'Regex' && (\n <Typography variant=\"caption\">Matches against a regular expression</Typography>\n )}\n </Stack>\n </MenuItem>\n <MenuItem value=\"Misc\">\n <Stack>\n <Typography>Misc</Typography>\n {mapping.kind !== 'Misc' && (\n <Typography variant=\"caption\">Matches against empty, null and NaN values</Typography>\n )}\n </Stack>\n </MenuItem>\n </TextField>\n <ConditionEditor\n width=\"100%\"\n mapping={mapping}\n onChange={(updatedMapping) => onChange({ ...mapping, ...updatedMapping })}\n />\n </Stack>\n </Grid>\n <Grid size={{ xs: 4 }}>\n <TextField\n label=\"Display text\"\n value={mapping.spec?.result?.value ?? ''}\n onChange={(e) =>\n onChange({\n ...mapping,\n spec: {\n ...mapping.spec,\n result: {\n ...mapping.spec?.result,\n value: e.target.value,\n },\n },\n } as ValueMapping)\n }\n fullWidth\n />\n </Grid>\n <Grid size={{ xs: 1 }}>\n <Stack direction=\"row\" justifyContent=\"center\" gap={1}>\n {mapping.spec?.result?.color ? (\n <OptionsColorPicker\n label=\"Color\"\n color={mapping.spec.result.color ?? '#000'}\n onColorChange={handleColorChange}\n onClear={() => handleColorChange(undefined)}\n />\n ) : (\n <IconButton onClick={() => handleColorChange('#000')}>\n <PlusIcon />\n </IconButton>\n )}\n </Stack>\n </Grid>\n <Grid size={{ xs: 1 }} textAlign=\"end\">\n <Tooltip title=\"Remove mapping settings\" placement=\"top\">\n <IconButton size=\"small\" sx={{ marginLeft: 'auto' }} onClick={onDelete}>\n <DeleteIcon />\n </IconButton>\n </Tooltip>\n </Grid>\n </Grid>\n );\n};\n"],"names":["IconButton","MenuItem","Stack","TextField","Tooltip","Typography","Grid2","Grid","DeleteIcon","PlusIcon","OptionsColorPicker","ConditionEditor","mapping","onChange","props","kind","gap","direction","label","placeholder","value","spec","e","target","fullWidth","from","undefined","to","pattern","select","SelectProps","renderValue","selected","String","variant","ValueMappingEditor","onDelete","handleColorChange","color","result","container","spacing","size","xs","width","required","sx","updatedMapping","justifyContent","onColorChange","onClear","onClick","textAlign","title","placement","marginLeft"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAEEA,UAAU,EACVC,QAAQ,EACRC,KAAK,EAELC,SAAS,EACTC,OAAO,EACPC,UAAU,EACVC,SAASC,IAAI,QACR,gBAAgB;AACvB,OAAOC,gBAAgB,gCAAgC;AACvD,OAAOC,cAAc,uBAAuB;AAG5C,SAASC,kBAAkB,QAAQ,oCAAoC;AAOvE,MAAMC,kBAAwD,CAAC,EAAEC,OAAO,EAAEC,QAAQ,EAAE,GAAGC,OAAO;IAC5F,OAAQF,QAAQG,IAAI;QAClB,KAAK;YACH,qBACE,KAACb;gBAAMc,K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ACCiC,OAAM;4BACNhC,SAASA;4BACTC,UAAU,CAACkC,iBAAmBlC,SAAS;oCAAE,GAAGD,OAAO;oCAAE,GAAGmC,cAAc;gCAAC;;;;;0BAI7E,KAACxC;gBAAKmC,MAAM;oBAAEC,IAAI;gBAAE;0BAClB,cAAA,KAACxC;oBACCe,OAAM;oBACNE,OAAOR,QAAQS,IAAI,EAAEkB,QAAQnB,SAAS;oBACtCP,UAAU,CAACS,IACTT,SAAS;4BACP,GAAGD,OAAO;4BACVS,MAAM;gCACJ,GAAGT,QAAQS,IAAI;gCACfkB,QAAQ;oCACN,GAAG3B,QAAQS,IAAI,EAAEkB,MAAM;oCACvBnB,OAAOE,EAAEC,MAAM,CAACH,KAAK;gCACvB;4BACF;wBACF;oBAEFI,SAAS;;;0BAGb,KAACjB;gBAAKmC,MAAM;oBAAEC,IAAI;gBAAE;0BAClB,cAAA,KAACzC;oBAAMe,WAAU;oBAAM+B,gBAAe;oBAAShC,KAAK;8BACjDJ,QAAQS,IAAI,EAAEkB,QAAQD,sBACrB,KAAC5B;wBACCQ,OAAM;wBACNoB,OAAO1B,QAAQS,IAAI,CAACkB,MAAM,CAACD,KAAK,IAAI;wBACpCW,eAAeZ;wBACfa,SAAS,IAAMb,kBAAkBX;uCAGnC,KAAC1B;wBAAWmD,SAAS,IAAMd,kBAAkB;kCAC3C,cAAA,KAAC5B;;;;0BAKT,KAACF;gBAAKmC,MAAM;oBAAEC,IAAI;gBAAE;gBAAGS,WAAU;0BAC/B,cAAA,KAAChD;oBAAQiD,OAAM;oBAA0BC,WAAU;8BACjD,cAAA,KAACtD;wBAAW0C,MAAK;wBAAQI,IAAI;4BAAES,YAAY;wBAAO;wBAAGJ,SAASf;kCAC5D,cAAA,KAAC5B;;;;;;AAMb,EAAE"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ValueMappingEditor/ValueMappingsEditor.tsx"],"sourcesContent":["// Copyright 2024 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 { Button, Divider, Stack, Typography, Grid2 as Grid } from '@mui/material';\n\nimport { FC, useState } from 'react';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { ValueMapping } from '@perses-dev/core';\nimport { ValueMappingEditor } from './ValueMappingEditor';\n\nexport interface ValueMappingsEditorProps {\n mappings: ValueMapping[];\n onChange: (valueMappings: ValueMapping[]) => void;\n}\n\nexport const ValueMappingsEditor: FC<ValueMappingsEditorProps> = ({ mappings, onChange }) => {\n const [valueMappings, setValueMappings] = useState<ValueMapping[]>(mappings);\n\n function handleValueMappingChange(index: number, mapping: ValueMapping): void {\n const updatedValueMapings = [...valueMappings];\n updatedValueMapings[index] = mapping;\n setValueMappings(updatedValueMapings);\n onChange(updatedValueMapings);\n }\n\n function handleAddValueMappingEditor(): void {\n const updatedValueMapings = [...valueMappings];\n updatedValueMapings.push({ kind: 'Value', spec: { result: { value: '' } } } as ValueMapping);\n setValueMappings(updatedValueMapings);\n onChange(updatedValueMapings);\n }\n\n function handleValueMappingDelete(index: number): void {\n const updatedValueMapings = [...valueMappings];\n updatedValueMapings.splice(index, 1);\n setValueMappings(updatedValueMapings);\n onChange(updatedValueMapings);\n }\n\n return (\n <Stack spacing={1}>\n <Grid container spacing={2}>\n <Grid size={{ xs: 5 }}>\n <Typography variant=\"subtitle1\">Condition</Typography>\n </Grid>\n <Grid size={{ xs: 4 }}>\n <Typography variant=\"subtitle1\">Display Text</Typography>\n </Grid>\n <Grid size={{ xs: 1 }} textAlign=\"center\">\n <Typography variant=\"subtitle1\">Color</Typography>\n </Grid>\n <Grid size={{ xs: 1 }}></Grid>\n </Grid>\n <Stack gap={1.5} divider={<Divider flexItem orientation=\"horizontal\" />}>\n {valueMappings.map((mapping, i) => (\n <ValueMappingEditor\n key={i}\n mapping={mapping}\n onChange={(updatedMapping: ValueMapping) => handleValueMappingChange(i, updatedMapping)}\n onDelete={() => handleValueMappingDelete(i)}\n />\n ))}\n </Stack>\n\n <Button variant=\"contained\" startIcon={<AddIcon />} sx={{ marginTop: 1 }} onClick={handleAddValueMappingEditor}>\n Add value mappings\n </Button>\n </Stack>\n );\n};\n"],"names":["Button","Divider","Stack","Typography","Grid2","Grid","useState","AddIcon","ValueMappingEditor","ValueMappingsEditor","mappings","onChange","valueMappings","setValueMappings","handleValueMappingChange","index","mapping","updatedValueMapings","handleAddValueMappingEditor","push","kind","spec","result","value","handleValueMappingDelete","splice","spacing","container","size","xs","variant","textAlign","gap","divider","flexItem","orientation","map","i","updatedMapping","onDelete","startIcon","sx","marginTop","onClick"],"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,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,UAAU,EAAEC,SAASC,IAAI,QAAQ,gBAAgB;AAElF,SAAaC,QAAQ,QAAQ,QAAQ;AACrC,OAAOC,aAAa,uBAAuB;AAE3C,SAASC,kBAAkB,QAAQ,uBAAuB;AAO1D,OAAO,MAAMC,sBAAoD,CAAC,EAAEC,QAAQ,EAAEC,QAAQ,EAAE;IACtF,MAAM,CAACC,eAAeC,iBAAiB,GAAGP,SAAyBI;IAEnE,SAASI,yBAAyBC,KAAa,EAAEC,OAA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C,SAASzB;0BAA6B;;;;AAKtH,EAAE"}
1
+ {"version":3,"sources":["../../src/ValueMappingEditor/ValueMappingsEditor.tsx"],"sourcesContent":["// Copyright 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 { Button, Divider, Stack, Typography, Grid2 as Grid } from '@mui/material';\n\nimport { FC, useState } from 'react';\nimport AddIcon from 'mdi-material-ui/Plus';\nimport { ValueMapping } from '@perses-dev/core';\nimport { ValueMappingEditor } from './ValueMappingEditor';\n\nexport interface ValueMappingsEditorProps {\n mappings: ValueMapping[];\n onChange: (valueMappings: ValueMapping[]) => void;\n}\n\nexport const ValueMappingsEditor: FC<ValueMappingsEditorProps> = ({ mappings, onChange }) => {\n const [valueMappings, setValueMappings] = useState<ValueMapping[]>(mappings);\n\n function handleValueMappingChange(index: number, mapping: ValueMapping): void {\n const updatedValueMapings = [...valueMappings];\n updatedValueMapings[index] = mapping;\n setValueMappings(updatedValueMapings);\n onChange(updatedValueMapings);\n }\n\n function handleAddValueMappingEditor(): void {\n const updatedValueMapings = [...valueMappings];\n updatedValueMapings.push({ kind: 'Value', spec: { result: { value: '' } } } as ValueMapping);\n setValueMappings(updatedValueMapings);\n onChange(updatedValueMapings);\n }\n\n function handleValueMappingDelete(index: number): void {\n const updatedValueMapings = [...valueMappings];\n updatedValueMapings.splice(index, 1);\n setValueMappings(updatedValueMapings);\n onChange(updatedValueMapings);\n }\n\n return (\n <Stack spacing={1}>\n <Grid container spacing={2}>\n <Grid size={{ xs: 5 }}>\n <Typography variant=\"subtitle1\">Condition</Typography>\n </Grid>\n <Grid size={{ xs: 4 }}>\n <Typography variant=\"subtitle1\">Display Text</Typography>\n </Grid>\n <Grid size={{ xs: 1 }} textAlign=\"center\">\n <Typography variant=\"subtitle1\">Color</Typography>\n </Grid>\n <Grid size={{ xs: 1 }}></Grid>\n </Grid>\n <Stack gap={1.5} divider={<Divider flexItem orientation=\"horizontal\" />}>\n {valueMappings.map((mapping, i) => (\n <ValueMappingEditor\n key={i}\n mapping={mapping}\n onChange={(updatedMapping: ValueMapping) => handleValueMappingChange(i, updatedMapping)}\n onDelete={() => handleValueMappingDelete(i)}\n />\n ))}\n </Stack>\n\n <Button variant=\"contained\" startIcon={<AddIcon />} sx={{ marginTop: 1 }} onClick={handleAddValueMappingEditor}>\n Add value mappings\n </Button>\n </Stack>\n );\n};\n"],"names":["Button","Divider","Stack","Typography","Grid2","Grid","useState","AddIcon","ValueMappingEditor","ValueMappingsEditor","mappings","onChange","valueMappings","setValueMappings","handleValueMappingChange","index","mapping","updatedValueMapings","handleAddValueMappingEditor","push","kind","spec","result","value","handleValueMappingDelete","splice","spacing","container","size","xs","variant","textAlign","gap","divider","flexItem","orientation","map","i","updatedMapping","onDelete","startIcon","sx","marginTop","onClick"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAEjC,SAASA,MAAM,EAAEC,OAAO,EAAEC,KAAK,EAAEC,UAAU,EAAEC,SAASC,IAAI,QAAQ,gBAAgB;AAElF,SAAaC,QAAQ,QAAQ,QAAQ;AACrC,OAAOC,aAAa,uBAAuB;AAE3C,SAASC,kBAAkB,QAAQ,uBAAuB;AAO1D,OAAO,MAAMC,sBAAoD,CAAC,EAAEC,QAAQ,EAAEC,QAAQ,EAAE;IACtF,MAAM,CAACC,eAAeC,iBAAiB,GAAGP,SAAyBI;IAEnE,SAASI,yBAAyBC,KAAa,EAAEC,O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AGC,SAASzB;0BAA6B;;;;AAKtH,EAAE"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ValueMappingEditor/index.ts"],"sourcesContent":["// Copyright 2024 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\nexport * from './ValueMappingsEditor';\n"],"names":[],"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,cAAc,wBAAwB"}
1
+ {"version":3,"sources":["../../src/ValueMappingEditor/index.ts"],"sourcesContent":["// Copyright 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\nexport * from './ValueMappingsEditor';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,wBAAwB"}
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -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';\nimport { ReactElement } from 'react';\n\ninterface YAxisLabelProps {\n name: string;\n height: number;\n}\n\nexport function YAxisLabel({ name, height }: YAxisLabelProps): ReactElement {\n return (\n <Box\n style={{\n maxWidth: height, // allows rotated text to truncate instead of causing overlap\n top: `calc(${height}px / 2)`,\n }}\n sx={{\n display: 'inline-block',\n position: 'absolute',\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","style","maxWidth","top","sx","display","position","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;AAQhD,OAAO,SAASC,WAAW,EAAEC,IAAI,EAAEC,MAAM,EAAmB;IAC1D,qBACE,KAACJ;QACCK,OAAO;YACLC,UAAUF;YACVG,KAAK,CAAC,KAAK,EAAEH,OAAO,OAAO,CAAC;QAC9B;QACAI,IAAI;YACFC,SAAS;YACTC,UAAU;YACVC,WAAW;YACXC,iBAAiB;YACjBC,WAAW;YACXC,QAAQ;QACV;kBAEA,cAAA,KAACb;YACCc,SAAQ;YACRC,cAAW;YACXR,IAAI;gBACFS,YAAY;gBACZC,UAAU;gBACVC,cAAc;YAChB;sBAEChB;;;AAIT"}
1
+ {"version":3,"sources":["../src/YAxisLabel.tsx"],"sourcesContent":["// Copyright 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';\nimport { ReactElement } from 'react';\n\ninterface YAxisLabelProps {\n name: string;\n height: number;\n}\n\nexport function YAxisLabel({ name, height }: YAxisLabelProps): ReactElement {\n return (\n <Box\n style={{\n maxWidth: height, // allows rotated text to truncate instead of causing overlap\n top: `calc(${height}px / 2)`,\n }}\n sx={{\n display: 'inline-block',\n position: 'absolute',\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","style","maxWidth","top","sx","display","position","transform","transformOrigin","textAlign","zIndex","variant","aria-label","whiteSpace","overflow","textOverflow"],"mappings":"AAAA,+BAA+B;AAC/B,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;AAQhD,OAAO,SAASC,WAAW,EAAEC,IAAI,EAAEC,MAAM,EAAmB;IAC1D,qBACE,KAACJ;QACCK,OAAO;YACLC,UAAUF;YACVG,KAAK,CAAC,KAAK,EAAEH,OAAO,OAAO,CAAC;QAC9B;QACAI,IAAI;YACFC,SAAS;YACTC,UAAU;YACVC,WAAW;YACXC,iBAAiB;YACjBC,WAAW;YACXC,QAAQ;QACV;kBAEA,cAAA,KAACb;YACCc,SAAQ;YACRC,cAAW;YACXR,IAAI;gBACFS,YAAY;gBACZC,UAAU;gBACVC,cAAc;YAChB;sBAEChB;;;AAIT"}
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License | Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License | Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License | Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -25,13 +25,7 @@ const _material = require("@mui/material");
25
25
  const _core = require("@perses-dev/core");
26
26
  const _OptionsEditorLayout = require("../OptionsEditorLayout");
27
27
  const _SettingsAutocomplete = require("../SettingsAutocomplete");
28
- const KIND_OPTIONS = Object.entries(_core.UNIT_CONFIG).map(([id, config])=>{
29
- return {
30
- ...config,
31
- id: id,
32
- group: config.group || 'Decimal'
33
- };
34
- }).filter((config)=>!config.disableSelectorOption);
28
+ const _UnitSelector = require("./UnitSelector");
35
29
  const DECIMAL_PLACES_OPTIONS = [
36
30
  {
37
31
  id: 'default',
@@ -70,10 +64,10 @@ function getOptionByDecimalPlaces(decimalPlaces) {
70
64
  function FormatControls({ value, onChange, disabled = false }) {
71
65
  const hasDecimalPlaces = (0, _core.isUnitWithDecimalPlaces)(value);
72
66
  const hasShortValues = (0, _core.isUnitWithShortValues)(value);
73
- const handleKindChange = (_, newValue)=>{
74
- onChange({
75
- unit: newValue?.id || 'decimal'
76
- }); // Fallback to 'decimal' if no unit is selected
67
+ const handleUnitChange = (newValue)=>{
68
+ onChange(newValue || {
69
+ unit: 'decimal'
70
+ }); // Fallback to 'decimal' if undefined
77
71
  };
78
72
  const handleDecimalPlacesChange = ({ decimalPlaces })=>{
79
73
  if (hasDecimalPlaces) {
@@ -91,7 +85,6 @@ function FormatControls({ value, onChange, disabled = false }) {
91
85
  });
92
86
  }
93
87
  };
94
- const unitConfig = _core.UNIT_CONFIG[value?.unit || 'decimal'];
95
88
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
96
89
  children: [
97
90
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorLayout.OptionsEditorControl, {
@@ -104,15 +97,9 @@ function FormatControls({ value, onChange, disabled = false }) {
104
97
  }),
105
98
  /*#__PURE__*/ (0, _jsxruntime.jsx)(_OptionsEditorLayout.OptionsEditorControl, {
106
99
  label: "Unit",
107
- control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_SettingsAutocomplete.SettingsAutocomplete, {
108
- value: {
109
- id: value?.unit || 'decimal',
110
- ...unitConfig
111
- },
112
- options: KIND_OPTIONS,
113
- groupBy: (option)=>option.group ?? 'Decimal',
114
- onChange: handleKindChange,
115
- disableClearable: true,
100
+ control: /*#__PURE__*/ (0, _jsxruntime.jsx)(_UnitSelector.UnitSelector, {
101
+ value: value,
102
+ onChange: handleUnitChange,
116
103
  disabled: disabled
117
104
  })
118
105
  }),
@@ -0,0 +1,55 @@
1
+ // Copyright 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, "UnitSelector", {
18
+ enumerable: true,
19
+ get: function() {
20
+ return UnitSelector;
21
+ }
22
+ });
23
+ const _jsxruntime = require("react/jsx-runtime");
24
+ const _core = require("@perses-dev/core");
25
+ const _SettingsAutocomplete = require("../SettingsAutocomplete");
26
+ const KIND_OPTIONS = Object.entries(_core.UNIT_CONFIG).map(([id, config])=>{
27
+ return {
28
+ ...config,
29
+ id: id,
30
+ group: config.group || 'Decimal'
31
+ };
32
+ }).filter((config)=>!config.disableSelectorOption);
33
+ function UnitSelector({ value, onChange, disabled = false, ...otherProps }) {
34
+ const unitConfig = _core.UNIT_CONFIG[value?.unit || 'decimal'];
35
+ const handleChange = (_, newValue)=>{
36
+ if (newValue === null) {
37
+ onChange(undefined);
38
+ } else {
39
+ onChange({
40
+ unit: newValue.id
41
+ });
42
+ }
43
+ };
44
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_SettingsAutocomplete.SettingsAutocomplete, {
45
+ value: value ? {
46
+ id: value.unit || 'decimal',
47
+ ...unitConfig
48
+ } : null,
49
+ options: KIND_OPTIONS,
50
+ groupBy: (option)=>option.group ?? 'Decimal',
51
+ onChange: handleChange,
52
+ disabled: disabled,
53
+ ...otherProps
54
+ });
55
+ }
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -15,6 +15,7 @@ Object.defineProperty(exports, "__esModule", {
15
15
  value: true
16
16
  });
17
17
  _export_star(require("./FormatControls"), exports);
18
+ _export_star(require("./UnitSelector"), exports);
18
19
  function _export_star(from, to) {
19
20
  Object.keys(from).forEach(function(k) {
20
21
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(to, k)) {
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2025 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2024 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License, Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at
@@ -1,4 +1,4 @@
1
- // Copyright 2023 The Perses Authors
1
+ // Copyright The Perses Authors
2
2
  // Licensed under the Apache License | Version 2.0 (the "License");
3
3
  // you may not use this file except in compliance with the License.
4
4
  // You may obtain a copy of the License at