@perses-dev/components 0.55.0-beta.2 → 0.55.0-beta.6

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 (806) hide show
  1. package/dist/AlignSelector/AlignSelector.d.ts +2 -2
  2. package/dist/AlignSelector/AlignSelector.d.ts.map +1 -1
  3. package/dist/AlignSelector/AlignSelector.js +2 -2
  4. package/dist/AlignSelector/AlignSelector.js.map +1 -1
  5. package/dist/AlignSelector/index.js +1 -1
  6. package/dist/AlignSelector/index.js.map +1 -1
  7. package/dist/ColorPicker/ColorPicker.d.ts +1 -1
  8. package/dist/ColorPicker/ColorPicker.d.ts.map +1 -1
  9. package/dist/ColorPicker/ColorPicker.js +5 -5
  10. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  11. package/dist/ColorPicker/OptionsColorPicker.d.ts +1 -1
  12. package/dist/ColorPicker/OptionsColorPicker.d.ts.map +1 -1
  13. package/dist/ColorPicker/OptionsColorPicker.js +5 -5
  14. package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
  15. package/dist/ColorPicker/index.js +2 -2
  16. package/dist/ColorPicker/index.js.map +1 -1
  17. package/dist/ContentWithLegend/ContentWithLegend.d.ts +2 -2
  18. package/dist/ContentWithLegend/ContentWithLegend.d.ts.map +1 -1
  19. package/dist/ContentWithLegend/ContentWithLegend.js +5 -5
  20. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  21. package/dist/ContentWithLegend/index.js +1 -1
  22. package/dist/ContentWithLegend/index.js.map +1 -1
  23. package/dist/ContentWithLegend/model/content-with-legend-model.d.ts +3 -4
  24. package/dist/ContentWithLegend/model/content-with-legend-model.d.ts.map +1 -1
  25. package/dist/ContentWithLegend/model/content-with-legend-model.js +2 -2
  26. package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
  27. package/dist/DensitySelector/DensitySelector.d.ts +1 -1
  28. package/dist/DensitySelector/DensitySelector.d.ts.map +1 -1
  29. package/dist/DensitySelector/DensitySelector.js +2 -2
  30. package/dist/DensitySelector/DensitySelector.js.map +1 -1
  31. package/dist/DensitySelector/index.js +1 -1
  32. package/dist/DensitySelector/index.js.map +1 -1
  33. package/dist/Dialog/Dialog.d.ts +4 -3
  34. package/dist/Dialog/Dialog.d.ts.map +1 -1
  35. package/dist/Dialog/Dialog.js +3 -3
  36. package/dist/Dialog/Dialog.js.map +1 -1
  37. package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts +1 -1
  38. package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
  39. package/dist/Dialog/DiscardChangesConfirmationDialog.js +2 -2
  40. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  41. package/dist/Dialog/index.js +2 -2
  42. package/dist/Dialog/index.js.map +1 -1
  43. package/dist/DragAndDrop/DragAndDropList.d.ts +1 -1
  44. package/dist/DragAndDrop/DragAndDropList.d.ts.map +1 -1
  45. package/dist/DragAndDrop/DragAndDropList.js +8 -8
  46. package/dist/DragAndDrop/DragAndDropList.js.map +1 -1
  47. package/dist/DragAndDrop/DragButton.d.ts +1 -2
  48. package/dist/DragAndDrop/DragButton.d.ts.map +1 -1
  49. package/dist/DragAndDrop/DragButton.js +4 -4
  50. package/dist/DragAndDrop/DragButton.js.map +1 -1
  51. package/dist/DragAndDrop/DropIndicator.d.ts +1 -1
  52. package/dist/DragAndDrop/DropIndicator.d.ts.map +1 -1
  53. package/dist/DragAndDrop/DropIndicator.js +1 -1
  54. package/dist/DragAndDrop/DropIndicator.js.map +1 -1
  55. package/dist/DragAndDrop/index.js +3 -3
  56. package/dist/DragAndDrop/index.js.map +1 -1
  57. package/dist/DragAndDrop/model.d.ts +1 -1
  58. package/dist/DragAndDrop/model.d.ts.map +1 -1
  59. package/dist/DragAndDrop/model.js.map +1 -1
  60. package/dist/Drawer/Drawer.d.ts +2 -2
  61. package/dist/Drawer/Drawer.d.ts.map +1 -1
  62. package/dist/Drawer/Drawer.js +3 -3
  63. package/dist/Drawer/Drawer.js.map +1 -1
  64. package/dist/Drawer/index.js +1 -1
  65. package/dist/Drawer/index.js.map +1 -1
  66. package/dist/EChart/EChart.d.ts +4 -4
  67. package/dist/EChart/EChart.d.ts.map +1 -1
  68. package/dist/EChart/EChart.js +10 -10
  69. package/dist/EChart/EChart.js.map +1 -1
  70. package/dist/EChart/index.js +2 -2
  71. package/dist/EChart/index.js.map +1 -1
  72. package/dist/EChart/timezone-formatter.d.ts.map +1 -1
  73. package/dist/EChart/timezone-formatter.js +1 -1
  74. package/dist/ErrorAlert.d.ts +1 -1
  75. package/dist/ErrorAlert.d.ts.map +1 -1
  76. package/dist/ErrorAlert.js +1 -1
  77. package/dist/ErrorAlert.js.map +1 -1
  78. package/dist/ErrorBoundary.js +1 -1
  79. package/dist/FontSizeSelector/FontSizeSelector.d.ts +1 -1
  80. package/dist/FontSizeSelector/FontSizeSelector.d.ts.map +1 -1
  81. package/dist/FontSizeSelector/FontSizeSelector.js +2 -2
  82. package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
  83. package/dist/FontSizeSelector/index.js +1 -1
  84. package/dist/FontSizeSelector/index.js.map +1 -1
  85. package/dist/FormEditor/FormActions.d.ts +3 -3
  86. package/dist/FormEditor/FormActions.d.ts.map +1 -1
  87. package/dist/FormEditor/FormActions.js +2 -2
  88. package/dist/FormEditor/FormActions.js.map +1 -1
  89. package/dist/FormEditor/index.js +1 -1
  90. package/dist/FormEditor/index.js.map +1 -1
  91. package/dist/FormatControls/FormatControls.d.ts +2 -2
  92. package/dist/FormatControls/FormatControls.d.ts.map +1 -1
  93. package/dist/FormatControls/FormatControls.js +6 -6
  94. package/dist/FormatControls/FormatControls.js.map +1 -1
  95. package/dist/FormatControls/UnitSelector.d.ts +2 -2
  96. package/dist/FormatControls/UnitSelector.d.ts.map +1 -1
  97. package/dist/FormatControls/UnitSelector.js +35 -6
  98. package/dist/FormatControls/UnitSelector.js.map +1 -1
  99. package/dist/FormatControls/index.js +2 -2
  100. package/dist/FormatControls/index.js.map +1 -1
  101. package/dist/InfoTooltip/InfoTooltip.d.ts +1 -1
  102. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
  103. package/dist/InfoTooltip/InfoTooltip.js +1 -1
  104. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  105. package/dist/InfoTooltip/index.js +1 -1
  106. package/dist/InfoTooltip/index.js.map +1 -1
  107. package/dist/JSONEditor.d.ts +2 -2
  108. package/dist/JSONEditor.d.ts.map +1 -1
  109. package/dist/JSONEditor.js +5 -5
  110. package/dist/JSONEditor.js.map +1 -1
  111. package/dist/Legend/CompactLegend.d.ts +3 -3
  112. package/dist/Legend/CompactLegend.d.ts.map +1 -1
  113. package/dist/Legend/CompactLegend.js +3 -3
  114. package/dist/Legend/CompactLegend.js.map +1 -1
  115. package/dist/Legend/Legend.d.ts +4 -4
  116. package/dist/Legend/Legend.d.ts.map +1 -1
  117. package/dist/Legend/Legend.js +6 -6
  118. package/dist/Legend/Legend.js.map +1 -1
  119. package/dist/Legend/LegendColorBadge.d.ts +1 -2
  120. package/dist/Legend/LegendColorBadge.d.ts.map +1 -1
  121. package/dist/Legend/LegendColorBadge.js +4 -4
  122. package/dist/Legend/LegendColorBadge.js.map +1 -1
  123. package/dist/Legend/ListLegend.d.ts +3 -3
  124. package/dist/Legend/ListLegend.d.ts.map +1 -1
  125. package/dist/Legend/ListLegend.js +7 -6
  126. package/dist/Legend/ListLegend.js.map +1 -1
  127. package/dist/Legend/ListLegendItem.d.ts +3 -3
  128. package/dist/Legend/ListLegendItem.d.ts.map +1 -1
  129. package/dist/Legend/ListLegendItem.js +8 -7
  130. package/dist/Legend/ListLegendItem.js.map +1 -1
  131. package/dist/Legend/TableLegend.d.ts +3 -3
  132. package/dist/Legend/TableLegend.d.ts.map +1 -1
  133. package/dist/Legend/TableLegend.js +3 -3
  134. package/dist/Legend/TableLegend.js.map +1 -1
  135. package/dist/Legend/index.js +2 -2
  136. package/dist/Legend/index.js.map +1 -1
  137. package/dist/Legend/legend-model.d.ts +2 -2
  138. package/dist/Legend/legend-model.d.ts.map +1 -1
  139. package/dist/Legend/legend-model.js.map +1 -1
  140. package/dist/LinksEditor/LinkEditorForm.d.ts +1 -1
  141. package/dist/LinksEditor/LinkEditorForm.d.ts.map +1 -1
  142. package/dist/LinksEditor/LinkEditorForm.js +2 -2
  143. package/dist/LinksEditor/LinkEditorForm.js.map +1 -1
  144. package/dist/LinksEditor/index.js +1 -1
  145. package/dist/LinksEditor/index.js.map +1 -1
  146. package/dist/ModeSelector/ModeSelector.d.ts +1 -1
  147. package/dist/ModeSelector/ModeSelector.d.ts.map +1 -1
  148. package/dist/ModeSelector/ModeSelector.js +2 -2
  149. package/dist/ModeSelector/ModeSelector.js.map +1 -1
  150. package/dist/ModeSelector/index.js +1 -1
  151. package/dist/ModeSelector/index.js.map +1 -1
  152. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts +1 -1
  153. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -1
  154. package/dist/OptionsEditorLayout/OptionsEditorColumn.js +1 -1
  155. package/dist/OptionsEditorLayout/OptionsEditorColumn.js.map +1 -1
  156. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts +2 -2
  157. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
  158. package/dist/OptionsEditorLayout/OptionsEditorControl.js +6 -6
  159. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  160. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts +1 -1
  161. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -1
  162. package/dist/OptionsEditorLayout/OptionsEditorGrid.js +1 -1
  163. package/dist/OptionsEditorLayout/OptionsEditorGrid.js.map +1 -1
  164. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts +2 -1
  165. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
  166. package/dist/OptionsEditorLayout/OptionsEditorGroup.js +2 -2
  167. package/dist/OptionsEditorLayout/OptionsEditorGroup.js.map +1 -1
  168. package/dist/OptionsEditorLayout/index.js +4 -4
  169. package/dist/OptionsEditorLayout/index.js.map +1 -1
  170. package/dist/Overlay/Overlay.d.ts +2 -2
  171. package/dist/Overlay/Overlay.d.ts.map +1 -1
  172. package/dist/Overlay/Overlay.js +2 -2
  173. package/dist/Overlay/Overlay.js.map +1 -1
  174. package/dist/Overlay/index.js +1 -1
  175. package/dist/Overlay/index.js.map +1 -1
  176. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts +3 -3
  177. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
  178. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js +2 -2
  179. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  180. package/dist/RefreshIntervalPicker/index.js +1 -1
  181. package/dist/RefreshIntervalPicker/index.js.map +1 -1
  182. package/dist/RepeatGrid/RepeatGrid.d.ts +15 -0
  183. package/dist/RepeatGrid/RepeatGrid.d.ts.map +1 -0
  184. package/dist/RepeatGrid/RepeatGrid.js +68 -0
  185. package/dist/RepeatGrid/RepeatGrid.js.map +1 -0
  186. package/dist/RepeatGrid/index.d.ts +2 -0
  187. package/dist/RepeatGrid/index.d.ts.map +1 -0
  188. package/dist/{cjs/model/types.js → RepeatGrid/index.js} +3 -4
  189. package/dist/RepeatGrid/index.js.map +1 -0
  190. package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts +2 -2
  191. package/dist/SettingsAutocomplete/SettingsAutocomplete.d.ts.map +1 -1
  192. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +2 -2
  193. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  194. package/dist/SettingsAutocomplete/index.js +1 -1
  195. package/dist/SettingsAutocomplete/index.js.map +1 -1
  196. package/dist/SortSelector/SortSelector.d.ts +1 -1
  197. package/dist/SortSelector/SortSelector.d.ts.map +1 -1
  198. package/dist/SortSelector/SortSelector.js +2 -2
  199. package/dist/SortSelector/SortSelector.js.map +1 -1
  200. package/dist/SortSelector/SortSelectorButtons.d.ts +3 -3
  201. package/dist/SortSelector/SortSelectorButtons.d.ts.map +1 -1
  202. package/dist/SortSelector/SortSelectorButtons.js +2 -2
  203. package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
  204. package/dist/SortSelector/index.js +2 -2
  205. package/dist/SortSelector/index.js.map +1 -1
  206. package/dist/Table/InnerTable.d.ts +2 -3
  207. package/dist/Table/InnerTable.d.ts.map +1 -1
  208. package/dist/Table/InnerTable.js +3 -3
  209. package/dist/Table/InnerTable.js.map +1 -1
  210. package/dist/Table/Table.d.ts +2 -2
  211. package/dist/Table/Table.d.ts.map +1 -1
  212. package/dist/Table/Table.js +7 -7
  213. package/dist/Table/Table.js.map +1 -1
  214. package/dist/Table/TableBody.d.ts +1 -2
  215. package/dist/Table/TableBody.d.ts.map +1 -1
  216. package/dist/Table/TableBody.js +3 -3
  217. package/dist/Table/TableBody.js.map +1 -1
  218. package/dist/Table/TableCell.d.ts +3 -3
  219. package/dist/Table/TableCell.d.ts.map +1 -1
  220. package/dist/Table/TableCell.js +5 -5
  221. package/dist/Table/TableCell.js.map +1 -1
  222. package/dist/Table/TableCheckbox.d.ts +3 -3
  223. package/dist/Table/TableCheckbox.d.ts.map +1 -1
  224. package/dist/Table/TableCheckbox.js +2 -2
  225. package/dist/Table/TableCheckbox.js.map +1 -1
  226. package/dist/Table/TableFoot.d.ts +1 -2
  227. package/dist/Table/TableFoot.d.ts.map +1 -1
  228. package/dist/Table/TableFoot.js +3 -3
  229. package/dist/Table/TableFoot.js.map +1 -1
  230. package/dist/Table/TableHead.d.ts +1 -2
  231. package/dist/Table/TableHead.d.ts.map +1 -1
  232. package/dist/Table/TableHead.js +3 -3
  233. package/dist/Table/TableHead.js.map +1 -1
  234. package/dist/Table/TableHeaderCell.d.ts +3 -3
  235. package/dist/Table/TableHeaderCell.d.ts.map +1 -1
  236. package/dist/Table/TableHeaderCell.js +2 -2
  237. package/dist/Table/TableHeaderCell.js.map +1 -1
  238. package/dist/Table/TableRow.d.ts +2 -3
  239. package/dist/Table/TableRow.d.ts.map +1 -1
  240. package/dist/Table/TableRow.js +3 -3
  241. package/dist/Table/TableRow.js.map +1 -1
  242. package/dist/Table/TableToolbar.d.ts +2 -2
  243. package/dist/Table/TableToolbar.d.ts.map +1 -1
  244. package/dist/Table/TableToolbar.js +8 -8
  245. package/dist/Table/TableToolbar.js.map +1 -1
  246. package/dist/Table/VirtualizedTable.d.ts +4 -4
  247. package/dist/Table/VirtualizedTable.d.ts.map +1 -1
  248. package/dist/Table/VirtualizedTable.js +14 -14
  249. package/dist/Table/VirtualizedTable.js.map +1 -1
  250. package/dist/Table/VirtualizedTableContainer.d.ts +1 -2
  251. package/dist/Table/VirtualizedTableContainer.d.ts.map +1 -1
  252. package/dist/Table/VirtualizedTableContainer.js +4 -4
  253. package/dist/Table/VirtualizedTableContainer.js.map +1 -1
  254. package/dist/Table/hooks/useFuzzySearch.d.ts +3 -3
  255. package/dist/Table/hooks/useFuzzySearch.d.ts.map +1 -1
  256. package/dist/Table/hooks/useFuzzySearch.js +3 -3
  257. package/dist/Table/hooks/useFuzzySearch.js.map +1 -1
  258. package/dist/Table/hooks/useTableKeyboardNav.d.ts +1 -1
  259. package/dist/Table/hooks/useTableKeyboardNav.d.ts.map +1 -1
  260. package/dist/Table/hooks/useTableKeyboardNav.js +1 -1
  261. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  262. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts +3 -3
  263. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.map +1 -1
  264. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +1 -1
  265. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  266. package/dist/Table/index.js +2 -2
  267. package/dist/Table/index.js.map +1 -1
  268. package/dist/Table/model/table-model.d.ts +5 -5
  269. package/dist/Table/model/table-model.d.ts.map +1 -1
  270. package/dist/Table/model/table-model.js.map +1 -1
  271. package/dist/ThresholdsEditor/ThresholdInput.d.ts +2 -2
  272. package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -1
  273. package/dist/ThresholdsEditor/ThresholdInput.js +4 -4
  274. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  275. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts +2 -2
  276. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
  277. package/dist/ThresholdsEditor/ThresholdsEditor.js +10 -10
  278. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  279. package/dist/ThresholdsEditor/index.js +1 -1
  280. package/dist/ThresholdsEditor/index.js.map +1 -1
  281. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts +2 -2
  282. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -1
  283. package/dist/TimeRangeSelector/DateTimeRangePicker.js +8 -8
  284. package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
  285. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +4 -4
  286. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -1
  287. package/dist/TimeRangeSelector/TimeRangeSelector.js +11 -11
  288. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
  289. package/dist/TimeRangeSelector/index.js +2 -2
  290. package/dist/TimeRangeSelector/index.js.map +1 -1
  291. package/dist/TimeRangeSelector/utils.d.ts +1 -1
  292. package/dist/TimeRangeSelector/utils.d.ts.map +1 -1
  293. package/dist/TimeRangeSelector/utils.js +3 -3
  294. package/dist/TimeRangeSelector/utils.js.map +1 -1
  295. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts +1 -1
  296. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
  297. package/dist/TimeSeriesTooltip/SeriesInfo.js +4 -4
  298. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  299. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts +1 -1
  300. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -1
  301. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js +2 -2
  302. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  303. package/dist/TimeSeriesTooltip/SeriesMarker.d.ts +2 -2
  304. package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -1
  305. package/dist/TimeSeriesTooltip/SeriesMarker.js +3 -3
  306. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  307. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +5 -5
  308. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
  309. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +8 -8
  310. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  311. package/dist/TimeSeriesTooltip/TooltipContent.d.ts +2 -2
  312. package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -1
  313. package/dist/TimeSeriesTooltip/TooltipContent.js +3 -3
  314. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  315. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts +1 -2
  316. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
  317. package/dist/TimeSeriesTooltip/TooltipHeader.js +6 -6
  318. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  319. package/dist/TimeSeriesTooltip/index.js +10 -10
  320. package/dist/TimeSeriesTooltip/index.js.map +1 -1
  321. package/dist/TimeSeriesTooltip/nearby-series.d.ts +5 -5
  322. package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
  323. package/dist/TimeSeriesTooltip/nearby-series.js +4 -4
  324. package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
  325. package/dist/TimeSeriesTooltip/tooltip-model.d.ts +2 -2
  326. package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
  327. package/dist/TimeSeriesTooltip/tooltip-model.js +1 -1
  328. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  329. package/dist/TimeSeriesTooltip/utils.d.ts +4 -4
  330. package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
  331. package/dist/TimeSeriesTooltip/utils.js +1 -1
  332. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  333. package/dist/TimeZoneSelector.d.ts +3 -3
  334. package/dist/TimeZoneSelector.d.ts.map +1 -1
  335. package/dist/TimeZoneSelector.js +8 -5
  336. package/dist/TimeZoneSelector.js.map +1 -1
  337. package/dist/ToolbarIconButton/ToolbarIconButton.d.ts +1 -2
  338. package/dist/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -1
  339. package/dist/ToolbarIconButton/ToolbarIconButton.js +3 -3
  340. package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
  341. package/dist/ToolbarIconButton/index.js +1 -1
  342. package/dist/ToolbarIconButton/index.js.map +1 -1
  343. package/dist/TransformsEditor/TransformEditor.d.ts +3 -3
  344. package/dist/TransformsEditor/TransformEditor.d.ts.map +1 -1
  345. package/dist/TransformsEditor/TransformEditor.js +3 -3
  346. package/dist/TransformsEditor/TransformEditor.js.map +1 -1
  347. package/dist/TransformsEditor/TransformEditorContainer.d.ts +2 -2
  348. package/dist/TransformsEditor/TransformEditorContainer.d.ts.map +1 -1
  349. package/dist/TransformsEditor/TransformEditorContainer.js +8 -8
  350. package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
  351. package/dist/TransformsEditor/TransformsEditor.d.ts +3 -3
  352. package/dist/TransformsEditor/TransformsEditor.d.ts.map +1 -1
  353. package/dist/TransformsEditor/TransformsEditor.js +5 -5
  354. package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
  355. package/dist/TransformsEditor/index.js +1 -1
  356. package/dist/TransformsEditor/index.js.map +1 -1
  357. package/dist/ValueMappingEditor/ValueMappingEditor.d.ts +3 -3
  358. package/dist/ValueMappingEditor/ValueMappingEditor.d.ts.map +1 -1
  359. package/dist/ValueMappingEditor/ValueMappingEditor.js +5 -5
  360. package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
  361. package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts +2 -2
  362. package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts.map +1 -1
  363. package/dist/ValueMappingEditor/ValueMappingsEditor.js +4 -4
  364. package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -1
  365. package/dist/ValueMappingEditor/index.js +1 -1
  366. package/dist/ValueMappingEditor/index.js.map +1 -1
  367. package/dist/YAxisLabel.d.ts +1 -1
  368. package/dist/YAxisLabel.d.ts.map +1 -1
  369. package/dist/YAxisLabel.js +1 -1
  370. package/dist/YAxisLabel.js.map +1 -1
  371. package/dist/context/ChartsProvider.d.ts +4 -3
  372. package/dist/context/ChartsProvider.d.ts.map +1 -1
  373. package/dist/context/ChartsProvider.js +2 -2
  374. package/dist/context/ChartsProvider.js.map +1 -1
  375. package/dist/context/ItemActionsProvider.d.ts +1 -1
  376. package/dist/context/ItemActionsProvider.d.ts.map +1 -1
  377. package/dist/context/ItemActionsProvider.js +2 -2
  378. package/dist/context/ItemActionsProvider.js.map +1 -1
  379. package/dist/context/SelectionProvider.d.ts +1 -1
  380. package/dist/context/SelectionProvider.d.ts.map +1 -1
  381. package/dist/context/SelectionProvider.js +2 -2
  382. package/dist/context/SelectionProvider.js.map +1 -1
  383. package/dist/context/SnackbarProvider.d.ts +2 -1
  384. package/dist/context/SnackbarProvider.d.ts.map +1 -1
  385. package/dist/context/SnackbarProvider.js +3 -3
  386. package/dist/context/SnackbarProvider.js.map +1 -1
  387. package/dist/context/TimeZoneProvider.d.ts +2 -1
  388. package/dist/context/TimeZoneProvider.d.ts.map +1 -1
  389. package/dist/context/TimeZoneProvider.js +3 -3
  390. package/dist/context/TimeZoneProvider.js.map +1 -1
  391. package/dist/context/index.js +5 -5
  392. package/dist/context/index.js.map +1 -1
  393. package/dist/controls/TextField.d.ts +1 -2
  394. package/dist/controls/TextField.d.ts.map +1 -1
  395. package/dist/controls/TextField.js +4 -4
  396. package/dist/controls/TextField.js.map +1 -1
  397. package/dist/controls/index.js +1 -1
  398. package/dist/controls/index.js.map +1 -1
  399. package/dist/index.d.ts +1 -0
  400. package/dist/index.d.ts.map +1 -1
  401. package/dist/index.js +39 -38
  402. package/dist/index.js.map +1 -1
  403. package/dist/model/action.d.ts +1 -1
  404. package/dist/model/action.d.ts.map +1 -1
  405. package/dist/model/action.js.map +1 -1
  406. package/dist/model/bits.d.ts +1 -1
  407. package/dist/model/bits.d.ts.map +1 -1
  408. package/dist/model/bits.js +4 -4
  409. package/dist/model/bits.js.map +1 -1
  410. package/dist/model/bytes.d.ts +1 -1
  411. package/dist/model/bytes.d.ts.map +1 -1
  412. package/dist/model/bytes.js +4 -4
  413. package/dist/model/bytes.js.map +1 -1
  414. package/dist/model/currency.d.ts +1 -1
  415. package/dist/model/currency.d.ts.map +1 -1
  416. package/dist/model/currency.js +4 -4
  417. package/dist/model/currency.js.map +1 -1
  418. package/dist/model/date.d.ts +1 -1
  419. package/dist/model/date.d.ts.map +1 -1
  420. package/dist/model/date.js.map +1 -1
  421. package/dist/model/decimal.d.ts +1 -1
  422. package/dist/model/decimal.d.ts.map +1 -1
  423. package/dist/model/decimal.js +3 -3
  424. package/dist/model/decimal.js.map +1 -1
  425. package/dist/model/formatterCache.js.map +1 -1
  426. package/dist/model/graph.d.ts +3 -3
  427. package/dist/model/graph.d.ts.map +1 -1
  428. package/dist/model/graph.js.map +1 -1
  429. package/dist/model/index.js +21 -21
  430. package/dist/model/index.js.map +1 -1
  431. package/dist/model/percent.d.ts +1 -1
  432. package/dist/model/percent.d.ts.map +1 -1
  433. package/dist/model/percent.js +3 -3
  434. package/dist/model/percent.js.map +1 -1
  435. package/dist/model/temperature.d.ts +1 -1
  436. package/dist/model/temperature.d.ts.map +1 -1
  437. package/dist/model/temperature.js +3 -3
  438. package/dist/model/temperature.js.map +1 -1
  439. package/dist/model/theme.d.ts +1 -1
  440. package/dist/model/theme.d.ts.map +1 -1
  441. package/dist/model/theme.js.map +1 -1
  442. package/dist/model/throughput.d.ts +1 -1
  443. package/dist/model/throughput.d.ts.map +1 -1
  444. package/dist/model/throughput.js +5 -5
  445. package/dist/model/throughput.js.map +1 -1
  446. package/dist/model/time.d.ts +1 -1
  447. package/dist/model/time.d.ts.map +1 -1
  448. package/dist/model/time.js +3 -3
  449. package/dist/model/time.js.map +1 -1
  450. package/dist/model/timeOption.d.ts +1 -1
  451. package/dist/model/timeOption.d.ts.map +1 -1
  452. package/dist/model/timeOption.js +2 -2
  453. package/dist/model/timeOption.js.map +1 -1
  454. package/dist/model/types.d.ts +3 -3
  455. package/dist/model/types.d.ts.map +1 -1
  456. package/dist/model/types.js.map +1 -1
  457. package/dist/model/units.d.ts +10 -10
  458. package/dist/model/units.d.ts.map +1 -1
  459. package/dist/model/units.js +9 -9
  460. package/dist/model/units.js.map +1 -1
  461. package/dist/test/index.js +1 -1
  462. package/dist/test/index.js.map +1 -1
  463. package/dist/test/render.d.ts +2 -2
  464. package/dist/test/render.d.ts.map +1 -1
  465. package/dist/test/render.js +2 -2
  466. package/dist/test/render.js.map +1 -1
  467. package/dist/test/setup-tests.d.ts +1 -1
  468. package/dist/test/setup-tests.d.ts.map +1 -1
  469. package/dist/test/setup-tests.js +3 -2
  470. package/dist/test/setup-tests.js.map +1 -1
  471. package/dist/test-utils/index.js +1 -1
  472. package/dist/test-utils/index.js.map +1 -1
  473. package/dist/test-utils/theme.d.ts +2 -2
  474. package/dist/test-utils/theme.d.ts.map +1 -1
  475. package/dist/test-utils/theme.js +2 -2
  476. package/dist/test-utils/theme.js.map +1 -1
  477. package/dist/theme/component-overrides/alert.d.ts +1 -1
  478. package/dist/theme/component-overrides/alert.d.ts.map +1 -1
  479. package/dist/theme/component-overrides/alert.js +1 -1
  480. package/dist/theme/component-overrides/alert.js.map +1 -1
  481. package/dist/theme/component-overrides/paper.d.ts +1 -1
  482. package/dist/theme/component-overrides/paper.d.ts.map +1 -1
  483. package/dist/theme/component-overrides/paper.js.map +1 -1
  484. package/dist/theme/index.d.ts +1 -1
  485. package/dist/theme/index.d.ts.map +1 -1
  486. package/dist/theme/index.js +2 -2
  487. package/dist/theme/index.js.map +1 -1
  488. package/dist/theme/palette/background.d.ts +2 -2
  489. package/dist/theme/palette/background.d.ts.map +1 -1
  490. package/dist/theme/palette/background.js +1 -1
  491. package/dist/theme/palette/background.js.map +1 -1
  492. package/dist/theme/palette/colors/blue.d.ts +1 -1
  493. package/dist/theme/palette/colors/blue.d.ts.map +1 -1
  494. package/dist/theme/palette/colors/blue.js.map +1 -1
  495. package/dist/theme/palette/colors/green.d.ts +1 -1
  496. package/dist/theme/palette/colors/green.d.ts.map +1 -1
  497. package/dist/theme/palette/colors/green.js.map +1 -1
  498. package/dist/theme/palette/colors/grey.d.ts +1 -1
  499. package/dist/theme/palette/colors/grey.d.ts.map +1 -1
  500. package/dist/theme/palette/colors/grey.js.map +1 -1
  501. package/dist/theme/palette/colors/index.js +8 -8
  502. package/dist/theme/palette/colors/index.js.map +1 -1
  503. package/dist/theme/palette/colors/orange.d.ts +1 -1
  504. package/dist/theme/palette/colors/orange.d.ts.map +1 -1
  505. package/dist/theme/palette/colors/orange.js.map +1 -1
  506. package/dist/theme/palette/colors/purple.d.ts +1 -1
  507. package/dist/theme/palette/colors/purple.d.ts.map +1 -1
  508. package/dist/theme/palette/colors/purple.js.map +1 -1
  509. package/dist/theme/palette/colors/red.d.ts +1 -1
  510. package/dist/theme/palette/colors/red.d.ts.map +1 -1
  511. package/dist/theme/palette/colors/red.js.map +1 -1
  512. package/dist/theme/palette/error.d.ts +1 -1
  513. package/dist/theme/palette/error.d.ts.map +1 -1
  514. package/dist/theme/palette/error.js +1 -1
  515. package/dist/theme/palette/error.js.map +1 -1
  516. package/dist/theme/palette/grey.d.ts +2 -2
  517. package/dist/theme/palette/grey.d.ts.map +1 -1
  518. package/dist/theme/palette/grey.js +1 -1
  519. package/dist/theme/palette/grey.js.map +1 -1
  520. package/dist/theme/palette/index.js +1 -1
  521. package/dist/theme/palette/index.js.map +1 -1
  522. package/dist/theme/palette/palette-options.d.ts +1 -1
  523. package/dist/theme/palette/palette-options.d.ts.map +1 -1
  524. package/dist/theme/palette/palette-options.js +10 -10
  525. package/dist/theme/palette/palette-options.js.map +1 -1
  526. package/dist/theme/palette/primary.d.ts +1 -1
  527. package/dist/theme/palette/primary.d.ts.map +1 -1
  528. package/dist/theme/palette/primary.js +1 -1
  529. package/dist/theme/palette/primary.js.map +1 -1
  530. package/dist/theme/palette/secondary.d.ts +1 -1
  531. package/dist/theme/palette/secondary.d.ts.map +1 -1
  532. package/dist/theme/palette/secondary.js +1 -1
  533. package/dist/theme/palette/secondary.js.map +1 -1
  534. package/dist/theme/palette/success.d.ts +1 -1
  535. package/dist/theme/palette/success.d.ts.map +1 -1
  536. package/dist/theme/palette/success.js +1 -1
  537. package/dist/theme/palette/success.js.map +1 -1
  538. package/dist/theme/palette/text.d.ts +2 -2
  539. package/dist/theme/palette/text.d.ts.map +1 -1
  540. package/dist/theme/palette/text.js +1 -1
  541. package/dist/theme/palette/text.js.map +1 -1
  542. package/dist/theme/palette/warning.d.ts +1 -1
  543. package/dist/theme/palette/warning.d.ts.map +1 -1
  544. package/dist/theme/palette/warning.js +1 -1
  545. package/dist/theme/palette/warning.js.map +1 -1
  546. package/dist/theme/theme.d.ts +2 -1
  547. package/dist/theme/theme.d.ts.map +1 -1
  548. package/dist/theme/theme.js +5 -5
  549. package/dist/theme/theme.js.map +1 -1
  550. package/dist/theme/types/ThemeExtension.d.js +2 -1
  551. package/dist/theme/types/ThemeExtension.d.js.map +1 -1
  552. package/dist/theme/typography.d.ts +1 -1
  553. package/dist/theme/typography.d.ts.map +1 -1
  554. package/dist/theme/typography.js +6 -6
  555. package/dist/theme/typography.js.map +1 -1
  556. package/dist/utils/axis.d.ts +1 -1
  557. package/dist/utils/axis.d.ts.map +1 -1
  558. package/dist/utils/axis.js +2 -2
  559. package/dist/utils/axis.js.map +1 -1
  560. package/dist/utils/browser-storage.js +1 -1
  561. package/dist/utils/browser-storage.js.map +1 -1
  562. package/dist/utils/chart-actions.d.ts +3 -3
  563. package/dist/utils/chart-actions.d.ts.map +1 -1
  564. package/dist/utils/chart-actions.js +1 -1
  565. package/dist/utils/chart-actions.js.map +1 -1
  566. package/dist/utils/combine-sx.d.ts +1 -1
  567. package/dist/utils/combine-sx.d.ts.map +1 -1
  568. package/dist/utils/combine-sx.js.map +1 -1
  569. package/dist/utils/component-ids.js +1 -1
  570. package/dist/utils/data-field-interpolation.js +1 -1
  571. package/dist/utils/data-field-interpolation.js.map +1 -1
  572. package/dist/utils/format.d.ts.map +1 -1
  573. package/dist/utils/format.js +8 -3
  574. package/dist/utils/format.js.map +1 -1
  575. package/dist/utils/index.js +19 -19
  576. package/dist/utils/index.js.map +1 -1
  577. package/dist/utils/mathjs.d.ts +1 -1
  578. package/dist/utils/mathjs.js +1 -1
  579. package/dist/utils/memo.d.ts +1 -1
  580. package/dist/utils/memo.d.ts.map +1 -1
  581. package/dist/utils/memo.js +2 -2
  582. package/dist/utils/memo.js.map +1 -1
  583. package/dist/utils/request-interpolation.d.ts +2 -2
  584. package/dist/utils/request-interpolation.d.ts.map +1 -1
  585. package/dist/utils/request-interpolation.js +2 -2
  586. package/dist/utils/request-interpolation.js.map +1 -1
  587. package/dist/utils/selection-interpolation.d.ts +2 -2
  588. package/dist/utils/selection-interpolation.d.ts.map +1 -1
  589. package/dist/utils/selection-interpolation.js +2 -2
  590. package/dist/utils/selection-interpolation.js.map +1 -1
  591. package/dist/utils/text.d.ts +1 -1
  592. package/dist/utils/text.d.ts.map +1 -1
  593. package/dist/utils/text.js.map +1 -1
  594. package/dist/utils/theme-gen.d.ts +2 -2
  595. package/dist/utils/theme-gen.d.ts.map +1 -1
  596. package/dist/utils/theme-gen.js +1 -1
  597. package/dist/utils/theme-gen.js.map +1 -1
  598. package/dist/utils/time-series-data.d.ts +1 -1
  599. package/dist/utils/time-series-data.d.ts.map +1 -1
  600. package/dist/utils/time-series-data.js +1 -1
  601. package/dist/utils/time-series-data.js.map +1 -1
  602. package/dist/utils/trace-data.d.ts +2 -2
  603. package/dist/utils/trace-data.d.ts.map +1 -1
  604. package/dist/utils/trace-data.js.map +1 -1
  605. package/dist/utils/transform-data.d.ts +1 -1
  606. package/dist/utils/transform-data.d.ts.map +1 -1
  607. package/dist/utils/transform-data.js.map +1 -1
  608. package/dist/utils/value-mapping.d.ts +1 -1
  609. package/dist/utils/value-mapping.d.ts.map +1 -1
  610. package/dist/utils/value-mapping.js +1 -1
  611. package/dist/utils/value-mapping.js.map +1 -1
  612. package/dist/utils/variable-interpolation.d.ts +9 -1
  613. package/dist/utils/variable-interpolation.d.ts.map +1 -1
  614. package/dist/utils/variable-interpolation.js +12 -0
  615. package/dist/utils/variable-interpolation.js.map +1 -1
  616. package/package.json +10 -10
  617. package/dist/cjs/AlignSelector/AlignSelector.js +0 -50
  618. package/dist/cjs/AlignSelector/index.js +0 -30
  619. package/dist/cjs/ColorPicker/ColorPicker.js +0 -106
  620. package/dist/cjs/ColorPicker/OptionsColorPicker.js +0 -92
  621. package/dist/cjs/ColorPicker/index.js +0 -31
  622. package/dist/cjs/ContentWithLegend/ContentWithLegend.js +0 -71
  623. package/dist/cjs/ContentWithLegend/index.js +0 -30
  624. package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +0 -122
  625. package/dist/cjs/DensitySelector/DensitySelector.js +0 -54
  626. package/dist/cjs/DensitySelector/index.js +0 -30
  627. package/dist/cjs/Dialog/Dialog.js +0 -102
  628. package/dist/cjs/Dialog/DiscardChangesConfirmationDialog.js +0 -55
  629. package/dist/cjs/Dialog/index.js +0 -31
  630. package/dist/cjs/DragAndDrop/DragAndDropList.js +0 -159
  631. package/dist/cjs/DragAndDrop/DragButton.js +0 -123
  632. package/dist/cjs/DragAndDrop/DropIndicator.js +0 -52
  633. package/dist/cjs/DragAndDrop/index.js +0 -32
  634. package/dist/cjs/DragAndDrop/model.js +0 -25
  635. package/dist/cjs/Drawer/Drawer.js +0 -44
  636. package/dist/cjs/Drawer/index.js +0 -30
  637. package/dist/cjs/EChart/EChart.js +0 -203
  638. package/dist/cjs/EChart/index.js +0 -31
  639. package/dist/cjs/EChart/timezone-formatter.js +0 -49
  640. package/dist/cjs/ErrorAlert.js +0 -31
  641. package/dist/cjs/ErrorBoundary.js +0 -24
  642. package/dist/cjs/FontSizeSelector/FontSizeSelector.js +0 -132
  643. package/dist/cjs/FontSizeSelector/index.js +0 -30
  644. package/dist/cjs/FormEditor/FormActions.js +0 -83
  645. package/dist/cjs/FormEditor/index.js +0 -30
  646. package/dist/cjs/FormatControls/FormatControls.js +0 -119
  647. package/dist/cjs/FormatControls/UnitSelector.js +0 -55
  648. package/dist/cjs/FormatControls/index.js +0 -31
  649. package/dist/cjs/InfoTooltip/InfoTooltip.js +0 -86
  650. package/dist/cjs/InfoTooltip/index.js +0 -30
  651. package/dist/cjs/JSONEditor.js +0 -69
  652. package/dist/cjs/Legend/CompactLegend.js +0 -56
  653. package/dist/cjs/Legend/Legend.js +0 -131
  654. package/dist/cjs/Legend/LegendColorBadge.js +0 -39
  655. package/dist/cjs/Legend/ListLegend.js +0 -54
  656. package/dist/cjs/Legend/ListLegendItem.js +0 -84
  657. package/dist/cjs/Legend/TableLegend.js +0 -98
  658. package/dist/cjs/Legend/index.js +0 -31
  659. package/dist/cjs/Legend/legend-model.js +0 -27
  660. package/dist/cjs/LinksEditor/LinkEditorForm.js +0 -95
  661. package/dist/cjs/LinksEditor/index.js +0 -30
  662. package/dist/cjs/ModeSelector/ModeSelector.js +0 -51
  663. package/dist/cjs/ModeSelector/index.js +0 -30
  664. package/dist/cjs/OptionsEditorLayout/OptionsEditorColumn.js +0 -34
  665. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +0 -95
  666. package/dist/cjs/OptionsEditorLayout/OptionsEditorGrid.js +0 -31
  667. package/dist/cjs/OptionsEditorLayout/OptionsEditorGroup.js +0 -59
  668. package/dist/cjs/OptionsEditorLayout/index.js +0 -33
  669. package/dist/cjs/Overlay/Overlay.js +0 -71
  670. package/dist/cjs/Overlay/index.js +0 -30
  671. package/dist/cjs/RefreshIntervalPicker/RefreshIntervalPicker.js +0 -68
  672. package/dist/cjs/RefreshIntervalPicker/index.js +0 -30
  673. package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +0 -82
  674. package/dist/cjs/SettingsAutocomplete/index.js +0 -30
  675. package/dist/cjs/SortSelector/SortSelector.js +0 -50
  676. package/dist/cjs/SortSelector/SortSelectorButtons.js +0 -50
  677. package/dist/cjs/SortSelector/index.js +0 -31
  678. package/dist/cjs/Table/InnerTable.js +0 -47
  679. package/dist/cjs/Table/Table.js +0 -222
  680. package/dist/cjs/Table/TableBody.js +0 -31
  681. package/dist/cjs/Table/TableCell.js +0 -153
  682. package/dist/cjs/Table/TableCheckbox.js +0 -57
  683. package/dist/cjs/Table/TableFoot.js +0 -31
  684. package/dist/cjs/Table/TableHead.js +0 -31
  685. package/dist/cjs/Table/TableHeaderCell.js +0 -93
  686. package/dist/cjs/Table/TableRow.js +0 -37
  687. package/dist/cjs/Table/TableToolbar.js +0 -151
  688. package/dist/cjs/Table/VirtualizedTable.js +0 -284
  689. package/dist/cjs/Table/VirtualizedTableContainer.js +0 -36
  690. package/dist/cjs/Table/hooks/useFuzzySearch.js +0 -67
  691. package/dist/cjs/Table/hooks/useTableKeyboardNav.js +0 -108
  692. package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +0 -89
  693. package/dist/cjs/Table/index.js +0 -31
  694. package/dist/cjs/Table/model/table-model.js +0 -138
  695. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +0 -80
  696. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +0 -282
  697. package/dist/cjs/ThresholdsEditor/index.js +0 -30
  698. package/dist/cjs/TimeRangeSelector/DateTimeRangePicker.js +0 -204
  699. package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +0 -271
  700. package/dist/cjs/TimeRangeSelector/index.js +0 -31
  701. package/dist/cjs/TimeRangeSelector/utils.js +0 -72
  702. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +0 -98
  703. package/dist/cjs/TimeSeriesTooltip/SeriesLabelsStack.js +0 -107
  704. package/dist/cjs/TimeSeriesTooltip/SeriesMarker.js +0 -41
  705. package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +0 -113
  706. package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +0 -58
  707. package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +0 -168
  708. package/dist/cjs/TimeSeriesTooltip/index.js +0 -39
  709. package/dist/cjs/TimeSeriesTooltip/nearby-series.js +0 -454
  710. package/dist/cjs/TimeSeriesTooltip/tooltip-model.js +0 -148
  711. package/dist/cjs/TimeSeriesTooltip/types.js +0 -16
  712. package/dist/cjs/TimeSeriesTooltip/utils.js +0 -199
  713. package/dist/cjs/TimeZoneSelector.js +0 -63
  714. package/dist/cjs/ToolbarIconButton/ToolbarIconButton.js +0 -40
  715. package/dist/cjs/ToolbarIconButton/index.js +0 -30
  716. package/dist/cjs/TransformsEditor/TransformEditor.js +0 -297
  717. package/dist/cjs/TransformsEditor/TransformEditorContainer.js +0 -131
  718. package/dist/cjs/TransformsEditor/TransformsEditor.js +0 -103
  719. package/dist/cjs/TransformsEditor/index.js +0 -30
  720. package/dist/cjs/ValueMappingEditor/ValueMappingEditor.js +0 -387
  721. package/dist/cjs/ValueMappingEditor/ValueMappingsEditor.js +0 -131
  722. package/dist/cjs/ValueMappingEditor/index.js +0 -30
  723. package/dist/cjs/YAxisLabel.js +0 -50
  724. package/dist/cjs/context/ChartsProvider.js +0 -114
  725. package/dist/cjs/context/ItemActionsProvider.js +0 -111
  726. package/dist/cjs/context/SelectionProvider.js +0 -128
  727. package/dist/cjs/context/SnackbarProvider.js +0 -126
  728. package/dist/cjs/context/TimeZoneProvider.js +0 -98
  729. package/dist/cjs/context/index.js +0 -34
  730. package/dist/cjs/controls/TextField.js +0 -54
  731. package/dist/cjs/controls/index.js +0 -30
  732. package/dist/cjs/index.js +0 -67
  733. package/dist/cjs/model/action.js +0 -43
  734. package/dist/cjs/model/bits.js +0 -113
  735. package/dist/cjs/model/bytes.js +0 -115
  736. package/dist/cjs/model/constants.js +0 -23
  737. package/dist/cjs/model/currency.js +0 -126
  738. package/dist/cjs/model/date.js +0 -297
  739. package/dist/cjs/model/decimal.js +0 -72
  740. package/dist/cjs/model/formatterCache.js +0 -120
  741. package/dist/cjs/model/graph.js +0 -59
  742. package/dist/cjs/model/index.js +0 -50
  743. package/dist/cjs/model/legend.js +0 -101
  744. package/dist/cjs/model/percent.js +0 -82
  745. package/dist/cjs/model/temperature.js +0 -72
  746. package/dist/cjs/model/theme.js +0 -16
  747. package/dist/cjs/model/thresholds.js +0 -16
  748. package/dist/cjs/model/throughput.js +0 -161
  749. package/dist/cjs/model/time.js +0 -178
  750. package/dist/cjs/model/timeOption.js +0 -34
  751. package/dist/cjs/model/timeZoneOption.js +0 -34
  752. package/dist/cjs/model/transforms.js +0 -29
  753. package/dist/cjs/model/units.js +0 -186
  754. package/dist/cjs/model/utils.js +0 -48
  755. package/dist/cjs/model/value-mapping.js +0 -16
  756. package/dist/cjs/test/index.js +0 -30
  757. package/dist/cjs/test/render.js +0 -38
  758. package/dist/cjs/test/setup-tests.js +0 -20
  759. package/dist/cjs/test-utils/index.js +0 -30
  760. package/dist/cjs/test-utils/theme.js +0 -61
  761. package/dist/cjs/theme/component-overrides/alert.js +0 -104
  762. package/dist/cjs/theme/component-overrides/paper.js +0 -29
  763. package/dist/cjs/theme/index.js +0 -31
  764. package/dist/cjs/theme/palette/background.js +0 -46
  765. package/dist/cjs/theme/palette/colors/blue.js +0 -37
  766. package/dist/cjs/theme/palette/colors/common.js +0 -32
  767. package/dist/cjs/theme/palette/colors/green.js +0 -37
  768. package/dist/cjs/theme/palette/colors/grey.js +0 -37
  769. package/dist/cjs/theme/palette/colors/index.js +0 -37
  770. package/dist/cjs/theme/palette/colors/orange.js +0 -37
  771. package/dist/cjs/theme/palette/colors/purple.js +0 -37
  772. package/dist/cjs/theme/palette/colors/red.js +0 -37
  773. package/dist/cjs/theme/palette/colors/types.js +0 -16
  774. package/dist/cjs/theme/palette/error.js +0 -34
  775. package/dist/cjs/theme/palette/grey.js +0 -50
  776. package/dist/cjs/theme/palette/index.js +0 -30
  777. package/dist/cjs/theme/palette/palette-options.js +0 -61
  778. package/dist/cjs/theme/palette/primary.js +0 -34
  779. package/dist/cjs/theme/palette/secondary.js +0 -34
  780. package/dist/cjs/theme/palette/success.js +0 -34
  781. package/dist/cjs/theme/palette/text.js +0 -44
  782. package/dist/cjs/theme/palette/warning.js +0 -34
  783. package/dist/cjs/theme/theme.js +0 -90
  784. package/dist/cjs/theme/types/ThemeExtension.d.js +0 -17
  785. package/dist/cjs/theme/typography.js +0 -99
  786. package/dist/cjs/utils/axis.js +0 -122
  787. package/dist/cjs/utils/browser-storage.js +0 -62
  788. package/dist/cjs/utils/chart-actions.js +0 -180
  789. package/dist/cjs/utils/combine-sx.js +0 -31
  790. package/dist/cjs/utils/component-ids.js +0 -33
  791. package/dist/cjs/utils/data-field-interpolation.js +0 -230
  792. package/dist/cjs/utils/format.js +0 -127
  793. package/dist/cjs/utils/index.js +0 -48
  794. package/dist/cjs/utils/mathjs.js +0 -38
  795. package/dist/cjs/utils/memo.js +0 -64
  796. package/dist/cjs/utils/regexp.js +0 -54
  797. package/dist/cjs/utils/request-interpolation.js +0 -99
  798. package/dist/cjs/utils/selection-interpolation.js +0 -69
  799. package/dist/cjs/utils/text.js +0 -52
  800. package/dist/cjs/utils/theme-gen.js +0 -274
  801. package/dist/cjs/utils/time-series-data.js +0 -141
  802. package/dist/cjs/utils/trace-data.js +0 -25
  803. package/dist/cjs/utils/transform-data.js +0 -157
  804. package/dist/cjs/utils/types.js +0 -16
  805. package/dist/cjs/utils/value-mapping.js +0 -105
  806. package/dist/cjs/utils/variable-interpolation.js +0 -198
@@ -1 +1 @@
1
- {"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../../src/theme/palette/warning.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAGvE,eAAO,MAAM,OAAO,SAAU,WAAW,KAAG,yBAY3C,CAAC"}
1
+ {"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../../src/theme/palette/warning.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,yBAAyB,EAAE,MAAM,eAAe,CAAC;AAI5E,eAAO,MAAM,OAAO,GAAI,MAAM,WAAW,KAAG,yBAY3C,CAAC"}
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { orange } from './colors';
13
+ import { orange } from "./colors/index.js";
14
14
  export const warning = (mode)=>{
15
15
  return mode === 'light' ? {
16
16
  main: orange[500],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/theme/palette/warning.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\nimport { PaletteMode, SimplePaletteColorOptions } from '@mui/material';\nimport { orange } from './colors';\n\nexport const warning = (mode: PaletteMode): SimplePaletteColorOptions => {\n return mode === 'light'\n ? {\n main: orange[500],\n dark: orange[700],\n light: orange[50],\n }\n : {\n main: orange[400],\n dark: orange[800],\n light: orange[300],\n };\n};\n"],"names":["orange","warning","mode","main","dark","light"],"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;AAGjC,SAASA,MAAM,QAAQ,WAAW;AAElC,OAAO,MAAMC,UAAU,CAACC;IACtB,OAAOA,SAAS,UACZ;QACEC,MAAMH,MAAM,CAAC,IAAI;QACjBI,MAAMJ,MAAM,CAAC,IAAI;QACjBK,OAAOL,MAAM,CAAC,GAAG;IACnB,IACA;QACEG,MAAMH,MAAM,CAAC,IAAI;QACjBI,MAAMJ,MAAM,CAAC,IAAI;QACjBK,OAAOL,MAAM,CAAC,IAAI;IACpB;AACN,EAAE"}
1
+ {"version":3,"sources":["../../../src/theme/palette/warning.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\nimport type { PaletteMode, SimplePaletteColorOptions } from '@mui/material';\n\nimport { orange } from './colors';\n\nexport const warning = (mode: PaletteMode): SimplePaletteColorOptions => {\n return mode === 'light'\n ? {\n main: orange[500],\n dark: orange[700],\n light: orange[50],\n }\n : {\n main: orange[400],\n dark: orange[800],\n light: orange[300],\n };\n};\n"],"names":["orange","warning","mode","main","dark","light"],"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;AAIjC,SAASA,MAAM,QAAQ,oBAAW;AAElC,OAAO,MAAMC,UAAU,CAACC;IACtB,OAAOA,SAAS,UACZ;QACEC,MAAMH,MAAM,CAAC,IAAI;QACjBI,MAAMJ,MAAM,CAAC,IAAI;QACjBK,OAAOL,MAAM,CAAC,GAAG;IACnB,IACA;QACEG,MAAMH,MAAM,CAAC,IAAI;QACjBI,MAAMJ,MAAM,CAAC,IAAI;QACjBK,OAAOL,MAAM,CAAC,IAAI;IACpB;AACN,EAAE"}
@@ -1,4 +1,5 @@
1
- import { createTheme, PaletteMode, Theme } from '@mui/material';
1
+ import type { PaletteMode, Theme } from '@mui/material';
2
+ import { createTheme } from '@mui/material';
2
3
  /**
3
4
  * Gets theme used by all components for the provided mode. For more details, see:
4
5
  * - Base colors, typography, sizing - go/chrono-ui-theme
@@ -1 +1 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AAuB9E;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,WAAW,EACjB,OAAO,GAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAM,EAC/C,mBAAmB,GAAE,OAAe,GACnC,KAAK,CAQP"}
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../src/theme/theme.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAgB,KAAK,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAwB5C;;;;;;;;;;;GAWG;AACH,wBAAgB,QAAQ,CACtB,IAAI,EAAE,WAAW,EACjB,OAAO,GAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,CAAM,EAC/C,mBAAmB,GAAE,OAAe,GACnC,KAAK,CAQP"}
@@ -10,11 +10,11 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { createTheme } from '@mui/material';
14
- import { MuiAlert } from './component-overrides/alert';
15
- import { MuiPaper } from './component-overrides/paper';
16
- import { getPaletteOptions } from './palette';
17
- import { typography } from './typography';
13
+ import { createTheme } from "@mui/material";
14
+ import { MuiAlert } from "./component-overrides/alert.js";
15
+ import { MuiPaper } from "./component-overrides/paper.js";
16
+ import { getPaletteOptions } from "./palette/index.js";
17
+ import { typography } from "./typography.js";
18
18
  const getModalBackgroundStyle = ({ theme })=>{
19
19
  const backgroundStyle = theme.palette.mode === 'light' ? {} : {
20
20
  backgroundImage: 'unset',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/theme/theme.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\nimport { createTheme, PaletteMode, ThemeOptions, Theme } from '@mui/material';\nimport { MuiAlert } from './component-overrides/alert';\nimport { MuiPaper } from './component-overrides/paper';\nimport { getPaletteOptions } from './palette';\nimport { typography } from './typography';\n\nconst getModalBackgroundStyle = ({\n theme,\n}: {\n theme: Omit<Theme, 'components'>;\n}): { backgroundImage?: string; backgroundColor?: string } => {\n const backgroundStyle =\n theme.palette.mode === 'light'\n ? {}\n : {\n backgroundImage: 'unset',\n backgroundColor: theme.palette.designSystem.grey[800],\n };\n return {\n ...backgroundStyle,\n };\n};\n\n/**\n * Gets theme used by all components for the provided mode. For more details, see:\n * - Base colors, typography, sizing - go/chrono-ui-theme\n * - Material UI defaults: https://material-ui.com/customization/default-theme/\n * - Material UI variables: https://material-ui.com/customization/theming/#theme-configuration-variables\n * - Material UI global overrides and default props: https://material-ui.com/customization/globals/#css\n *\n * Need to reinstantiate the theme everytime to support switching between light and dark themes\n * https://github.com/mui-org/material-ui/issues/18831\n *\n * Enable disableBodyOverride to prevent the theme from applying color scheme to the body element.\n */\nexport function getTheme(\n mode: PaletteMode,\n options: Parameters<typeof createTheme>[0] = {},\n disableBodyOverride: boolean = false\n): Theme {\n return createTheme({\n palette: getPaletteOptions(mode),\n typography,\n mixins: {},\n components: getComponents(mode, disableBodyOverride),\n ...options,\n });\n}\n\n// Overrides for component default prop values and styles go here\nfunction getComponents(mode: PaletteMode, disableBodyOverride: boolean): ThemeOptions['components'] {\n const components: ThemeOptions['components'] = {\n MuiAlert,\n MuiFormControl: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiPaper,\n MuiTextField: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiDrawer: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiDialog: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiPopover: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n };\n\n if (disableBodyOverride) {\n return components;\n }\n\n return {\n MuiCssBaseline: {\n styleOverrides: {\n body: {\n colorScheme: mode,\n },\n },\n },\n ...components,\n };\n}\n"],"names":["createTheme","MuiAlert","MuiPaper","getPaletteOptions","typography","getModalBackgroundStyle","theme","backgroundStyle","palette","mode","backgroundImage","backgroundColor","designSystem","grey","getTheme","options","disableBodyOverride","mixins","components","getComponents","MuiFormControl","defaultProps","size","MuiTextField","MuiDrawer","styleOverrides","paper","MuiDialog","MuiPopover","MuiCssBaseline","body","colorScheme"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C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}
1
+ {"version":3,"sources":["../../src/theme/theme.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\nimport type { PaletteMode, ThemeOptions, Theme } from '@mui/material';\nimport { createTheme } from '@mui/material';\n\nimport { MuiAlert } from './component-overrides/alert';\nimport { MuiPaper } from './component-overrides/paper';\nimport { getPaletteOptions } from './palette';\nimport { typography } from './typography';\n\nconst getModalBackgroundStyle = ({\n theme,\n}: {\n theme: Omit<Theme, 'components'>;\n}): { backgroundImage?: string; backgroundColor?: string } => {\n const backgroundStyle =\n theme.palette.mode === 'light'\n ? {}\n : {\n backgroundImage: 'unset',\n backgroundColor: theme.palette.designSystem.grey[800],\n };\n return {\n ...backgroundStyle,\n };\n};\n\n/**\n * Gets theme used by all components for the provided mode. For more details, see:\n * - Base colors, typography, sizing - go/chrono-ui-theme\n * - Material UI defaults: https://material-ui.com/customization/default-theme/\n * - Material UI variables: https://material-ui.com/customization/theming/#theme-configuration-variables\n * - Material UI global overrides and default props: https://material-ui.com/customization/globals/#css\n *\n * Need to reinstantiate the theme everytime to support switching between light and dark themes\n * https://github.com/mui-org/material-ui/issues/18831\n *\n * Enable disableBodyOverride to prevent the theme from applying color scheme to the body element.\n */\nexport function getTheme(\n mode: PaletteMode,\n options: Parameters<typeof createTheme>[0] = {},\n disableBodyOverride: boolean = false,\n): Theme {\n return createTheme({\n palette: getPaletteOptions(mode),\n typography,\n mixins: {},\n components: getComponents(mode, disableBodyOverride),\n ...options,\n });\n}\n\n// Overrides for component default prop values and styles go here\nfunction getComponents(mode: PaletteMode, disableBodyOverride: boolean): ThemeOptions['components'] {\n const components: ThemeOptions['components'] = {\n MuiAlert,\n MuiFormControl: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiPaper,\n MuiTextField: {\n defaultProps: {\n size: 'small',\n },\n },\n MuiDrawer: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiDialog: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n MuiPopover: {\n styleOverrides: {\n paper: getModalBackgroundStyle,\n },\n },\n };\n\n if (disableBodyOverride) {\n return components;\n }\n\n return {\n MuiCssBaseline: {\n styleOverrides: {\n body: {\n colorScheme: mode,\n },\n },\n },\n ...components,\n };\n}\n"],"names":["createTheme","MuiAlert","MuiPaper","getPaletteOptions","typography","getModalBackgroundStyle","theme","backgroundStyle","palette","mode","backgroundImage","backgroundColor","designSystem","grey","getTheme","options","disableBodyOverride","mixins","components","getComponents","MuiFormControl","defaultProps","size","MuiTextField","MuiDrawer","styleOverrides","paper","MuiDialog","MuiPopover","MuiCssBaseline","body","colorScheme"],"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;AAGjC,SAASA,WAAW,QAAQ,gBAAgB;AAE5C,SAASC,QAAQ,QAAQ,iCAA8B;AACvD,SAASC,QAAQ,QAAQ,iCAA8B;AACvD,SAASC,iBAAiB,QAAQ,qBAAY;AAC9C,SAASC,UAAU,QAAQ,kBAAe;AAE1C,MAAMC,0BAA0B,CAAC,EAC/BC,KAAK,EAGN;IACC,MAAMC,kBACJD,MAAME,OAAO,CAACC,IAAI,KAAK,UACnB,CAAC,IACD;QACEC,iBAAiB;QACjBC,iBAAiBL,MAAME,OAAO,CAACI,YAAY,CAACC,IAAI,CAAC,IAAI;IACvD;IACN,OAAO;QACL,GAAGN,eAAe;IACpB;AACF;AAEA;;;;;;;;;;;CAWC,GACD,OAAO,SAASO,SACdL,IAAiB,EACjBM,UAA6C,CAAC,CAAC,EAC/CC,sBAA+B,KAAK;IAEpC,OAAOhB,YAAY;QACjBQ,SAASL,kBAAkBM;QAC3BL;QACAa,QAAQ,CAAC;QACTC,YAAYC,cAAcV,MAAMO;QAChC,GAAGD,OAAO;IACZ;AACF;AAEA,iEAAiE;AACjE,SAASI,cAAcV,IAAiB,EAAEO,mBAA4B;IACpE,MAAME,aAAyC;QAC7CjB;QACAmB,gBAAgB;YACdC,cAAc;gBACZC,MAAM;YACR;QACF;QACApB;QACAqB,cAAc;YACZF,cAAc;gBACZC,MAAM;YACR;QACF;QACAE,WAAW;YACTC,gBAAgB;gBACdC,OAAOrB;YACT;QACF;QACAsB,WAAW;YACTF,gBAAgB;gBACdC,OAAOrB;YACT;QACF;QACAuB,YAAY;YACVH,gBAAgB;gBACdC,OAAOrB;YACT;QACF;IACF;IAEA,IAAIW,qBAAqB;QACvB,OAAOE;IACT;IAEA,OAAO;QACLW,gBAAgB;YACdJ,gBAAgB;gBACdK,MAAM;oBACJC,aAAatB;gBACf;YACF;QACF;QACA,GAAGS,UAAU;IACf;AACF"}
@@ -11,6 +11,7 @@
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
13
  // Allows extending Lab types/components also
14
- export { };
14
+ // oxlint-disable-next-line import/no-unassigned-import -- This declaration intentionally loads MUI Lab's type augmentation.
15
+ import "@mui/lab/themeAugmentation";
15
16
 
16
17
  //# sourceMappingURL=ThemeExtension.d.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/theme/types/ThemeExtension.d.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\n// Allows extending Lab types/components also\nimport type {} from '@mui/lab/themeAugmentation';\n\n// Use Typescript interface augmentation to extend the MUI type definition\ndeclare module '@mui/material' {\n interface Color {\n 150: string;\n 250: string;\n 350: string;\n 450: string;\n 550: string;\n 650: string;\n 750: string;\n 850: string;\n 950: string;\n }\n}\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,6CAA6C;AAC7C,WAAiD"}
1
+ {"version":3,"sources":["../../../src/theme/types/ThemeExtension.d.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\n// Allows extending Lab types/components also\n// oxlint-disable-next-line import/no-unassigned-import -- This declaration intentionally loads MUI Lab's type augmentation.\nimport '@mui/lab/themeAugmentation';\n\n// Use Typescript interface augmentation to extend the MUI type definition\ndeclare module '@mui/material' {\n interface Color {\n 150: string;\n 250: string;\n 350: string;\n 450: string;\n 550: string;\n 650: string;\n 750: string;\n 850: string;\n 950: string;\n }\n}\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,6CAA6C;AAC7C,4HAA4H;AAC5H,OAAO,6BAA6B"}
@@ -4,7 +4,7 @@ import '@fontsource/inter/500.css';
4
4
  import '@fontsource/inter/600.css';
5
5
  import '@fontsource/inter/700.css';
6
6
  import '@fontsource/inter/900.css';
7
- import { ThemeOptions } from '@mui/material';
7
+ import type { ThemeOptions } from '@mui/material';
8
8
  /**
9
9
  * Theme typography options that are the same across both the dark and light themes.
10
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/theme/typography.ts"],"names":[],"mappings":"AAaA,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQ7C;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,YAAY,CAsEjD,CAAC"}
1
+ {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../src/theme/typography.ts"],"names":[],"mappings":"AAaA,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAQlD;;GAEG;AACH,eAAO,MAAM,UAAU,EAAE,YAAY,CAAC,YAAY,CAsEjD,CAAC"}
@@ -10,12 +10,12 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import '@fontsource/inter/300.css';
14
- import '@fontsource/inter/400.css';
15
- import '@fontsource/inter/500.css';
16
- import '@fontsource/inter/600.css';
17
- import '@fontsource/inter/700.css';
18
- import '@fontsource/inter/900.css';
13
+ import "@fontsource/inter/300.css";
14
+ import "@fontsource/inter/400.css";
15
+ import "@fontsource/inter/500.css";
16
+ import "@fontsource/inter/600.css";
17
+ import "@fontsource/inter/700.css";
18
+ import "@fontsource/inter/900.css";
19
19
  // Font weights need to correspond with the imports at the top of the file
20
20
  const fontWeightLight = 300;
21
21
  const fontWeightRegular = 400;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/theme/typography.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\nimport '@fontsource/inter/300.css';\nimport '@fontsource/inter/400.css';\nimport '@fontsource/inter/500.css';\nimport '@fontsource/inter/600.css';\nimport '@fontsource/inter/700.css';\nimport '@fontsource/inter/900.css';\nimport { ThemeOptions } from '@mui/material';\n\n// Font weights need to correspond with the imports at the top of the file\nconst fontWeightLight = 300;\nconst fontWeightRegular = 400;\nconst fontWeightMedium = 600;\nconst fontWeightBold = 700;\n\n/**\n * Theme typography options that are the same across both the dark and light themes.\n */\nexport const typography: ThemeOptions['typography'] = {\n fontFamily:\n 'Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold,\n\n h1: {\n fontSize: '1.5rem', // 24px\n fontWeight: fontWeightMedium,\n lineHeight: '32px',\n },\n h2: {\n fontSize: '1.25rem', // 20px\n fontWeight: fontWeightMedium,\n lineHeight: '28px',\n },\n h3: {\n fontSize: '1rem', // 16px\n fontWeight: fontWeightMedium,\n lineHeight: '24px',\n },\n h4: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightMedium,\n lineHeight: '22px',\n },\n h5: undefined,\n h6: undefined,\n\n body1: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightRegular,\n lineHeight: '20px',\n },\n body2: {\n fontSize: '0.75rem', // 12px\n fontWeight: fontWeightRegular,\n lineHeight: '18px',\n },\n subtitle1: {\n fontSize: '1rem', // 16px\n fontWeight: fontWeightRegular,\n lineHeight: '24px',\n letterSpacing: '0.02rem',\n },\n subtitle2: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightMedium,\n lineHeight: '22px',\n letterSpacing: '0.03rem',\n textTransform: 'uppercase',\n },\n\n button: {\n // 14px\n fontSize: '0.875rem',\n fontWeight: fontWeightMedium,\n // 20 px\n lineHeight: '1.25rem',\n textTransform: 'none',\n letterSpacing: '0.03rem',\n },\n caption: {\n fontSize: '0.6875rem', // 11px\n fontWeight: fontWeightRegular,\n lineHeight: '16px',\n },\n};\n"],"names":["fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","typography","fontFamily","h1","fontSize","fontWeight","lineHeight","h2","h3","h4","h5","undefined","h6","body1","body2","subtitle1","letterSpacing","subtitle2","textTransform","button","caption"],"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,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AAGnC,0EAA0E;AAC1E,MAAMA,kBAAkB;AACxB,MAAMC,oBAAoB;AAC1B,MAAMC,mBAAmB;AACzB,MAAMC,iBAAiB;AAEvB;;CAEC,GACD,OAAO,MAAMC,aAAyC;IACpDC,YACE;IAEFL;IACAC;IACAC;IACAC;IAEAG,IAAI;QACFC,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAC,IAAI;QACFH,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAE,IAAI;QACFJ,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAG,IAAI;QACFL,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAI,IAAIC;IACJC,IAAID;IAEJE,OAAO;QACLT,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;IACAQ,OAAO;QACLV,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;IACAS,WAAW;QACTX,UAAU;QACVC,YAAYP;QACZQ,YAAY;QACZU,eAAe;IACjB;IACAC,WAAW;QACTb,UAAU;QACVC,YAAYN;QACZO,YAAY;QACZU,eAAe;QACfE,eAAe;IACjB;IAEAC,QAAQ;QACN,OAAO;QACPf,UAAU;QACVC,YAAYN;QACZ,QAAQ;QACRO,YAAY;QACZY,eAAe;QACfF,eAAe;IACjB;IACAI,SAAS;QACPhB,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;AACF,EAAE"}
1
+ {"version":3,"sources":["../../src/theme/typography.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\nimport '@fontsource/inter/300.css';\nimport '@fontsource/inter/400.css';\nimport '@fontsource/inter/500.css';\nimport '@fontsource/inter/600.css';\nimport '@fontsource/inter/700.css';\nimport '@fontsource/inter/900.css';\nimport type { ThemeOptions } from '@mui/material';\n\n// Font weights need to correspond with the imports at the top of the file\nconst fontWeightLight = 300;\nconst fontWeightRegular = 400;\nconst fontWeightMedium = 600;\nconst fontWeightBold = 700;\n\n/**\n * Theme typography options that are the same across both the dark and light themes.\n */\nexport const typography: ThemeOptions['typography'] = {\n fontFamily:\n 'Inter, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"',\n\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold,\n\n h1: {\n fontSize: '1.5rem', // 24px\n fontWeight: fontWeightMedium,\n lineHeight: '32px',\n },\n h2: {\n fontSize: '1.25rem', // 20px\n fontWeight: fontWeightMedium,\n lineHeight: '28px',\n },\n h3: {\n fontSize: '1rem', // 16px\n fontWeight: fontWeightMedium,\n lineHeight: '24px',\n },\n h4: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightMedium,\n lineHeight: '22px',\n },\n h5: undefined,\n h6: undefined,\n\n body1: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightRegular,\n lineHeight: '20px',\n },\n body2: {\n fontSize: '0.75rem', // 12px\n fontWeight: fontWeightRegular,\n lineHeight: '18px',\n },\n subtitle1: {\n fontSize: '1rem', // 16px\n fontWeight: fontWeightRegular,\n lineHeight: '24px',\n letterSpacing: '0.02rem',\n },\n subtitle2: {\n fontSize: '0.875rem', // 14px\n fontWeight: fontWeightMedium,\n lineHeight: '22px',\n letterSpacing: '0.03rem',\n textTransform: 'uppercase',\n },\n\n button: {\n // 14px\n fontSize: '0.875rem',\n fontWeight: fontWeightMedium,\n // 20 px\n lineHeight: '1.25rem',\n textTransform: 'none',\n letterSpacing: '0.03rem',\n },\n caption: {\n fontSize: '0.6875rem', // 11px\n fontWeight: fontWeightRegular,\n lineHeight: '16px',\n },\n};\n"],"names":["fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","typography","fontFamily","h1","fontSize","fontWeight","lineHeight","h2","h3","h4","h5","undefined","h6","body1","body2","subtitle1","letterSpacing","subtitle2","textTransform","button","caption"],"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,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AACnC,OAAO,4BAA4B;AAGnC,0EAA0E;AAC1E,MAAMA,kBAAkB;AACxB,MAAMC,oBAAoB;AAC1B,MAAMC,mBAAmB;AACzB,MAAMC,iBAAiB;AAEvB;;CAEC,GACD,OAAO,MAAMC,aAAyC;IACpDC,YACE;IAEFL;IACAC;IACAC;IACAC;IAEAG,IAAI;QACFC,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAC,IAAI;QACFH,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAE,IAAI;QACFJ,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAG,IAAI;QACFL,UAAU;QACVC,YAAYN;QACZO,YAAY;IACd;IACAI,IAAIC;IACJC,IAAID;IAEJE,OAAO;QACLT,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;IACAQ,OAAO;QACLV,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;IACAS,WAAW;QACTX,UAAU;QACVC,YAAYP;QACZQ,YAAY;QACZU,eAAe;IACjB;IACAC,WAAW;QACTb,UAAU;QACVC,YAAYN;QACZO,YAAY;QACZU,eAAe;QACfE,eAAe;IACjB;IAEAC,QAAQ;QACN,OAAO;QACPf,UAAU;QACVC,YAAYN;QACZ,QAAQ;QACRO,YAAY;QACZY,eAAe;QACfF,eAAe;IACjB;IACAI,SAAS;QACPhB,UAAU;QACVC,YAAYP;QACZQ,YAAY;IACd;AACF,EAAE"}
@@ -1,5 +1,5 @@
1
1
  import type { XAXisComponentOption, YAXisComponentOption } from 'echarts';
2
- import { FormatOptions } from '../model';
2
+ import type { FormatOptions } from '../model';
3
3
  export interface YAxisConfig {
4
4
  format?: FormatOptions;
5
5
  position?: 'left' | 'right';
@@ -1 +1 @@
1
- {"version":3,"file":"axis.d.ts","sourceRoot":"","sources":["../../src/utils/axis.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAe,MAAM,UAAU,CAAC;AAEtD,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA0BD,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,EAAE,CAWpH;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,UAAU,EAAE,aAAa,GAAG,SAAS,EACrC,iBAAiB,EAAE,aAAa,EAAE,EAClC,SAAS,CAAC,EAAE,MAAM,EAAE,GACnB,oBAAoB,EAAE,CAkDxB"}
1
+ {"version":3,"file":"axis.d.ts","sourceRoot":"","sources":["../../src/utils/axis.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAG1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AA0BD,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,oBAAoB,GAAG,oBAAoB,EAAE,IAAI,CAAC,EAAE,aAAa,GAAG,OAAO,EAAE,CAWpH;AAED;;;;;;;;;GASG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,oBAAoB,GAAG,SAAS,EAC1C,UAAU,EAAE,aAAa,GAAG,SAAS,EACrC,iBAAiB,EAAE,aAAa,EAAE,EAClC,SAAS,CAAC,EAAE,MAAM,EAAE,GACnB,oBAAoB,EAAE,CAkDxB"}
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import merge from 'lodash/merge';
14
- import { formatValue } from '../model';
13
+ import merge from "lodash/merge";
14
+ import { formatValue } from "../model/index.js";
15
15
  // Character width multipliers (approximate for typical UI fonts)
16
16
  const CHAR_WIDTH_BASE = 6;
17
17
  const AXIS_LABEL_PADDING = 10; // Extra padding to avoid label clipping
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/axis.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\nimport merge from 'lodash/merge';\nimport type { XAXisComponentOption, YAXisComponentOption } from 'echarts';\nimport { FormatOptions, formatValue } from '../model';\n\nexport interface YAxisConfig {\n format?: FormatOptions;\n position?: 'left' | 'right';\n show?: boolean;\n min?: number;\n max?: number;\n}\n\n// Character width multipliers (approximate for typical UI fonts)\nconst CHAR_WIDTH_BASE = 6;\nconst AXIS_LABEL_PADDING = 10; // Extra padding to avoid label clipping\n\n/**\n * Estimate the pixel width needed for an axis label using Canvas API.\n */\nfunction estimateLabelWidth(format: FormatOptions | undefined, maxValue: number): number {\n const formattedLabel = formatValue(maxValue, format);\n // Create a canvas element (reuse if possible for performance)\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!context) {\n // Fallback to estimation if canvas not available\n return formattedLabel.length * CHAR_WIDTH_BASE;\n }\n context.font = '12px sans-serif';\n const metrics = context.measureText(formattedLabel);\n return metrics.width;\n}\n\n/*\n * Populate yAxis or xAxis properties, returns an Array since multiple axes are supported\n */\nexport function getFormattedAxis(axis?: YAXisComponentOption | XAXisComponentOption, unit?: FormatOptions): unknown[] {\n const AXIS_DEFAULT = {\n type: 'value',\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number): string => {\n return formatValue(value, unit);\n },\n },\n };\n return [merge(AXIS_DEFAULT, axis)];\n}\n\n/**\n * Create multiple Y axes configurations for ECharts\n * The first axis (index 0) is always on the left side (default axis from panel settings)\n * Additional axes are placed on the right side\n *\n * @param baseAxis - Base axis configuration from panel settings\n * @param baseFormat - Format for the base/default Y axis\n * @param additionalFormats - Array of formats for additional right-side Y axes\n * @param maxValues - Optional array of max values for each additional format (used to compute dynamic label widths)\n */\nexport function getFormattedMultipleYAxes(\n baseAxis: YAXisComponentOption | undefined,\n baseFormat: FormatOptions | undefined,\n additionalFormats: FormatOptions[],\n maxValues?: number[]\n): YAXisComponentOption[] {\n const axes: YAXisComponentOption[] = [];\n\n // Base/default Y axis (left side)\n const baseAxisConfig: YAXisComponentOption = merge(\n {\n type: 'value',\n position: 'left',\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number): string => {\n return formatValue(value, baseFormat);\n },\n // Let ECharts handle width automatically\n overflow: 'truncate',\n },\n },\n baseAxis\n );\n axes.push(baseAxisConfig);\n\n // Calculate cumulative offsets based on actual formatted label widths\n let cumulativeOffset = 0;\n\n // Additional Y axes (right side) for each unique format\n additionalFormats.forEach((format, index) => {\n const rightAxisConfig: YAXisComponentOption = {\n type: 'value',\n position: 'right',\n // Dynamic offset based on cumulative width of preceding axis labels\n offset: cumulativeOffset,\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number): string => {\n return formatValue(value, format);\n },\n },\n splitLine: {\n show: false, // Hide grid lines for right-side axes to reduce visual noise\n },\n show: baseAxis?.show,\n };\n axes.push(rightAxisConfig);\n // For subsequent axes, add the width of the previous axis's labels\n if (maxValues) {\n cumulativeOffset += estimateLabelWidth(format, maxValues[index] ?? 1000) + AXIS_LABEL_PADDING;\n }\n });\n\n return axes;\n}\n"],"names":["merge","formatValue","CHAR_WIDTH_BASE","AXIS_LABEL_PADDING","estimateLabelWidth","format","maxValue","formattedLabel","canvas","document","createElement","context","getContext","length","font","metrics","measureText","width","getFormattedAxis","axis","unit","AXIS_DEFAULT","type","boundaryGap","axisLabel","formatter","value","getFormattedMultipleYAxes","baseAxis","baseFormat","additionalFormats","maxValues","axes","baseAxisConfig","position","overflow","push","cumulativeOffset","forEach","index","rightAxisConfig","offset","splitLine","show"],"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,OAAOA,WAAW,eAAe;AAEjC,SAAwBC,WAAW,QAAQ,WAAW;AAUtD,iEAAiE;AACjE,MAAMC,kBAAkB;AACxB,MAAMC,qBAAqB,IAAI,wCAAwC;AAEvE;;CAEC,GACD,SAASC,mBAAmBC,MAAiC,EAAEC,QAAgB;IAC7E,MAAMC,iBAAiBN,YAAYK,UAAUD;IAC7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KI,IAAI,CAACI;QACV,mEAAmE;QACnE,IAAIT,WAAW;YACbM,oBAAoBjC,mBAAmBC,QAAQ0B,SAAS,CAACQ,MAAM,IAAI,QAAQpC;QAC7E;IACF;IAEA,OAAO6B;AACT"}
1
+ {"version":3,"sources":["../../src/utils/axis.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\nimport type { XAXisComponentOption, YAXisComponentOption } from 'echarts';\nimport merge from 'lodash/merge';\n\nimport type { FormatOptions } from '../model';\nimport { formatValue } from '../model';\n\nexport interface YAxisConfig {\n format?: FormatOptions;\n position?: 'left' | 'right';\n show?: boolean;\n min?: number;\n max?: number;\n}\n\n// Character width multipliers (approximate for typical UI fonts)\nconst CHAR_WIDTH_BASE = 6;\nconst AXIS_LABEL_PADDING = 10; // Extra padding to avoid label clipping\n\n/**\n * Estimate the pixel width needed for an axis label using Canvas API.\n */\nfunction estimateLabelWidth(format: FormatOptions | undefined, maxValue: number): number {\n const formattedLabel = formatValue(maxValue, format);\n // Create a canvas element (reuse if possible for performance)\n const canvas = document.createElement('canvas');\n const context = canvas.getContext('2d');\n if (!context) {\n // Fallback to estimation if canvas not available\n return formattedLabel.length * CHAR_WIDTH_BASE;\n }\n context.font = '12px sans-serif';\n const metrics = context.measureText(formattedLabel);\n return metrics.width;\n}\n\n/*\n * Populate yAxis or xAxis properties, returns an Array since multiple axes are supported\n */\nexport function getFormattedAxis(axis?: YAXisComponentOption | XAXisComponentOption, unit?: FormatOptions): unknown[] {\n const AXIS_DEFAULT = {\n type: 'value',\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number): string => {\n return formatValue(value, unit);\n },\n },\n };\n return [merge(AXIS_DEFAULT, axis)];\n}\n\n/**\n * Create multiple Y axes configurations for ECharts\n * The first axis (index 0) is always on the left side (default axis from panel settings)\n * Additional axes are placed on the right side\n *\n * @param baseAxis - Base axis configuration from panel settings\n * @param baseFormat - Format for the base/default Y axis\n * @param additionalFormats - Array of formats for additional right-side Y axes\n * @param maxValues - Optional array of max values for each additional format (used to compute dynamic label widths)\n */\nexport function getFormattedMultipleYAxes(\n baseAxis: YAXisComponentOption | undefined,\n baseFormat: FormatOptions | undefined,\n additionalFormats: FormatOptions[],\n maxValues?: number[],\n): YAXisComponentOption[] {\n const axes: YAXisComponentOption[] = [];\n\n // Base/default Y axis (left side)\n const baseAxisConfig: YAXisComponentOption = merge(\n {\n type: 'value',\n position: 'left',\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number): string => {\n return formatValue(value, baseFormat);\n },\n // Let ECharts handle width automatically\n overflow: 'truncate',\n },\n },\n baseAxis,\n );\n axes.push(baseAxisConfig);\n\n // Calculate cumulative offsets based on actual formatted label widths\n let cumulativeOffset = 0;\n\n // Additional Y axes (right side) for each unique format\n additionalFormats.forEach((format, index) => {\n const rightAxisConfig: YAXisComponentOption = {\n type: 'value',\n position: 'right',\n // Dynamic offset based on cumulative width of preceding axis labels\n offset: cumulativeOffset,\n boundaryGap: [0, '10%'],\n axisLabel: {\n formatter: (value: number): string => {\n return formatValue(value, format);\n },\n },\n splitLine: {\n show: false, // Hide grid lines for right-side axes to reduce visual noise\n },\n show: baseAxis?.show,\n };\n axes.push(rightAxisConfig);\n // For subsequent axes, add the width of the previous axis's labels\n if (maxValues) {\n cumulativeOffset += estimateLabelWidth(format, maxValues[index] ?? 1000) + AXIS_LABEL_PADDING;\n }\n });\n\n return axes;\n}\n"],"names":["merge","formatValue","CHAR_WIDTH_BASE","AXIS_LABEL_PADDING","estimateLabelWidth","format","maxValue","formattedLabel","canvas","document","createElement","context","getContext","length","font","metrics","measureText","width","getFormattedAxis","axis","unit","AXIS_DEFAULT","type","boundaryGap","axisLabel","formatter","value","getFormattedMultipleYAxes","baseAxis","baseFormat","additionalFormats","maxValues","axes","baseAxisConfig","position","overflow","push","cumulativeOffset","forEach","index","rightAxisConfig","offset","splitLine","show"],"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;AAGjC,OAAOA,WAAW,eAAe;AAGjC,SAASC,WAAW,QAAQ,oBAAW;AAUvC,iEAAiE;AACjE,MAAMC,kBAAkB;AACxB,MAAMC,qBAAqB,IAAI,wCAAwC;AAEvE;;CAEC,GACD,SAASC,mBAAmBC,MAAiC,EAAEC,QAAgB;IAC7E,MAAMC,iBAAiBN,YAAYK,UAAUD;IAC7C,8DAA8D;IAC9D,MAAMG,SAASC,SAASC,aAAa,CAAC;IACtC,MAAMC,UAAUH,OAAOI,UAAU,CAAC;IAClC,IAAI,CAACD,SAAS;QACZ,iDAAiD;QACjD,OAAOJ,eAAeM,MAAM,GAAGX;IACjC;IACAS,QAAQG,IAAI,GAAG;IACf,MAAMC,UAAUJ,QAAQK,WAAW,CAACT;IACpC,OAAOQ,QAAQE,KAAK;AACtB;AAEA;;CAEC,GACD,OAAO,SAASC,iBAAiBC,IAAkD,EAAEC,IAAoB;IACvG,MAAMC,eAAe;QACnBC,MAAM;QACNC,aAAa;YAAC;YAAG;SAAM;QACvBC,WAAW;YACTC,WAAW,CAACC;gBACV,OAAOzB,YAAYyB,OAAON;YAC5B;QACF;IACF;IACA,OAAO;QAACpB,MAAMqB,cAAcF;KAAM;AACpC;AAEA;;;;;;;;;CASC,GACD,OAAO,SAASQ,0BACdC,QAA0C,EAC1CC,UAAqC,EACrCC,iBAAkC,EAClCC,SAAoB;IAEpB,MAAMC,OAA+B,EAAE;IAEvC,kCAAkC;IAClC,MAAMC,iBAAuCjC,MAC3C;QACEsB,MAAM;QACNY,UAAU;QACVX,aAAa;YAAC;YAAG;SAAM;QACvBC,WAAW;YACTC,WAAW,CAACC;gBACV,OAAOzB,YAAYyB,OAAOG;YAC5B;YACA,yCAAyC;YACzCM,UAAU;QACZ;IACF,GACAP;IAEFI,KAAKI,IAAI,CAACH;IAEV,sEAAsE;IACtE,IAAII,mBAAmB;IAEvB,wDAAwD;IACxDP,kBAAkBQ,OAAO,CAAC,CAACjC,QAAQkC;QACjC,MAAMC,kBAAwC;YAC5ClB,MAAM;YACNY,UAAU;YACV,oEAAoE;YACpEO,QAAQJ;YACRd,aAAa;gBAAC;gBAAG;aAAM;YACvBC,WAAW;gBACTC,WAAW,CAACC;oBACV,OAAOzB,YAAYyB,OAAOrB;gBAC5B;YACF;YACAqC,WAAW;gBACTC,MAAM;YACR;YACAA,MAAMf,UAAUe;QAClB;QACAX,KAAKI,IAAI,CAACI;QACV,mEAAmE;QACnE,IAAIT,WAAW;YACbM,oBAAoBjC,mBAAmBC,QAAQ0B,SAAS,CAACQ,MAAM,IAAI,QAAQpC;QAC7E;IACF;IAEA,OAAO6B;AACT"}
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { useState, useCallback } from 'react';
13
+ import { useState, useCallback } from "react";
14
14
  /**
15
15
  * Just like useState but gets/sets the value in the browser's local storage.
16
16
  * 'key' should be a constant string. 'initialValue' is returned when local
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/browser-storage.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\nimport { useState, useCallback } from 'react';\n\ntype StorageTuple<T> = [T, (next: T) => void];\n\n/**\n * Just like useState but gets/sets the value in the browser's local storage.\n * 'key' should be a constant string. 'initialValue' is returned when local\n * storage does not have any data yet.\n */\nexport function useLocalStorage<T>(key: string, initialValue: T): StorageTuple<T> {\n const { value, setValueAndStore } = useStorage(window.localStorage, key, initialValue);\n return [value, setValueAndStore];\n}\n\n// Common functionality used by all storage hooks\nfunction useStorage<T>(\n storage: Storage,\n key: string,\n initialValue: T\n): {\n setValueAndStore: (value: T) => void;\n setValue: (value: T) => void;\n value: T;\n} {\n // Use state so that changes cause the page to re-render\n const [value, setValue] = useState<T>(() => {\n try {\n const json = storage.getItem(key);\n if (json !== null) {\n return JSON.parse(json);\n }\n } catch {\n // No-op\n }\n\n // Either the value isn't in storage yet or JSON parsing failed, so\n // set to the initial value in both places\n storage.setItem(key, JSON.stringify(initialValue));\n return initialValue;\n });\n\n // Set in both places\n const setValueAndStore = useCallback(\n (val: T) => {\n setValue(val);\n storage.setItem(key, JSON.stringify(val));\n },\n [setValue, storage, key]\n );\n\n return { value, setValue, setValueAndStore };\n}\n"],"names":["useState","useCallback","useLocalStorage","key","initialValue","value","setValueAndStore","useStorage","window","localStorage","storage","setValue","json","getItem","JSON","parse","setItem","stringify","val"],"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,QAAQ,EAAEC,WAAW,QAAQ,QAAQ;AAI9C;;;;CAIC,GACD,OAAO,SAASC,gBAAmBC,GAAW,EAAEC,YAAe;IAC7D,MAAM,EAAEC,KAAK,EAAEC,gBAAgB,EAAE,GAAGC,WAAWC,OAAOC,YAAY,EAAEN,KAAKC;IACzE,OAAO;QAACC;QAAOC;KAAiB;AAClC;AAEA,iDAAiD;AACjD,SAASC,WACPG,OAAgB,EAChBP,GAAW,EACXC,YAAe;IAMf,wDAAwD;IACxD,MAAM,CAACC,OAAOM,SAAS,GAAGX,SAAY;QACpC,IAAI;YACF,MAAMY,OAAOF,QAAQG,OAAO,CAACV;YAC7B,IAAIS,SAAS,MAAM;gBACjB,OAAOE,KAAKC,KAAK,CAACH;YACpB;QACF,EAAE,OAAM;QACN,QAAQ;QACV;QAEA,mEAAmE;QACnE,0CAA0C;QAC1CF,QAAQM,OAAO,CAACb,KAAKW,KAAKG,SAAS,CAACb;QACpC,OAAOA;IACT;IAEA,qBAAqB;IACrB,MAAME,mBAAmBL,YACvB,CAACiB;QACCP,SAASO;QACTR,QAAQM,OAAO,CAACb,KAAKW,KAAKG,SAAS,CAACC;IACtC,GACA;QAACP;QAAUD;QAASP;KAAI;IAG1B,OAAO;QAAEE;QAAOM;QAAUL;IAAiB;AAC7C"}
1
+ {"version":3,"sources":["../../src/utils/browser-storage.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\nimport { useState, useCallback } from 'react';\n\ntype StorageTuple<T> = [T, (next: T) => void];\n\n/**\n * Just like useState but gets/sets the value in the browser's local storage.\n * 'key' should be a constant string. 'initialValue' is returned when local\n * storage does not have any data yet.\n */\nexport function useLocalStorage<T>(key: string, initialValue: T): StorageTuple<T> {\n const { value, setValueAndStore } = useStorage(window.localStorage, key, initialValue);\n return [value, setValueAndStore];\n}\n\n// Common functionality used by all storage hooks\nfunction useStorage<T>(\n storage: Storage,\n key: string,\n initialValue: T,\n): {\n setValueAndStore: (value: T) => void;\n setValue: (value: T) => void;\n value: T;\n} {\n // Use state so that changes cause the page to re-render\n const [value, setValue] = useState<T>(() => {\n try {\n const json = storage.getItem(key);\n if (json !== null) {\n return JSON.parse(json);\n }\n } catch {\n // No-op\n }\n\n // Either the value isn't in storage yet or JSON parsing failed, so\n // set to the initial value in both places\n storage.setItem(key, JSON.stringify(initialValue));\n return initialValue;\n });\n\n // Set in both places\n const setValueAndStore = useCallback(\n (val: T) => {\n setValue(val);\n storage.setItem(key, JSON.stringify(val));\n },\n [setValue, storage, key],\n );\n\n return { value, setValue, setValueAndStore };\n}\n"],"names":["useState","useCallback","useLocalStorage","key","initialValue","value","setValueAndStore","useStorage","window","localStorage","storage","setValue","json","getItem","JSON","parse","setItem","stringify","val"],"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,QAAQ,EAAEC,WAAW,QAAQ,QAAQ;AAI9C;;;;CAIC,GACD,OAAO,SAASC,gBAAmBC,GAAW,EAAEC,YAAe;IAC7D,MAAM,EAAEC,KAAK,EAAEC,gBAAgB,EAAE,GAAGC,WAAWC,OAAOC,YAAY,EAAEN,KAAKC;IACzE,OAAO;QAACC;QAAOC;KAAiB;AAClC;AAEA,iDAAiD;AACjD,SAASC,WACPG,OAAgB,EAChBP,GAAW,EACXC,YAAe;IAMf,wDAAwD;IACxD,MAAM,CAACC,OAAOM,SAAS,GAAGX,SAAY;QACpC,IAAI;YACF,MAAMY,OAAOF,QAAQG,OAAO,CAACV;YAC7B,IAAIS,SAAS,MAAM;gBACjB,OAAOE,KAAKC,KAAK,CAACH;YACpB;QACF,EAAE,OAAM;QACN,QAAQ;QACV;QAEA,mEAAmE;QACnE,0CAA0C;QAC1CF,QAAQM,OAAO,CAACb,KAAKW,KAAKG,SAAS,CAACb;QACpC,OAAOA;IACT;IAEA,qBAAqB;IACrB,MAAME,mBAAmBL,YACvB,CAACiB;QACCP,SAASO;QACTR,QAAQM,OAAO,CAACb,KAAKW,KAAKG,SAAS,CAACC;IACtC,GACA;QAACP;QAAUD;QAASP;KAAI;IAG1B,OAAO;QAAEE;QAAOM;QAAUL;IAAiB;AAC7C"}
@@ -1,6 +1,6 @@
1
- import { ECharts as EChartsInstance } from 'echarts/core';
2
- import { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/spec';
3
- import { DatapointInfo, TimeChartSeriesMapping } from '../model';
1
+ import type { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/spec';
2
+ import type { ECharts as EChartsInstance } from 'echarts/core';
3
+ import type { DatapointInfo, TimeChartSeriesMapping } from '../model';
4
4
  export interface ZoomEventData {
5
5
  start: number;
6
6
  end: number;
@@ -1 +1 @@
1
- {"version":3,"file":"chart-actions.d.ts","sourceRoot":"","sources":["../../src/utils/chart-actions.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAgC,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAE/F,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAa3D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAKzD;AAMD,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,eAAe,GAAG,IAAI,CAYnE;AAOD,wBAAgB,cAAc,CAAC,YAAY,EAAE,MA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OD,wBAAgB,cAAc,CAAC,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,eAAe,GAAG,MAAM,EAAE,GAAG,IAAI,CAYnH;AAOD,wBAAgB,gCAAgC,CAC9C,KAAK,EAAE,eAAe,EACtB,mBAAmB,EAAE,MAAM,EAAE,EAC7B,uBAAuB,EAAE,MAAM,EAAE,EACjC,0BAA0B,EAAE,MAAM,EAAE,EACpC,oBAAoB,EAAE,aAAa,EAAE,EACrC,mBAAmB,EAAE,aAAa,EAAE,GACnC,IAAI,CA0DN;AAKD,wBAAgB,0BAA0B,CAAC,aAAa,EAAE,sBAAsB,GAAG,OAAO,CAGzF;AAMD,wBAAgB,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,oBAAoB,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAgB9G;AAKD,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAapG"}
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { PINNED_CROSSHAIR_SERIES_NAME } from '../model';
13
+ import { PINNED_CROSSHAIR_SERIES_NAME } from "../model/index.js";
14
14
  /**
15
15
  * Enable dataZoom without requring user to click toolbox icon.
16
16
  * https://stackoverflow.com/questions/57183297/is-there-a-way-to-use-zoom-of-type-select-without-showing-the-toolbar
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/chart-actions.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\nimport { ECharts as EChartsInstance } from 'echarts/core';\nimport { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/spec';\nimport { DatapointInfo, PINNED_CROSSHAIR_SERIES_NAME, TimeChartSeriesMapping } from '../model';\n\nexport interface ZoomEventData {\n start: number;\n end: number;\n}\n\n/**\n * Enable dataZoom without requring user to click toolbox icon.\n * https://stackoverflow.com/questions/57183297/is-there-a-way-to-use-zoom-of-type-select-without-showing-the-toolbar\n */\nexport function enableDataZoom(chart: EChartsInstance): void {\n const chartModel = chart['_model'];\n if (chartModel === undefined) return;\n if (chartModel.option.toolbox !== undefined && chartModel.option.toolbox.length > 0) {\n // check if hidden data zoom icon is unselected (if selected it would be 'emphasis' instead of 'normal')\n if (chartModel.option.toolbox[0].feature.dataZoom.iconStatus.zoom === 'normal') {\n chart.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'dataZoomSelect',\n dataZoomSelectActive: true,\n });\n }\n }\n}\n\n/**\n * Restore chart to original state before zoom or other actions were dispatched\n */\nexport function restoreChart(chart: EChartsInstance): void {\n // TODO: support incremental unzoom instead of restore to original state\n chart.dispatchAction({\n type: 'restore', // https://echarts.apache.org/en/api.html#events.restore\n });\n}\n\n/*\n * Clear all highlighted series when cursor exits canvas\n * https://echarts.apache.org/en/api.html#action.downplay\n */\nexport function clearHighlightedSeries(chart: EChartsInstance): void {\n if (chart.dispatchAction !== undefined) {\n // Clear any selected data points\n chart.dispatchAction({\n type: 'unselect',\n });\n\n // Clear any highlighted series\n chart.dispatchAction({\n type: 'downplay',\n });\n }\n}\n\n/*\n * Convert a point from pixel coordinate to logical coordinate.\n * Used to determine if cursor is over chart canvas and closest datapoint.\n * https://echarts.apache.org/en/api.html#echartsInstance.convertFromPixel\n */\nexport function getPointInGrid(cursorCoordX: number, cursorCoordY: number, chart?: EChartsInstance): number[] | null {\n if (chart === undefined) {\n return null;\n }\n\n const pointInPixel = [cursorCoordX, cursorCoordY];\n if (!chart.containPixel('grid', pointInPixel)) {\n return null;\n }\n\n const pointInGrid: number[] = chart.convertFromPixel('grid', pointInPixel);\n return pointInGrid;\n}\n\n/*\n * TimeSeriesChart tooltip is built custom to support finding nearby series instead of single or all series.\n * This means ECharts actions need to be dispatched manually for series highlighting, datapoint select state, etc.\n * More info: https://echarts.apache.org/en/api.html#action\n */\nexport function batchDispatchNearbySeriesActions(\n chart: EChartsInstance,\n nearbySeriesIndexes: number[],\n emphasizedSeriesIndexes: number[],\n nonEmphasizedSeriesIndexes: number[],\n emphasizedDatapoints: DatapointInfo[],\n duplicateDatapoints: DatapointInfo[]\n): void {\n // Accounts for multiple series that are rendered direct on top of eachother.\n // Only applies select state to the datapoint that is visible to avoid color mismatch.\n const lastEmphasizedDatapoint =\n duplicateDatapoints.length > 0\n ? duplicateDatapoints[duplicateDatapoints.length - 1]\n : emphasizedDatapoints[emphasizedDatapoints.length - 1];\n if (lastEmphasizedDatapoint !== undefined) {\n // Corresponds to select options inside getTimeSeries util.\n // https://echarts.apache.org/en/option.html#series-line.select.itemStyle\n chart.dispatchAction({\n type: 'select',\n seriesIndex: lastEmphasizedDatapoint.seriesIndex,\n dataIndex: lastEmphasizedDatapoint.dataIndex,\n // Shared crosshair should not emphasize datapoints on adjacent charts.\n escapeConnect: true, // TODO: try to remove escapeConnect and match by seriesName for cross panel correlation\n });\n }\n\n // Blanket downplay clears axis-triggered emphasis (enlarged \"big point\" markers) before\n // re-applying emphasis to only the winner series.\n // https://echarts.apache.org/en/api.html#action.downplay\n chart.dispatchAction({\n type: 'downplay',\n });\n\n // Clears emphasis state of all lines that are not emphasized.\n // Emphasized is a subset of just the nearby series that are closest to cursor.\n if (nonEmphasizedSeriesIndexes.length > 0) {\n chart.dispatchAction({\n type: 'downplay',\n seriesIndex: nonEmphasizedSeriesIndexes,\n });\n }\n\n // https://echarts.apache.org/en/api.html#action.highlight\n if (emphasizedSeriesIndexes.length > 0) {\n // Fadeout opacity of all series not closest to cursor.\n chart.dispatchAction({\n type: 'highlight',\n seriesIndex: emphasizedSeriesIndexes,\n notBlur: false, // ensure blur IS triggered, this is default but setting so it is explicit\n escapeConnect: true, // shared crosshair should not emphasize series on adjacent charts\n });\n } else {\n // When no emphasized series with bold text, notBlur allows opacity fadeout to not trigger.\n chart.dispatchAction({\n type: 'highlight',\n seriesIndex: nearbySeriesIndexes,\n notBlur: true, // do not trigger blur state when cursor is not immediately close to any series\n escapeConnect: true, // shared crosshair should not emphasize series on adjacent charts\n });\n\n // Clears selected datapoints since no bold series in tooltip, restore does not impact highlighting\n chart.dispatchAction({\n type: 'toggleSelect', // https://echarts.apache.org/en/api.html#action.toggleSelect\n });\n }\n}\n\n/*\n * Determine whether a markLine was pushed into the final series, which means crosshair was already pinned onClick\n */\nexport function checkCrosshairPinnedStatus(seriesMapping: TimeChartSeriesMapping): boolean {\n const isCrosshairPinned = seriesMapping[seriesMapping.length - 1]?.name === PINNED_CROSSHAIR_SERIES_NAME;\n return isCrosshairPinned;\n}\n\n/*\n * Find closest timestamp to logical x coordinate returned from echartsInstance.convertFromPixel\n * Used to find nearby series in time series tooltip.\n */\nexport function getClosestTimestamp(timeSeriesValues?: TimeSeriesValueTuple[], cursorX?: number): number | null {\n if (timeSeriesValues === undefined || cursorX === undefined) {\n return null;\n }\n\n let currentClosestTimestamp: number | null = null;\n let currentClosestDistance = Infinity;\n\n for (const [timestamp] of timeSeriesValues) {\n const distance = Math.abs(timestamp - cursorX);\n if (distance < currentClosestDistance) {\n currentClosestTimestamp = timestamp;\n currentClosestDistance = distance;\n }\n }\n return currentClosestTimestamp;\n}\n\n/*\n * Find closest timestamp in full dataset, used to snap crosshair into place onClick when tooltip is pinned.\n */\nexport function getClosestTimestampInFullDataset(data: TimeSeries[], cursorX?: number): number | null {\n if (cursorX === undefined) {\n return null;\n }\n const totalSeries = data.length;\n let closestTimestamp = null;\n for (let seriesIdx = 0; seriesIdx < totalSeries; seriesIdx++) {\n const currentDataset = totalSeries > 0 ? data[seriesIdx] : null;\n if (!currentDataset) break;\n const currentValues: TimeSeriesValueTuple[] = currentDataset.values;\n closestTimestamp = getClosestTimestamp(currentValues, cursorX);\n }\n return closestTimestamp;\n}\n"],"names":["PINNED_CROSSHAIR_SERIES_NAME","enableDataZoom","chart","chartModel","undefined","option","toolbox","length","feature","dataZoom","iconStatus","zoom","dispatchAction","type","key","dataZoomSelectActive","restoreChart","clearHighlightedSeries","getPointInGrid","cursorCoordX","cursorCoordY","pointInPixel","containPixel","pointInGrid","convertFromPixel","batchDispatchNearbySeriesActions","nearbySeriesIndexes","emphasizedSeriesIndexes","nonEmphasizedSeriesIndexes","emphasizedDatapoints","duplicateDatapoints","lastEmphasizedDatapoint","seriesIndex","dataIndex","escapeConnect","notBlur","checkCrosshairPinnedStatus","seriesMapping","isCrosshairPinned","name","getClosestTimestamp","timeSeriesValues","cursorX","currentClosestTimestamp","currentClosestDistance","Infinity","timestamp","distance","Math","abs","getClosestTimestampInFullDataset","data","totalSeries","closestTimestamp","seriesIdx","currentDataset","currentValues","values"],"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;AAIjC,SAAwBA,4BAA4B,QAAgC,WAAW;AAO/F;;;CAGC,GACD,OAAO,SAASC,eAAeC,KAAsB;IACnD,MAAMC,aAAaD,KAAK,CAAC,SAAS;IAClC,IAAIC,eAAeC,WAAW;IAC9B,IAAID,WAAWE,MAAM,CAACC,OAAO,KAAKF,aAAaD,WAAWE,MAAM,CAACC,OAAO,CAACC,MAAM,GAAG,GAAG;QACnF,wGAAwG;QACxG,IAAIJ,WAAWE,MAAM,CAACC,OAAO,CAAC,EAAE,CAACE,OAAO,CAACC,QAAQ,CAACC,UAAU,CAACC,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B,IAAI8C,mBAAmB;IACvB,IAAK,IAAIC,YAAY,GAAGA,YAAYF,aAAaE,YAAa;QAC5D,MAAMC,iBAAiBH,cAAc,IAAID,IAAI,CAACG,UAAU,GAAG;QAC3D,IAAI,CAACC,gBAAgB;QACrB,MAAMC,gBAAwCD,eAAeE,MAAM;QACnEJ,mBAAmBb,oBAAoBgB,eAAed;IACxD;IACA,OAAOW;AACT"}
1
+ {"version":3,"sources":["../../src/utils/chart-actions.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\nimport type { TimeSeries, TimeSeriesValueTuple } from '@perses-dev/spec';\nimport type { ECharts as EChartsInstance } from 'echarts/core';\n\nimport type { DatapointInfo, TimeChartSeriesMapping } from '../model';\nimport { PINNED_CROSSHAIR_SERIES_NAME } from '../model';\n\nexport interface ZoomEventData {\n start: number;\n end: number;\n}\n\n/**\n * Enable dataZoom without requring user to click toolbox icon.\n * https://stackoverflow.com/questions/57183297/is-there-a-way-to-use-zoom-of-type-select-without-showing-the-toolbar\n */\nexport function enableDataZoom(chart: EChartsInstance): void {\n const chartModel = chart['_model'];\n if (chartModel === undefined) return;\n if (chartModel.option.toolbox !== undefined && chartModel.option.toolbox.length > 0) {\n // check if hidden data zoom icon is unselected (if selected it would be 'emphasis' instead of 'normal')\n if (chartModel.option.toolbox[0].feature.dataZoom.iconStatus.zoom === 'normal') {\n chart.dispatchAction({\n type: 'takeGlobalCursor',\n key: 'dataZoomSelect',\n dataZoomSelectActive: true,\n });\n }\n }\n}\n\n/**\n * Restore chart to original state before zoom or other actions were dispatched\n */\nexport function restoreChart(chart: EChartsInstance): void {\n // TODO: support incremental unzoom instead of restore to original state\n chart.dispatchAction({\n type: 'restore', // https://echarts.apache.org/en/api.html#events.restore\n });\n}\n\n/*\n * Clear all highlighted series when cursor exits canvas\n * https://echarts.apache.org/en/api.html#action.downplay\n */\nexport function clearHighlightedSeries(chart: EChartsInstance): void {\n if (chart.dispatchAction !== undefined) {\n // Clear any selected data points\n chart.dispatchAction({\n type: 'unselect',\n });\n\n // Clear any highlighted series\n chart.dispatchAction({\n type: 'downplay',\n });\n }\n}\n\n/*\n * Convert a point from pixel coordinate to logical coordinate.\n * Used to determine if cursor is over chart canvas and closest datapoint.\n * https://echarts.apache.org/en/api.html#echartsInstance.convertFromPixel\n */\nexport function getPointInGrid(cursorCoordX: number, cursorCoordY: number, chart?: EChartsInstance): number[] | null {\n if (chart === undefined) {\n return null;\n }\n\n const pointInPixel = [cursorCoordX, cursorCoordY];\n if (!chart.containPixel('grid', pointInPixel)) {\n return null;\n }\n\n const pointInGrid: number[] = chart.convertFromPixel('grid', pointInPixel);\n return pointInGrid;\n}\n\n/*\n * TimeSeriesChart tooltip is built custom to support finding nearby series instead of single or all series.\n * This means ECharts actions need to be dispatched manually for series highlighting, datapoint select state, etc.\n * More info: https://echarts.apache.org/en/api.html#action\n */\nexport function batchDispatchNearbySeriesActions(\n chart: EChartsInstance,\n nearbySeriesIndexes: number[],\n emphasizedSeriesIndexes: number[],\n nonEmphasizedSeriesIndexes: number[],\n emphasizedDatapoints: DatapointInfo[],\n duplicateDatapoints: DatapointInfo[],\n): void {\n // Accounts for multiple series that are rendered direct on top of eachother.\n // Only applies select state to the datapoint that is visible to avoid color mismatch.\n const lastEmphasizedDatapoint =\n duplicateDatapoints.length > 0\n ? duplicateDatapoints[duplicateDatapoints.length - 1]\n : emphasizedDatapoints[emphasizedDatapoints.length - 1];\n if (lastEmphasizedDatapoint !== undefined) {\n // Corresponds to select options inside getTimeSeries util.\n // https://echarts.apache.org/en/option.html#series-line.select.itemStyle\n chart.dispatchAction({\n type: 'select',\n seriesIndex: lastEmphasizedDatapoint.seriesIndex,\n dataIndex: lastEmphasizedDatapoint.dataIndex,\n // Shared crosshair should not emphasize datapoints on adjacent charts.\n escapeConnect: true, // TODO: try to remove escapeConnect and match by seriesName for cross panel correlation\n });\n }\n\n // Blanket downplay clears axis-triggered emphasis (enlarged \"big point\" markers) before\n // re-applying emphasis to only the winner series.\n // https://echarts.apache.org/en/api.html#action.downplay\n chart.dispatchAction({\n type: 'downplay',\n });\n\n // Clears emphasis state of all lines that are not emphasized.\n // Emphasized is a subset of just the nearby series that are closest to cursor.\n if (nonEmphasizedSeriesIndexes.length > 0) {\n chart.dispatchAction({\n type: 'downplay',\n seriesIndex: nonEmphasizedSeriesIndexes,\n });\n }\n\n // https://echarts.apache.org/en/api.html#action.highlight\n if (emphasizedSeriesIndexes.length > 0) {\n // Fadeout opacity of all series not closest to cursor.\n chart.dispatchAction({\n type: 'highlight',\n seriesIndex: emphasizedSeriesIndexes,\n notBlur: false, // ensure blur IS triggered, this is default but setting so it is explicit\n escapeConnect: true, // shared crosshair should not emphasize series on adjacent charts\n });\n } else {\n // When no emphasized series with bold text, notBlur allows opacity fadeout to not trigger.\n chart.dispatchAction({\n type: 'highlight',\n seriesIndex: nearbySeriesIndexes,\n notBlur: true, // do not trigger blur state when cursor is not immediately close to any series\n escapeConnect: true, // shared crosshair should not emphasize series on adjacent charts\n });\n\n // Clears selected datapoints since no bold series in tooltip, restore does not impact highlighting\n chart.dispatchAction({\n type: 'toggleSelect', // https://echarts.apache.org/en/api.html#action.toggleSelect\n });\n }\n}\n\n/*\n * Determine whether a markLine was pushed into the final series, which means crosshair was already pinned onClick\n */\nexport function checkCrosshairPinnedStatus(seriesMapping: TimeChartSeriesMapping): boolean {\n const isCrosshairPinned = seriesMapping[seriesMapping.length - 1]?.name === PINNED_CROSSHAIR_SERIES_NAME;\n return isCrosshairPinned;\n}\n\n/*\n * Find closest timestamp to logical x coordinate returned from echartsInstance.convertFromPixel\n * Used to find nearby series in time series tooltip.\n */\nexport function getClosestTimestamp(timeSeriesValues?: TimeSeriesValueTuple[], cursorX?: number): number | null {\n if (timeSeriesValues === undefined || cursorX === undefined) {\n return null;\n }\n\n let currentClosestTimestamp: number | null = null;\n let currentClosestDistance = Infinity;\n\n for (const [timestamp] of timeSeriesValues) {\n const distance = Math.abs(timestamp - cursorX);\n if (distance < currentClosestDistance) {\n currentClosestTimestamp = timestamp;\n currentClosestDistance = distance;\n }\n }\n return currentClosestTimestamp;\n}\n\n/*\n * Find closest timestamp in full dataset, used to snap crosshair into place onClick when tooltip is pinned.\n */\nexport function getClosestTimestampInFullDataset(data: TimeSeries[], cursorX?: number): number | null {\n if (cursorX === undefined) {\n return null;\n }\n const totalSeries = data.length;\n let closestTimestamp = null;\n for (let seriesIdx = 0; seriesIdx < totalSeries; seriesIdx++) {\n const currentDataset = totalSeries > 0 ? data[seriesIdx] : null;\n if (!currentDataset) break;\n const currentValues: TimeSeriesValueTuple[] = currentDataset.values;\n closestTimestamp = getClosestTimestamp(currentValues, cursorX);\n }\n return closestTimestamp;\n}\n"],"names":["PINNED_CROSSHAIR_SERIES_NAME","enableDataZoom","chart","chartModel","undefined","option","toolbox","length","feature","dataZoom","iconStatus","zoom","dispatchAction","type","key","dataZoomSelectActive","restoreChart","clearHighlightedSeries","getPointInGrid","cursorCoordX","cursorCoordY","pointInPixel","containPixel","pointInGrid","convertFromPixel","batchDispatchNearbySeriesActions","nearbySeriesIndexes","emphasizedSeriesIndexes","nonEmphasizedSeriesIndexes","emphasizedDatapoints","duplicateDatapoints","lastEmphasizedDatapoint","seriesIndex","dataIndex","escapeConnect","notBlur","checkCrosshairPinnedStatus","seriesMapping","isCrosshairPinned","name","getClosestTimestamp","timeSeriesValues","cursorX","currentClosestTimestamp","currentClosestDistance","Infinity","timestamp","distance","Math","abs","getClosestTimestampInFullDataset","data","totalSeries","closestTimestamp","seriesIdx","currentDataset","currentValues","values"],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE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;CAGC,GACD,OAAO,SAASE,oBAAoBC,gBAAyC,EAAEC,OAAgB;IAC7F,IAAID,qBAAqBrC,aAAasC,YAAYtC,WAAW;QAC3D,OAAO;IACT;IAEA,IAAIuC,0BAAyC;IAC7C,IAAIC,yBAAyBC;IAE7B,KAAK,MAAM,CAACC,UAAU,IAAIL,iBAAkB;QAC1C,MAAMM,WAAWC,KAAKC,GAAG,CAACH,YAAYJ;QACtC,IAAIK,WAAWH,wBAAwB;YACrCD,0BAA0BG;YAC1BF,yBAAyBG;QAC3B;IACF;IACA,OAAOJ;AACT;AAEA;;CAEC,GACD,OAAO,SAASO,iCAAiCC,IAAkB,EAAET,OAAgB;IACnF,IAAIA,YAAYtC,WAAW;QACzB,OAAO;IACT;IACA,MAAMgD,cAAcD,KAAK5C,MAAM;IAC/B,IAAI8C,mBAAmB;IACvB,IAAK,IAAIC,YAAY,GAAGA,YAAYF,aAAaE,YAAa;QAC5D,MAAMC,iBAAiBH,cAAc,IAAID,IAAI,CAACG,UAAU,GAAG;QAC3D,IAAI,CAACC,gBAAgB;QACrB,MAAMC,gBAAwCD,eAAeE,MAAM;QACnEJ,mBAAmBb,oBAAoBgB,eAAed;IACxD;IACA,OAAOW;AACT"}
@@ -1,4 +1,4 @@
1
- import { SxProps, Theme } from '@mui/material';
1
+ import type { SxProps, Theme } from '@mui/material';
2
2
  /**
3
3
  * Combines sx props from multiple sources. Useful when creating a component and
4
4
  * you want consumers to be able to provide SxProps that should be combined with
@@ -1 +1 @@
1
- {"version":3,"file":"combine-sx.d.ts","sourceRoot":"","sources":["../../src/utils/combine-sx.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAE/C;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAMvF"}
1
+ {"version":3,"file":"combine-sx.d.ts","sourceRoot":"","sources":["../../src/utils/combine-sx.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEpD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,SAAS,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAMvF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/combine-sx.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\nimport { SxProps, Theme } from '@mui/material';\n\n/**\n * Combines sx props from multiple sources. Useful when creating a component and\n * you want consumers to be able to provide SxProps that should be combined with\n * some built-in styles.\n */\nexport function combineSx(...sxProps: Array<SxProps<Theme> | undefined>): SxProps<Theme> {\n return sxProps.flatMap((sx) => {\n if (sx === undefined) return [];\n if (Array.isArray(sx)) return sx;\n return [sx];\n });\n}\n"],"names":["combineSx","sxProps","flatMap","sx","undefined","Array","isArray"],"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;AAIjC;;;;CAIC,GACD,OAAO,SAASA,UAAU,GAAGC,OAA0C;IACrE,OAAOA,QAAQC,OAAO,CAAC,CAACC;QACtB,IAAIA,OAAOC,WAAW,OAAO,EAAE;QAC/B,IAAIC,MAAMC,OAAO,CAACH,KAAK,OAAOA;QAC9B,OAAO;YAACA;SAAG;IACb;AACF"}
1
+ {"version":3,"sources":["../../src/utils/combine-sx.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\nimport type { SxProps, Theme } from '@mui/material';\n\n/**\n * Combines sx props from multiple sources. Useful when creating a component and\n * you want consumers to be able to provide SxProps that should be combined with\n * some built-in styles.\n */\nexport function combineSx(...sxProps: Array<SxProps<Theme> | undefined>): SxProps<Theme> {\n return sxProps.flatMap((sx) => {\n if (sx === undefined) return [];\n if (Array.isArray(sx)) return sx;\n return [sx];\n });\n}\n"],"names":["combineSx","sxProps","flatMap","sx","undefined","Array","isArray"],"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;AAIjC;;;;CAIC,GACD,OAAO,SAASA,UAAU,GAAGC,OAA0C;IACrE,OAAOA,QAAQC,OAAO,CAAC,CAACC;QACtB,IAAIA,OAAOC,WAAW,OAAO,EAAE;QAC/B,IAAIC,MAAMC,OAAO,CAACH,KAAK,OAAOA;QAC9B,OAAO;YAACA;SAAG;IACb;AACF"}
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { useRef } from 'react';
13
+ import { useRef } from "react";
14
14
  /**
15
15
  * Generates a unique (stable) ID for a component. Should be replaced with React.useId once we support only React 18.
16
16
  */ export function useId(prefix) {
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { interpolate, InterpolationFormat } from './variable-interpolation';
13
+ import { interpolate, InterpolationFormat } from "./variable-interpolation.js";
14
14
  // Regex patterns for data field interpolation
15
15
  // Matches: ${__data.fields["fieldName"]} or ${__data.fields['fieldName']} or ${__data.fields.fieldName} with optional format ${__data.fields["fieldName"]:format}
16
16
  const SINGLE_FIELD_REGEX = /\$\{__data\.fields(?:\[(?:"|')([^"']+)(?:"|')\]|\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\}/g;
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/data-field-interpolation.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\nimport { interpolate, InterpolationFormat } from './variable-interpolation';\n\n/**\n * Data item with its fields (used for selection/row data)\n */\nexport type DataItem = Record<string, unknown>;\n\n/**\n * Result of interpolation with data fields\n */\nexport interface InterpolationResult {\n text: string;\n errors?: string[];\n}\n\n/**\n * Options for data field replacement\n */\nexport interface ReplaceDataFieldsOptions {\n /**\n * Whether to URL encode values. Defaults to true.\n */\n urlEncode?: boolean;\n /**\n * Current index (0-based) for ${__data.index} replacement.\n */\n index?: number;\n /**\n * Total count for ${__data.count} replacement.\n */\n count?: number;\n}\n\n// Regex patterns for data field interpolation\n// Matches: ${__data.fields[\"fieldName\"]} or ${__data.fields['fieldName']} or ${__data.fields.fieldName} with optional format ${__data.fields[\"fieldName\"]:format}\nconst SINGLE_FIELD_REGEX =\n /\\$\\{__data\\.fields(?:\\[(?:\"|')([^\"']+)(?:\"|')\\]|\\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\\}/g;\n\n// Matches: ${__data[0].fields[\"fieldName\"]} or ${__data[0].fields['fieldName']} for indexed access\nconst INDEXED_FIELD_REGEX = /\\$\\{__data\\[(\\d+)\\]\\.fields\\[(?:\"|')([^\"']+)(?:\"|')\\]\\}/g;\n\n// Matches: ${__data.index}\nconst DATA_INDEX_REGEX = /\\$\\{__data\\.index\\}/g;\n\n// Matches: ${__data.count}\nconst DATA_COUNT_REGEX = /\\$\\{__data\\.count\\}/g;\n\n// Matches: ${__data} or ${__data:format} or '${__data:format}' or \"${__data:format}\"\nconst FULL_DATA_REGEX = /(\"|')?\\$\\{__data(?::([a-z]+))?\\}(\"|')?/g;\n\n/**\n * Get field value from a data item, converting to string.\n * Supports nested field access using dot notation in field names (e.g., \"foo.bar\" accesses item.foo.bar).\n * For backward compatibility, first checks if the exact key exists before attempting nested access.\n */\nfunction getFieldValue(item: DataItem, fieldName: string): string {\n // First, try direct property access (for backward compatibility with literal dot keys)\n if (Object.prototype.hasOwnProperty.call(item, fieldName)) {\n const value = item[fieldName];\n if (value === undefined || value === null) {\n return '';\n }\n if (typeof value === 'object') {\n return JSON.stringify(value);\n }\n return String(value);\n }\n\n // If not found and contains dots, try nested access\n if (fieldName.includes('.')) {\n const parts = fieldName.split('.');\n let current: unknown = item;\n\n for (const part of parts) {\n if (current === null || current === undefined) {\n return '';\n }\n if (typeof current !== 'object') {\n return '';\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n if (current === undefined || current === null) {\n return '';\n }\n if (typeof current === 'object') {\n return JSON.stringify(current);\n }\n return String(current);\n }\n\n // Field not found\n return '';\n}\n\n/**\n * Parse format string to InterpolationFormat enum\n */\nexport function parseFormat(format: string | undefined): InterpolationFormat | undefined {\n if (!format) return undefined;\n const lowerFormat = format.toLowerCase();\n return Object.values(InterpolationFormat).find((f) => f === lowerFormat);\n}\n\n/**\n * Replace data field placeholders in a template string with values from a single data item.\n *\n * Supports:\n * - ${__data.fields[\"fieldName\"]} - field value from the item (URL encoded by default)\n * - ${__data.fields[\"fieldName\"]:format} - field value with format specifier\n * - ${__data.index} - current index (0-based) if provided in options\n * - ${__data.count} - total count if provided in options\n * - ${__data} - full data array\n * - ${__data:format} - full data array with format specifier\n *\n * @param template - The template string with placeholders\n * @param item - The data item containing field values\n * @param options - Optional configuration for replacement behavior\n * @returns InterpolationResult with the interpolated text and any errors\n */\nexport function replaceDataFields(\n template: string,\n item: DataItem,\n options: ReplaceDataFieldsOptions = {}\n): InterpolationResult {\n const { urlEncode = true, index, count } = options;\n let result = template;\n const errors: string[] = [];\n\n // Replace ${__data.index} if provided\n if (index !== undefined) {\n result = result.replaceAll(DATA_INDEX_REGEX, String(index));\n }\n\n // Replace ${__data.count} if provided\n if (count !== undefined) {\n result = result.replaceAll(DATA_COUNT_REGEX, String(count));\n }\n\n // Replace full data placeholder with optional format: ${__data} or ${__data:format}\n result = result.replaceAll(\n FULL_DATA_REGEX,\n (_match, _leadingQuote: string | undefined, format: string | undefined, _trailingQuote: string | undefined) => {\n const interpolationFormat = parseFormat(format) ?? InterpolationFormat.RAW;\n let interpolationResult: string = '';\n\n if (interpolationFormat === InterpolationFormat.JSON) {\n interpolationResult = JSON.stringify(item);\n } else {\n interpolationResult = interpolate(\n Object.values(item).map((v) => JSON.stringify(v)),\n '',\n interpolationFormat\n );\n }\n\n return interpolationResult;\n }\n );\n\n // Reset regex lastIndex\n SINGLE_FIELD_REGEX.lastIndex = 0;\n\n // Replace __data.fields[\"fieldName\"] or __data.fields.fieldName patterns\n result = result.replaceAll(\n SINGLE_FIELD_REGEX,\n (_match, bracketField: string | undefined, dotField: string | undefined, format: string | undefined) => {\n const fieldName = bracketField ?? dotField ?? '';\n const value = getFieldValue(item, fieldName);\n if (value === '' && item[fieldName] === undefined) {\n errors.push(`Field \"${fieldName}\" not found in data`);\n }\n const interpolationFormat = parseFormat(format);\n if (interpolationFormat) {\n return interpolate([value], fieldName, interpolationFormat);\n }\n\n if (urlEncode) {\n // override: disable urlEncode for RAW format\n if (interpolationFormat === InterpolationFormat.RAW) {\n return value;\n }\n\n // avoid double encoding for queryparam and percentencode formats\n if (\n interpolationFormat !== InterpolationFormat.QUERYPARAM &&\n interpolationFormat !== InterpolationFormat.PERCENTENCODE\n ) {\n return encodeURIComponent(value);\n }\n }\n\n return value;\n }\n );\n\n return { text: result, errors: errors.length > 0 ? errors : undefined };\n}\n\n/**\n * Replace data field placeholders in a template string with values from multiple data items (batch mode).\n *\n * Supports:\n * - ${__data[0].fields[\"fieldName\"]} - field value from specific item by index\n * - ${__data.fields[\"fieldName\"]} - aggregated field values (defaults to CSV format)\n * - ${__data.fields[\"fieldName\"]:csv} - aggregated field values with format specifier\n * - ${__data.count} - total number of items\n * - ${__data} - full data array\n * - ${__data:format} - full data array with format specifier\n *\n * @param template - The template string with placeholders\n * @param items - Array of data items containing field values\n * @param options - Optional configuration for replacement behavior\n * @returns InterpolationResult with the interpolated text and any errors\n */\nexport function replaceDataFieldsBatch(\n template: string,\n items: DataItem[],\n options: ReplaceDataFieldsOptions = {}\n): InterpolationResult {\n const { urlEncode = true } = options;\n let result = template;\n const errors: string[] = [];\n\n // Replace __data.count with items length\n result = result.replaceAll(DATA_COUNT_REGEX, String(items.length));\n\n // Reset regex lastIndex\n INDEXED_FIELD_REGEX.lastIndex = 0;\n SINGLE_FIELD_REGEX.lastIndex = 0;\n\n // Replace full data placeholder with optional format\n result = result.replaceAll(\n FULL_DATA_REGEX,\n (_match, leadingQuote: string | undefined, format: string | undefined, trailingQuote: string | undefined) => {\n const interpolationFormat = parseFormat(format) ?? InterpolationFormat.RAW;\n\n const interpolationResult = interpolate(\n Object.values(items).map((e) => JSON.stringify(e)),\n '',\n interpolationFormat\n );\n\n if (!leadingQuote || !trailingQuote) {\n // preserve quotes as they were not surrounding the full_data pattern\n return `${leadingQuote ?? ''}${interpolationResult}${trailingQuote ?? ''}`;\n }\n\n return interpolationResult;\n }\n );\n\n // Replace indexed access: ${__data[0].fields[\"fieldName\"]} or ${__data[0].fields['fieldName']}\n result = result.replaceAll(INDEXED_FIELD_REGEX, (match, indexStr: string, fieldName: string) => {\n const idx = parseInt(indexStr, 10);\n if (idx < 0 || idx >= items.length) {\n errors.push(`Index ${idx} out of bounds (0-${items.length - 1})`);\n return match;\n }\n const value = getFieldValue(items[idx]!, fieldName);\n if (value === '' && items[idx]![fieldName] === undefined) {\n errors.push(`Field \"${fieldName}\" not found in data at index ${idx}`);\n }\n return urlEncode ? encodeURIComponent(value) : value;\n });\n\n // Replace aggregated access with format: ${__data.fields[\"fieldName\"]:csv} or ${__data.fields.fieldName:csv}\n result = result.replaceAll(\n SINGLE_FIELD_REGEX,\n (_match, bracketField: string | undefined, dotField: string | undefined, format: string | undefined) => {\n const fieldName = bracketField ?? dotField ?? '';\n const values = items.map((item) => getFieldValue(item, fieldName));\n const interpolationFormat = parseFormat(format) || InterpolationFormat.CSV;\n return interpolate(values, fieldName, interpolationFormat);\n }\n );\n\n return { text: result, errors: errors.length > 0 ? errors : undefined };\n}\n\n/**\n * Check if a template contains batch-only patterns (indexed access or format specifiers)\n */\nexport function hasBatchPatterns(template: string): boolean {\n // Reset regex lastIndex\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return (\n INDEXED_FIELD_REGEX.test(template) ||\n /\\$\\{__data\\.fields(?:\\[[\"'][^\"']+[\"']\\]|\\.[a-zA-Z_][a-zA-Z0-9_]*):[a-z]+\\}/.test(template)\n );\n}\n\n/**\n * Check if a template contains indexed access patterns\n */\nexport function hasIndexedPatterns(template: string): boolean {\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return INDEXED_FIELD_REGEX.test(template);\n}\n\n/**\n * Check if a template contains data field patterns\n */\nexport function hasDataFieldPatterns(template: string): boolean {\n SINGLE_FIELD_REGEX.lastIndex = 0;\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return SINGLE_FIELD_REGEX.test(template) || INDEXED_FIELD_REGEX.test(template);\n}\n\n/**\n * Extract all field names referenced in a template\n */\nexport function extractFieldNames(template: string): string[] {\n const fields = new Set<string>();\n\n // Reset regex lastIndex\n SINGLE_FIELD_REGEX.lastIndex = 0;\n INDEXED_FIELD_REGEX.lastIndex = 0;\n\n let match;\n while ((match = SINGLE_FIELD_REGEX.exec(template)) !== null) {\n // Group 1 is bracket notation, group 2 is dot notation\n fields.add(match[1] ?? match[2]!);\n }\n while ((match = INDEXED_FIELD_REGEX.exec(template)) !== null) {\n fields.add(match[2]!);\n }\n\n return Array.from(fields);\n}\n"],"names":["interpolate","InterpolationFormat","SINGLE_FIELD_REGEX","INDEXED_FIELD_REGEX","DATA_INDEX_REGEX","DATA_COUNT_REGEX","FULL_DATA_REGEX","getFieldValue","item","fieldName","Object","prototype","hasOwnProperty","call","value","undefined","JSON","stringify","String","includes","parts","split","current","part","parseFormat","format","lowerFormat","toLowerCase","values","find","f","replaceDataFields","template","options","urlEncode","index","count","result","errors","replaceAll","_match","_leadingQuote","_trailingQuote","interpolationFormat","RAW","interpolationResult","map","v","lastIndex","bracketField","dotField","push","QUERYPARAM","PERCENTENCODE","encodeURIComponent","text","length","replaceDataFieldsBatch","items","leadingQuote","trailingQuote","e","match","indexStr","idx","parseInt","CSV","hasBatchPatterns","test","hasIndexedPatterns","hasDataFieldPatterns","extractFieldNames","fields","Set","exec","add","Array","from"],"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,WAAW,EAAEC,mBAAmB,QAAQ,2BAA2B;AAiC5E,8CAA8C;AAC9C,kKAAkK;AAClK,MAAMC,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ChC,OAAO9C,mBAAmBkE,IAAI,CAACpC,aAAa7B,oBAAoBiE,IAAI,CAACpC;AACvE;AAEA;;CAEC,GACD,OAAO,SAASuC,kBAAkBvC,QAAgB;IAChD,MAAMwC,SAAS,IAAIC;IAEnB,wBAAwB;IACxBvE,mBAAmB8C,SAAS,GAAG;IAC/B7C,oBAAoB6C,SAAS,GAAG;IAEhC,IAAIc;IACJ,MAAO,AAACA,CAAAA,QAAQ5D,mBAAmBwE,IAAI,CAAC1C,SAAQ,MAAO,KAAM;QAC3D,uDAAuD;QACvDwC,OAAOG,GAAG,CAACb,KAAK,CAAC,EAAE,IAAIA,KAAK,CAAC,EAAE;IACjC;IACA,MAAO,AAACA,CAAAA,QAAQ3D,oBAAoBuE,IAAI,CAAC1C,SAAQ,MAAO,KAAM;QAC5DwC,OAAOG,GAAG,CAACb,KAAK,CAAC,EAAE;IACrB;IAEA,OAAOc,MAAMC,IAAI,CAACL;AACpB"}
1
+ {"version":3,"sources":["../../src/utils/data-field-interpolation.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\nimport { interpolate, InterpolationFormat } from './variable-interpolation';\n\n/**\n * Data item with its fields (used for selection/row data)\n */\nexport type DataItem = Record<string, unknown>;\n\n/**\n * Result of interpolation with data fields\n */\nexport interface InterpolationResult {\n text: string;\n errors?: string[];\n}\n\n/**\n * Options for data field replacement\n */\nexport interface ReplaceDataFieldsOptions {\n /**\n * Whether to URL encode values. Defaults to true.\n */\n urlEncode?: boolean;\n /**\n * Current index (0-based) for ${__data.index} replacement.\n */\n index?: number;\n /**\n * Total count for ${__data.count} replacement.\n */\n count?: number;\n}\n\n// Regex patterns for data field interpolation\n// Matches: ${__data.fields[\"fieldName\"]} or ${__data.fields['fieldName']} or ${__data.fields.fieldName} with optional format ${__data.fields[\"fieldName\"]:format}\nconst SINGLE_FIELD_REGEX =\n /\\$\\{__data\\.fields(?:\\[(?:\"|')([^\"']+)(?:\"|')\\]|\\.([a-zA-Z_][a-zA-Z0-9_]*))(?::([a-z]+))?\\}/g;\n\n// Matches: ${__data[0].fields[\"fieldName\"]} or ${__data[0].fields['fieldName']} for indexed access\nconst INDEXED_FIELD_REGEX = /\\$\\{__data\\[(\\d+)\\]\\.fields\\[(?:\"|')([^\"']+)(?:\"|')\\]\\}/g;\n\n// Matches: ${__data.index}\nconst DATA_INDEX_REGEX = /\\$\\{__data\\.index\\}/g;\n\n// Matches: ${__data.count}\nconst DATA_COUNT_REGEX = /\\$\\{__data\\.count\\}/g;\n\n// Matches: ${__data} or ${__data:format} or '${__data:format}' or \"${__data:format}\"\nconst FULL_DATA_REGEX = /(\"|')?\\$\\{__data(?::([a-z]+))?\\}(\"|')?/g;\n\n/**\n * Get field value from a data item, converting to string.\n * Supports nested field access using dot notation in field names (e.g., \"foo.bar\" accesses item.foo.bar).\n * For backward compatibility, first checks if the exact key exists before attempting nested access.\n */\nfunction getFieldValue(item: DataItem, fieldName: string): string {\n // First, try direct property access (for backward compatibility with literal dot keys)\n if (Object.prototype.hasOwnProperty.call(item, fieldName)) {\n const value = item[fieldName];\n if (value === undefined || value === null) {\n return '';\n }\n if (typeof value === 'object') {\n return JSON.stringify(value);\n }\n return String(value);\n }\n\n // If not found and contains dots, try nested access\n if (fieldName.includes('.')) {\n const parts = fieldName.split('.');\n let current: unknown = item;\n\n for (const part of parts) {\n if (current === null || current === undefined) {\n return '';\n }\n if (typeof current !== 'object') {\n return '';\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n if (current === undefined || current === null) {\n return '';\n }\n if (typeof current === 'object') {\n return JSON.stringify(current);\n }\n return String(current);\n }\n\n // Field not found\n return '';\n}\n\n/**\n * Parse format string to InterpolationFormat enum\n */\nexport function parseFormat(format: string | undefined): InterpolationFormat | undefined {\n if (!format) return undefined;\n const lowerFormat = format.toLowerCase();\n return Object.values(InterpolationFormat).find((f) => f === lowerFormat);\n}\n\n/**\n * Replace data field placeholders in a template string with values from a single data item.\n *\n * Supports:\n * - ${__data.fields[\"fieldName\"]} - field value from the item (URL encoded by default)\n * - ${__data.fields[\"fieldName\"]:format} - field value with format specifier\n * - ${__data.index} - current index (0-based) if provided in options\n * - ${__data.count} - total count if provided in options\n * - ${__data} - full data array\n * - ${__data:format} - full data array with format specifier\n *\n * @param template - The template string with placeholders\n * @param item - The data item containing field values\n * @param options - Optional configuration for replacement behavior\n * @returns InterpolationResult with the interpolated text and any errors\n */\nexport function replaceDataFields(\n template: string,\n item: DataItem,\n options: ReplaceDataFieldsOptions = {},\n): InterpolationResult {\n const { urlEncode = true, index, count } = options;\n let result = template;\n const errors: string[] = [];\n\n // Replace ${__data.index} if provided\n if (index !== undefined) {\n result = result.replaceAll(DATA_INDEX_REGEX, String(index));\n }\n\n // Replace ${__data.count} if provided\n if (count !== undefined) {\n result = result.replaceAll(DATA_COUNT_REGEX, String(count));\n }\n\n // Replace full data placeholder with optional format: ${__data} or ${__data:format}\n result = result.replaceAll(\n FULL_DATA_REGEX,\n (_match, _leadingQuote: string | undefined, format: string | undefined, _trailingQuote: string | undefined) => {\n const interpolationFormat = parseFormat(format) ?? InterpolationFormat.RAW;\n let interpolationResult: string = '';\n\n if (interpolationFormat === InterpolationFormat.JSON) {\n interpolationResult = JSON.stringify(item);\n } else {\n interpolationResult = interpolate(\n Object.values(item).map((v) => JSON.stringify(v)),\n '',\n interpolationFormat,\n );\n }\n\n return interpolationResult;\n },\n );\n\n // Reset regex lastIndex\n SINGLE_FIELD_REGEX.lastIndex = 0;\n\n // Replace __data.fields[\"fieldName\"] or __data.fields.fieldName patterns\n result = result.replaceAll(\n SINGLE_FIELD_REGEX,\n (_match, bracketField: string | undefined, dotField: string | undefined, format: string | undefined) => {\n const fieldName = bracketField ?? dotField ?? '';\n const value = getFieldValue(item, fieldName);\n if (value === '' && item[fieldName] === undefined) {\n errors.push(`Field \"${fieldName}\" not found in data`);\n }\n const interpolationFormat = parseFormat(format);\n if (interpolationFormat) {\n return interpolate([value], fieldName, interpolationFormat);\n }\n\n if (urlEncode) {\n // override: disable urlEncode for RAW format\n if (interpolationFormat === InterpolationFormat.RAW) {\n return value;\n }\n\n // avoid double encoding for queryparam and percentencode formats\n if (\n interpolationFormat !== InterpolationFormat.QUERYPARAM &&\n interpolationFormat !== InterpolationFormat.PERCENTENCODE\n ) {\n return encodeURIComponent(value);\n }\n }\n\n return value;\n },\n );\n\n return { text: result, errors: errors.length > 0 ? errors : undefined };\n}\n\n/**\n * Replace data field placeholders in a template string with values from multiple data items (batch mode).\n *\n * Supports:\n * - ${__data[0].fields[\"fieldName\"]} - field value from specific item by index\n * - ${__data.fields[\"fieldName\"]} - aggregated field values (defaults to CSV format)\n * - ${__data.fields[\"fieldName\"]:csv} - aggregated field values with format specifier\n * - ${__data.count} - total number of items\n * - ${__data} - full data array\n * - ${__data:format} - full data array with format specifier\n *\n * @param template - The template string with placeholders\n * @param items - Array of data items containing field values\n * @param options - Optional configuration for replacement behavior\n * @returns InterpolationResult with the interpolated text and any errors\n */\nexport function replaceDataFieldsBatch(\n template: string,\n items: DataItem[],\n options: ReplaceDataFieldsOptions = {},\n): InterpolationResult {\n const { urlEncode = true } = options;\n let result = template;\n const errors: string[] = [];\n\n // Replace __data.count with items length\n result = result.replaceAll(DATA_COUNT_REGEX, String(items.length));\n\n // Reset regex lastIndex\n INDEXED_FIELD_REGEX.lastIndex = 0;\n SINGLE_FIELD_REGEX.lastIndex = 0;\n\n // Replace full data placeholder with optional format\n result = result.replaceAll(\n FULL_DATA_REGEX,\n (_match, leadingQuote: string | undefined, format: string | undefined, trailingQuote: string | undefined) => {\n const interpolationFormat = parseFormat(format) ?? InterpolationFormat.RAW;\n\n const interpolationResult = interpolate(\n Object.values(items).map((e) => JSON.stringify(e)),\n '',\n interpolationFormat,\n );\n\n if (!leadingQuote || !trailingQuote) {\n // preserve quotes as they were not surrounding the full_data pattern\n return `${leadingQuote ?? ''}${interpolationResult}${trailingQuote ?? ''}`;\n }\n\n return interpolationResult;\n },\n );\n\n // Replace indexed access: ${__data[0].fields[\"fieldName\"]} or ${__data[0].fields['fieldName']}\n result = result.replaceAll(INDEXED_FIELD_REGEX, (match, indexStr: string, fieldName: string) => {\n const idx = parseInt(indexStr, 10);\n if (idx < 0 || idx >= items.length) {\n errors.push(`Index ${idx} out of bounds (0-${items.length - 1})`);\n return match;\n }\n const value = getFieldValue(items[idx]!, fieldName);\n if (value === '' && items[idx]![fieldName] === undefined) {\n errors.push(`Field \"${fieldName}\" not found in data at index ${idx}`);\n }\n return urlEncode ? encodeURIComponent(value) : value;\n });\n\n // Replace aggregated access with format: ${__data.fields[\"fieldName\"]:csv} or ${__data.fields.fieldName:csv}\n result = result.replaceAll(\n SINGLE_FIELD_REGEX,\n (_match, bracketField: string | undefined, dotField: string | undefined, format: string | undefined) => {\n const fieldName = bracketField ?? dotField ?? '';\n const values = items.map((item) => getFieldValue(item, fieldName));\n const interpolationFormat = parseFormat(format) || InterpolationFormat.CSV;\n return interpolate(values, fieldName, interpolationFormat);\n },\n );\n\n return { text: result, errors: errors.length > 0 ? errors : undefined };\n}\n\n/**\n * Check if a template contains batch-only patterns (indexed access or format specifiers)\n */\nexport function hasBatchPatterns(template: string): boolean {\n // Reset regex lastIndex\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return (\n INDEXED_FIELD_REGEX.test(template) ||\n /\\$\\{__data\\.fields(?:\\[[\"'][^\"']+[\"']\\]|\\.[a-zA-Z_][a-zA-Z0-9_]*):[a-z]+\\}/.test(template)\n );\n}\n\n/**\n * Check if a template contains indexed access patterns\n */\nexport function hasIndexedPatterns(template: string): boolean {\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return INDEXED_FIELD_REGEX.test(template);\n}\n\n/**\n * Check if a template contains data field patterns\n */\nexport function hasDataFieldPatterns(template: string): boolean {\n SINGLE_FIELD_REGEX.lastIndex = 0;\n INDEXED_FIELD_REGEX.lastIndex = 0;\n return SINGLE_FIELD_REGEX.test(template) || INDEXED_FIELD_REGEX.test(template);\n}\n\n/**\n * Extract all field names referenced in a template\n */\nexport function extractFieldNames(template: string): string[] {\n const fields = new Set<string>();\n\n // Reset regex lastIndex\n SINGLE_FIELD_REGEX.lastIndex = 0;\n INDEXED_FIELD_REGEX.lastIndex = 0;\n\n let match;\n while ((match = SINGLE_FIELD_REGEX.exec(template)) !== null) {\n // Group 1 is bracket notation, group 2 is dot notation\n fields.add(match[1] ?? match[2]!);\n }\n while ((match = INDEXED_FIELD_REGEX.exec(template)) !== null) {\n fields.add(match[2]!);\n }\n\n return Array.from(fields);\n}\n"],"names":["interpolate","InterpolationFormat","SINGLE_FIELD_REGEX","INDEXED_FIELD_REGEX","DATA_INDEX_REGEX","DATA_COUNT_REGEX","FULL_DATA_REGEX","getFieldValue","item","fieldName","Object","prototype","hasOwnProperty","call","value","undefined","JSON","stringify","String","includes","parts","split","current","part","parseFormat","format","lowerFormat","toLowerCase","values","find","f","replaceDataFields","template","options","urlEncode","index","count","result","errors","replaceAll","_match","_leadingQuote","_trailingQuote","interpolationFormat","RAW","interpolationResult","map","v","lastIndex","bracketField","dotField","push","QUERYPARAM","PERCENTENCODE","encodeURIComponent","text","length","replaceDataFieldsBatch","items","leadingQuote","trailingQuote","e","match","indexStr","idx","parseInt","CSV","hasBatchPatterns","test","hasIndexedPatterns","hasDataFieldPatterns","extractFieldNames","fields","Set","exec","add","Array","from"],"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,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AW,CAAC;CAClB,CA8BJ;AAED,UAAU,iBAAiB;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,YAChB,MAAM,iBACA,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,KACpD,iBASF,CAAC"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAgBA,wBAAgB,6BAA6B,CAC3C,iBAAiB,EAAE,IAAI,CAAC,qBAAqB,EAC7C,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI,CAAC,qBAAqB,CAgB5B;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAY9F;AAED,wBAAgB,YAAY,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CA0BtD;AAGD,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GACjD,MAAM,GACN;IACE,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,wCAAwC,CAAC;IAC/C,GAAG,EAAE,WAAW,CAAC;CAClB,CA8BJ;AAED,UAAU,iBAAiB;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,cAAc,GACzB,SAAS,MAAM,EACf,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,MAAM,KACpD,iBASF,CAAC"}
@@ -10,8 +10,8 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import { tz } from '@date-fns/tz';
14
- import { format } from 'date-fns';
13
+ import { tz } from "@date-fns/tz";
14
+ import { format } from "date-fns";
15
15
  export function dateFormatOptionsWithTimeZone(dateFormatOptions, timeZone) {
16
16
  /*
17
17
  * if timeZone is provided, and is not local|browser,
@@ -44,7 +44,12 @@ export function formatWithTimeZone(date, formatString, timeZone) {
44
44
  }
45
45
  export function getGMTOffset(timeZone) {
46
46
  const lower = timeZone?.toLowerCase();
47
- const resolvedTimeZone = !timeZone || lower === 'local' || lower === 'browser' ? Intl.DateTimeFormat().resolvedOptions().timeZone : lower === 'utc' ? 'UTC' : timeZone;
47
+ let resolvedTimeZone = timeZone;
48
+ if (!timeZone || lower === 'local' || lower === 'browser') {
49
+ resolvedTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
50
+ } else if (lower === 'utc') {
51
+ resolvedTimeZone = 'UTC';
52
+ }
48
53
  try {
49
54
  const formatter = new Intl.DateTimeFormat('en-US', {
50
55
  timeZone: resolvedTimeZone,