@perses-dev/components 0.50.0 → 0.51.0-beta.0

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 (153) hide show
  1. package/dist/ColorPicker/ColorPicker.js +2 -2
  2. package/dist/ColorPicker/ColorPicker.js.map +1 -1
  3. package/dist/ContentWithLegend/model/content-with-legend-model.js +2 -3
  4. package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
  5. package/dist/DragAndDrop/DragButton.d.ts +2 -2
  6. package/dist/DragAndDrop/DragButton.d.ts.map +1 -1
  7. package/dist/DragAndDrop/DragButton.js +6 -4
  8. package/dist/DragAndDrop/DragButton.js.map +1 -1
  9. package/dist/Drawer/Drawer.js +1 -1
  10. package/dist/Drawer/Drawer.js.map +1 -1
  11. package/dist/EChart/EChart.js +3 -4
  12. package/dist/EChart/EChart.js.map +1 -1
  13. package/dist/GaugeChart/GaugeChart.js +2 -5
  14. package/dist/GaugeChart/GaugeChart.js.map +1 -1
  15. package/dist/InfoTooltip/InfoTooltip.js +5 -4
  16. package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
  17. package/dist/Legend/ListLegendItem.js +3 -4
  18. package/dist/Legend/ListLegendItem.js.map +1 -1
  19. package/dist/LineChart/LineChart.js +4 -8
  20. package/dist/LineChart/LineChart.js.map +1 -1
  21. package/dist/LinksEditor/LinksEditor.js +9 -18
  22. package/dist/LinksEditor/LinksEditor.js.map +1 -1
  23. package/dist/Overlay/Overlay.js +1 -1
  24. package/dist/Overlay/Overlay.js.map +1 -1
  25. package/dist/SettingsAutocomplete/SettingsAutocomplete.js +1 -2
  26. package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
  27. package/dist/StatChart/StatChart.d.ts +4 -4
  28. package/dist/StatChart/StatChart.d.ts.map +1 -1
  29. package/dist/StatChart/StatChart.js +9 -15
  30. package/dist/StatChart/StatChart.js.map +1 -1
  31. package/dist/StatChart/calculateFontSize.js +2 -4
  32. package/dist/StatChart/calculateFontSize.js.map +1 -1
  33. package/dist/StatChart/utils/formatStatChartValue.d.ts +3 -0
  34. package/dist/StatChart/utils/formatStatChartValue.d.ts.map +1 -0
  35. package/dist/StatChart/utils/formatStatChartValue.js +26 -0
  36. package/dist/StatChart/utils/formatStatChartValue.js.map +1 -0
  37. package/dist/StatusHistoryChart/StatusHistoryChart.d.ts +16 -3
  38. package/dist/StatusHistoryChart/StatusHistoryChart.d.ts.map +1 -1
  39. package/dist/StatusHistoryChart/StatusHistoryChart.js +9 -26
  40. package/dist/StatusHistoryChart/StatusHistoryChart.js.map +1 -1
  41. package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts +2 -1
  42. package/dist/StatusHistoryChart/StatusHistoryTooltip.d.ts.map +1 -1
  43. package/dist/StatusHistoryChart/StatusHistoryTooltip.js +3 -3
  44. package/dist/StatusHistoryChart/StatusHistoryTooltip.js.map +1 -1
  45. package/dist/StatusHistoryChart/utils/get-color.d.ts +1 -1
  46. package/dist/StatusHistoryChart/utils/get-color.d.ts.map +1 -1
  47. package/dist/StatusHistoryChart/utils/get-color.js +5 -5
  48. package/dist/StatusHistoryChart/utils/get-color.js.map +1 -1
  49. package/dist/Table/Table.js +5 -5
  50. package/dist/Table/Table.js.map +1 -1
  51. package/dist/Table/TableCell.js +5 -6
  52. package/dist/Table/TableCell.js.map +1 -1
  53. package/dist/Table/VirtualizedTable.js +11 -14
  54. package/dist/Table/VirtualizedTable.js.map +1 -1
  55. package/dist/Table/hooks/useTableKeyboardNav.js +1 -1
  56. package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
  57. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +7 -13
  58. package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
  59. package/dist/Table/model/table-model.js +1 -1
  60. package/dist/Table/model/table-model.js.map +1 -1
  61. package/dist/ThresholdsEditor/ThresholdsEditor.js +15 -23
  62. package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
  63. package/dist/TimeChart/TimeChart.js +3 -6
  64. package/dist/TimeChart/TimeChart.js.map +1 -1
  65. package/dist/TimeSeriesTooltip/LineChartTooltip.js +6 -11
  66. package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
  67. package/dist/TimeSeriesTooltip/SeriesInfo.js +1 -2
  68. package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
  69. package/dist/TimeSeriesTooltip/TimeChartTooltip.js +2 -3
  70. package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
  71. package/dist/TimeSeriesTooltip/TooltipHeader.js +4 -10
  72. package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
  73. package/dist/TimeSeriesTooltip/nearby-series.js +13 -23
  74. package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
  75. package/dist/TimeSeriesTooltip/utils.js +2 -4
  76. package/dist/TimeSeriesTooltip/utils.js.map +1 -1
  77. package/dist/TransformsEditor/TransformEditor.js +4 -7
  78. package/dist/TransformsEditor/TransformEditor.js.map +1 -1
  79. package/dist/TransformsEditor/TransformEditorContainer.js +3 -5
  80. package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
  81. package/dist/TransformsEditor/TransformsEditor.js +3 -6
  82. package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
  83. package/dist/ValueMappingEditor/ValueMappingEditor.d.ts +10 -0
  84. package/dist/ValueMappingEditor/ValueMappingEditor.d.ts.map +1 -0
  85. package/dist/ValueMappingEditor/ValueMappingEditor.js +374 -0
  86. package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -0
  87. package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts +8 -0
  88. package/dist/ValueMappingEditor/ValueMappingsEditor.d.ts.map +1 -0
  89. package/dist/ValueMappingEditor/ValueMappingsEditor.js +118 -0
  90. package/dist/ValueMappingEditor/ValueMappingsEditor.js.map +1 -0
  91. package/dist/ValueMappingEditor/index.d.ts +2 -0
  92. package/dist/ValueMappingEditor/index.d.ts.map +1 -0
  93. package/dist/ValueMappingEditor/index.js +15 -0
  94. package/dist/ValueMappingEditor/index.js.map +1 -0
  95. package/dist/cjs/ColorPicker/ColorPicker.js +2 -2
  96. package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +2 -3
  97. package/dist/cjs/DragAndDrop/DragButton.js +5 -3
  98. package/dist/cjs/Drawer/Drawer.js +1 -1
  99. package/dist/cjs/EChart/EChart.js +3 -4
  100. package/dist/cjs/GaugeChart/GaugeChart.js +2 -5
  101. package/dist/cjs/InfoTooltip/InfoTooltip.js +5 -4
  102. package/dist/cjs/Legend/ListLegendItem.js +3 -4
  103. package/dist/cjs/LineChart/LineChart.js +4 -8
  104. package/dist/cjs/LinksEditor/LinksEditor.js +9 -18
  105. package/dist/cjs/Overlay/Overlay.js +1 -1
  106. package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +1 -2
  107. package/dist/cjs/StatChart/StatChart.js +11 -17
  108. package/dist/cjs/StatChart/calculateFontSize.js +2 -4
  109. package/dist/cjs/StatChart/utils/formatStatChartValue.js +34 -0
  110. package/dist/cjs/StatusHistoryChart/StatusHistoryChart.js +11 -28
  111. package/dist/cjs/StatusHistoryChart/StatusHistoryTooltip.js +3 -3
  112. package/dist/cjs/StatusHistoryChart/utils/get-color.js +7 -7
  113. package/dist/cjs/Table/Table.js +5 -5
  114. package/dist/cjs/Table/TableCell.js +5 -6
  115. package/dist/cjs/Table/VirtualizedTable.js +11 -14
  116. package/dist/cjs/Table/hooks/useTableKeyboardNav.js +1 -1
  117. package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +7 -13
  118. package/dist/cjs/Table/model/table-model.js +1 -1
  119. package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +15 -23
  120. package/dist/cjs/TimeChart/TimeChart.js +3 -6
  121. package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +6 -11
  122. package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +1 -2
  123. package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +2 -3
  124. package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +4 -10
  125. package/dist/cjs/TimeSeriesTooltip/nearby-series.js +13 -23
  126. package/dist/cjs/TimeSeriesTooltip/utils.js +2 -4
  127. package/dist/cjs/TransformsEditor/TransformEditor.js +4 -7
  128. package/dist/cjs/TransformsEditor/TransformEditorContainer.js +3 -5
  129. package/dist/cjs/TransformsEditor/TransformsEditor.js +3 -6
  130. package/dist/cjs/ValueMappingEditor/ValueMappingEditor.js +387 -0
  131. package/dist/cjs/ValueMappingEditor/ValueMappingsEditor.js +131 -0
  132. package/dist/cjs/ValueMappingEditor/index.js +30 -0
  133. package/dist/cjs/context/TimeZoneProvider.js +1 -1
  134. package/dist/cjs/controls/TextField.js +1 -1
  135. package/dist/cjs/index.js +1 -0
  136. package/dist/cjs/utils/chart-actions.js +1 -2
  137. package/dist/cjs/utils/format.js +1 -1
  138. package/dist/cjs/utils/theme-gen.js +5 -7
  139. package/dist/context/TimeZoneProvider.js +1 -1
  140. package/dist/context/TimeZoneProvider.js.map +1 -1
  141. package/dist/controls/TextField.js +1 -1
  142. package/dist/controls/TextField.js.map +1 -1
  143. package/dist/index.d.ts +1 -0
  144. package/dist/index.d.ts.map +1 -1
  145. package/dist/index.js +1 -0
  146. package/dist/index.js.map +1 -1
  147. package/dist/utils/chart-actions.js +1 -2
  148. package/dist/utils/chart-actions.js.map +1 -1
  149. package/dist/utils/format.js +1 -1
  150. package/dist/utils/format.js.map +1 -1
  151. package/dist/utils/theme-gen.js +5 -7
  152. package/dist/utils/theme-gen.js.map +1 -1
  153. package/package.json +3 -3
@@ -86,10 +86,10 @@ function VirtualizedTable({ width, height, density, defaultColumnWidth, onRowCli
86
86
  onClick: (e)=>onRowClick(e, row.id),
87
87
  density: density,
88
88
  onMouseOver: (e)=>{
89
- onRowMouseOver === null || onRowMouseOver === void 0 ? void 0 : onRowMouseOver(e, rowEventOpts);
89
+ onRowMouseOver?.(e, rowEventOpts);
90
90
  },
91
91
  onMouseOut: (e)=>{
92
- onRowMouseOut === null || onRowMouseOut === void 0 ? void 0 : onRowMouseOut(e, rowEventOpts);
92
+ onRowMouseOut?.(e, rowEventOpts);
93
93
  }
94
94
  });
95
95
  },
@@ -123,7 +123,6 @@ function VirtualizedTable({ width, height, density, defaultColumnWidth, onRowCli
123
123
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TableRow.TableRow, {
124
124
  density: density,
125
125
  children: headerGroup.headers.map((header, i, headers)=>{
126
- var _column_columnDef_meta, _column_columnDef_meta1;
127
126
  const column = header.column;
128
127
  const position = {
129
128
  row: 0,
@@ -136,10 +135,10 @@ function VirtualizedTable({ width, height, density, defaultColumnWidth, onRowCli
136
135
  sortDirection: typeof isSorted === 'string' ? isSorted : undefined,
137
136
  nextSortDirection: typeof nextSorting === 'string' ? nextSorting : undefined,
138
137
  width: column.getSize() || defaultColumnWidth,
139
- align: (_column_columnDef_meta = column.columnDef.meta) === null || _column_columnDef_meta === void 0 ? void 0 : _column_columnDef_meta.align,
138
+ align: column.columnDef.meta?.align,
140
139
  variant: "head",
141
140
  density: density,
142
- description: (_column_columnDef_meta1 = column.columnDef.meta) === null || _column_columnDef_meta1 === void 0 ? void 0 : _column_columnDef_meta1.headerDescription,
141
+ description: column.columnDef.meta?.headerDescription,
143
142
  focusState: getFocusState(position),
144
143
  onFocusTrigger: ()=>keyboardNav.onCellFocus(position),
145
144
  isFirstColumn: i === 0,
@@ -158,17 +157,16 @@ function VirtualizedTable({ width, height, density, defaultColumnWidth, onRowCli
158
157
  }
159
158
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, {
160
159
  children: row.getVisibleCells().map((cell, i, cells)=>{
161
- var _cell_column_columnDef_meta, _cell_column_columnDef_meta1;
162
160
  const position = {
163
161
  // Add 1 to the row index because the header is row 0
164
162
  row: index + 1,
165
163
  column: i
166
164
  };
167
165
  const cellContext = cell.getContext();
168
- const cellConfig = cellConfigs === null || cellConfigs === void 0 ? void 0 : cellConfigs[cellContext.cell.id];
166
+ const cellConfig = cellConfigs?.[cellContext.cell.id];
169
167
  const cellRenderFn = cell.column.columnDef.cell;
170
168
  const cellContent = typeof cellRenderFn === 'function' ? cellRenderFn(cellContext) : null;
171
- const cellDescriptionDef = (_cell_column_columnDef_meta = cell.column.columnDef.meta) === null || _cell_column_columnDef_meta === void 0 ? void 0 : _cell_column_columnDef_meta.cellDescription;
169
+ const cellDescriptionDef = cell.column.columnDef.meta?.cellDescription;
172
170
  let description = undefined;
173
171
  if (typeof cellDescriptionDef === 'function') {
174
172
  // If the cell description is a function, set the value using
@@ -180,21 +178,20 @@ function VirtualizedTable({ width, height, density, defaultColumnWidth, onRowCli
180
178
  // cell content.
181
179
  description = cellContent;
182
180
  }
183
- var _cellConfig_textColor, _cellConfig_backgroundColor;
184
181
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TableCell.TableCell, {
185
182
  "data-testid": cell.id,
186
- title: description || (cellConfig === null || cellConfig === void 0 ? void 0 : cellConfig.text) || cellContent,
183
+ title: description || cellConfig?.text || cellContent,
187
184
  width: cell.column.getSize() || defaultColumnWidth,
188
- align: (_cell_column_columnDef_meta1 = cell.column.columnDef.meta) === null || _cell_column_columnDef_meta1 === void 0 ? void 0 : _cell_column_columnDef_meta1.align,
185
+ align: cell.column.columnDef.meta?.align,
189
186
  density: density,
190
187
  focusState: getFocusState(position),
191
188
  onFocusTrigger: ()=>keyboardNav.onCellFocus(position),
192
189
  isFirstColumn: i === 0,
193
190
  isLastColumn: i === cells.length - 1,
194
191
  description: description,
195
- color: (_cellConfig_textColor = cellConfig === null || cellConfig === void 0 ? void 0 : cellConfig.textColor) !== null && _cellConfig_textColor !== void 0 ? _cellConfig_textColor : undefined,
196
- backgroundColor: (_cellConfig_backgroundColor = cellConfig === null || cellConfig === void 0 ? void 0 : cellConfig.backgroundColor) !== null && _cellConfig_backgroundColor !== void 0 ? _cellConfig_backgroundColor : undefined,
197
- children: (cellConfig === null || cellConfig === void 0 ? void 0 : cellConfig.text) || cellContent
192
+ color: cellConfig?.textColor ?? undefined,
193
+ backgroundColor: cellConfig?.backgroundColor ?? undefined,
194
+ children: cellConfig?.text || cellContent
198
195
  }, cell.id);
199
196
  })
200
197
  });
@@ -78,7 +78,7 @@ function useTableKeyboardNav({ maxRows, maxColumns, onActiveCellChange }) {
78
78
  column: nextColumn,
79
79
  row: nextRow
80
80
  };
81
- const newPosition = (onActiveCellChange === null || onActiveCellChange === void 0 ? void 0 : onActiveCellChange(e, curActiveCell, defaultNewPosition)) || defaultNewPosition;
81
+ const newPosition = onActiveCellChange?.(e, curActiveCell, defaultNewPosition) || defaultNewPosition;
82
82
  if (newPosition.row === curActiveCell.row && newPosition.column === curActiveCell.column) {
83
83
  // Return original to avoid creating a new object if nothing
84
84
  // changed.
@@ -28,14 +28,12 @@ function useVirtualizedTableKeyboardNav({ visibleRange, virtualTable, maxRows, m
28
28
  onActiveCellChange: (e, currentPosition, defaultNewPosition)=>{
29
29
  const key = e.key;
30
30
  const defaultValueChanged = defaultNewPosition && (currentPosition.column !== defaultNewPosition.column || currentPosition.row !== defaultNewPosition.row);
31
- var _defaultNewPosition_row;
32
- const nextRow = (_defaultNewPosition_row = defaultNewPosition === null || defaultNewPosition === void 0 ? void 0 : defaultNewPosition.row) !== null && _defaultNewPosition_row !== void 0 ? _defaultNewPosition_row : currentPosition.row;
31
+ const nextRow = defaultNewPosition?.row ?? currentPosition.row;
33
32
  if (key === 'ArrowDown' && defaultValueChanged) {
34
33
  // Use default cell position. Shift the virtual table scroll position
35
34
  // when needed to make the active cell visible.
36
35
  if (nextRow - 1 < visibleRange.current.startIndex || nextRow - 1 > visibleRange.current.endIndex) {
37
- var _virtualTable_current;
38
- (_virtualTable_current = virtualTable.current) === null || _virtualTable_current === void 0 ? void 0 : _virtualTable_current.scrollToIndex({
36
+ virtualTable.current?.scrollToIndex({
39
37
  index: nextRow - 1,
40
38
  align: 'end'
41
39
  });
@@ -44,28 +42,25 @@ function useVirtualizedTableKeyboardNav({ visibleRange, virtualTable, maxRows, m
44
42
  // Use default cell position. Shift the virtual table scroll position
45
43
  // when needed to make the active cell visible.
46
44
  if (nextRow - 1 < visibleRange.current.startIndex || nextRow - 1 > visibleRange.current.endIndex) {
47
- var _virtualTable_current1;
48
- (_virtualTable_current1 = virtualTable.current) === null || _virtualTable_current1 === void 0 ? void 0 : _virtualTable_current1.scrollToIndex({
45
+ virtualTable.current?.scrollToIndex({
49
46
  index: nextRow - 1,
50
47
  align: 'start'
51
48
  });
52
49
  }
53
50
  } else if (defaultValueChanged && (key === 'Home' || key === 'End')) {
54
- var // Use default cell position. Shift the virtual table scroll position
51
+ // Use default cell position. Shift the virtual table scroll position
55
52
  // when needed to make the active cell visible.
56
- _virtualTable_current2;
57
- (_virtualTable_current2 = virtualTable.current) === null || _virtualTable_current2 === void 0 ? void 0 : _virtualTable_current2.scrollToIndex({
53
+ virtualTable.current?.scrollToIndex({
58
54
  index: Math.max(nextRow - 1, 0),
59
55
  align: 'start'
60
56
  });
61
57
  } else if (key === 'PageDown') {
62
- var _virtualTable_current3;
63
58
  // Full handling of logic for `PageDown` because there is no default.
64
59
  e.preventDefault();
65
60
  let nextRow = currentPosition.row;
66
61
  // Add 1 to account for header
67
62
  nextRow = Math.min(maxRows - 1, visibleRange.current.endIndex + 1);
68
- (_virtualTable_current3 = virtualTable.current) === null || _virtualTable_current3 === void 0 ? void 0 : _virtualTable_current3.scrollToIndex({
63
+ virtualTable.current?.scrollToIndex({
69
64
  index: nextRow - 1,
70
65
  align: 'start'
71
66
  });
@@ -74,12 +69,11 @@ function useVirtualizedTableKeyboardNav({ visibleRange, virtualTable, maxRows, m
74
69
  column: currentPosition.column
75
70
  };
76
71
  } else if (key === 'PageUp') {
77
- var _virtualTable_current4;
78
72
  // Full handling of logic for `PageUp` because there is no default.
79
73
  let nextRow = currentPosition.row;
80
74
  // Minus 1 to account for header
81
75
  nextRow = Math.max(0, visibleRange.current.startIndex - 1);
82
- (_virtualTable_current4 = virtualTable.current) === null || _virtualTable_current4 === void 0 ? void 0 : _virtualTable_current4.scrollToIndex({
76
+ virtualTable.current?.scrollToIndex({
83
77
  index: nextRow - 1,
84
78
  align: 'end'
85
79
  });
@@ -35,7 +35,7 @@ const DEFAULT_COLUMN_WIDTH = 150;
35
35
  function calculateTableCellHeight(lineHeight, paddingY) {
36
36
  // Doing a bunch of math to enforce height to avoid weirdness with mismatched
37
37
  // heights based on customization of cell contents.
38
- const lineHeightNum = typeof lineHeight === 'string' ? parseInt(lineHeight, 10) : lineHeight !== null && lineHeight !== void 0 ? lineHeight : 0;
38
+ const lineHeightNum = typeof lineHeight === 'string' ? parseInt(lineHeight, 10) : lineHeight ?? 0;
39
39
  const verticalPaddingNum = typeof paddingY === 'string' ? parseInt(paddingY, 10) : paddingY;
40
40
  return lineHeightNum + verticalPaddingNum * 2;
41
41
  }
@@ -81,28 +81,26 @@ const DEFAULT_STEP = 10;
81
81
  function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMode }) {
82
82
  const chartsTheme = (0, _ChartsProvider.useChartsTheme)();
83
83
  const { thresholds: { defaultColor, palette } } = chartsTheme;
84
- var _thresholds_defaultColor;
85
- const defaultThresholdColor = (_thresholds_defaultColor = thresholds === null || thresholds === void 0 ? void 0 : thresholds.defaultColor) !== null && _thresholds_defaultColor !== void 0 ? _thresholds_defaultColor : defaultColor;
86
- const [steps, setSteps] = (0, _react.useState)(thresholds === null || thresholds === void 0 ? void 0 : thresholds.steps);
84
+ const defaultThresholdColor = thresholds?.defaultColor ?? defaultColor;
85
+ const [steps, setSteps] = (0, _react.useState)(thresholds?.steps);
87
86
  (0, _react.useEffect)(()=>{
88
- setSteps(thresholds === null || thresholds === void 0 ? void 0 : thresholds.steps);
87
+ setSteps(thresholds?.steps);
89
88
  }, [
90
- thresholds === null || thresholds === void 0 ? void 0 : thresholds.steps
89
+ thresholds?.steps
91
90
  ]);
92
91
  // every time a new threshold is added, we want to focus the recently added input
93
92
  const recentlyAddedInputRef = (0, _react.useRef)(null);
94
93
  const focusRef = (0, _react.useRef)(false);
95
94
  (0, _react.useEffect)(()=>{
96
- var _recentlyAddedInputRef_current;
97
95
  if (!recentlyAddedInputRef.current || !focusRef.current) return;
98
- (_recentlyAddedInputRef_current = recentlyAddedInputRef.current) === null || _recentlyAddedInputRef_current === void 0 ? void 0 : _recentlyAddedInputRef_current.focus();
96
+ recentlyAddedInputRef.current?.focus();
99
97
  focusRef.current = false;
100
98
  }, [
101
- steps === null || steps === void 0 ? void 0 : steps.length
99
+ steps?.length
102
100
  ]);
103
101
  const handleThresholdValueChange = (e, i)=>{
104
102
  setSteps((0, _immer.default)(steps, (draft)=>{
105
- const step = draft === null || draft === void 0 ? void 0 : draft[i];
103
+ const step = draft?.[i];
106
104
  if (step) {
107
105
  step.value = Number(e.target.value);
108
106
  }
@@ -176,14 +174,12 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
176
174
  } else {
177
175
  onChange((0, _immer.default)(thresholds, (draft)=>{
178
176
  const steps = draft.steps;
179
- if (steps === null || steps === void 0 ? void 0 : steps.length) {
177
+ if (steps?.length) {
180
178
  const lastStep = steps[steps.length - 1];
181
- var _palette_steps_length;
182
- const color = (_palette_steps_length = palette[steps.length]) !== null && _palette_steps_length !== void 0 ? _palette_steps_length : getRandomColor(); // we will assign color from the palette first, then generate random color
183
- var _lastStep_value;
179
+ const color = palette[steps.length] ?? getRandomColor(); // we will assign color from the palette first, then generate random color
184
180
  steps.push({
185
181
  color,
186
- value: ((_lastStep_value = lastStep === null || lastStep === void 0 ? void 0 : lastStep.value) !== null && _lastStep_value !== void 0 ? _lastStep_value : 0) + DEFAULT_STEP
182
+ value: (lastStep?.value ?? 0) + DEFAULT_STEP
187
183
  }); // set new threshold value to last step value + 10
188
184
  } else if (steps) {
189
185
  steps.push({
@@ -205,7 +201,6 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
205
201
  });
206
202
  }
207
203
  };
208
- var _thresholds_mode;
209
204
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_OptionsEditorLayout.OptionsEditorGroup, {
210
205
  title: "Thresholds",
211
206
  icon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_InfoTooltip.InfoTooltip, {
@@ -224,7 +219,7 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
224
219
  control: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.ToggleButtonGroup, {
225
220
  exclusive: true,
226
221
  disabled: disablePercentMode,
227
- value: (_thresholds_mode = thresholds === null || thresholds === void 0 ? void 0 : thresholds.mode) !== null && _thresholds_mode !== void 0 ? _thresholds_mode : 'absolute',
222
+ value: thresholds?.mode ?? 'absolute',
228
223
  onChange: handleModeChange,
229
224
  sx: {
230
225
  height: '36px',
@@ -250,14 +245,12 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
250
245
  ]
251
246
  })
252
247
  }),
253
- steps && steps.map((step, i)=>{
254
- var _step_color, _ref;
255
- return /*#__PURE__*/ (0, _jsxruntime.jsx)(_ThresholdInput.ThresholdInput, {
248
+ steps && steps.map((step, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_ThresholdInput.ThresholdInput, {
256
249
  inputRef: i === steps.length - 1 ? recentlyAddedInputRef : undefined,
257
250
  label: `T${i + 1}`,
258
- color: (_ref = (_step_color = step.color) !== null && _step_color !== void 0 ? _step_color : palette[i]) !== null && _ref !== void 0 ? _ref : defaultThresholdColor,
251
+ color: step.color ?? palette[i] ?? defaultThresholdColor,
259
252
  value: step.value,
260
- mode: thresholds === null || thresholds === void 0 ? void 0 : thresholds.mode,
253
+ mode: thresholds?.mode,
261
254
  onColorChange: (color)=>handleThresholdColorChange(color, i),
262
255
  onChange: (e)=>{
263
256
  handleThresholdValueChange(e, i);
@@ -266,8 +259,7 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
266
259
  deleteThreshold(i);
267
260
  },
268
261
  onBlur: handleThresholdBlur
269
- }, i);
270
- }).reverse(),
262
+ }, i)).reverse(),
271
263
  !hideDefault && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_system.Stack, {
272
264
  flex: 1,
273
265
  direction: "row",
@@ -57,7 +57,6 @@ function _interop_require_default(obj) {
57
57
  _renderers.CanvasRenderer
58
58
  ]);
59
59
  const TimeChart = /*#__PURE__*/ (0, _react.forwardRef)(function TimeChart({ height, data, seriesMapping, timeScale: timeScaleProp, yAxis, format, grid, isStackedBar = false, tooltipConfig = _TimeSeriesTooltip.DEFAULT_TOOLTIP_CONFIG, noDataVariant = 'message', syncGroup, onDataZoom, onDoubleClick, __experimentalEChartsOptionsOverride }, ref) {
60
- var _option_tooltip;
61
60
  const { chartsTheme, enablePinning, lastTooltipPinnedCoords, setLastTooltipPinnedCoords } = (0, _ChartsProvider.useChartsContext)();
62
61
  const isPinningEnabled = tooltipConfig.enablePinning && enablePinning;
63
62
  const chartRef = (0, _react.useRef)();
@@ -172,7 +171,6 @@ const TimeChart = /*#__PURE__*/ (0, _react.forwardRef)(function TimeChart({ heig
172
171
  ...seriesMapping,
173
172
  pinnedCrosshair
174
173
  ] : seriesMapping;
175
- var _timeScale_rangeMs;
176
174
  const option = {
177
175
  dataset: dataset,
178
176
  series: updatedSeriesMapping,
@@ -182,7 +180,7 @@ const TimeChart = /*#__PURE__*/ (0, _react.forwardRef)(function TimeChart({ heig
182
180
  max: isLocalTimeZone ? timeScale.endMs : (0, _datefnstz.utcToZonedTime)(timeScale.endMs, timeZone),
183
181
  axisLabel: {
184
182
  hideOverlap: true,
185
- formatter: (0, _utils.getFormattedAxisLabel)((_timeScale_rangeMs = timeScale.rangeMs) !== null && _timeScale_rangeMs !== void 0 ? _timeScale_rangeMs : 0)
183
+ formatter: (0, _utils.getFormattedAxisLabel)(timeScale.rangeMs ?? 0)
186
184
  },
187
185
  axisPointer: {
188
186
  snap: false
@@ -302,10 +300,9 @@ const TimeChart = /*#__PURE__*/ (0, _react.forwardRef)(function TimeChart({ heig
302
300
  setPinnedCrosshair((current)=>{
303
301
  // Only add pinned crosshair line series when there is not one already in seriesMapping.
304
302
  if (current === null) {
305
- var _data_;
306
303
  const cursorX = pointInGrid[0];
307
304
  // Only need to loop through first dataset source since getCommonTimeScale ensures xAxis timestamps are consistent
308
- const firstTimeSeriesValues = (_data_ = data[0]) === null || _data_ === void 0 ? void 0 : _data_.values;
305
+ const firstTimeSeriesValues = data[0]?.values;
309
306
  const closestTimestamp = (0, _utils.getClosestTimestamp)(firstTimeSeriesValues, cursorX);
310
307
  // Crosshair snaps to nearest timestamp since cursor may be slightly to left or right
311
308
  const pinnedCrosshair = (0, _merge.default)({}, _model.DEFAULT_PINNED_CROSSHAIR, {
@@ -378,7 +375,7 @@ const TimeChart = /*#__PURE__*/ (0, _react.forwardRef)(function TimeChart({ heig
378
375
  }
379
376
  },
380
377
  children: [
381
- showTooltip === true && ((_option_tooltip = option.tooltip) === null || _option_tooltip === void 0 ? void 0 : _option_tooltip.showContent) === false && tooltipConfig.hidden !== true && /*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeSeriesTooltip.TimeChartTooltip, {
378
+ showTooltip === true && option.tooltip?.showContent === false && tooltipConfig.hidden !== true && /*#__PURE__*/ (0, _jsxruntime.jsx)(_TimeSeriesTooltip.TimeChartTooltip, {
382
379
  containerId: chartsTheme.tooltipPortalContainerId,
383
380
  chartRef: chartRef,
384
381
  data: data,
@@ -44,8 +44,7 @@ const LineChartTooltip = /*#__PURE__*/ (0, _react.memo)(function LineChartToolti
44
44
  // Ensure user is hovering over a chart before checking for nearby series.
45
45
  if (pinnedPos === null && mousePos.target.tagName !== 'CANVAS') return null;
46
46
  const chart = chartRef.current;
47
- var _chart_getWidth;
48
- const chartWidth = (_chart_getWidth = chart === null || chart === void 0 ? void 0 : chart.getWidth()) !== null && _chart_getWidth !== void 0 ? _chart_getWidth : _tooltipmodel.FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
47
+ const chartWidth = chart?.getWidth() ?? _tooltipmodel.FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
49
48
  // Get series nearby the cursor and pass into tooltip content children.
50
49
  const nearbySeries = (0, _nearbyseries.legacyGetNearbySeriesData)({
51
50
  mousePos,
@@ -63,24 +62,21 @@ const LineChartTooltip = /*#__PURE__*/ (0, _react.memo)(function LineChartToolti
63
62
  // if tooltip is attached to a container, set max height to the height of the container so tooltip does not get cut off
64
63
  const maxHeight = containerElement ? containerElement.getBoundingClientRect().height : undefined;
65
64
  if (!isTooltipPinned) {
66
- transform.current = (0, _utils.assembleTransform)(mousePos, chartWidth, pinnedPos, height !== null && height !== void 0 ? height : 0, width !== null && width !== void 0 ? width : 0, containerElement);
65
+ transform.current = (0, _utils.assembleTransform)(mousePos, chartWidth, pinnedPos, height ?? 0, width ?? 0, containerElement);
67
66
  }
68
67
  return /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Portal, {
69
68
  container: containerElement,
70
69
  children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Box, {
71
70
  ref: tooltipRef,
72
- sx: (theme)=>{
73
- var _theme_palette_designSystem;
74
- var _theme_palette_designSystem_grey_;
75
- return {
71
+ sx: (theme)=>({
76
72
  minWidth: _tooltipmodel.TOOLTIP_MIN_WIDTH,
77
73
  maxWidth: _tooltipmodel.TOOLTIP_MAX_WIDTH,
78
- maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : _tooltipmodel.TOOLTIP_MAX_HEIGHT,
74
+ maxHeight: maxHeight ?? _tooltipmodel.TOOLTIP_MAX_HEIGHT,
79
75
  padding: 0,
80
76
  position: 'absolute',
81
77
  top: 0,
82
78
  left: 0,
83
- backgroundColor: (_theme_palette_designSystem_grey_ = (_theme_palette_designSystem = theme.palette.designSystem) === null || _theme_palette_designSystem === void 0 ? void 0 : _theme_palette_designSystem.grey[800]) !== null && _theme_palette_designSystem_grey_ !== void 0 ? _theme_palette_designSystem_grey_ : _tooltipmodel.TOOLTIP_BG_COLOR_FALLBACK,
79
+ backgroundColor: theme.palette.designSystem?.grey[800] ?? _tooltipmodel.TOOLTIP_BG_COLOR_FALLBACK,
84
80
  borderRadius: '6px',
85
81
  color: '#fff',
86
82
  fontSize: '11px',
@@ -93,8 +89,7 @@ const LineChartTooltip = /*#__PURE__*/ (0, _react.memo)(function LineChartToolti
93
89
  '&:hover': {
94
90
  overflowY: 'auto'
95
91
  }
96
- };
97
- },
92
+ }),
98
93
  style: {
99
94
  transform: transform.current,
100
95
  display: transform.current ? 'block' : 'none'
@@ -31,8 +31,7 @@ function SeriesInfo(props) {
31
31
  // ex with metric name: node_load15{env="demo",job="node"}
32
32
  // ex without metric name: {env="demo",job="node"}
33
33
  const splitName = seriesName.split('{');
34
- var _splitName_;
35
- const seriesLabels = (_splitName_ = splitName[1]) !== null && _splitName_ !== void 0 ? _splitName_ : seriesName;
34
+ const seriesLabels = splitName[1] ?? seriesName;
36
35
  // remove curly braces that wrap labels
37
36
  const formattedSeriesLabels = seriesLabels.replace(/[{}]/g, '');
38
37
  // determine whether to show labels on separate lines
@@ -44,13 +44,12 @@ const TimeChartTooltip = /*#__PURE__*/ (0, _react.memo)(function TimeChartToolti
44
44
  // Ensure user is hovering over a chart before checking for nearby series.
45
45
  if (pinnedPos === null && mousePos.target.tagName !== 'CANVAS') return null;
46
46
  const chart = chartRef.current;
47
- var _chart_getWidth;
48
- const chartWidth = (_chart_getWidth = chart === null || chart === void 0 ? void 0 : chart.getWidth()) !== null && _chart_getWidth !== void 0 ? _chart_getWidth : _tooltipmodel.FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
47
+ const chartWidth = chart?.getWidth() ?? _tooltipmodel.FALLBACK_CHART_WIDTH; // Fallback width not likely to ever be needed.
49
48
  const containerElement = containerId ? document.querySelector(containerId) : undefined;
50
49
  // if tooltip is attached to a container, set max height to the height of the container so tooltip does not get cut off
51
50
  const maxHeight = containerElement ? containerElement.getBoundingClientRect().height : undefined;
52
51
  if (!isTooltipPinned) {
53
- transform.current = (0, _utils.assembleTransform)(mousePos, chartWidth, pinnedPos, height !== null && height !== void 0 ? height : 0, width !== null && width !== void 0 ? width : 0, containerElement);
52
+ transform.current = (0, _utils.assembleTransform)(mousePos, chartWidth, pinnedPos, height ?? 0, width ?? 0, containerElement);
54
53
  }
55
54
  // Get series nearby the cursor and pass into tooltip content children.
56
55
  const nearbySeries = (0, _nearbyseries.getNearbySeriesData)({
@@ -33,9 +33,7 @@ function _interop_require_default(obj) {
33
33
  };
34
34
  }
35
35
  const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ nearbySeries, totalSeries, isTooltipPinned, showAllSeries, enablePinning = true, onShowAllClick, onUnpinClick }) {
36
- var _nearbySeries_;
37
- var _nearbySeries__date;
38
- const seriesTimeMs = (_nearbySeries__date = (_nearbySeries_ = nearbySeries[0]) === null || _nearbySeries_ === void 0 ? void 0 : _nearbySeries_.date) !== null && _nearbySeries__date !== void 0 ? _nearbySeries__date : null;
36
+ const seriesTimeMs = nearbySeries[0]?.date ?? null;
39
37
  if (seriesTimeMs === null) {
40
38
  return null;
41
39
  }
@@ -63,19 +61,15 @@ const TooltipHeader = /*#__PURE__*/ (0, _react.memo)(function TooltipHeader({ ne
63
61
  const showAllSeriesToggle = enablePinning && totalSeries > 5;
64
62
  const pinTooltipHelpText = isTooltipPinned ? _tooltipmodel.UNPIN_TOOLTIP_HELP_TEXT : _tooltipmodel.PIN_TOOLTIP_HELP_TEXT;
65
63
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
66
- sx: (theme)=>{
67
- var _theme_palette_designSystem;
68
- var _theme_palette_designSystem_grey_;
69
- return {
64
+ sx: (theme)=>({
70
65
  width: '100%',
71
66
  maxWidth: _tooltipmodel.TOOLTIP_MAX_WIDTH,
72
67
  padding: theme.spacing(1.5, 2, 0.5, 2),
73
- backgroundColor: (_theme_palette_designSystem_grey_ = (_theme_palette_designSystem = theme.palette.designSystem) === null || _theme_palette_designSystem === void 0 ? void 0 : _theme_palette_designSystem.grey[800]) !== null && _theme_palette_designSystem_grey_ !== void 0 ? _theme_palette_designSystem_grey_ : _tooltipmodel.TOOLTIP_BG_COLOR_FALLBACK,
68
+ backgroundColor: theme.palette.designSystem?.grey[800] ?? _tooltipmodel.TOOLTIP_BG_COLOR_FALLBACK,
74
69
  position: 'sticky',
75
70
  top: 0,
76
71
  left: 0
77
- };
78
- },
72
+ }),
79
73
  children: [
80
74
  /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Box, {
81
75
  sx: {
@@ -57,12 +57,9 @@ const INCREASE_NEARBY_SERIES_MULTIPLIER = 5.5; // adjusts how many series show i
57
57
  const DYNAMIC_NEARBY_SERIES_MULTIPLIER = 30; // used for adjustment after series number divisor
58
58
  const SHOW_FEWER_SERIES_LIMIT = 5;
59
59
  function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, chart, format) {
60
- var _data_;
61
60
  const currentNearbySeriesData = [];
62
- var _pointInGrid_;
63
- const cursorX = (_pointInGrid_ = pointInGrid[0]) !== null && _pointInGrid_ !== void 0 ? _pointInGrid_ : null;
64
- var _pointInGrid_1;
65
- const cursorY = (_pointInGrid_1 = pointInGrid[1]) !== null && _pointInGrid_1 !== void 0 ? _pointInGrid_1 : null;
61
+ const cursorX = pointInGrid[0] ?? null;
62
+ const cursorY = pointInGrid[1] ?? null;
66
63
  if (cursorX === null || cursorY === null) return currentNearbySeriesData;
67
64
  if (chart.dispatchAction === undefined) return currentNearbySeriesData;
68
65
  if (!Array.isArray(data)) return currentNearbySeriesData;
@@ -74,7 +71,7 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
74
71
  const totalSeries = data.length;
75
72
  const yValueCounts = new Map();
76
73
  // Only need to loop through first dataset source since getCommonTimeScale ensures xAxis timestamps are consistent
77
- const firstTimeSeriesValues = (_data_ = data[0]) === null || _data_ === void 0 ? void 0 : _data_.values;
74
+ const firstTimeSeriesValues = data[0]?.values;
78
75
  const closestTimestamp = (0, _utils.getClosestTimestamp)(firstTimeSeriesValues, cursorX);
79
76
  if (closestTimestamp === null) {
80
77
  return _tooltipmodel.EMPTY_TOOLTIP_DATA;
@@ -89,8 +86,7 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
89
86
  if (currentDatasetValues === undefined || !Array.isArray(currentDatasetValues)) break;
90
87
  const lineSeries = currentSeries;
91
88
  const currentSeriesName = lineSeries.name ? lineSeries.name.toString() : '';
92
- var _lineSeries_color;
93
- const markerColor = (_lineSeries_color = lineSeries.color) !== null && _lineSeries_color !== void 0 ? _lineSeries_color : '#000';
89
+ const markerColor = lineSeries.color ?? '#000';
94
90
  if (Array.isArray(data)) {
95
91
  for(let datumIdx = 0; datumIdx < currentDatasetValues.length; datumIdx++){
96
92
  const nearbyTimeSeries = currentDatasetValues[datumIdx];
@@ -112,10 +108,9 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
112
108
  if (isClosestToCursor) {
113
109
  // shows as bold in tooltip, customize 'emphasis' options in getTimeSeries util
114
110
  emphasizedSeriesIndexes.push(seriesIdx);
115
- var _yValueCounts_get;
116
111
  // Used to determine which datapoint to apply select styles to.
117
112
  // Accounts for cases where lines may be rendered directly on top of eachother.
118
- const duplicateValuesCount = (_yValueCounts_get = yValueCounts.get(yValue)) !== null && _yValueCounts_get !== void 0 ? _yValueCounts_get : 0;
113
+ const duplicateValuesCount = yValueCounts.get(yValue) ?? 0;
119
114
  yValueCounts.set(yValue, duplicateValuesCount + 1);
120
115
  if (duplicateValuesCount > 0) {
121
116
  duplicateDatapoints.push({
@@ -164,10 +159,8 @@ function checkforNearbyTimeSeries(data, seriesMapping, pointInGrid, yBuffer, cha
164
159
  }
165
160
  function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
166
161
  const currentNearbySeriesData = [];
167
- var _pointInGrid_;
168
- const cursorX = (_pointInGrid_ = pointInGrid[0]) !== null && _pointInGrid_ !== void 0 ? _pointInGrid_ : null;
169
- var _pointInGrid_1;
170
- const cursorY = (_pointInGrid_1 = pointInGrid[1]) !== null && _pointInGrid_1 !== void 0 ? _pointInGrid_1 : null;
162
+ const cursorX = pointInGrid[0] ?? null;
163
+ const cursorY = pointInGrid[1] ?? null;
171
164
  if (cursorX === null || cursorY === null) {
172
165
  return currentNearbySeriesData;
173
166
  }
@@ -181,12 +174,10 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
181
174
  if (currentSeries === undefined) break;
182
175
  if (currentNearbySeriesData.length >= _model.OPTIMIZED_MODE_SERIES_LIMIT) break;
183
176
  const currentSeriesName = currentSeries.name ? currentSeries.name.toString() : '';
184
- var _currentSeries_color;
185
- const markerColor = (_currentSeries_color = currentSeries.color) !== null && _currentSeries_color !== void 0 ? _currentSeries_color : '#000';
177
+ const markerColor = currentSeries.color ?? '#000';
186
178
  if (Array.isArray(currentSeries.data)) {
187
179
  for(let datumIdx = 0; datumIdx < currentSeries.data.length; datumIdx++){
188
- var _data_xAxis_datumIdx;
189
- const xValue = (_data_xAxis_datumIdx = data.xAxis[datumIdx]) !== null && _data_xAxis_datumIdx !== void 0 ? _data_xAxis_datumIdx : 0;
180
+ const xValue = data.xAxis[datumIdx] ?? 0;
190
181
  const yValue = currentSeries.data[datumIdx];
191
182
  // ensure null values not displayed in tooltip
192
183
  if (yValue !== undefined && yValue !== null && cursorX === datumIdx) {
@@ -204,7 +195,7 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
204
195
  } else {
205
196
  nonEmphasizedSeriesIndexes.push(seriesIdx);
206
197
  // ensure series not close to cursor are not highlighted
207
- if ((chart === null || chart === void 0 ? void 0 : chart.dispatchAction) !== undefined) {
198
+ if (chart?.dispatchAction !== undefined) {
208
199
  chart.dispatchAction({
209
200
  type: 'downplay',
210
201
  seriesIndex: seriesIdx
@@ -232,7 +223,7 @@ function legacyCheckforNearbySeries(data, pointInGrid, yBuffer, chart, format) {
232
223
  }
233
224
  }
234
225
  }
235
- if ((chart === null || chart === void 0 ? void 0 : chart.dispatchAction) !== undefined) {
226
+ if (chart?.dispatchAction !== undefined) {
236
227
  // Clears emphasis state of all lines that are not emphasized.
237
228
  // Emphasized is a subset of just the nearby series that are closest to cursor.
238
229
  chart.dispatchAction({
@@ -330,10 +321,9 @@ function legacyGetNearbySeriesData({ mousePos, pinnedPos, chartData, chart, form
330
321
  totalSeries,
331
322
  showAllSeries
332
323
  });
333
- var _mousePos_plotCanvas_x, _mousePos_plotCanvas_y;
334
324
  const pointInPixel = [
335
- (_mousePos_plotCanvas_x = mousePos.plotCanvas.x) !== null && _mousePos_plotCanvas_x !== void 0 ? _mousePos_plotCanvas_x : 0,
336
- (_mousePos_plotCanvas_y = mousePos.plotCanvas.y) !== null && _mousePos_plotCanvas_y !== void 0 ? _mousePos_plotCanvas_y : 0
325
+ mousePos.plotCanvas.x ?? 0,
326
+ mousePos.plotCanvas.y ?? 0
337
327
  ];
338
328
  if (chart.containPixel('grid', pointInPixel)) {
339
329
  const pointInGrid = chart.convertFromPixel('grid', pointInPixel);
@@ -68,18 +68,16 @@ function assembleTransform(mousePos, chartWidth, pinnedPos, tooltipHeight, toolt
68
68
  return mousePos.plotCanvas.x > xPosAdjustThreshold && x > _tooltipmodel.TOOLTIP_MAX_WIDTH ? `translate3d(${x - cursorPaddingX}px, ${y}px, 0) translateX(-100%)` : `translate3d(${x + cursorPaddingX}px, ${y}px, 0)`;
69
69
  }
70
70
  function getTooltipStyles(theme, pinnedPos, maxHeight) {
71
- var _theme_palette_designSystem;
72
71
  const adjustedMaxHeight = maxHeight ? maxHeight - _tooltipmodel.TOOLTIP_PADDING : undefined;
73
- var _theme_palette_designSystem_grey_;
74
72
  return {
75
73
  minWidth: _tooltipmodel.TOOLTIP_MIN_WIDTH,
76
74
  maxWidth: _tooltipmodel.TOOLTIP_MAX_WIDTH,
77
- maxHeight: adjustedMaxHeight !== null && adjustedMaxHeight !== void 0 ? adjustedMaxHeight : _tooltipmodel.TOOLTIP_MAX_HEIGHT,
75
+ maxHeight: adjustedMaxHeight ?? _tooltipmodel.TOOLTIP_MAX_HEIGHT,
78
76
  padding: 0,
79
77
  position: 'absolute',
80
78
  top: 0,
81
79
  left: 0,
82
- backgroundColor: (_theme_palette_designSystem_grey_ = (_theme_palette_designSystem = theme.palette.designSystem) === null || _theme_palette_designSystem === void 0 ? void 0 : _theme_palette_designSystem.grey[800]) !== null && _theme_palette_designSystem_grey_ !== void 0 ? _theme_palette_designSystem_grey_ : _tooltipmodel.TOOLTIP_BG_COLOR_FALLBACK,
80
+ backgroundColor: theme.palette.designSystem?.grey[800] ?? _tooltipmodel.TOOLTIP_BG_COLOR_FALLBACK,
83
81
  borderRadius: '6px',
84
82
  color: '#fff',
85
83
  fontSize: '11px',
@@ -24,7 +24,6 @@ const _jsxruntime = require("react/jsx-runtime");
24
24
  const _material = require("@mui/material");
25
25
  const _controls = require("../controls");
26
26
  function JoinByColumnValueTransformEditor({ value, onChange }) {
27
- var _value_spec_columns;
28
27
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
29
28
  direction: "row",
30
29
  children: [
@@ -36,7 +35,7 @@ function JoinByColumnValueTransformEditor({ value, onChange }) {
36
35
  width: '100%'
37
36
  },
38
37
  options: [],
39
- value: (_value_spec_columns = value.spec.columns) !== null && _value_spec_columns !== void 0 ? _value_spec_columns : [],
38
+ value: value.spec.columns ?? [],
40
39
  renderInput: (params)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
41
40
  ...params,
42
41
  variant: "outlined",
@@ -72,7 +71,6 @@ function JoinByColumnValueTransformEditor({ value, onChange }) {
72
71
  });
73
72
  }
74
73
  function MergeColumnsTransformEditor({ value, onChange }) {
75
- var _value_spec_columns, _value_spec_name;
76
74
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
77
75
  direction: "row",
78
76
  gap: 1,
@@ -86,7 +84,7 @@ function MergeColumnsTransformEditor({ value, onChange }) {
86
84
  width: '100%'
87
85
  },
88
86
  options: [],
89
- value: (_value_spec_columns = value.spec.columns) !== null && _value_spec_columns !== void 0 ? _value_spec_columns : [],
87
+ value: value.spec.columns ?? [],
90
88
  renderInput: (params)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.TextField, {
91
89
  ...params,
92
90
  variant: "outlined",
@@ -107,7 +105,7 @@ function MergeColumnsTransformEditor({ value, onChange }) {
107
105
  id: "merge-columns-name",
108
106
  variant: "outlined",
109
107
  label: "Output Name",
110
- value: (_value_spec_name = value.spec.name) !== null && _value_spec_name !== void 0 ? _value_spec_name : '',
108
+ value: value.spec.name ?? '',
111
109
  sx: {
112
110
  width: '100%'
113
111
  },
@@ -141,7 +139,6 @@ function MergeColumnsTransformEditor({ value, onChange }) {
141
139
  });
142
140
  }
143
141
  function MergeIndexedColumnsTransformEditor({ value, onChange }) {
144
- var _value_spec_column;
145
142
  return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
146
143
  direction: "row",
147
144
  children: [
@@ -150,7 +147,7 @@ function MergeIndexedColumnsTransformEditor({ value, onChange }) {
150
147
  variant: "outlined",
151
148
  label: "Column",
152
149
  placeholder: "Example: 'value' for merging 'value #1', 'value #2' and 'value #...'",
153
- value: (_value_spec_column = value.spec.column) !== null && _value_spec_column !== void 0 ? _value_spec_column : '',
150
+ value: value.spec.column ?? '',
154
151
  sx: {
155
152
  width: '100%'
156
153
  },