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

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 (352) hide show
  1. package/dist/ColorPicker/ColorPicker.d.ts.map +1 -1
  2. package/dist/ColorPicker/ColorPicker.js +2 -2
  3. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  4. package/dist/ColorPicker/OptionsColorPicker.d.ts.map +1 -1
  5. package/dist/ColorPicker/OptionsColorPicker.js +1 -1
  6. package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
  7. package/dist/ContentWithLegend/ContentWithLegend.d.ts.map +1 -1
  8. package/dist/ContentWithLegend/ContentWithLegend.js +2 -2
  9. package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
  10. package/dist/ContentWithLegend/model/content-with-legend-model.d.ts +1 -2
  11. package/dist/ContentWithLegend/model/content-with-legend-model.d.ts.map +1 -1
  12. package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
  13. package/dist/DensitySelector/DensitySelector.d.ts.map +1 -1
  14. package/dist/DensitySelector/DensitySelector.js.map +1 -1
  15. package/dist/Dialog/Dialog.d.ts.map +1 -1
  16. package/dist/Dialog/Dialog.js.map +1 -1
  17. package/dist/Dialog/DiscardChangesConfirmationDialog.d.ts.map +1 -1
  18. package/dist/Dialog/DiscardChangesConfirmationDialog.js.map +1 -1
  19. package/dist/DragAndDrop/DragAndDropList.d.ts.map +1 -1
  20. package/dist/DragAndDrop/DragAndDropList.js +4 -4
  21. package/dist/DragAndDrop/DragAndDropList.js.map +1 -1
  22. package/dist/DragAndDrop/DragButton.d.ts +0 -1
  23. package/dist/DragAndDrop/DragButton.d.ts.map +1 -1
  24. package/dist/DragAndDrop/DragButton.js.map +1 -1
  25. package/dist/Drawer/Drawer.d.ts.map +1 -1
  26. package/dist/Drawer/Drawer.js.map +1 -1
  27. package/dist/EChart/EChart.d.ts +2 -2
  28. package/dist/EChart/EChart.d.ts.map +1 -1
  29. package/dist/EChart/EChart.js +5 -5
  30. package/dist/EChart/EChart.js.map +1 -1
  31. package/dist/EChart/timezone-formatter.d.ts.map +1 -1
  32. package/dist/FontSizeSelector/FontSizeSelector.d.ts.map +1 -1
  33. package/dist/FontSizeSelector/FontSizeSelector.js.map +1 -1
  34. package/dist/FormatControls/FormatControls.d.ts.map +1 -1
  35. package/dist/FormatControls/FormatControls.js +1 -1
  36. package/dist/FormatControls/FormatControls.js.map +1 -1
  37. package/dist/FormatControls/UnitSelector.d.ts.map +1 -1
  38. package/dist/FormatControls/UnitSelector.js +1 -1
  39. package/dist/FormatControls/UnitSelector.js.map +1 -1
  40. package/dist/InfoTooltip/InfoTooltip.d.ts.map +1 -1
  41. package/dist/InfoTooltip/InfoTooltip.js +1 -1
  42. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  43. package/dist/JSONEditor.d.ts +1 -1
  44. package/dist/JSONEditor.d.ts.map +1 -1
  45. package/dist/JSONEditor.js +2 -2
  46. package/dist/JSONEditor.js.map +1 -1
  47. package/dist/Legend/CompactLegend.d.ts +1 -1
  48. package/dist/Legend/CompactLegend.d.ts.map +1 -1
  49. package/dist/Legend/CompactLegend.js +1 -1
  50. package/dist/Legend/CompactLegend.js.map +1 -1
  51. package/dist/Legend/Legend.d.ts +1 -1
  52. package/dist/Legend/Legend.d.ts.map +1 -1
  53. package/dist/Legend/Legend.js +1 -1
  54. package/dist/Legend/Legend.js.map +1 -1
  55. package/dist/Legend/LegendColorBadge.d.ts +0 -1
  56. package/dist/Legend/LegendColorBadge.d.ts.map +1 -1
  57. package/dist/Legend/LegendColorBadge.js +1 -1
  58. package/dist/Legend/LegendColorBadge.js.map +1 -1
  59. package/dist/Legend/ListLegend.d.ts +1 -1
  60. package/dist/Legend/ListLegend.d.ts.map +1 -1
  61. package/dist/Legend/ListLegend.js +5 -4
  62. package/dist/Legend/ListLegend.js.map +1 -1
  63. package/dist/Legend/ListLegendItem.d.ts +1 -1
  64. package/dist/Legend/ListLegendItem.d.ts.map +1 -1
  65. package/dist/Legend/ListLegendItem.js +4 -3
  66. package/dist/Legend/ListLegendItem.js.map +1 -1
  67. package/dist/Legend/TableLegend.d.ts.map +1 -1
  68. package/dist/Legend/TableLegend.js.map +1 -1
  69. package/dist/Legend/legend-model.d.ts.map +1 -1
  70. package/dist/Legend/legend-model.js.map +1 -1
  71. package/dist/LinksEditor/LinkEditorForm.d.ts.map +1 -1
  72. package/dist/LinksEditor/LinkEditorForm.js.map +1 -1
  73. package/dist/ModeSelector/ModeSelector.d.ts.map +1 -1
  74. package/dist/ModeSelector/ModeSelector.js.map +1 -1
  75. package/dist/OptionsEditorLayout/OptionsEditorColumn.d.ts.map +1 -1
  76. package/dist/OptionsEditorLayout/OptionsEditorControl.d.ts.map +1 -1
  77. package/dist/OptionsEditorLayout/OptionsEditorControl.js +2 -2
  78. package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
  79. package/dist/OptionsEditorLayout/OptionsEditorGrid.d.ts.map +1 -1
  80. package/dist/OptionsEditorLayout/OptionsEditorGroup.d.ts.map +1 -1
  81. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.d.ts.map +1 -1
  82. package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
  83. package/dist/RepeatGrid/RepeatGrid.d.ts +15 -0
  84. package/dist/RepeatGrid/RepeatGrid.d.ts.map +1 -0
  85. package/dist/RepeatGrid/RepeatGrid.js +68 -0
  86. package/dist/RepeatGrid/RepeatGrid.js.map +1 -0
  87. package/dist/RepeatGrid/index.d.ts +2 -0
  88. package/dist/RepeatGrid/index.d.ts.map +1 -0
  89. package/dist/RepeatGrid/index.js +15 -0
  90. package/dist/RepeatGrid/index.js.map +1 -0
  91. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  92. package/dist/SortSelector/SortSelector.d.ts.map +1 -1
  93. package/dist/SortSelector/SortSelector.js.map +1 -1
  94. package/dist/SortSelector/SortSelectorButtons.d.ts.map +1 -1
  95. package/dist/SortSelector/SortSelectorButtons.js.map +1 -1
  96. package/dist/Table/InnerTable.d.ts +0 -1
  97. package/dist/Table/InnerTable.d.ts.map +1 -1
  98. package/dist/Table/InnerTable.js.map +1 -1
  99. package/dist/Table/Table.d.ts.map +1 -1
  100. package/dist/Table/Table.js +1 -1
  101. package/dist/Table/Table.js.map +1 -1
  102. package/dist/Table/TableBody.d.ts +0 -1
  103. package/dist/Table/TableBody.d.ts.map +1 -1
  104. package/dist/Table/TableCell.d.ts.map +1 -1
  105. package/dist/Table/TableCell.js.map +1 -1
  106. package/dist/Table/TableCheckbox.d.ts.map +1 -1
  107. package/dist/Table/TableCheckbox.js.map +1 -1
  108. package/dist/Table/TableFoot.d.ts +0 -1
  109. package/dist/Table/TableFoot.d.ts.map +1 -1
  110. package/dist/Table/TableHead.d.ts +0 -1
  111. package/dist/Table/TableHead.d.ts.map +1 -1
  112. package/dist/Table/TableHeaderCell.d.ts +1 -1
  113. package/dist/Table/TableHeaderCell.d.ts.map +1 -1
  114. package/dist/Table/TableHeaderCell.js.map +1 -1
  115. package/dist/Table/TableRow.d.ts +0 -1
  116. package/dist/Table/TableRow.d.ts.map +1 -1
  117. package/dist/Table/TableRow.js.map +1 -1
  118. package/dist/Table/TableToolbar.d.ts.map +1 -1
  119. package/dist/Table/TableToolbar.js +4 -4
  120. package/dist/Table/TableToolbar.js.map +1 -1
  121. package/dist/Table/VirtualizedTable.d.ts +1 -1
  122. package/dist/Table/VirtualizedTable.d.ts.map +1 -1
  123. package/dist/Table/VirtualizedTable.js +8 -8
  124. package/dist/Table/VirtualizedTable.js.map +1 -1
  125. package/dist/Table/VirtualizedTableContainer.d.ts +0 -1
  126. package/dist/Table/VirtualizedTableContainer.d.ts.map +1 -1
  127. package/dist/Table/VirtualizedTableContainer.js.map +1 -1
  128. package/dist/Table/hooks/useFuzzySearch.d.ts +1 -1
  129. package/dist/Table/hooks/useFuzzySearch.d.ts.map +1 -1
  130. package/dist/Table/hooks/useFuzzySearch.js +1 -1
  131. package/dist/Table/hooks/useFuzzySearch.js.map +1 -1
  132. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  133. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts +1 -1
  134. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.d.ts.map +1 -1
  135. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  136. package/dist/Table/model/table-model.d.ts +1 -1
  137. package/dist/Table/model/table-model.d.ts.map +1 -1
  138. package/dist/Table/model/table-model.js.map +1 -1
  139. package/dist/ThresholdsEditor/ThresholdInput.d.ts.map +1 -1
  140. package/dist/ThresholdsEditor/ThresholdInput.js +1 -1
  141. package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
  142. package/dist/ThresholdsEditor/ThresholdsEditor.d.ts.map +1 -1
  143. package/dist/ThresholdsEditor/ThresholdsEditor.js +5 -5
  144. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  145. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts +1 -1
  146. package/dist/TimeRangeSelector/DateTimeRangePicker.d.ts.map +1 -1
  147. package/dist/TimeRangeSelector/DateTimeRangePicker.js +3 -3
  148. package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
  149. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts +1 -1
  150. package/dist/TimeRangeSelector/TimeRangeSelector.d.ts.map +1 -1
  151. package/dist/TimeRangeSelector/TimeRangeSelector.js +1 -1
  152. package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
  153. package/dist/TimeRangeSelector/utils.d.ts.map +1 -1
  154. package/dist/TimeRangeSelector/utils.js +1 -1
  155. package/dist/TimeRangeSelector/utils.js.map +1 -1
  156. package/dist/TimeSeriesTooltip/SeriesInfo.d.ts.map +1 -1
  157. package/dist/TimeSeriesTooltip/SeriesInfo.js +1 -1
  158. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  159. package/dist/TimeSeriesTooltip/SeriesLabelsStack.d.ts.map +1 -1
  160. package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
  161. package/dist/TimeSeriesTooltip/SeriesMarker.d.ts.map +1 -1
  162. package/dist/TimeSeriesTooltip/SeriesMarker.js.map +1 -1
  163. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts +2 -2
  164. package/dist/TimeSeriesTooltip/TimeChartTooltip.d.ts.map +1 -1
  165. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +4 -4
  166. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  167. package/dist/TimeSeriesTooltip/TooltipContent.d.ts.map +1 -1
  168. package/dist/TimeSeriesTooltip/TooltipContent.js +1 -1
  169. package/dist/TimeSeriesTooltip/TooltipContent.js.map +1 -1
  170. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts +0 -1
  171. package/dist/TimeSeriesTooltip/TooltipHeader.d.ts.map +1 -1
  172. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  173. package/dist/TimeSeriesTooltip/nearby-series.d.ts +1 -1
  174. package/dist/TimeSeriesTooltip/nearby-series.d.ts.map +1 -1
  175. package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
  176. package/dist/TimeSeriesTooltip/tooltip-model.d.ts +1 -1
  177. package/dist/TimeSeriesTooltip/tooltip-model.d.ts.map +1 -1
  178. package/dist/TimeSeriesTooltip/tooltip-model.js.map +1 -1
  179. package/dist/TimeSeriesTooltip/utils.d.ts.map +1 -1
  180. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  181. package/dist/TimeZoneSelector.d.ts +1 -1
  182. package/dist/TimeZoneSelector.d.ts.map +1 -1
  183. package/dist/TimeZoneSelector.js +5 -2
  184. package/dist/TimeZoneSelector.js.map +1 -1
  185. package/dist/ToolbarIconButton/ToolbarIconButton.d.ts +0 -1
  186. package/dist/ToolbarIconButton/ToolbarIconButton.d.ts.map +1 -1
  187. package/dist/ToolbarIconButton/ToolbarIconButton.js +1 -1
  188. package/dist/ToolbarIconButton/ToolbarIconButton.js.map +1 -1
  189. package/dist/TransformsEditor/TransformEditor.d.ts.map +1 -1
  190. package/dist/TransformsEditor/TransformEditor.js.map +1 -1
  191. package/dist/TransformsEditor/TransformEditorContainer.d.ts.map +1 -1
  192. package/dist/TransformsEditor/TransformEditorContainer.js +2 -2
  193. package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
  194. package/dist/TransformsEditor/TransformsEditor.d.ts.map +1 -1
  195. package/dist/TransformsEditor/TransformsEditor.js +1 -1
  196. package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
  197. package/dist/ValueMappingEditor/ValueMappingEditor.d.ts.map +1 -1
  198. package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
  199. package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts.map +1 -1
  200. package/dist/ValueMappingEditor/ValueMappingsEditor.js +1 -1
  201. package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -1
  202. package/dist/cjs/ColorPicker/ColorPicker.js +2 -2
  203. package/dist/cjs/ColorPicker/OptionsColorPicker.js +1 -1
  204. package/dist/cjs/ContentWithLegend/ContentWithLegend.js +1 -1
  205. package/dist/cjs/DragAndDrop/DragAndDropList.js +4 -4
  206. package/dist/cjs/EChart/EChart.js +4 -4
  207. package/dist/cjs/FormatControls/FormatControls.js +1 -1
  208. package/dist/cjs/FormatControls/UnitSelector.js +1 -1
  209. package/dist/cjs/JSONEditor.js +2 -2
  210. package/dist/cjs/Legend/CompactLegend.js +1 -1
  211. package/dist/cjs/Legend/Legend.js +1 -1
  212. package/dist/cjs/Legend/LegendColorBadge.js +1 -1
  213. package/dist/cjs/Legend/ListLegend.js +4 -3
  214. package/dist/cjs/Legend/ListLegendItem.js +4 -3
  215. package/dist/cjs/OptionsEditorLayout/OptionsEditorControl.js +2 -2
  216. package/dist/cjs/RepeatGrid/RepeatGrid.js +76 -0
  217. package/dist/cjs/RepeatGrid/index.js +30 -0
  218. package/dist/cjs/Table/Table.js +1 -1
  219. package/dist/cjs/Table/TableToolbar.js +4 -4
  220. package/dist/cjs/Table/VirtualizedTable.js +8 -8
  221. package/dist/cjs/Table/hooks/useFuzzySearch.js +1 -1
  222. package/dist/cjs/ThresholdsEditor/ThresholdInput.js +1 -1
  223. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +5 -5
  224. package/dist/cjs/TimeRangeSelector/DateTimeRangePicker.js +3 -3
  225. package/dist/cjs/TimeRangeSelector/TimeRangeSelector.js +1 -1
  226. package/dist/cjs/TimeRangeSelector/utils.js +1 -1
  227. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +1 -1
  228. package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +4 -4
  229. package/dist/cjs/TimeSeriesTooltip/TooltipContent.js +1 -1
  230. package/dist/cjs/TimeZoneSelector.js +5 -2
  231. package/dist/cjs/ToolbarIconButton/ToolbarIconButton.js +1 -1
  232. package/dist/cjs/TransformsEditor/TransformEditorContainer.js +2 -2
  233. package/dist/cjs/TransformsEditor/TransformsEditor.js +1 -1
  234. package/dist/cjs/ValueMappingEditor/ValueMappingsEditor.js +1 -1
  235. package/dist/cjs/context/SnackbarProvider.js +1 -1
  236. package/dist/cjs/controls/TextField.js +1 -1
  237. package/dist/cjs/index.js +1 -0
  238. package/dist/cjs/model/bits.js +1 -1
  239. package/dist/cjs/model/bytes.js +1 -1
  240. package/dist/cjs/model/currency.js +1 -1
  241. package/dist/cjs/model/throughput.js +2 -2
  242. package/dist/cjs/model/units.js +4 -4
  243. package/dist/cjs/test/render.js +1 -1
  244. package/dist/cjs/test/setup-tests.js +9 -3
  245. package/dist/cjs/theme/palette/palette-options.js +4 -4
  246. package/dist/cjs/utils/format.js +6 -1
  247. package/dist/cjs/utils/memo.js +1 -1
  248. package/dist/cjs/utils/request-interpolation.js +1 -1
  249. package/dist/context/ChartsProvider.d.ts.map +1 -1
  250. package/dist/context/ChartsProvider.js.map +1 -1
  251. package/dist/context/ItemActionsProvider.js.map +1 -1
  252. package/dist/context/SelectionProvider.js.map +1 -1
  253. package/dist/context/SnackbarProvider.d.ts +1 -1
  254. package/dist/context/SnackbarProvider.d.ts.map +1 -1
  255. package/dist/context/SnackbarProvider.js +1 -1
  256. package/dist/context/SnackbarProvider.js.map +1 -1
  257. package/dist/context/TimeZoneProvider.d.ts.map +1 -1
  258. package/dist/context/TimeZoneProvider.js.map +1 -1
  259. package/dist/controls/TextField.d.ts +0 -1
  260. package/dist/controls/TextField.d.ts.map +1 -1
  261. package/dist/controls/TextField.js +1 -1
  262. package/dist/controls/TextField.js.map +1 -1
  263. package/dist/index.d.ts +1 -0
  264. package/dist/index.d.ts.map +1 -1
  265. package/dist/index.js +1 -0
  266. package/dist/index.js.map +1 -1
  267. package/dist/model/bits.d.ts.map +1 -1
  268. package/dist/model/bits.js +1 -1
  269. package/dist/model/bits.js.map +1 -1
  270. package/dist/model/bytes.d.ts.map +1 -1
  271. package/dist/model/bytes.js +1 -1
  272. package/dist/model/bytes.js.map +1 -1
  273. package/dist/model/currency.d.ts.map +1 -1
  274. package/dist/model/currency.js +1 -1
  275. package/dist/model/currency.js.map +1 -1
  276. package/dist/model/formatterCache.js.map +1 -1
  277. package/dist/model/graph.d.ts.map +1 -1
  278. package/dist/model/graph.js.map +1 -1
  279. package/dist/model/temperature.d.ts.map +1 -1
  280. package/dist/model/theme.d.ts.map +1 -1
  281. package/dist/model/theme.js.map +1 -1
  282. package/dist/model/throughput.d.ts.map +1 -1
  283. package/dist/model/throughput.js +2 -2
  284. package/dist/model/throughput.js.map +1 -1
  285. package/dist/model/types.d.ts +1 -1
  286. package/dist/model/types.d.ts.map +1 -1
  287. package/dist/model/types.js.map +1 -1
  288. package/dist/model/units.d.ts +8 -8
  289. package/dist/model/units.d.ts.map +1 -1
  290. package/dist/model/units.js +4 -4
  291. package/dist/model/units.js.map +1 -1
  292. package/dist/test/render.d.ts.map +1 -1
  293. package/dist/test/render.js +1 -1
  294. package/dist/test/render.js.map +1 -1
  295. package/dist/test/setup-tests.d.ts +1 -1
  296. package/dist/test/setup-tests.d.ts.map +1 -1
  297. package/dist/test/setup-tests.js +3 -2
  298. package/dist/test/setup-tests.js.map +1 -1
  299. package/dist/test-utils/theme.d.ts +1 -1
  300. package/dist/test-utils/theme.d.ts.map +1 -1
  301. package/dist/test-utils/theme.js.map +1 -1
  302. package/dist/theme/index.d.ts.map +1 -1
  303. package/dist/theme/index.js.map +1 -1
  304. package/dist/theme/palette/background.d.ts +1 -1
  305. package/dist/theme/palette/background.d.ts.map +1 -1
  306. package/dist/theme/palette/background.js.map +1 -1
  307. package/dist/theme/palette/error.d.ts.map +1 -1
  308. package/dist/theme/palette/error.js.map +1 -1
  309. package/dist/theme/palette/grey.d.ts +1 -1
  310. package/dist/theme/palette/grey.d.ts.map +1 -1
  311. package/dist/theme/palette/grey.js.map +1 -1
  312. package/dist/theme/palette/palette-options.d.ts.map +1 -1
  313. package/dist/theme/palette/palette-options.js +4 -4
  314. package/dist/theme/palette/palette-options.js.map +1 -1
  315. package/dist/theme/palette/primary.d.ts.map +1 -1
  316. package/dist/theme/palette/primary.js.map +1 -1
  317. package/dist/theme/palette/secondary.d.ts.map +1 -1
  318. package/dist/theme/palette/secondary.js.map +1 -1
  319. package/dist/theme/palette/success.d.ts.map +1 -1
  320. package/dist/theme/palette/success.js.map +1 -1
  321. package/dist/theme/palette/text.d.ts +1 -1
  322. package/dist/theme/palette/text.d.ts.map +1 -1
  323. package/dist/theme/palette/text.js.map +1 -1
  324. package/dist/theme/palette/warning.d.ts.map +1 -1
  325. package/dist/theme/palette/warning.js.map +1 -1
  326. package/dist/theme/theme.d.ts.map +1 -1
  327. package/dist/theme/theme.js.map +1 -1
  328. package/dist/utils/axis.d.ts.map +1 -1
  329. package/dist/utils/axis.js.map +1 -1
  330. package/dist/utils/browser-storage.js.map +1 -1
  331. package/dist/utils/chart-actions.d.ts +1 -1
  332. package/dist/utils/chart-actions.d.ts.map +1 -1
  333. package/dist/utils/chart-actions.js.map +1 -1
  334. package/dist/utils/data-field-interpolation.js.map +1 -1
  335. package/dist/utils/format.d.ts.map +1 -1
  336. package/dist/utils/format.js +6 -1
  337. package/dist/utils/format.js.map +1 -1
  338. package/dist/utils/mathjs.d.ts +1 -1
  339. package/dist/utils/memo.d.ts.map +1 -1
  340. package/dist/utils/memo.js +1 -1
  341. package/dist/utils/memo.js.map +1 -1
  342. package/dist/utils/request-interpolation.d.ts.map +1 -1
  343. package/dist/utils/request-interpolation.js +1 -1
  344. package/dist/utils/request-interpolation.js.map +1 -1
  345. package/dist/utils/selection-interpolation.js.map +1 -1
  346. package/dist/utils/theme-gen.d.ts.map +1 -1
  347. package/dist/utils/theme-gen.js.map +1 -1
  348. package/dist/utils/time-series-data.d.ts.map +1 -1
  349. package/dist/utils/time-series-data.js.map +1 -1
  350. package/dist/utils/transform-data.js.map +1 -1
  351. package/dist/utils/variable-interpolation.js.map +1 -1
  352. package/package.json +7 -7
@@ -11,8 +11,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
11
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
- import { forwardRef, memo, useState } from 'react';
15
14
  import { Box, ListItemText, ListItemButton } from '@mui/material';
15
+ import { forwardRef, memo, useState } from 'react';
16
16
  import { combineSx } from '../utils';
17
17
  import { LegendColorBadge } from './LegendColorBadge';
18
18
  const ListLegendItemBase = /*#__PURE__*/ forwardRef(function ListLegendItem({ item, sx, truncateLabel, onClick, isVisuallySelected, onMouseOver, onMouseOut, index, ...others }, ref) {
@@ -31,7 +31,8 @@ const ListLegendItemBase = /*#__PURE__*/ forwardRef(function ListLegendItem({ it
31
31
  onClick(e, item.id);
32
32
  item.onClick?.(e);
33
33
  };
34
- return /*#__PURE__*/ _jsxs(ListItemButton, {
34
+ // ListItemButton must remain the measured and interactive element while exposing its position in the surrounding list.
35
+ /* oxlint-disable jsx-a11y/prefer-tag-over-role */ return /*#__PURE__*/ _jsxs(ListItemButton, {
35
36
  ...others,
36
37
  role: "listitem",
37
38
  sx: combineSx({
@@ -70,7 +71,7 @@ const ListLegendItemBase = /*#__PURE__*/ forwardRef(function ListLegendItem({ it
70
71
  })
71
72
  ]
72
73
  });
73
- });
74
+ /* oxlint-enable jsx-a11y/prefer-tag-over-role */ });
74
75
  export const ListLegendItem = /*#__PURE__*/ memo(ListLegendItemBase);
75
76
 
76
77
  //# sourceMappingURL=ListLegendItem.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Legend/ListLegendItem.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { forwardRef, memo, MouseEvent, MouseEventHandler, ReactElement, useState } from 'react';\nimport { Box, ListItemText, ListItemProps, ListItemButton } from '@mui/material';\nimport { combineSx } from '../utils';\nimport { LegendColorBadge } from './LegendColorBadge';\nimport { LegendItem } from './legend-model';\n\nexport type LegendItemEventOpts = {\n /**\n * Unique identifier for the legend item.\n */\n id: string;\n\n /**\n * Index of the row in the original data.\n */\n index: number;\n};\n\nexport interface ListLegendItemProps extends Omit<ListItemProps<'div'>, 'onClick' | 'onMouseOver' | 'onMouseOut'> {\n item: LegendItem;\n\n index: number;\n\n /**\n * When true, the item is rendered differently to visually communicate it is\n * selected.\n */\n isVisuallySelected?: boolean;\n\n onClick: (e: MouseEvent<HTMLElement>, seriesId: string) => void;\n\n onMouseOver?: (e: MouseEvent, opts: LegendItemEventOpts) => void;\n onMouseOut?: (e: MouseEvent, opts: LegendItemEventOpts) => void;\n\n /**\n * When `true`, will keep labels to a single line with overflow ellipsized. The\n * full content will be shown on hover.\n *\n * When `false` or unset, will show the full label.\n */\n truncateLabel?: boolean;\n}\n\nconst ListLegendItemBase = forwardRef<HTMLDivElement, ListLegendItemProps>(function ListLegendItem(\n { item, sx, truncateLabel, onClick, isVisuallySelected, onMouseOver, onMouseOut, index, ...others },\n ref\n): ReactElement {\n const [noWrap, setNoWrap] = useState(truncateLabel);\n\n function handleTextMouseOver(): void {\n if (truncateLabel) {\n setNoWrap(false);\n }\n }\n\n function handleTextMouseOut(): void {\n if (truncateLabel) {\n setNoWrap(true);\n }\n }\n\n const handleClick: MouseEventHandler<HTMLDivElement> = (e) => {\n onClick(e, item.id);\n item.onClick?.(e);\n };\n\n return (\n <ListItemButton\n {...others}\n role=\"listitem\"\n sx={combineSx(\n {\n padding: 0,\n cursor: 'pointer',\n },\n sx\n )}\n dense={true}\n onClick={handleClick}\n onMouseOver={(e: MouseEvent) => onMouseOver?.(e, { id: item.id, index })}\n onMouseOut={(e: MouseEvent) => onMouseOut?.(e, { id: item.id, index })}\n selected={isVisuallySelected}\n ref={ref}\n >\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n <LegendColorBadge color={item.color} />\n </Box>\n <ListItemText\n primary={item.label}\n primaryTypographyProps={{ noWrap: noWrap }}\n onMouseOver={handleTextMouseOver}\n onMouseOut={handleTextMouseOut}\n ></ListItemText>\n </ListItemButton>\n );\n});\n\nexport const ListLegendItem = memo(ListLegendItemBase);\n"],"names":["forwardRef","memo","useState","Box","ListItemText","ListItemButton","combineSx","LegendColorBadge","ListLegendItemBase","ListLegendItem","item","sx","truncateLabel","onClick","isVisuallySelected","onMouseOver","onMouseOut","index","others","ref","noWrap","setNoWrap","handleTextMouseOver","handleTextMouseOut","handleClick","e","id","role","padding","cursor","dense","selected","display","alignItems","color","primary","label","primaryTypographyProps"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0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,SAASzB,KAAK0B,KAAK;gBACnBC,wBAAwB;oBAAEjB,QAAQA;gBAAO;gBACzCL,aAAaO;gBACbN,YAAYO;;;;AAIpB;AAEA,OAAO,MAAMd,+BAAiBR,KAAKO,oBAAoB"}
1
+ {"version":3,"sources":["../../src/Legend/ListLegendItem.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, ListItemText, ListItemProps, ListItemButton } from '@mui/material';\nimport { forwardRef, memo, MouseEvent, MouseEventHandler, ReactElement, useState } from 'react';\n\nimport { combineSx } from '../utils';\nimport { LegendItem } from './legend-model';\nimport { LegendColorBadge } from './LegendColorBadge';\n\nexport type LegendItemEventOpts = {\n /**\n * Unique identifier for the legend item.\n */\n id: string;\n\n /**\n * Index of the row in the original data.\n */\n index: number;\n};\n\nexport interface ListLegendItemProps extends Omit<ListItemProps<'div'>, 'onClick' | 'onMouseOver' | 'onMouseOut'> {\n item: LegendItem;\n\n index: number;\n\n /**\n * When true, the item is rendered differently to visually communicate it is\n * selected.\n */\n isVisuallySelected?: boolean;\n\n onClick: (e: MouseEvent<HTMLElement>, seriesId: string) => void;\n\n onMouseOver?: (e: MouseEvent, opts: LegendItemEventOpts) => void;\n onMouseOut?: (e: MouseEvent, opts: LegendItemEventOpts) => void;\n\n /**\n * When `true`, will keep labels to a single line with overflow ellipsized. The\n * full content will be shown on hover.\n *\n * When `false` or unset, will show the full label.\n */\n truncateLabel?: boolean;\n}\n\nconst ListLegendItemBase = forwardRef<HTMLDivElement, ListLegendItemProps>(function ListLegendItem(\n { item, sx, truncateLabel, onClick, isVisuallySelected, onMouseOver, onMouseOut, index, ...others },\n ref,\n): ReactElement {\n const [noWrap, setNoWrap] = useState(truncateLabel);\n\n function handleTextMouseOver(): void {\n if (truncateLabel) {\n setNoWrap(false);\n }\n }\n\n function handleTextMouseOut(): void {\n if (truncateLabel) {\n setNoWrap(true);\n }\n }\n\n const handleClick: MouseEventHandler<HTMLDivElement> = (e) => {\n onClick(e, item.id);\n item.onClick?.(e);\n };\n\n // ListItemButton must remain the measured and interactive element while exposing its position in the surrounding list.\n /* oxlint-disable jsx-a11y/prefer-tag-over-role */\n return (\n <ListItemButton\n {...others}\n role=\"listitem\"\n sx={combineSx(\n {\n padding: 0,\n cursor: 'pointer',\n },\n sx,\n )}\n dense={true}\n onClick={handleClick}\n onMouseOver={(e: MouseEvent) => onMouseOver?.(e, { id: item.id, index })}\n onMouseOut={(e: MouseEvent) => onMouseOut?.(e, { id: item.id, index })}\n selected={isVisuallySelected}\n ref={ref}\n >\n <Box sx={{ display: 'flex', alignItems: 'center' }}>\n <LegendColorBadge color={item.color} />\n </Box>\n <ListItemText\n primary={item.label}\n primaryTypographyProps={{ noWrap: noWrap }}\n onMouseOver={handleTextMouseOver}\n onMouseOut={handleTextMouseOut}\n ></ListItemText>\n </ListItemButton>\n );\n /* oxlint-enable jsx-a11y/prefer-tag-over-role */\n});\n\nexport const ListLegendItem = memo(ListLegendItemBase);\n"],"names":["Box","ListItemText","ListItemButton","forwardRef","memo","useState","combineSx","LegendColorBadge","ListLegendItemBase","ListLegendItem","item","sx","truncateLabel","onClick","isVisuallySelected","onMouseOver","onMouseOut","index","others","ref","noWrap","setNoWrap","handleTextMouseOver","handleTextMouseOut","handleClick","e","id","role","padding","cursor","dense","selected","display","alignItems","color","primary","label","primaryTypographyProps"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,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zCL,aAAaO;gBACbN,YAAYO;;;;AAIlB,+CAA+C,GACjD;AAEA,OAAO,MAAMd,+BAAiBL,KAAKI,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"TableLegend.d.ts","sourceRoot":"","sources":["../../src/Legend/TableLegend.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAS,UAAU,EAAqE,MAAM,UAAU,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,iBAAiB,CAAC;IACnG,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC;IAC9D,qBAAqB,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC;IACtE,eAAe,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC3D,cAAc,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,eAAe,CAAC,CAAC;IACzD,OAAO,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;CAC7C;AA2BD,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,aAAa,EAAE,gBAAgB,EAC/B,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,MAAM,EACN,KAAK,EACL,OAAO,EAAE,iBAAsB,EAC/B,OAAO,EACP,eAAe,GAChB,EAAE,gBAAgB,GAAG,YAAY,CAyDjC"}
1
+ {"version":3,"file":"TableLegend.d.ts","sourceRoot":"","sources":["../../src/Legend/TableLegend.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAS,UAAU,EAAqE,MAAM,UAAU,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,SAAS,GAAG,iBAAiB,CAAC;IACnG,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,aAAa,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC;IAC9D,qBAAqB,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,sBAAsB,CAAC,CAAC;IACtE,eAAe,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,gBAAgB,CAAC,CAAC;IAC3D,cAAc,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,eAAe,CAAC,CAAC;IACzD,OAAO,CAAC,EAAE,UAAU,CAAC,UAAU,CAAC,CAAC,SAAS,CAAC,CAAC;CAC7C;AA2BD,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,aAAa,EAAE,gBAAgB,EAC/B,qBAAqB,EACrB,eAAe,EACf,cAAc,EACd,MAAM,EACN,KAAK,EACL,OAAO,EAAE,iBAAsB,EAC/B,OAAO,EACP,eAAe,GAChB,EAAE,gBAAgB,GAAG,YAAY,CAyDjC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Legend/TableLegend.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\nimport { Table, TableProps, TableColumnConfig, DEFAULT_COLUMN_WIDTH, DEFAULT_COLUMN_MIN_WIDTH } from '../Table';\nimport { LegendItem } from './legend-model';\n\nexport interface TableLegendProps extends Pick<TableProps<LegendItem>, 'sorting' | 'onSortingChange'> {\n items: LegendItem[];\n height: number;\n width: number;\n selectedItems: TableProps<LegendItem>['rowSelection'] | 'ALL';\n onSelectedItemsChange: TableProps<LegendItem>['onRowSelectionChange'];\n onItemMouseOver?: TableProps<LegendItem>['onRowMouseOver'];\n onItemMouseOut?: TableProps<LegendItem>['onRowMouseOut'];\n columns?: TableProps<LegendItem>['columns'];\n}\n\nconst COLUMNS: Array<TableColumnConfig<LegendItem>> = [\n {\n accessorKey: 'label',\n header: 'Name',\n enableSorting: true,\n enableResizing: true,\n\n // Starting with `title` attr instead of a tooltip because it is easier to\n // implement. We should try adding a tooltip in the future, but we'll need\n // to be very careful about performance when doing so with large tables.\n cell: ({ getValue }) => <span title={getValue()}>{getValue()}</span>,\n },\n];\n\nconst getRowId: NonNullable<TableProps<LegendItem>['getRowId']> = (data) => {\n return data.id;\n};\n\nconst getCheckboxColor: TableProps<LegendItem>['getCheckboxColor'] = (data) => {\n return data.color;\n};\n\n// This is a rough estimate of value that needs to be subtracted from the total width to avoid horizontal scrolling on initial render\nconst TABLE_PADDING = 45;\n\nexport function TableLegend({\n items,\n selectedItems: initRowSelection,\n onSelectedItemsChange,\n onItemMouseOver,\n onItemMouseOut,\n height,\n width,\n columns: additionalColumns = [],\n sorting,\n onSortingChange,\n}: TableLegendProps): ReactElement {\n const rowSelection = useMemo(() => {\n return typeof initRowSelection !== 'string'\n ? initRowSelection\n : // Turn \"ALL\" state into a table component friendly map of all of the selected\n // items for checkboxes.\n // TODO: clean this up if we switch to also using checkboxes in list legend.\n items.reduce(\n (allRowSelection, item, index) => {\n allRowSelection[getRowId(item, index)] = true;\n return allRowSelection;\n },\n {} as Record<string, boolean>\n );\n }, [initRowSelection, items]);\n\n const columns = useMemo(() => {\n // Calculate column widths to fit the container on initial render, avoiding unnecessary horizontal scrolling.\n // Falls back to a default width if available width is too small; the user can resize columns as needed.\n const additionalColumnsLength =\n additionalColumns?.reduce((colWidth, col) => {\n return colWidth + (typeof col.width === 'number' ? col.width : DEFAULT_COLUMN_WIDTH);\n }, 0) ?? 0;\n const availableWidth = Math.max(\n width - additionalColumnsLength - TABLE_PADDING,\n DEFAULT_COLUMN_MIN_WIDTH * COLUMNS.length\n );\n const columnWidth = availableWidth / COLUMNS.length;\n return [\n ...COLUMNS.map((column) => ({\n ...column,\n width: columnWidth,\n })),\n ...additionalColumns,\n ];\n }, [additionalColumns, width]);\n\n return (\n <Table\n height={height}\n width={width}\n rowSelection={rowSelection}\n onRowSelectionChange={onSelectedItemsChange}\n onRowMouseOver={onItemMouseOver}\n onRowMouseOut={onItemMouseOut}\n sorting={sorting}\n onSortingChange={onSortingChange}\n data={items}\n columns={columns}\n density=\"compact\"\n defaultColumnWidth=\"auto\"\n getRowId={getRowId}\n getCheckboxColor={getCheckboxColor}\n checkboxSelection\n rowSelectionVariant=\"legend\"\n />\n );\n}\n"],"names":["useMemo","Table","DEFAULT_COLUMN_WIDTH","DEFAULT_COLUMN_MIN_WIDTH","COLUMNS","accessorKey","header","enableSorting","enableResizing","cell","getValue","span","title","getRowId","data","id","getCheckboxColor","color","TABLE_PADDING","TableLegend","items","selectedItems","initRowSelection","onSelectedItemsChange","onItemMouseOver","onItemMouseOut","height","width","columns","additionalColumns","sorting","onSortingChange","rowSelection","reduce","allRowSelection","item","index","additionalColumnsLength","colWidth","col","availableWidth","Math","max","length","columnWidth","map","column","onRowSelectionChange","onRowMouseOver","onRowMouseOut","density","defaultColumnWidth","checkboxSelection","rowSelectionVariant"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AAC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AG,CAC7Bf,QAAQU,0BAA0BnB,eAClCf,2BAA2BC,QAAQuC,MAAM;QAE3C,MAAMC,cAAcJ,iBAAiBpC,QAAQuC,MAAM;QACnD,OAAO;eACFvC,QAAQyC,GAAG,CAAC,CAACC,SAAY,CAAA;oBAC1B,GAAGA,MAAM;oBACTnB,OAAOiB;gBACT,CAAA;eACGf;SACJ;IACH,GAAG;QAACA;QAAmBF;KAAM;IAE7B,qBACE,KAAC1B;QACCyB,QAAQA;QACRC,OAAOA;QACPK,cAAcA;QACde,sBAAsBxB;QACtByB,gBAAgBxB;QAChByB,eAAexB;QACfK,SAASA;QACTC,iBAAiBA;QACjBjB,MAAMM;QACNQ,SAASA;QACTsB,SAAQ;QACRC,oBAAmB;QACnBtC,UAAUA;QACVG,kBAAkBA;QAClBoC,iBAAiB;QACjBC,qBAAoB;;AAG1B"}
1
+ {"version":3,"sources":["../../src/Legend/TableLegend.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement, useMemo } from 'react';\n\nimport { Table, TableProps, TableColumnConfig, DEFAULT_COLUMN_WIDTH, DEFAULT_COLUMN_MIN_WIDTH } from '../Table';\nimport { LegendItem } from './legend-model';\n\nexport interface TableLegendProps extends Pick<TableProps<LegendItem>, 'sorting' | 'onSortingChange'> {\n items: LegendItem[];\n height: number;\n width: number;\n selectedItems: TableProps<LegendItem>['rowSelection'] | 'ALL';\n onSelectedItemsChange: TableProps<LegendItem>['onRowSelectionChange'];\n onItemMouseOver?: TableProps<LegendItem>['onRowMouseOver'];\n onItemMouseOut?: TableProps<LegendItem>['onRowMouseOut'];\n columns?: TableProps<LegendItem>['columns'];\n}\n\nconst COLUMNS: Array<TableColumnConfig<LegendItem>> = [\n {\n accessorKey: 'label',\n header: 'Name',\n enableSorting: true,\n enableResizing: true,\n\n // Starting with `title` attr instead of a tooltip because it is easier to\n // implement. We should try adding a tooltip in the future, but we'll need\n // to be very careful about performance when doing so with large tables.\n cell: ({ getValue }) => <span title={getValue()}>{getValue()}</span>,\n },\n];\n\nconst getRowId: NonNullable<TableProps<LegendItem>['getRowId']> = (data) => {\n return data.id;\n};\n\nconst getCheckboxColor: TableProps<LegendItem>['getCheckboxColor'] = (data) => {\n return data.color;\n};\n\n// This is a rough estimate of value that needs to be subtracted from the total width to avoid horizontal scrolling on initial render\nconst TABLE_PADDING = 45;\n\nexport function TableLegend({\n items,\n selectedItems: initRowSelection,\n onSelectedItemsChange,\n onItemMouseOver,\n onItemMouseOut,\n height,\n width,\n columns: additionalColumns = [],\n sorting,\n onSortingChange,\n}: TableLegendProps): ReactElement {\n const rowSelection = useMemo(() => {\n return typeof initRowSelection !== 'string'\n ? initRowSelection\n : // Turn \"ALL\" state into a table component friendly map of all of the selected\n // items for checkboxes.\n // TODO: clean this up if we switch to also using checkboxes in list legend.\n items.reduce(\n (allRowSelection, item, index) => {\n allRowSelection[getRowId(item, index)] = true;\n return allRowSelection;\n },\n {} as Record<string, boolean>,\n );\n }, [initRowSelection, items]);\n\n const columns = useMemo(() => {\n // Calculate column widths to fit the container on initial render, avoiding unnecessary horizontal scrolling.\n // Falls back to a default width if available width is too small; the user can resize columns as needed.\n const additionalColumnsLength =\n additionalColumns?.reduce((colWidth, col) => {\n return colWidth + (typeof col.width === 'number' ? col.width : DEFAULT_COLUMN_WIDTH);\n }, 0) ?? 0;\n const availableWidth = Math.max(\n width - additionalColumnsLength - TABLE_PADDING,\n DEFAULT_COLUMN_MIN_WIDTH * COLUMNS.length,\n );\n const columnWidth = availableWidth / COLUMNS.length;\n return [\n ...COLUMNS.map((column) => ({\n ...column,\n width: columnWidth,\n })),\n ...additionalColumns,\n ];\n }, [additionalColumns, width]);\n\n return (\n <Table\n height={height}\n width={width}\n rowSelection={rowSelection}\n onRowSelectionChange={onSelectedItemsChange}\n onRowMouseOver={onItemMouseOver}\n onRowMouseOut={onItemMouseOut}\n sorting={sorting}\n onSortingChange={onSortingChange}\n data={items}\n columns={columns}\n density=\"compact\"\n defaultColumnWidth=\"auto\"\n getRowId={getRowId}\n getCheckboxColor={getCheckboxColor}\n checkboxSelection\n rowSelectionVariant=\"legend\"\n />\n );\n}\n"],"names":["useMemo","Table","DEFAULT_COLUMN_WIDTH","DEFAULT_COLUMN_MIN_WIDTH","COLUMNS","accessorKey","header","enableSorting","enableResizing","cell","getValue","span","title","getRowId","data","id","getCheckboxColor","color","TABLE_PADDING","TableLegend","items","selectedItems","initRowSelection","onSelectedItemsChange","onItemMouseOver","onItemMouseOut","height","width","columns","additionalColumns","sorting","onSortingChange","rowSelection","reduce","allRowSelection","item","index","additionalColumnsLength","colWidth","col","availableWidth","Math","max","length","columnWidth","map","column","onRowSelectionChange","onRowMouseOver","onRowMouseOut","density","defaultColumnWidth","checkboxSelection","rowSelectionVariant"],"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,SAAuBA,OAAO,QAAQ,QAAQ;AAE9C,SAASC,KAAK,EAAiCC,oBAAoB,EAAEC,wBAAwB,QAAQ,WAAW;AAchH,MAAMC,UAAgD;IACpD;QACEC,aAAa;QACbC,QAAQ;QACRC,eAAe;QACfC,gBAAgB;QAEhB,0EAA0E;QAC1E,0EAA0E;QAC1E,wEAAwE;QACxEC,MAAM,CAAC,EAAEC,QAAQ,EAAE,iBAAK,KAACC;gBAAKC,OAAOF;0BAAaA;;IACpD;CACD;AAED,MAAMG,WAA4D,C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jB,MAAMM;QACNQ,SAASA;QACTsB,SAAQ;QACRC,oBAAmB;QACnBtC,UAAUA;QACVG,kBAAkBA;QAClBoC,iBAAiB;QACjBC,qBAAoB;;AAG1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"legend-model.d.ts","sourceRoot":"","sources":["../../src/Legend/legend-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAS7C,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AAEvD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B,OAAO,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;CAC1C;AAED;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;AAEhF,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,uBAAuB,GAAG,OAAO,CAI9G"}
1
+ {"version":3,"file":"legend-model.d.ts","sourceRoot":"","sources":["../../src/Legend/legend-model.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAS7C,MAAM,MAAM,sBAAsB,GAAG,iBAAiB,CAAC;AAEvD,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAE/B,OAAO,CAAC,EAAE,iBAAiB,CAAC,WAAW,CAAC,CAAC;CAC1C;AAED;;;;;;GAMG;AACH,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,GAAG,KAAK,CAAC;AAEhF,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,UAAU,EAAE,aAAa,EAAE,uBAAuB,GAAG,OAAO,CAI9G"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Legend/legend-model.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 { MouseEventHandler } from 'react';\nimport { LegendOptionsBase } from '../model';\n\n// This file contains legend-related model code specific to the legend component.\n// See the `core` package for common/shared legend model code and the\n// `plugin-system` package for legend model code specific to panel plugin specs.\n\n// Note: explicitly defining different options for the legend component and\n// legend spec that extend from some common options, so we can allow the\n// component and the spec to diverge in some upcoming work.\nexport type LegendComponentOptions = LegendOptionsBase;\n\nexport interface LegendItem {\n id: string;\n label: string;\n color: string;\n\n /**\n * Additional data for the legend item. Useful for laying out additional\n * columns when using a table legend.\n */\n data?: Record<string, unknown>;\n\n onClick?: MouseEventHandler<HTMLElement>;\n}\n\n/**\n * State of selected items in the legend.\n * - When \"ALL\", all legend items are selected, but not visually highlighted.\n * - Otherwise, it is a Record that associates legend item ids with a boolean\n * value. When the associated entry for a legend item is `true`, that item\n * will be treated as selected and visually highlighted.\n */\nexport type SelectedLegendItemState = Record<LegendItem['id'], boolean> | 'ALL';\n\nexport function isLegendItemVisuallySelected(item: LegendItem, selectedItems: SelectedLegendItemState): boolean {\n // In the \"ALL\" case, technically all legend items are selected, but we do\n // not render them differently.\n return selectedItems !== 'ALL' && !!selectedItems[item.id];\n}\n"],"names":["isLegendItemVisuallySelected","item","selectedItems","id"],"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;AAqCjC,OAAO,SAASA,6BAA6BC,IAAgB,EAAEC,aAAsC;IACnG,0EAA0E;IAC1E,+BAA+B;IAC/B,OAAOA,kBAAkB,SAAS,CAAC,CAACA,aAAa,CAACD,KAAKE,EAAE,CAAC;AAC5D"}
1
+ {"version":3,"sources":["../../src/Legend/legend-model.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 { MouseEventHandler } from 'react';\n\nimport { LegendOptionsBase } from '../model';\n\n// This file contains legend-related model code specific to the legend component.\n// See the `core` package for common/shared legend model code and the\n// `plugin-system` package for legend model code specific to panel plugin specs.\n\n// Note: explicitly defining different options for the legend component and\n// legend spec that extend from some common options, so we can allow the\n// component and the spec to diverge in some upcoming work.\nexport type LegendComponentOptions = LegendOptionsBase;\n\nexport interface LegendItem {\n id: string;\n label: string;\n color: string;\n\n /**\n * Additional data for the legend item. Useful for laying out additional\n * columns when using a table legend.\n */\n data?: Record<string, unknown>;\n\n onClick?: MouseEventHandler<HTMLElement>;\n}\n\n/**\n * State of selected items in the legend.\n * - When \"ALL\", all legend items are selected, but not visually highlighted.\n * - Otherwise, it is a Record that associates legend item ids with a boolean\n * value. When the associated entry for a legend item is `true`, that item\n * will be treated as selected and visually highlighted.\n */\nexport type SelectedLegendItemState = Record<LegendItem['id'], boolean> | 'ALL';\n\nexport function isLegendItemVisuallySelected(item: LegendItem, selectedItems: SelectedLegendItemState): boolean {\n // In the \"ALL\" case, technically all legend items are selected, but we do\n // not render them differently.\n return selectedItems !== 'ALL' && !!selectedItems[item.id];\n}\n"],"names":["isLegendItemVisuallySelected","item","selectedItems","id"],"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;AAsCjC,OAAO,SAASA,6BAA6BC,IAAgB,EAAEC,aAAsC;IACnG,0EAA0E;IAC1E,+BAA+B;IAC/B,OAAOA,kBAAkB,SAAS,CAAC,CAACA,aAAa,CAACD,KAAKE,EAAE,CAAC;AAC5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"LinkEditorForm.d.ts","sourceRoot":"","sources":["../../src/LinksEditor/LinkEditorForm.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAGrC,MAAM,WAAW,mBAAmB,CAAC,CAAC;IACpC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE;QAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpD;AAED,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,QAAQ,GAAG,eAAe,CAAC;IACjC,GAAG,E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O,CAAC,EAAE,OAAO,CAAC,CAAC;IACxD,eAAe,CAAC,EAAE,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC,CAAC;CAC/D;AAED,eAAO,MAAM,cAAc,GAAI,OAAO,mBAAmB,KAAG,YAoE3D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/LinksEditor/LinkEditorForm.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Checkbox, FormControlLabel, Stack } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { TextField } from '../controls';\n\nexport interface LinkEditorFormField<T> {\n value: T;\n onChange: (value: T) => void;\n placeholder?: string;\n label: string;\n error: { hasError?: boolean; helperText?: string };\n}\n\nexport interface LinkEditorFormProps {\n mode: 'inline' | 'modalEmbedded';\n url: LinkEditorFormField<string>;\n name?: Omit<LinkEditorFormField<string>, 'error'>;\n tooltip?: Omit<LinkEditorFormField<string>, 'error'>;\n newTabOpen: Omit<LinkEditorFormField<boolean>, 'error'>;\n renderVariables?: Omit<LinkEditorFormField<boolean>, 'error'>;\n}\n\nexport const LinkEditorForm = (props: LinkEditorFormProps): ReactElement => {\n const { mode, url, name, newTabOpen, renderVariables, tooltip } = props;\n\n return (\n <Stack direction=\"column\" gap={2} flexGrow={1}>\n <TextField\n label={url.label}\n error={url.error?.hasError}\n helperText={url.error?.helperText}\n onChange={url.onChange}\n placeholder={url.placeholder}\n multiline\n maxRows={5}\n required\n fullWidth\n value={url.value}\n />\n {(name || tooltip) && (\n <Stack gap={1} direction={mode === 'inline' ? 'row' : 'column'}>\n {name && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={name.label}\n onChange={name?.onChange}\n placeholder={name?.placeholder}\n value={name?.value}\n />\n )}\n {tooltip && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={tooltip.label}\n onChange={tooltip?.onChange}\n placeholder={tooltip?.placeholder}\n value={tooltip?.value}\n />\n )}\n </Stack>\n )}\n <Stack direction=\"row\" gap={1}>\n {renderVariables && (\n <FormControlLabel\n label={renderVariables.label}\n control={\n <Checkbox\n checked={renderVariables.value}\n onChange={(e) => {\n renderVariables?.onChange(e.target.checked);\n }}\n />\n }\n />\n )}\n\n <FormControlLabel\n label={newTabOpen.label}\n control={\n <Checkbox\n checked={newTabOpen.value}\n onChange={(e) => {\n newTabOpen?.onChange(e.target.checked);\n }}\n />\n }\n />\n </Stack>\n </Stack>\n );\n};\n"],"names":["Checkbox","FormControlLabel","Stack","TextField","LinkEditorForm","props","mode","url","name","newTabOpen","renderVariables","tooltip","direction","gap","flexGrow","label","error","hasError","helperText","onChange","placeholder","multiline","maxRows","required","fullWidth","value","sx","control","checked","e","target"],"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,gBAAgB,EAAEC,KAAK,QAAQ,gBAAgB;AAElE,SAASC,SAAS,QAAQ,cAAc;AAmBxC,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAEC,UAAU,EAAEC,eAAe,EAAEC,OAAO,EAAE,GAAGN;IAElE,qBACE,MAACH;QAAMU,WAAU;QAASC,KAAK;QAAGC,UAAU;;0BAC1C,KAACX;gBACCY,OAAOR,IAAIQ,KAAK;gBAChBC,OAAOT,IAAIS,KAAK,EAAEC;gBAClBC,YAAYX,IAAIS,KAAK,EAAEE;gBACvBC,UAAUZ,IAAIY,QAAQ;gBACtBC,aAAab,IAAIa,WAAW;gBAC5BC,SAAS;gBACTC,SAAS;gBACTC,QAAQ;gBACRC,SAAS;gBACTC,OAAOlB,IAAIkB,KAAK;;YAEhBjB,CAAAA,QAAQG,OAAM,mBACd,MAACT;gBAAMW,KAAK;gBAAGD,WAAWN,SAAS,WAAW,QAAQ;;oBACnDE,sBACC,KAACL;wBACCuB,IAAI;4BAAEZ,UAAU;wBAAI;wBACpBC,OAAOP,KAAKO,KAAK;wBACjBI,UAAUX,MAAMW;wBAChBC,aAAaZ,MAAMY;wBACnBK,OAAOjB,MAAMiB;;oBAGhBd,yBACC,KAACR;wBACCuB,IAAI;4BAAEZ,UAAU;wBAAI;wBACpBC,OAAOJ,QAAQI,KAAK;wBACpBI,UAAUR,SAASQ;wBACnBC,aAAaT,SAASS;wBACtBK,OAAOd,SAASc;;;;0BAKxB,MAACvB;gBAAMU,WAAU;gBAAMC,KAAK;;oBACzBH,iCACC,KAACT;wBACCc,OAAOL,gBAAgBK,KAAK;wBAC5BY,uBACE,KAAC3B;4BACC4B,SAASlB,gBAAgBe,KAAK;4BAC9BN,UAAU,CAACU;gCACTnB,iBAAiBS,SAASU,EAAEC,MAAM,CAACF,OAAO;4BAC5C;;;kCAMR,KAAC3B;wBACCc,OAAON,WAAWM,KAAK;wBACvBY,uBACE,KAAC3B;4BACC4B,SAASnB,WAAWgB,KAAK;4BACzBN,UAAU,CAACU;gCACTpB,YAAYU,SAASU,EAAEC,MAAM,CAACF,OAAO;4BACvC;;;;;;;AAOd,EAAE"}
1
+ {"version":3,"sources":["../../src/LinksEditor/LinkEditorForm.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Checkbox, FormControlLabel, Stack } from '@mui/material';\nimport { ReactElement } from 'react';\n\nimport { TextField } from '../controls';\n\nexport interface LinkEditorFormField<T> {\n value: T;\n onChange: (value: T) => void;\n placeholder?: string;\n label: string;\n error: { hasError?: boolean; helperText?: string };\n}\n\nexport interface LinkEditorFormProps {\n mode: 'inline' | 'modalEmbedded';\n url: LinkEditorFormField<string>;\n name?: Omit<LinkEditorFormField<string>, 'error'>;\n tooltip?: Omit<LinkEditorFormField<string>, 'error'>;\n newTabOpen: Omit<LinkEditorFormField<boolean>, 'error'>;\n renderVariables?: Omit<LinkEditorFormField<boolean>, 'error'>;\n}\n\nexport const LinkEditorForm = (props: LinkEditorFormProps): ReactElement => {\n const { mode, url, name, newTabOpen, renderVariables, tooltip } = props;\n\n return (\n <Stack direction=\"column\" gap={2} flexGrow={1}>\n <TextField\n label={url.label}\n error={url.error?.hasError}\n helperText={url.error?.helperText}\n onChange={url.onChange}\n placeholder={url.placeholder}\n multiline\n maxRows={5}\n required\n fullWidth\n value={url.value}\n />\n {(name || tooltip) && (\n <Stack gap={1} direction={mode === 'inline' ? 'row' : 'column'}>\n {name && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={name.label}\n onChange={name?.onChange}\n placeholder={name?.placeholder}\n value={name?.value}\n />\n )}\n {tooltip && (\n <TextField\n sx={{ flexGrow: '1' }}\n label={tooltip.label}\n onChange={tooltip?.onChange}\n placeholder={tooltip?.placeholder}\n value={tooltip?.value}\n />\n )}\n </Stack>\n )}\n <Stack direction=\"row\" gap={1}>\n {renderVariables && (\n <FormControlLabel\n label={renderVariables.label}\n control={\n <Checkbox\n checked={renderVariables.value}\n onChange={(e) => {\n renderVariables?.onChange(e.target.checked);\n }}\n />\n }\n />\n )}\n\n <FormControlLabel\n label={newTabOpen.label}\n control={\n <Checkbox\n checked={newTabOpen.value}\n onChange={(e) => {\n newTabOpen?.onChange(e.target.checked);\n }}\n />\n }\n />\n </Stack>\n </Stack>\n );\n};\n"],"names":["Checkbox","FormControlLabel","Stack","TextField","LinkEditorForm","props","mode","url","name","newTabOpen","renderVariables","tooltip","direction","gap","flexGrow","label","error","hasError","helperText","onChange","placeholder","multiline","maxRows","required","fullWidth","value","sx","control","checked","e","target"],"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,gBAAgB,EAAEC,KAAK,QAAQ,gBAAgB;AAGlE,SAASC,SAAS,QAAQ,cAAc;AAmBxC,OAAO,MAAMC,iBAAiB,CAACC;IAC7B,MAAM,EAAEC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAEC,UAAU,EAAEC,eAAe,EAAEC,OAAO,EAAE,GAAGN;IAElE,qBACE,MAACH;QAAMU,WAAU;QAASC,KAAK;QAAGC,UAAU;;0BAC1C,KAACX;gBACCY,OAAOR,IAAIQ,KAAK;gBAChBC,OAAOT,IAAIS,KAAK,EAAEC;gBAClBC,YAAYX,IAAIS,KAAK,EAAEE;gBACvBC,UAAUZ,IAAIY,QAAQ;gBACtBC,aAAab,IAAIa,WAAW;gBAC5BC,SAAS;gBACTC,SAAS;gBACTC,QAAQ;gBACRC,SAAS;gBACTC,OAAOlB,IAAIkB,KAAK;;YAEhBjB,CAAAA,QAAQG,OAAM,mBACd,MAACT;gBAAMW,KAAK;gBAAGD,WAAWN,SAAS,WAAW,QAAQ;;oBACnDE,sBACC,KAACL;wBACCuB,IAAI;4BAAEZ,UAAU;wBAAI;wBACpBC,OAAOP,KAAKO,KAAK;wBACjBI,UAAUX,MAAMW;wBAChBC,aAAaZ,MAAMY;wBACnBK,OAAOjB,MAAMiB;;oBAGhBd,yBACC,KAACR;wBACCuB,IAAI;4BAAEZ,UAAU;wBAAI;wBACpBC,OAAOJ,QAAQI,KAAK;wBACpBI,UAAUR,SAASQ;wBACnBC,aAAaT,SAASS;wBACtBK,OAAOd,SAASc;;;;0BAKxB,MAACvB;gBAAMU,WAAU;gBAAMC,KAAK;;oBACzBH,iCACC,KAACT;wBACCc,OAAOL,gBAAgBK,KAAK;wBAC5BY,uBACE,KAAC3B;4BACC4B,SAASlB,gBAAgBe,KAAK;4BAC9BN,UAAU,CAACU;gCACTnB,iBAAiBS,SAASU,EAAEC,MAAM,CAACF,OAAO;4BAC5C;;;kCAMR,KAAC3B;wBACCc,OAAON,WAAWM,KAAK;wBACvBY,uBACE,KAAC3B;4BACC4B,SAASnB,WAAWgB,KAAK;4BACzBN,UAAU,CAACU;gCACTpB,YAAYU,SAASU,EAAEC,MAAM,CAACF,OAAO;4BACvC;;;;;;;AAOd,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ModeSelector.d.ts","sourceRoot":"","sources":["../../src/ModeSelector/ModeSelector.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AASrC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,qBAAqB,EAAE,QAAQ,EAAE,KAAe,EAAE,EAAE,iBAAiB,GAAG,YAAY,CAoBlH"}
1
+ {"version":3,"file":"ModeSelector.d.ts","sourceRoot":"","sources":["../../src/ModeSelector/ModeSelector.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAUrC,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,YAAY,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,qBAAqB,EAAE,QAAQ,EAAE,KAAe,EAAE,EAAE,iBAAiB,GAAG,YAAY,CAoBlH"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/ModeSelector/ModeSelector.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License | Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing | software\n// distributed under the License is distributed on an \"AS IS\" BASIS |\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND | either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement } from 'react';\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst MODE_OPTIONS: Array<{ id: ModeOption; label: string }> = [\n { id: 'value', label: 'Value' },\n { id: 'percentage', label: 'Percentage' },\n];\n\nexport type ModeOption = 'value' | 'percentage';\n\nexport interface ModeSelectorProps {\n disablePercentageMode: boolean;\n onChange: (mode: ModeOption) => void;\n value?: ModeOption;\n}\n\nexport function ModeSelector({ disablePercentageMode, onChange, value = 'value' }: ModeSelectorProps): ReactElement {\n const handleModeChange = (_: unknown, { id }: { id: ModeOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <SettingsAutocomplete\n value={MODE_OPTIONS.find((o) => o.id === value)}\n options={MODE_OPTIONS}\n getOptionLabel={(o) => o.label}\n getOptionDisabled={(o) => o.id === 'percentage' && disablePercentageMode}\n onChange={handleModeChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","MODE_OPTIONS","id","label","ModeSelector","disablePercentageMode","onChange","value","handleModeChange","_","control","find","o","options","getOptionLabel","getOptionDisabled","disableClearable"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,oBAAoB,QAAQ,0BAA0B;AAE/D,MAAMC,eAAyD;IAC7D;QAAEC,IAAI;QAASC,OAAO;IAAQ;IAC9B;QAAED,IAAI;QAAcC,OAAO;IAAa;CACzC;AAUD,OAAO,SAASC,aAAa,EAAEC,qBAAqB,EAAEC,QAAQ,EAAEC,QAAQ,OAAO,EAAqB;IAClG,MAAMC,mBAAmB,CAACC,GAAY,EAAEP,EAAE,EAAsB;QAC9DI,SAASJ;IACX;IAEA,qBACE,KAACH;QACCI,OAAM;QACNO,uBACE,KAACV;YACCO,OAAON,aAAaU,IAAI,CAAC,CAACC,IAAMA,EAAEV,EAAE,KAAKK;YACzCM,SAASZ;YACTa,gBAAgB,CAACF,IAAMA,EAAET,KAAK;YAC9BY,mBAAmB,CAACH,IAAMA,EAAEV,EAAE,KAAK,gBAAgBG;YACnDC,UAAUE;YACVQ,gBAAgB;;;AAK1B"}
1
+ {"version":3,"sources":["../../src/ModeSelector/ModeSelector.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License | Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing | software\n// distributed under the License is distributed on an \"AS IS\" BASIS |\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND | either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement } from 'react';\n\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst MODE_OPTIONS: Array<{ id: ModeOption; label: string }> = [\n { id: 'value', label: 'Value' },\n { id: 'percentage', label: 'Percentage' },\n];\n\nexport type ModeOption = 'value' | 'percentage';\n\nexport interface ModeSelectorProps {\n disablePercentageMode: boolean;\n onChange: (mode: ModeOption) => void;\n value?: ModeOption;\n}\n\nexport function ModeSelector({ disablePercentageMode, onChange, value = 'value' }: ModeSelectorProps): ReactElement {\n const handleModeChange = (_: unknown, { id }: { id: ModeOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Mode\"\n control={\n <SettingsAutocomplete\n value={MODE_OPTIONS.find((o) => o.id === value)}\n options={MODE_OPTIONS}\n getOptionLabel={(o) => o.label}\n getOptionDisabled={(o) => o.id === 'percentage' && disablePercentageMode}\n onChange={handleModeChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","MODE_OPTIONS","id","label","ModeSelector","disablePercentageMode","onChange","value","handleModeChange","_","control","find","o","options","getOptionLabel","getOptionDisabled","disableClearable"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;AAIjC,SAASA,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,oBAAoB,QAAQ,0BAA0B;AAE/D,MAAMC,eAAyD;IAC7D;QAAEC,IAAI;QAASC,OAAO;IAAQ;IAC9B;QAAED,IAAI;QAAcC,OAAO;IAAa;CACzC;AAUD,OAAO,SAASC,aAAa,EAAEC,qBAAqB,EAAEC,QAAQ,EAAEC,QAAQ,OAAO,EAAqB;IAClG,MAAMC,mBAAmB,CAACC,GAAY,EAAEP,EAAE,EAAsB;QAC9DI,SAASJ;IACX;IAEA,qBACE,KAACH;QACCI,OAAM;QACNO,uBACE,KAACV;YACCO,OAAON,aAAaU,IAAI,CAAC,CAACC,IAAMA,EAAEV,EAAE,KAAKK;YACzCM,SAASZ;YACTa,gBAAgB,CAACF,IAAMA,EAAET,KAAK;YAC9BY,mBAAmB,CAACH,IAAMA,EAAEV,EAAE,KAAK,gBAAgBG;YACnDC,UAAUE;YACVQ,gBAAgB;;;AAK1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"OptionsEditorColumn.d.ts","sourceRoot":"","sources":["../../src/OptionsEditorLayout/OptionsEditorColumn.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,iBAAkB,wBAAwB,KAAG,YAM5E,CAAC"}
1
+ {"version":3,"file":"OptionsEditorColumn.d.ts","sourceRoot":"","sources":["../../src/OptionsEditorLayout/OptionsEditorColumn.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,MAAM,MAAM,wBAAwB,GAAG;IACrC;;;OAGG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,mBAAmB,GAAI,cAAc,wBAAwB,KAAG,YAM5E,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"OptionsEditorControl.d.ts","sourceRoot":"","sources":["../../src/OptionsEditorLayout/OptionsEditorControl.tsx"],"names":[],"mappings":"AAaA,OAAO,EAA0B,qBAAqB,EAA0B,MAAM,eAAe,CAAC;AACtG,OAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,qBAAqB,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG;IACzF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,oCAAqC,yBAAyB,KAAG,YAuCjG,CAAC"}
1
+ {"version":3,"file":"OptionsEditorControl.d.ts","sourceRoot":"","sources":["../../src/OptionsEditorLayout/OptionsEditorControl.tsx"],"names":[],"mappings":"AAaA,OAAO,EAA0B,qBAAqB,EAA0B,MAAM,eAAe,CAAC;AAEtG,OAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK5C,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAC,qBAAqB,EAAE,OAAO,GAAG,SAAS,CAAC,GAAG;IACzF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,GAAI,iCAAiC,yBAAyB,KAAG,YAuCjG,CAAC"}
@@ -12,10 +12,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
  import { FormControl, FormLabel, Stack, Box, IconButton } from '@mui/material';
15
- import React from 'react';
16
15
  import InformationOutlineIcon from 'mdi-material-ui/InformationOutline';
17
- import { useId } from '../utils';
16
+ import React from 'react';
18
17
  import { InfoTooltip } from '../InfoTooltip';
18
+ import { useId } from '../utils';
19
19
  export const OptionsEditorControl = ({ label, control, description })=>{
20
20
  // Make sure we have a unique ID we can use for associating labels and
21
21
  // controls for a11y.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorControl.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { FormControl, FormLabel, FormControlLabelProps, Stack, Box, IconButton } from '@mui/material';\nimport React, { ReactElement } from 'react';\nimport InformationOutlineIcon from 'mdi-material-ui/InformationOutline';\nimport { useId } from '../utils';\nimport { InfoTooltip } from '../InfoTooltip';\n\nexport type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'control'> & {\n description?: string;\n};\n\nexport const OptionsEditorControl = ({ label, control, description }: OptionsEditorControlProps): ReactElement => {\n // Make sure we have a unique ID we can use for associating labels and\n // controls for a11y.\n const generatedControlId = useId('EditorSectionControl');\n const controlId = `${generatedControlId}-control`;\n const labelId = `${generatedControlId}-label`;\n\n const controlProps = {\n id: controlId,\n 'aria-labelledby': labelId,\n };\n\n return (\n <FormControl>\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <FormLabel id={labelId} htmlFor={controlId}>\n {label}\n </FormLabel>\n {description && (\n <InfoTooltip description={description} enterDelay={100}>\n <IconButton\n size=\"small\"\n sx={(theme) => ({ borderRadius: theme.shape.borderRadius, padding: '4x', margin: '0 2px' })}\n >\n <InformationOutlineIcon\n aria-describedby=\"info-tooltip\"\n aria-hidden={false}\n fontSize=\"inherit\"\n sx={{ color: (theme) => theme.palette.grey[700] }}\n />\n </IconButton>\n </InfoTooltip>\n )}\n </Stack>\n <Box sx={{ width: '180px', textAlign: 'right' }}> {React.cloneElement(control, controlProps)}</Box>\n </Stack>\n </FormControl>\n );\n};\n"],"names":["FormControl","FormLabel","Stack","Box","IconButton","React","InformationOutlineIcon","useId","InfoTooltip","OptionsEditorControl","label","control","description","generatedControlId","controlId","labelId","controlProps","id","direction","alignItems","justifyContent","htmlFor","enterDelay","size","sx","theme","borderRadius","shape","padding","margin","aria-described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MS,OAAO,CAACC,IAAI,CAAC,IAAI;oCAAC;;;;;;8BAM1D,MAAChC;oBAAIqB,IAAI;wBAAEY,OAAO;wBAASC,WAAW;oBAAQ;;wBAAG;sCAAEhC,MAAMiC,YAAY,CAAC3B,SAASK;;;;;;AAIvF,EAAE"}
1
+ {"version":3,"sources":["../../src/OptionsEditorLayout/OptionsEditorControl.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { FormControl, FormLabel, FormControlLabelProps, Stack, Box, IconButton } from '@mui/material';\nimport InformationOutlineIcon from 'mdi-material-ui/InformationOutline';\nimport React, { ReactElement } from 'react';\n\nimport { InfoTooltip } from '../InfoTooltip';\nimport { useId } from '../utils';\n\nexport type OptionsEditorControlProps = Pick<FormControlLabelProps, 'label' | 'control'> & {\n description?: string;\n};\n\nexport const OptionsEditorControl = ({ label, control, description }: OptionsEditorControlProps): ReactElement => {\n // Make sure we have a unique ID we can use for associating labels and\n // controls for a11y.\n const generatedControlId = useId('EditorSectionControl');\n const controlId = `${generatedControlId}-control`;\n const labelId = `${generatedControlId}-label`;\n\n const controlProps = {\n id: controlId,\n 'aria-labelledby': labelId,\n };\n\n return (\n <FormControl>\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"space-between\">\n <Stack direction=\"row\" alignItems=\"center\" justifyContent=\"center\">\n <FormLabel id={labelId} htmlFor={controlId}>\n {label}\n </FormLabel>\n {description && (\n <InfoTooltip description={description} enterDelay={100}>\n <IconButton\n size=\"small\"\n sx={(theme) => ({ borderRadius: theme.shape.borderRadius, padding: '4x', margin: '0 2px' })}\n >\n <InformationOutlineIcon\n aria-describedby=\"info-tooltip\"\n aria-hidden={false}\n fontSize=\"inherit\"\n sx={{ color: (theme) => theme.palette.grey[700] }}\n />\n </IconButton>\n </InfoTooltip>\n )}\n </Stack>\n <Box sx={{ width: '180px', textAlign: 'right' }}> {React.cloneElement(control, controlProps)}</Box>\n </Stack>\n </FormControl>\n );\n};\n"],"names":["FormControl","FormLabel","Stack","Box","IconButton","InformationOutlineIcon","React","InfoTooltip","useId","OptionsEditorControl","label","control","description","generatedControlId","controlId","labelId","controlProps","id","direction","alignItems","justifyContent","htmlFor","enterDelay","size","sx","theme","borderRadius","shape","padding","margin","aria-describedby","aria-hidden","fontSize","color","palette","grey","width","textAlign","cloneElement"],"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,SAAS,EAAyBC,KAAK,EAAEC,GAAG,EAAEC,UAAU,QAAQ,gBAAgB;AACtG,OAAOC,4BAA4B,qCAAqC;AACxE,OAAOC,WAA6B,QAAQ;AAE5C,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,KAAK,QAAQ,WAAW;AAMjC,OAAO,MAAMC,uBAAuB,CAAC,EAAEC,KAAK,EAAEC,OAAO,EAAEC,WAAW,EAA6B;IAC7F,sEAAsE;IACtE,qBAAqB;IACrB,MAAMC,qBAAqBL,MAAM;IACjC,MAAMM,YAAY,GAAGD,mBAAmB,QAAQ,CAAC;IACjD,MAAME,UAAU,GAAGF,mBAAmB,MAAM,CAAC;IAE7C,MAAMG,eAAe;QACnBC,IAAIH;QACJ,mBAAmBC;IACrB;IAEA,qBACE,KAACf;kBACC,cAAA,MAACE;YAAMgB,WAAU;YAAMC,YAAW;YAASC,gBAAe;;8BACxD,MAAClB;oBAAMgB,WAAU;oBAAMC,YAAW;oBAASC,gBAAe;;sCACxD,KAACnB;4BAAUgB,IAAIF;4BAASM,SAASP;sCAC9BJ;;wBAEFE,6BACC,KAACL;4BAAYK,aAAaA;4BAAaU,YAAY;sCACjD,cAAA,KAAClB;gCACCmB,MAAK;gCACLC,IAAI,CAACC,QAAW,CAAA;wCAAEC,cAAcD,MAAME,KAAK,CAACD,YAAY;wCAAEE,SAAS;wCAAMC,QAAQ;oCAAQ,CAAA;0CAEzF,cAAA,KAACxB;oCACCyB,oBAAiB;oCACjBC,eAAa;oCACbC,UAAS;oCACTR,IAAI;wCAAES,OAAO,CAACR,QAAUA,MAAMS,OAAO,CAACC,IAAI,CAAC,IAAI;oCAAC;;;;;;8BAM1D,MAAChC;oBAAIqB,IAAI;wBAAEY,OAAO;wBAASC,WAAW;oBAAQ;;wBAAG;sCAAE/B,MAAMgC,YAAY,CAAC3B,SAASK;;;;;;AAIvF,EAAE"}
@@ -1 +1 @@
1
- {"version":3,"file":"OptionsEditorGrid.d.ts","sourceRoot":"","sources":["../../src/OptionsEditorLayout/OptionsEditorGrid.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,iBAAkB,sBAAsB,KAAG,YAMxE,CAAC"}
1
+ {"version":3,"file":"OptionsEditorGrid.d.ts","sourceRoot":"","sources":["../../src/OptionsEditorLayout/OptionsEditorGrid.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,cAAc,sBAAsB,KAAG,YAMxE,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"OptionsEditorGroup.d.ts","sourceRoot":"","sources":["../../src/OptionsEditorLayout/OptionsEditorGroup.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,8BAA+B,uBAAuB,KAAG,YAYvF,CAAC"}
1
+ {"version":3,"file":"OptionsEditorGroup.d.ts","sourceRoot":"","sources":["../../src/OptionsEditorLayout/OptionsEditorGroup.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAE5C,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CACxB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAAI,2BAA2B,uBAAuB,KAAG,YAYvF,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshIntervalPicker.d.ts","sourceRoot":"","sources":["../../src/RefreshIntervalPicker/RefreshIntervalPicker.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,UAAU,0BAA0B;IAClC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,GAAG,YAAY,CAqCrF"}
1
+ {"version":3,"file":"RefreshIntervalPicker.d.ts","sourceRoot":"","sources":["../../src/RefreshIntervalPicker/RefreshIntervalPicker.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAW,MAAM,OAAO,CAAC;AAE9C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,UAAU,0BAA0B;IAClC,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B,KAAK,CAAC,EAAE,cAAc,CAAC;IACvB,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,IAAI,CAAC;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,0BAA0B,GAAG,YAAY,CAqCrF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/RefreshIntervalPicker/RefreshIntervalPicker.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, FormControl, MenuItem, Select } from '@mui/material';\nimport { DurationString } from '@perses-dev/spec';\nimport { ReactElement, useMemo } from 'react';\nimport { TimeOption } from '../model';\n\ninterface RefreshIntervalPickerProps {\n timeOptions: TimeOption[];\n value?: DurationString;\n onChange: (value: DurationString) => void;\n height?: string;\n}\n\nexport function RefreshIntervalPicker(props: RefreshIntervalPickerProps): ReactElement {\n const { value, onChange, timeOptions, height } = props;\n\n // If the dashboard refresh interval is not provided in timeOptions, it will create a specific option for the select\n const customInterval = useMemo(() => {\n if (value && !timeOptions.some((option) => option.value.pastDuration === value)) {\n return <MenuItem value={value}>{value}</MenuItem>;\n }\n }, [timeOptions, value]);\n\n return (\n <FormControl>\n <Box>\n <Select\n id=\"refreshInterval\"\n value={value}\n onChange={(event) => {\n const duration = event.target.value as DurationString;\n onChange(duration);\n }}\n inputProps={{\n 'aria-label': `Select refresh interval. Currently set to ${value}`,\n }}\n sx={{\n '.MuiSelect-select': height ? { lineHeight: height, paddingY: 0 } : {},\n }}\n >\n {timeOptions.map((item, idx) => (\n <MenuItem key={idx} value={item.value.pastDuration}>\n {item.display}\n </MenuItem>\n ))}\n {customInterval}\n </Select>\n </Box>\n </FormControl>\n );\n}\n"],"names":["Box","FormControl","MenuItem","Select","useMemo","RefreshIntervalPicker","props","value","onChange","timeOptions","height","customInterval","some","option","pastDuration","id","event","duration","target","inputProps","sx","lineHeight","paddingY","map","item","idx","display"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,GAAG,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,gBAAgB;AAEnE,SAAuBC,OAAO,QAAQ,QAAQ;AAU9C,OAAO,SAASC,sBAAsBC,KAAiC;IACrE,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,EAAE,GAAGJ;IAEjD,oHAAoH;IACpH,MAAMK,iBAAiBP,QAAQ;QAC7B,IAAIG,SAAS,CAACE,YAAYG,IAAI,CAAC,CAACC,SAAWA,OAAON,KAAK,CAACO,YAAY,KAAKP,QAAQ;YAC/E,qBAAO,KAACL;gBAASK,OAAOA;0BAAQA;;QAClC;IACF,GAAG;QAACE;QAAaF;KAAM;IAEvB,qBACE,KAACN;kBACC,cAAA,KAACD;sBACC,cAAA,MAACG;gBACCY,IAAG;gBACHR,OAAOA;gBACPC,UAAU,CAACQ;oBACT,MAAMC,WAAWD,MAAME,MAAM,CAACX,KAAK;oBACnCC,SAASS;gBACX;gBACAE,YAAY;oBACV,cAAc,CAAC,0CAA0C,EAAEZ,OAAO;gBACpE;gBACAa,IAAI;oBACF,qBAAqBV,SAAS;wBAAEW,YAAYX;wBAAQY,UAAU;oBAAE,IAAI,CAAC;gBACvE;;oBAECb,YAAYc,GAAG,CAAC,CAACC,MAAMC,oBACtB,KAACvB;4BAAmBK,OAAOiB,KAAKjB,KAAK,CAACO,YAAY;sCAC/CU,KAAKE,OAAO;2BADAD;oBAIhBd;;;;;AAKX"}
1
+ {"version":3,"sources":["../../src/RefreshIntervalPicker/RefreshIntervalPicker.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, FormControl, MenuItem, Select } from '@mui/material';\nimport { DurationString } from '@perses-dev/spec';\nimport { ReactElement, useMemo } from 'react';\n\nimport { TimeOption } from '../model';\n\ninterface RefreshIntervalPickerProps {\n timeOptions: TimeOption[];\n value?: DurationString;\n onChange: (value: DurationString) => void;\n height?: string;\n}\n\nexport function RefreshIntervalPicker(props: RefreshIntervalPickerProps): ReactElement {\n const { value, onChange, timeOptions, height } = props;\n\n // If the dashboard refresh interval is not provided in timeOptions, it will create a specific option for the select\n const customInterval = useMemo(() => {\n if (value && !timeOptions.some((option) => option.value.pastDuration === value)) {\n return <MenuItem value={value}>{value}</MenuItem>;\n }\n }, [timeOptions, value]);\n\n return (\n <FormControl>\n <Box>\n <Select\n id=\"refreshInterval\"\n value={value}\n onChange={(event) => {\n const duration = event.target.value as DurationString;\n onChange(duration);\n }}\n inputProps={{\n 'aria-label': `Select refresh interval. Currently set to ${value}`,\n }}\n sx={{\n '.MuiSelect-select': height ? { lineHeight: height, paddingY: 0 } : {},\n }}\n >\n {timeOptions.map((item, idx) => (\n <MenuItem key={idx} value={item.value.pastDuration}>\n {item.display}\n </MenuItem>\n ))}\n {customInterval}\n </Select>\n </Box>\n </FormControl>\n );\n}\n"],"names":["Box","FormControl","MenuItem","Select","useMemo","RefreshIntervalPicker","props","value","onChange","timeOptions","height","customInterval","some","option","pastDuration","id","event","duration","target","inputProps","sx","lineHeight","paddingY","map","item","idx","display"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,GAAG,EAAEC,WAAW,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,gBAAgB;AAEnE,SAAuBC,OAAO,QAAQ,QAAQ;AAW9C,OAAO,SAASC,sBAAsBC,KAAiC;IACrE,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,MAAM,EAAE,GAAGJ;IAEjD,oHAAoH;IACpH,MAAMK,iBAAiBP,QAAQ;QAC7B,IAAIG,SAAS,CAACE,YAAYG,IAAI,CAAC,CAACC,SAAWA,OAAON,KAAK,CAACO,YAAY,KAAKP,QAAQ;YAC/E,qBAAO,KAACL;gBAASK,OAAOA;0BAAQA;;QAClC;IACF,GAAG;QAACE;QAAaF;KAAM;IAEvB,qBACE,KAACN;kBACC,cAAA,KAACD;sBACC,cAAA,MAACG;gBACCY,IAAG;gBACHR,OAAOA;gBACPC,UAAU,CAACQ;oBACT,MAAMC,WAAWD,MAAME,MAAM,CAACX,KAAK;oBACnCC,SAASS;gBACX;gBACAE,YAAY;oBACV,cAAc,CAAC,0CAA0C,EAAEZ,OAAO;gBACpE;gBACAa,IAAI;oBACF,qBAAqBV,SAAS;wBAAEW,YAAYX;wBAAQY,UAAU;oBAAE,IAAI,CAAC;gBACvE;;oBAECb,YAAYc,GAAG,CAAC,CAACC,MAAMC,oBACtB,KAACvB;4BAAmBK,OAAOiB,KAAKjB,KAAK,CAACO,YAAY;sCAC/CU,KAAKE,OAAO;2BADAD;oBAIhBd;;;;;AAKX"}
@@ -0,0 +1,15 @@
1
+ import { SxProps, Theme } from '@mui/material';
2
+ import { ReactNode } from 'react';
3
+ export interface RepeatGridProps<T> {
4
+ repeatItems: T[];
5
+ maxPer: number;
6
+ gap: number;
7
+ renderItem: (item: T, options: {
8
+ rowIndex: number;
9
+ colIndex: number;
10
+ }) => ReactNode;
11
+ containerSx?: SxProps<Theme>;
12
+ rowSx?: SxProps<Theme>;
13
+ }
14
+ export declare function RepeatGrid<T>({ repeatItems, maxPer, gap, renderItem, containerSx, rowSx, }: RepeatGridProps<T>): ReactNode;
15
+ //# sourceMappingURL=RepeatGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RepeatGrid.d.ts","sourceRoot":"","sources":["../../src/RepeatGrid/RepeatGrid.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAO,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EAAE,SAAS,EAAW,MAAM,OAAO,CAAC;AAE3C,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,WAAW,EAAE,CAAC,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IACpF,WAAW,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;IAC7B,KAAK,CAAC,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;CACxB;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,EAC5B,WAAW,EACX,MAAM,EACN,GAAG,EACH,UAAU,EACV,WAAW,EACX,KAAK,GACN,EAAE,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAmChC"}
@@ -0,0 +1,68 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // Copyright The Perses Authors
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ import { Box } from '@mui/material';
15
+ import { useMemo } from 'react';
16
+ export function RepeatGrid({ repeatItems, maxPer, gap, renderItem, containerSx, rowSx }) {
17
+ const { rows, perRow } = useMemo(()=>{
18
+ const perRow = Math.max(1, maxPer);
19
+ const rows = [];
20
+ for(let i = 0; i < repeatItems.length; i += perRow){
21
+ rows.push(repeatItems.slice(i, i + perRow));
22
+ }
23
+ return {
24
+ rows,
25
+ perRow
26
+ };
27
+ }, [
28
+ maxPer,
29
+ repeatItems
30
+ ]);
31
+ return /*#__PURE__*/ _jsx(Box, {
32
+ sx: [
33
+ {
34
+ display: 'flex',
35
+ flexDirection: 'column',
36
+ width: '100%',
37
+ height: '100%',
38
+ gap: `${gap}px`
39
+ },
40
+ ...Array.isArray(containerSx) ? containerSx : [
41
+ containerSx
42
+ ]
43
+ ],
44
+ children: rows.map((rowItems, rowIndex)=>/*#__PURE__*/ _jsx(Box, {
45
+ sx: [
46
+ {
47
+ display: 'flex',
48
+ gap: `${gap}px`
49
+ },
50
+ ...Array.isArray(rowSx) ? rowSx : [
51
+ rowSx
52
+ ]
53
+ ],
54
+ children: rowItems.map((item, colIndex)=>/*#__PURE__*/ _jsx(Box, {
55
+ sx: {
56
+ width: `calc((100% - ${gap * (perRow - 1)}px) / ${perRow})`,
57
+ overflow: 'hidden'
58
+ },
59
+ children: renderItem(item, {
60
+ rowIndex,
61
+ colIndex
62
+ })
63
+ }, `${rowIndex}-${colIndex}`))
64
+ }, rowIndex))
65
+ });
66
+ }
67
+
68
+ //# sourceMappingURL=RepeatGrid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/RepeatGrid/RepeatGrid.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Box, SxProps, Theme } from '@mui/material';\nimport { ReactNode, useMemo } from 'react';\n\nexport interface RepeatGridProps<T> {\n repeatItems: T[];\n maxPer: number;\n gap: number;\n renderItem: (item: T, options: { rowIndex: number; colIndex: number }) => ReactNode;\n containerSx?: SxProps<Theme>;\n rowSx?: SxProps<Theme>;\n}\n\nexport function RepeatGrid<T>({\n repeatItems,\n maxPer,\n gap,\n renderItem,\n containerSx,\n rowSx,\n}: RepeatGridProps<T>): ReactNode {\n const { rows, perRow } = useMemo(() => {\n const perRow = Math.max(1, maxPer);\n const rows: T[][] = [];\n for (let i = 0; i < repeatItems.length; i += perRow) {\n rows.push(repeatItems.slice(i, i + perRow));\n }\n\n return { rows, perRow };\n }, [maxPer, repeatItems]);\n\n return (\n <Box\n sx={[\n { display: 'flex', flexDirection: 'column', width: '100%', height: '100%', gap: `${gap}px` },\n ...(Array.isArray(containerSx) ? containerSx : [containerSx]),\n ]}\n >\n {rows.map((rowItems, rowIndex) => (\n <Box key={rowIndex} sx={[{ display: 'flex', gap: `${gap}px` }, ...(Array.isArray(rowSx) ? rowSx : [rowSx])]}>\n {rowItems.map((item, colIndex) => (\n <Box\n key={`${rowIndex}-${colIndex}`}\n sx={{\n width: `calc((100% - ${gap * (perRow - 1)}px) / ${perRow})`,\n overflow: 'hidden',\n }}\n >\n {renderItem(item, { rowIndex, colIndex })}\n </Box>\n ))}\n </Box>\n ))}\n </Box>\n );\n}\n"],"names":["Box","useMemo","RepeatGrid","repeatItems","maxPer","gap","renderItem","containerSx","rowSx","rows","perRow","Math","max","i","length","push","slice","sx","display","flexDirection","width","height","Array","isArray","map","rowItems","rowIndex","item","colIndex","overflow"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,GAAG,QAAwB,gBAAgB;AACpD,SAAoBC,OAAO,QAAQ,QAAQ;AAW3C,OAAO,SAASC,WAAc,EAC5BC,WAAW,EACXC,MAAM,EACNC,GAAG,EACHC,UAAU,EACVC,WAAW,EACXC,KAAK,EACc;IACnB,MAAM,EAAEC,IAAI,EAAEC,MAAM,EAAE,GAAGT,QAAQ;QAC/B,MAAMS,SAASC,KAAKC,GAAG,CAAC,GAAGR;QAC3B,MAAMK,OAAc,EAAE;QACtB,IAAK,IAAII,IAAI,GAAGA,IAAIV,YAAYW,MAAM,EAAED,KAAKH,OAAQ;YACnDD,KAAKM,IAAI,CAACZ,YAAYa,KAAK,CAACH,GAAGA,IAAIH;QACrC;QAEA,OAAO;YAAED;YAAMC;QAAO;IACxB,GAAG;QAACN;QAAQD;KAAY;IAExB,qBACE,KAACH;QACCiB,IAAI;YACF;gBAAEC,SAAS;gBAAQC,eAAe;gBAAUC,OAAO;gBAAQC,QAAQ;gBAAQhB,KAAK,GAAGA,IAAI,EAAE,CAAC;YAAC;eACvFiB,MAAMC,OAAO,CAAChB,eAAeA,cAAc;gBAACA;aAAY;SAC7D;kBAEAE,KAAKe,GAAG,CAAC,CAACC,UAAUC,yBACnB,KAAC1B;gBAAmBiB,IAAI;oBAAC;wBAAEC,SAAS;wBAAQb,KAAK,GAAGA,IAAI,EAAE,CAAC;oBAAC;uBAAOiB,MAAMC,OAAO,CAACf,SAASA,QAAQ;wBAACA;qBAAM;iBAAE;0BACxGiB,SAASD,GAAG,CAAC,CAACG,MAAMC,yBACnB,KAAC5B;wBAECiB,IAAI;4BACFG,OAAO,CAAC,aAAa,EAAEf,MAAOK,CAAAA,SAAS,CAAA,EAAG,MAAM,EAAEA,OAAO,CAAC,CAAC;4BAC3DmB,UAAU;wBACZ;kCAECvB,WAAWqB,MAAM;4BAAED;4BAAUE;wBAAS;uBANlC,GAAGF,SAAS,CAAC,EAAEE,UAAU;eAH1BF;;AAgBlB"}
@@ -0,0 +1,2 @@
1
+ export * from './RepeatGrid';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/RepeatGrid/index.ts"],"names":[],"mappings":"AAaA,cAAc,cAAc,CAAC"}
@@ -0,0 +1,15 @@
1
+ // Copyright The Perses Authors
2
+ // Licensed under the Apache License, Version 2.0 (the "License");
3
+ // you may not use this file except in compliance with the License.
4
+ // You may obtain a copy of the License at
5
+ //
6
+ // http://www.apache.org/licenses/LICENSE-2.0
7
+ //
8
+ // Unless required by applicable law or agreed to in writing, software
9
+ // distributed under the License is distributed on an "AS IS" BASIS,
10
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
+ // See the License for the specific language governing permissions and
12
+ // limitations under the License.
13
+ export * from './RepeatGrid';
14
+
15
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/RepeatGrid/index.ts"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nexport * from './RepeatGrid';\n"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AAEjC,cAAc,eAAe"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/SettingsAutocomplete/SettingsAutocomplete.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n Autocomplete,\n AutocompleteProps,\n TextField,\n Typography,\n UseAutocompleteProps,\n createFilterOptions,\n} from '@mui/material';\nimport { ReactElement, ReactNode } from 'react';\n\n/**\n * Interface to extend from for `options` when using `SettingsAutocomplete`.\n */\nexport interface SettingsAutocompleteOption {\n /**\n * Unique identifier for the option.\n */\n id: string;\n\n /**\n * Optional value that is presented to the user for each option. If not set,\n * the `id` will be used instead.\n */\n label?: string;\n\n /**\n * Optional description that will be rendered below the `label` to provide the\n * user with additional information about the option.\n */\n description?: ReactNode;\n\n /**\n * When `true`, the option will be disabled.\n */\n disabled?: boolean;\n}\n\nexport interface SettingsAutocompleteProps<\n OptionType extends SettingsAutocompleteOption,\n Multiple extends boolean | undefined,\n DisableClearable extends boolean | undefined,\n // Note that the last `false` in the generic arguments sets the `freeSolo` option to `false`.\n // This component is intended to be used with a discrete list of options, so `freeSolo` never\n // needs to be `true`.\n> extends Omit<AutocompleteProps<OptionType, Multiple, DisableClearable, false>, 'renderInput'> {\n // Modifying this to optional, so we can define a sensible default below that\n // is used in many of the simple cases.\n renderInput?: AutocompleteProps<OptionType, Multiple, DisableClearable, false>['renderInput'];\n}\n\n/**\n * Opinionated autocomplete component useful for providing users with a dropdown\n * for settings that require selecting one or more options from a list.\n *\n * **Note: This component is currently experimental and is likely to have significant breaking changes in the near future. Use with caution outside of the core Perses codebase.**\n */\nexport function SettingsAutocomplete<\n OptionType extends SettingsAutocompleteOption,\n Multiple extends boolean | undefined = false,\n DisableClearable extends boolean | undefined = false,\n>({\n options,\n renderInput = (params): ReactElement => <TextField {...params} />,\n id,\n 'aria-labelledby': ariaLabelledby,\n ...otherProps\n}: SettingsAutocompleteProps<OptionType, Multiple, DisableClearable>): ReactElement {\n const getOptionLabel: UseAutocompleteProps<OptionType, undefined, boolean, undefined>['getOptionLabel'] = (\n option\n ) => {\n return option.label ?? option.id;\n };\n\n // Merge id and aria-labelledby props into the input element for proper accessibility\n // and form association, while still allowing custom renderInput implementations.\n const handleRenderInput: AutocompleteProps<OptionType, Multiple, DisableClearable, false>['renderInput'] = (\n params\n ) => {\n const mergedParams = {\n ...params,\n inputProps: { ...params.inputProps, id, 'aria-labelledby': ariaLabelledby },\n };\n return renderInput(mergedParams);\n };\n\n // Note: this component currently is not virtualized because it is specific\n // to being used for settings, which generally have a pretty small list of\n // options. If this changes to include values with many options, virtualization\n // should be added using react-virtuoso.\n return (\n <Autocomplete\n isOptionEqualToValue={(option, value) => option.id === value.id}\n getOptionDisabled={(option) => !!option.disabled}\n getOptionLabel={getOptionLabel}\n options={options}\n renderInput={handleRenderInput}\n renderOption={({ key, ...props }, option) => {\n return (\n <li key={key} {...props}>\n <div>\n <Typography variant=\"body1\" component=\"div\">\n {getOptionLabel(option)}\n </Typography>\n {option.description && (\n <Typography variant=\"body2\" component=\"div\" sx={{ color: (theme) => theme.palette.text.secondary }}>\n {option.description}\n </Typography>\n )}\n </div>\n </li>\n );\n }}\n filterOptions={createFilterOptions({\n // Include the label and the description in search.\n stringify: (option) => `${getOptionLabel(option)} ${option.description || ''}`,\n })}\n {...otherProps}\n />\n );\n}\n"],"names":["Autocomplete","TextField","Typography","createFilterOptions","SettingsAutocomplete","options","renderInput","params","id","ariaLabelledby","otherProps","getOptionLabel","option","label","handleRenderInput","mergedParams","inputProps","isOptionEqualToValue","value","getOptionDisabled","disabled","renderOption","key","props","li","div","variant","component","description","sx","color","theme","palette","text","secondary","filterOptions","stringify"],"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,SACEA,YAAY,EAEZC,SAAS,EACTC,UAAU,EAEVC,mBAAmB,QACd,gBAAgB;AA2CvB;;;;;CAKC,GACD,OAAO,SAASC,qBAId,EACAC,OAAO,EACPC,cAAc,CAACC,uBAAyB,KAACN;QAAW,GAAGM,MAAM;MAAI,EACjEC,EAAE,EACF,mBAAmBC,cAAc,EACjC,GAAGC,YAC+D;IAClE,MAAMC,iBAAoG,CACxGC;QAEA,OAAOA,OAAOC,KAAK,IAAID,OAAOJ,EAAE;IAClC;IAEA,qFAAqF;IACrF,iFAAiF;IACjF,MAAMM,oBAAqG,CACzGP;QAEA,MAAMQ,eAAe;YACnB,GAAGR,MAAM;YACTS,YAAY;gBAAE,GAAGT,OAAOS,UAAU;gBAAER;gBAAI,mBAAmBC;YAAe;QAC5E;QACA,OAAOH,YAAYS;IACrB;IAEA,2EAA2E;IAC3E,0EAA0E;IAC1E,+EAA+E;IAC/E,wCAAwC;IACxC,qBACE,KAACf;QACCiB,sBAAsB,CAACL,QAAQM,QAAUN,OAAOJ,EAAE,KAAKU,MAAMV,EAAE;QAC/DW,mBAAmB,CAACP,SAAW,CAAC,CAACA,OAAOQ,QAAQ;QAChDT,gBAAgBA;QAChBN,SAASA;QACTC,aAAaQ;QACbO,cAAc,CAAC,EAAEC,GAAG,EAAE,GAAGC,OAAO,EAAEX;YAChC,qBACE,KAACY;gBAAc,GAAGD,KAAK;0BACrB,cAAA,MAACE;;sCACC,KAACvB;4BAAWwB,SAAQ;4BAAQC,WAAU;sCACnChB,eAAeC;;wBAEjBA,OAAOgB,WAAW,kBACjB,KAAC1B;4BAAWwB,SAAQ;4BAAQC,WAAU;4BAAME,IAAI;gCAAEC,OAAO,CAACC,QAAUA,MAAMC,OAAO,CAACC,IAAI,CAACC,SAAS;4BAAC;sCAC9FtB,OAAOgB,WAAW;;;;eAPlBN;QAab;QACAa,eAAehC,oBAAoB;YACjC,mDAAmD;YACnDiC,WAAW,CAACxB,SAAW,GAAGD,eAAeC,QAAQ,CAAC,EAAEA,OAAOgB,WAAW,IAAI,IAAI;QAChF;QACC,GAAGlB,UAAU;;AAGpB"}
1
+ {"version":3,"sources":["../../src/SettingsAutocomplete/SettingsAutocomplete.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {\n Autocomplete,\n AutocompleteProps,\n TextField,\n Typography,\n UseAutocompleteProps,\n createFilterOptions,\n} from '@mui/material';\nimport { ReactElement, ReactNode } from 'react';\n\n/**\n * Interface to extend from for `options` when using `SettingsAutocomplete`.\n */\nexport interface SettingsAutocompleteOption {\n /**\n * Unique identifier for the option.\n */\n id: string;\n\n /**\n * Optional value that is presented to the user for each option. If not set,\n * the `id` will be used instead.\n */\n label?: string;\n\n /**\n * Optional description that will be rendered below the `label` to provide the\n * user with additional information about the option.\n */\n description?: ReactNode;\n\n /**\n * When `true`, the option will be disabled.\n */\n disabled?: boolean;\n}\n\nexport interface SettingsAutocompleteProps<\n OptionType extends SettingsAutocompleteOption,\n Multiple extends boolean | undefined,\n DisableClearable extends boolean | undefined,\n // Note that the last `false` in the generic arguments sets the `freeSolo` option to `false`.\n // This component is intended to be used with a discrete list of options, so `freeSolo` never\n // needs to be `true`.\n> extends Omit<AutocompleteProps<OptionType, Multiple, DisableClearable, false>, 'renderInput'> {\n // Modifying this to optional, so we can define a sensible default below that\n // is used in many of the simple cases.\n renderInput?: AutocompleteProps<OptionType, Multiple, DisableClearable, false>['renderInput'];\n}\n\n/**\n * Opinionated autocomplete component useful for providing users with a dropdown\n * for settings that require selecting one or more options from a list.\n *\n * **Note: This component is currently experimental and is likely to have significant breaking changes in the near future. Use with caution outside of the core Perses codebase.**\n */\nexport function SettingsAutocomplete<\n OptionType extends SettingsAutocompleteOption,\n Multiple extends boolean | undefined = false,\n DisableClearable extends boolean | undefined = false,\n>({\n options,\n renderInput = (params): ReactElement => <TextField {...params} />,\n id,\n 'aria-labelledby': ariaLabelledby,\n ...otherProps\n}: SettingsAutocompleteProps<OptionType, Multiple, DisableClearable>): ReactElement {\n const getOptionLabel: UseAutocompleteProps<OptionType, undefined, boolean, undefined>['getOptionLabel'] = (\n option,\n ) => {\n return option.label ?? option.id;\n };\n\n // Merge id and aria-labelledby props into the input element for proper accessibility\n // and form association, while still allowing custom renderInput implementations.\n const handleRenderInput: AutocompleteProps<OptionType, Multiple, DisableClearable, false>['renderInput'] = (\n params,\n ) => {\n const mergedParams = {\n ...params,\n inputProps: { ...params.inputProps, id, 'aria-labelledby': ariaLabelledby },\n };\n return renderInput(mergedParams);\n };\n\n // Note: this component currently is not virtualized because it is specific\n // to being used for settings, which generally have a pretty small list of\n // options. If this changes to include values with many options, virtualization\n // should be added using react-virtuoso.\n return (\n <Autocomplete\n isOptionEqualToValue={(option, value) => option.id === value.id}\n getOptionDisabled={(option) => !!option.disabled}\n getOptionLabel={getOptionLabel}\n options={options}\n renderInput={handleRenderInput}\n renderOption={({ key, ...props }, option) => {\n return (\n <li key={key} {...props}>\n <div>\n <Typography variant=\"body1\" component=\"div\">\n {getOptionLabel(option)}\n </Typography>\n {option.description && (\n <Typography variant=\"body2\" component=\"div\" sx={{ color: (theme) => theme.palette.text.secondary }}>\n {option.description}\n </Typography>\n )}\n </div>\n </li>\n );\n }}\n filterOptions={createFilterOptions({\n // Include the label and the description in search.\n stringify: (option) => `${getOptionLabel(option)} ${option.description || ''}`,\n })}\n {...otherProps}\n />\n );\n}\n"],"names":["Autocomplete","TextField","Typography","createFilterOptions","SettingsAutocomplete","options","renderInput","params","id","ariaLabelledby","otherProps","getOptionLabel","option","label","handleRenderInput","mergedParams","inputProps","isOptionEqualToValue","value","getOptionDisabled","disabled","renderOption","key","props","li","div","variant","component","description","sx","color","theme","palette","text","secondary","filterOptions","stringify"],"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,SACEA,YAAY,EAEZC,SAAS,EACTC,UAAU,EAEVC,mBAAmB,QACd,gBAAgB;AA2CvB;;;;;CAKC,GACD,OAAO,SAASC,qBAId,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d.ts","sourceRoot":"","sources":["../../src/SortSelector/SortSelector.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AASrC,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,KAAc,EAAE,EAAE,iBAAiB,GAAG,YAAY,CAmB1F"}
1
+ {"version":3,"file":"SortSelector.d.ts","sourceRoot":"","sources":["../../src/SortSelector/SortSelector.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAUrC,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,MAAM,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,CAAC,IAAI,EAAE,UAAU,KAAK,IAAI,CAAC;IACrC,KAAK,CAAC,EAAE,UAAU,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,KAAc,EAAE,EAAE,iBAAiB,GAAG,YAAY,CAmB1F"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/SortSelector/SortSelector.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License | Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing | software\n// distributed under the License is distributed on an \"AS IS\" BASIS |\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND | either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement } from 'react';\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst SORT_OPTIONS: Array<{ id: SortOption; label: string }> = [\n { id: 'asc', label: 'Ascending' },\n { id: 'desc', label: 'Descending' },\n];\n\nexport type SortOption = 'asc' | 'desc';\n\nexport interface SortSelectorProps {\n onChange: (sort: SortOption) => void;\n value?: SortOption;\n}\n\nexport function SortSelector({ onChange, value = 'desc' }: SortSelectorProps): ReactElement {\n const handleSortChange = (_: unknown, { id }: { id: SortOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Sort\"\n control={\n <SettingsAutocomplete\n value={SORT_OPTIONS.find((o) => o.id === value)}\n options={SORT_OPTIONS}\n getOptionLabel={(o) => o.label}\n onChange={handleSortChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","SORT_OPTIONS","id","label","SortSelector","onChange","value","handleSortChange","_","control","find","o","options","getOptionLabel","disableClearable"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;AAGjC,SAASA,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,oBAAoB,QAAQ,0BAA0B;AAE/D,MAAMC,eAAyD;IAC7D;QAAEC,IAAI;QAAOC,OAAO;IAAY;IAChC;QAAED,IAAI;QAAQC,OAAO;IAAa;CACnC;AASD,OAAO,SAASC,aAAa,EAAEC,QAAQ,EAAEC,QAAQ,MAAM,EAAqB;IAC1E,MAAMC,mBAAmB,CAACC,GAAY,EAAEN,EAAE,EAAsB;QAC9DG,SAASH;IACX;IAEA,qBACE,KAACH;QACCI,OAAM;QACNM,uBACE,KAACT;YACCM,OAAOL,aAAaS,IAAI,CAAC,CAACC,IAAMA,EAAET,EAAE,KAAKI;YACzCM,SAASX;YACTY,gBAAgB,CAACF,IAAMA,EAAER,KAAK;YAC9BE,UAAUE;YACVO,gBAAgB;;;AAK1B"}
1
+ {"version":3,"sources":["../../src/SortSelector/SortSelector.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License | Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing | software\n// distributed under the License is distributed on an \"AS IS\" BASIS |\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND | either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { ReactElement } from 'react';\n\nimport { OptionsEditorControl } from '../OptionsEditorLayout';\nimport { SettingsAutocomplete } from '../SettingsAutocomplete';\n\nconst SORT_OPTIONS: Array<{ id: SortOption; label: string }> = [\n { id: 'asc', label: 'Ascending' },\n { id: 'desc', label: 'Descending' },\n];\n\nexport type SortOption = 'asc' | 'desc';\n\nexport interface SortSelectorProps {\n onChange: (sort: SortOption) => void;\n value?: SortOption;\n}\n\nexport function SortSelector({ onChange, value = 'desc' }: SortSelectorProps): ReactElement {\n const handleSortChange = (_: unknown, { id }: { id: SortOption }): void => {\n onChange(id);\n };\n\n return (\n <OptionsEditorControl\n label=\"Sort\"\n control={\n <SettingsAutocomplete\n value={SORT_OPTIONS.find((o) => o.id === value)}\n options={SORT_OPTIONS}\n getOptionLabel={(o) => o.label}\n onChange={handleSortChange}\n disableClearable\n />\n }\n />\n );\n}\n"],"names":["OptionsEditorControl","SettingsAutocomplete","SORT_OPTIONS","id","label","SortSelector","onChange","value","handleSortChange","_","control","find","o","options","getOptionLabel","disableClearable"],"mappings":"AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;;AAIjC,SAASA,oBAAoB,QAAQ,yBAAyB;AAC9D,SAASC,oBAAoB,QAAQ,0BAA0B;AAE/D,MAAMC,eAAyD;IAC7D;QAAEC,IAAI;QAAOC,OAAO;IAAY;IAChC;QAAED,IAAI;QAAQC,OAAO;IAAa;CACnC;AASD,OAAO,SAASC,aAAa,EAAEC,QAAQ,EAAEC,QAAQ,MAAM,EAAqB;IAC1E,MAAMC,mBAAmB,CAACC,GAAY,EAAEN,EAAE,EAAsB;QAC9DG,SAASH;IACX;IAEA,qBACE,KAACH;QACCI,OAAM;QACNM,uBACE,KAACT;YACCM,OAAOL,aAAaS,IAAI,CAAC,CAACC,IAAMA,EAAET,EAAE,KAAKI;YACzCM,SAASX;YACTY,gBAAgB,CAACF,IAAMA,EAAER,KAAK;YAC9BE,UAAUE;YACVO,gBAAgB;;;AAK1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"SortSelectorButtons.d.ts","sourceRoot":"","sources":["../../src/SortSelector/SortSelectorButtons.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAuB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAClF,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,GAAG,YAAY,CAkBzG"}
1
+ {"version":3,"file":"SortSelectorButtons.d.ts","sourceRoot":"","sources":["../../src/SortSelector/SortSelectorButtons.tsx"],"names":[],"mappings":"AAaA,OAAO,EAAuB,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,wBAAyB,SAAQ,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAClF,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;CACvC;AAED,wBAAgB,mBAAmB,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,wBAAwB,GAAG,YAAY,CAkBzG"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/SortSelector/SortSelectorButtons.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License | Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing | software\n// distributed under the License is distributed on an \"AS IS\" BASIS |\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND | either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Button, ButtonGroup, ButtonGroupProps } from '@mui/material';\nimport { ReactElement } from 'react';\nimport { SortOption } from './SortSelector';\n\nexport interface SortSelectorButtonsProps extends Omit<ButtonGroupProps, 'onChange'> {\n value?: SortOption;\n onChange: (sort?: SortOption) => void;\n}\n\nexport function SortSelectorButtons({ onChange, value, ...props }: SortSelectorButtonsProps): ReactElement {\n const handleSortChange = (sort?: SortOption): void => {\n onChange(sort);\n };\n\n return (\n <ButtonGroup aria-label=\"Sort\" {...props}>\n <Button onClick={() => handleSortChange(undefined)} variant={value === undefined ? 'contained' : 'outlined'}>\n None\n </Button>\n <Button onClick={() => handleSortChange('asc')} variant={value === 'asc' ? 'contained' : 'outlined'}>\n Asc\n </Button>\n <Button onClick={() => handleSortChange('desc')} variant={value === 'desc' ? 'contained' : 'outlined'}>\n Desc\n </Button>\n </ButtonGroup>\n );\n}\n"],"names":["Button","ButtonGroup","SortSelectorButtons","onChange","value","props","handleSortChange","sort","aria-label","onClick","undefined","variant"],"mappings":";AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,MAAM,EAAEC,WAAW,QAA0B,gBAAgB;AAStE,OAAO,SAASC,oBAAoB,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGC,OAAiC;IACzF,MAAMC,mBAAmB,CAACC;QACxBJ,SAASI;IACX;IAEA,qBACE,MAACN;QAAYO,cAAW;QAAQ,GAAGH,KAAK;;0BACtC,KAACL;gBAAOS,SAAS,IAAMH,iBAAiBI;gBAAYC,SAASP,UAAUM,YAAY,cAAc;0BAAY;;0BAG7G,KAACV;gBAAOS,SAAS,IAAMH,iBAAiB;gBAAQK,SAASP,UAAU,QAAQ,cAAc;0BAAY;;0BAGrG,KAACJ;gBAAOS,SAAS,IAAMH,iBAAiB;gBAASK,SAASP,UAAU,SAAS,cAAc;0BAAY;;;;AAK7G"}
1
+ {"version":3,"sources":["../../src/SortSelector/SortSelectorButtons.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License | Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing | software\n// distributed under the License is distributed on an \"AS IS\" BASIS |\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND | either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Button, ButtonGroup, ButtonGroupProps } from '@mui/material';\nimport { ReactElement } from 'react';\n\nimport { SortOption } from './SortSelector';\n\nexport interface SortSelectorButtonsProps extends Omit<ButtonGroupProps, 'onChange'> {\n value?: SortOption;\n onChange: (sort?: SortOption) => void;\n}\n\nexport function SortSelectorButtons({ onChange, value, ...props }: SortSelectorButtonsProps): ReactElement {\n const handleSortChange = (sort?: SortOption): void => {\n onChange(sort);\n };\n\n return (\n <ButtonGroup aria-label=\"Sort\" {...props}>\n <Button onClick={() => handleSortChange(undefined)} variant={value === undefined ? 'contained' : 'outlined'}>\n None\n </Button>\n <Button onClick={() => handleSortChange('asc')} variant={value === 'asc' ? 'contained' : 'outlined'}>\n Asc\n </Button>\n <Button onClick={() => handleSortChange('desc')} variant={value === 'desc' ? 'contained' : 'outlined'}>\n Desc\n </Button>\n </ButtonGroup>\n );\n}\n"],"names":["Button","ButtonGroup","SortSelectorButtons","onChange","value","props","handleSortChange","sort","aria-label","onClick","undefined","variant"],"mappings":";AAAA,+BAA+B;AAC/B,oEAAoE;AACpE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,wEAAwE;AACxE,qEAAqE;AACrE,6EAA6E;AAC7E,sEAAsE;AACtE,iCAAiC;AAEjC,SAASA,MAAM,EAAEC,WAAW,QAA0B,gBAAgB;AAUtE,OAAO,SAASC,oBAAoB,EAAEC,QAAQ,EAAEC,KAAK,EAAE,GAAGC,OAAiC;IACzF,MAAMC,mBAAmB,CAACC;QACxBJ,SAASI;IACX;IAEA,qBACE,MAACN;QAAYO,cAAW;QAAQ,GAAGH,KAAK;;0BACtC,KAACL;gBAAOS,SAAS,IAAMH,iBAAiBI;gBAAYC,SAASP,UAAUM,YAAY,cAAc;0BAAY;;0BAG7G,KAACV;gBAAOS,SAAS,IAAMH,iBAAiB;gBAAQK,SAASP,UAAU,QAAQ,cAAc;0BAAY;;0BAGrG,KAACJ;gBAAOS,SAAS,IAAMH,iBAAiB;gBAASK,SAASP,UAAU,SAAS,cAAc;0BAAY;;;;AAK7G"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { TableProps as MuiTableProps } from '@mui/material';
3
2
  import { TableDensity } from './model/table-model';
4
3
  type InnerTableProps = Omit<MuiTableProps, 'size'> & {
@@ -1 +1 @@
1
- {"version":3,"file":"InnerTable.d.ts","sourceRoot":"","sources":["../../src/Table/InnerTable.tsx"],"names":[],"mappings":";AAaA,OAAO,EAA6B,UAAU,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASnD,KAAK,eAAe,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG;IACnD,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAQF,eAAO,MAAM,UAAU,2HAerB,CAAC"}
1
+ {"version":3,"file":"InnerTable.d.ts","sourceRoot":"","sources":["../../src/Table/InnerTable.tsx"],"names":[],"mappings":"AAaA,OAAO,EAA6B,UAAU,IAAI,aAAa,EAAE,MAAM,eAAe,CAAC;AAGvF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AASnD,KAAK,eAAe,GAAG,IAAI,CAAC,aAAa,EAAE,MAAM,CAAC,GAAG;IACnD,OAAO,EAAE,YAAY,CAAC;CACvB,CAAC;AAQF,eAAO,MAAM,UAAU,2HAerB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Table/InnerTable.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Table as MuiTable, styled, TableProps as MuiTableProps } from '@mui/material';\nimport { forwardRef } from 'react';\nimport { TableDensity } from './model/table-model';\n\nconst StyledMuiTable = styled(MuiTable)(({ theme }) => ({\n // This value is needed to have a consistent table layout when scrolling.\n tableLayout: 'fixed',\n borderCollapse: 'separate',\n backgroundColor: theme.palette.background.default,\n}));\n\ntype InnerTableProps = Omit<MuiTableProps, 'size'> & {\n density: TableDensity;\n};\n\nconst TABLE_DENSITY_CONFIG: Record<TableDensity, MuiTableProps['size']> = {\n compact: 'small',\n standard: 'medium',\n comfortable: 'medium',\n};\n\nexport const InnerTable = forwardRef<HTMLTableElement, InnerTableProps>(function InnerTable(\n { density, ...otherProps },\n ref\n) {\n return (\n <StyledMuiTable\n {...otherProps}\n tabIndex={-1}\n size={TABLE_DENSITY_CONFIG[density]}\n ref={ref}\n sx={{\n width: '100%',\n }}\n />\n );\n});\n"],"names":["Table","MuiTable","styled","forwardRef","StyledMuiTable","theme","tableLayout","borderCollapse","backgroundColor","palette","background","default","TABLE_DENSITY_CONFIG","compact","standard","comfortable","InnerTable","density","otherProps","ref","tabIndex","size","sx","width"],"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,SAASC,QAAQ,EAAEC,MAAM,QAAqC,gBAAgB;AACvF,SAASC,UAAU,QAAQ,QAAQ;AAGnC,MAAMC,iBAAiBF,OAAOD,UAAU,CAAC,EAAEI,KAAK,EAAE,GAAM,CAAA;QACtD,yEAAyE;QACzEC,aAAa;QACbC,gBAAgB;QAChBC,iBAAiBH,MAAMI,OAAO,CAACC,UAAU,CAACC,OAAO;IACnD,CAAA;AAMA,MAAMC,uBAAoE;IACxEC,SAAS;IACTC,UAAU;IACVC,aAAa;AACf;AAEA,OAAO,MAAMC,2BAAab,WAA8C,SAASa,WAC/E,EAAEC,OAAO,EAAE,GAAGC,YAAY,EAC1BC,GAAG;IAEH,qBACE,KAACf;QACE,GAAGc,UAAU;QACdE,UAAU,CAAC;QACXC,MAAMT,oBAAoB,CAACK,QAAQ;QACnCE,KAAKA;QACLG,IAAI;YACFC,OAAO;QACT;;AAGN,GAAG"}
1
+ {"version":3,"sources":["../../src/Table/InnerTable.tsx"],"sourcesContent":["// Copyright The Perses Authors\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport { Table as MuiTable, styled, TableProps as MuiTableProps } from '@mui/material';\nimport { forwardRef } from 'react';\n\nimport { TableDensity } from './model/table-model';\n\nconst StyledMuiTable = styled(MuiTable)(({ theme }) => ({\n // This value is needed to have a consistent table layout when scrolling.\n tableLayout: 'fixed',\n borderCollapse: 'separate',\n backgroundColor: theme.palette.background.default,\n}));\n\ntype InnerTableProps = Omit<MuiTableProps, 'size'> & {\n density: TableDensity;\n};\n\nconst TABLE_DENSITY_CONFIG: Record<TableDensity, MuiTableProps['size']> = {\n compact: 'small',\n standard: 'medium',\n comfortable: 'medium',\n};\n\nexport const InnerTable = forwardRef<HTMLTableElement, InnerTableProps>(function InnerTable(\n { density, ...otherProps },\n ref,\n) {\n return (\n <StyledMuiTable\n {...otherProps}\n tabIndex={-1}\n size={TABLE_DENSITY_CONFIG[density]}\n ref={ref}\n sx={{\n width: '100%',\n }}\n />\n );\n});\n"],"names":["Table","MuiTable","styled","forwardRef","StyledMuiTable","theme","tableLayout","borderCollapse","backgroundColor","palette","background","default","TABLE_DENSITY_CONFIG","compact","standard","comfortable","InnerTable","density","otherProps","ref","tabIndex","size","sx","width"],"mappings":";AAAA,+BAA+B;AAC/B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,6CAA6C;AAC7C,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E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 {"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../src/Table/Table.tsx"],"names":[],"mappings":"AA6BA,OAAO,EAAE,YAAY,EAAkC,MAAM,OAAO,CAAC;AAGrE,OAAO,EAAwD,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAcvG;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,SAAS,EAAE,EAC/B,IAAI,EACJ,OAAO,EACP,WAAW,EACX,OAAoB,EACpB,kBAAyC,EACzC,mBAA4B,EAC5B,iBAAiB,EACjB,oBAAoB,EACpB,eAAe,EACf,gBAAgB,EAChB,QAA6B,EAC7B,YAAoC,EACpC,OAAyB,EACzB,cAAc,EACd,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,mBAAgC,EAChC,UAAU,EACV,aAAa,EACb,kBAAkB,EAClB,gBAA6B,EAC7B,mBAAmB,EACnB,GAAG,UAAU,EACd,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,YAAY,CAoMtC"}
@@ -15,9 +15,9 @@ import { Stack, useTheme } from '@mui/material';
15
15
  import { getCoreRowModel, getExpandedRowModel, getPaginationRowModel, getSortedRowModel, useReactTable } from '@tanstack/react-table';
16
16
  import { useCallback, useMemo, useState } from 'react';
17
17
  import { useFuzzySearch } from './hooks/useFuzzySearch';
18
+ import { DEFAULT_COLUMN_WIDTH, persesColumnsToTanstackColumns } from './model/table-model';
18
19
  import { TableCheckbox } from './TableCheckbox';
19
20
  import { VirtualizedTable } from './VirtualizedTable';
20
- import { DEFAULT_COLUMN_WIDTH, persesColumnsToTanstackColumns } from './model/table-model';
21
21
  const DEFAULT_GET_ROW_ID = (data, index)=>{
22
22
  return `${index}`;
23
23
  };