@perses-dev/components 0.50.3 → 0.51.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarChart/BarChart.js.map +1 -1
- package/dist/ColorPicker/ColorPicker.js +2 -2
- package/dist/ColorPicker/ColorPicker.js.map +1 -1
- package/dist/ColorPicker/OptionsColorPicker.js.map +1 -1
- package/dist/ContentWithLegend/ContentWithLegend.js.map +1 -1
- package/dist/ContentWithLegend/model/content-with-legend-model.js +2 -3
- package/dist/ContentWithLegend/model/content-with-legend-model.js.map +1 -1
- package/dist/DragAndDrop/DragButton.js +1 -1
- package/dist/DragAndDrop/DragButton.js.map +1 -1
- package/dist/DragAndDrop/DropIndicator.js.map +1 -1
- package/dist/Drawer/Drawer.js +1 -1
- package/dist/Drawer/Drawer.js.map +1 -1
- package/dist/EChart/EChart.d.ts.map +1 -1
- package/dist/EChart/EChart.js +19 -5
- package/dist/EChart/EChart.js.map +1 -1
- package/dist/GaugeChart/GaugeChart.js +2 -5
- package/dist/GaugeChart/GaugeChart.js.map +1 -1
- package/dist/InfoTooltip/InfoTooltip.js +5 -4
- package/dist/InfoTooltip/InfoTooltip.js.map +1 -1
- package/dist/JSONEditor.js.map +1 -1
- package/dist/Legend/ListLegendItem.js +3 -4
- package/dist/Legend/ListLegendItem.js.map +1 -1
- package/dist/LineChart/LineChart.js +4 -8
- package/dist/LineChart/LineChart.js.map +1 -1
- package/dist/LinksEditor/LinksEditor.js +9 -18
- package/dist/LinksEditor/LinksEditor.js.map +1 -1
- package/dist/OptionsEditorLayout/OptionsEditorControl.js.map +1 -1
- package/dist/Overlay/Overlay.js +1 -1
- package/dist/Overlay/Overlay.js.map +1 -1
- package/dist/RefreshIntervalPicker/RefreshIntervalPicker.js.map +1 -1
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js +1 -2
- package/dist/SettingsAutocomplete/SettingsAutocomplete.js.map +1 -1
- package/dist/StatChart/StatChart.js +3 -5
- package/dist/StatChart/StatChart.js.map +1 -1
- package/dist/StatChart/calculateFontSize.js +2 -4
- package/dist/StatChart/calculateFontSize.js.map +1 -1
- package/dist/StatusHistoryChart/StatusHistoryChart.js +1 -2
- package/dist/StatusHistoryChart/StatusHistoryChart.js.map +1 -1
- package/dist/StatusHistoryChart/utils/get-color.js.map +1 -1
- package/dist/Table/Table.d.ts +1 -1
- package/dist/Table/Table.d.ts.map +1 -1
- package/dist/Table/Table.js +7 -6
- package/dist/Table/Table.js.map +1 -1
- package/dist/Table/TableCell.d.ts +2 -1
- package/dist/Table/TableCell.d.ts.map +1 -1
- package/dist/Table/TableCell.js +9 -8
- package/dist/Table/TableCell.js.map +1 -1
- package/dist/Table/TableHeaderCell.js.map +1 -1
- package/dist/Table/VirtualizedTable.d.ts +2 -2
- package/dist/Table/VirtualizedTable.d.ts.map +1 -1
- package/dist/Table/VirtualizedTable.js +14 -15
- package/dist/Table/VirtualizedTable.js.map +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js +1 -1
- package/dist/Table/hooks/useTableKeyboardNav.js.map +1 -1
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js +7 -13
- package/dist/Table/hooks/useVirtualizedTableKeyboardNav.js.map +1 -1
- package/dist/Table/model/table-model.d.ts +8 -1
- package/dist/Table/model/table-model.d.ts.map +1 -1
- package/dist/Table/model/table-model.js +5 -3
- package/dist/Table/model/table-model.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdInput.js.map +1 -1
- package/dist/ThresholdsEditor/ThresholdsEditor.js +16 -24
- package/dist/ThresholdsEditor/ThresholdsEditor.js.map +1 -1
- package/dist/TimeChart/TimeChart.js +7 -10
- package/dist/TimeChart/TimeChart.js.map +1 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.js +1 -1
- package/dist/TimeRangeSelector/DateTimeRangePicker.js.map +1 -1
- package/dist/TimeRangeSelector/TimeRangeSelector.js.map +1 -1
- package/dist/TimeRangeSelector/utils.js.map +1 -1
- package/dist/TimeSeriesTooltip/LineChartTooltip.js +6 -11
- package/dist/TimeSeriesTooltip/LineChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesInfo.js +1 -2
- package/dist/TimeSeriesTooltip/SeriesInfo.js.map +1 -1
- package/dist/TimeSeriesTooltip/SeriesLabelsStack.js.map +1 -1
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js +2 -3
- package/dist/TimeSeriesTooltip/TimeChartTooltip.js.map +1 -1
- package/dist/TimeSeriesTooltip/TooltipHeader.js +4 -10
- package/dist/TimeSeriesTooltip/TooltipHeader.js.map +1 -1
- package/dist/TimeSeriesTooltip/nearby-series.js +13 -23
- package/dist/TimeSeriesTooltip/nearby-series.js.map +1 -1
- package/dist/TimeSeriesTooltip/utils.js +2 -4
- package/dist/TimeSeriesTooltip/utils.js.map +1 -1
- package/dist/TransformsEditor/TransformEditor.js +4 -7
- package/dist/TransformsEditor/TransformEditor.js.map +1 -1
- package/dist/TransformsEditor/TransformEditorContainer.js +3 -5
- package/dist/TransformsEditor/TransformEditorContainer.js.map +1 -1
- package/dist/TransformsEditor/TransformsEditor.js +3 -6
- package/dist/TransformsEditor/TransformsEditor.js.map +1 -1
- package/dist/ValueMappingEditor/ValueMappingEditor.js +11 -24
- package/dist/ValueMappingEditor/ValueMappingEditor.js.map +1 -1
- package/dist/cjs/ColorPicker/ColorPicker.js +2 -2
- package/dist/cjs/ContentWithLegend/model/content-with-legend-model.js +2 -3
- package/dist/cjs/DragAndDrop/DragButton.js +1 -1
- package/dist/cjs/Drawer/Drawer.js +1 -1
- package/dist/cjs/EChart/EChart.js +18 -4
- package/dist/cjs/GaugeChart/GaugeChart.js +2 -5
- package/dist/cjs/InfoTooltip/InfoTooltip.js +5 -4
- package/dist/cjs/Legend/ListLegendItem.js +3 -4
- package/dist/cjs/LineChart/LineChart.js +4 -8
- package/dist/cjs/LinksEditor/LinksEditor.js +9 -18
- package/dist/cjs/Overlay/Overlay.js +1 -1
- package/dist/cjs/SettingsAutocomplete/SettingsAutocomplete.js +1 -2
- package/dist/cjs/StatChart/StatChart.js +3 -5
- package/dist/cjs/StatChart/calculateFontSize.js +2 -4
- package/dist/cjs/StatusHistoryChart/StatusHistoryChart.js +1 -2
- package/dist/cjs/Table/Table.js +7 -6
- package/dist/cjs/Table/TableCell.js +9 -8
- package/dist/cjs/Table/VirtualizedTable.js +14 -15
- package/dist/cjs/Table/hooks/useTableKeyboardNav.js +1 -1
- package/dist/cjs/Table/hooks/useVirtualizedTableKeyboardNav.js +7 -13
- package/dist/cjs/Table/model/table-model.js +8 -3
- package/dist/cjs/ThresholdsEditor/ThresholdsEditor.js +24 -32
- package/dist/cjs/TimeChart/TimeChart.js +6 -9
- package/dist/cjs/TimeRangeSelector/DateTimeRangePicker.js +2 -2
- package/dist/cjs/TimeSeriesTooltip/LineChartTooltip.js +6 -11
- package/dist/cjs/TimeSeriesTooltip/SeriesInfo.js +1 -2
- package/dist/cjs/TimeSeriesTooltip/TimeChartTooltip.js +2 -3
- package/dist/cjs/TimeSeriesTooltip/TooltipHeader.js +4 -10
- package/dist/cjs/TimeSeriesTooltip/nearby-series.js +13 -23
- package/dist/cjs/TimeSeriesTooltip/utils.js +2 -4
- package/dist/cjs/TransformsEditor/TransformEditor.js +4 -7
- package/dist/cjs/TransformsEditor/TransformEditorContainer.js +3 -5
- package/dist/cjs/TransformsEditor/TransformsEditor.js +3 -6
- package/dist/cjs/ValueMappingEditor/ValueMappingEditor.js +11 -24
- package/dist/cjs/context/TimeZoneProvider.js +1 -1
- package/dist/cjs/controls/TextField.js +1 -1
- package/dist/cjs/utils/chart-actions.js +1 -2
- package/dist/cjs/utils/format.js +1 -1
- package/dist/cjs/utils/theme-gen.js +5 -7
- package/dist/context/SnackbarProvider.js.map +1 -1
- package/dist/context/TimeZoneProvider.js +1 -1
- package/dist/context/TimeZoneProvider.js.map +1 -1
- package/dist/controls/TextField.js +1 -1
- package/dist/controls/TextField.js.map +1 -1
- package/dist/model/timeOption.js.map +1 -1
- package/dist/theme/component-overrides/alert.js.map +1 -1
- package/dist/utils/chart-actions.js +1 -2
- package/dist/utils/chart-actions.js.map +1 -1
- package/dist/utils/component-ids.js.map +1 -1
- package/dist/utils/format.js +1 -1
- package/dist/utils/format.js.map +1 -1
- package/dist/utils/theme-gen.js +5 -7
- package/dist/utils/theme-gen.js.map +1 -1
- package/package.json +5 -8
|
@@ -22,7 +22,7 @@ Object.defineProperty(exports, "ThresholdsEditor", {
|
|
|
22
22
|
});
|
|
23
23
|
const _jsxruntime = require("react/jsx-runtime");
|
|
24
24
|
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
25
|
-
const _immer =
|
|
25
|
+
const _immer = require("immer");
|
|
26
26
|
const _material = require("@mui/material");
|
|
27
27
|
const _Plus = /*#__PURE__*/ _interop_require_default(require("mdi-material-ui/Plus"));
|
|
28
28
|
const _system = require("@mui/system");
|
|
@@ -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
|
-
|
|
85
|
-
const
|
|
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
|
|
87
|
+
setSteps(thresholds?.steps);
|
|
89
88
|
}, [
|
|
90
|
-
thresholds
|
|
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
|
-
|
|
96
|
+
recentlyAddedInputRef.current?.focus();
|
|
99
97
|
focusRef.current = false;
|
|
100
98
|
}, [
|
|
101
|
-
steps
|
|
99
|
+
steps?.length
|
|
102
100
|
]);
|
|
103
101
|
const handleThresholdValueChange = (e, i)=>{
|
|
104
|
-
setSteps((0, _immer.
|
|
105
|
-
const step = draft
|
|
102
|
+
setSteps((0, _immer.produce)(steps, (draft)=>{
|
|
103
|
+
const step = draft?.[i];
|
|
106
104
|
if (step) {
|
|
107
105
|
step.value = Number(e.target.value);
|
|
108
106
|
}
|
|
@@ -110,7 +108,7 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
|
|
|
110
108
|
};
|
|
111
109
|
const handleThresholdColorChange = (color, i)=>{
|
|
112
110
|
if (thresholds !== undefined) {
|
|
113
|
-
onChange((0, _immer.
|
|
111
|
+
onChange((0, _immer.produce)(thresholds, (draft)=>{
|
|
114
112
|
if (draft.steps !== undefined) {
|
|
115
113
|
const step = draft.steps[i];
|
|
116
114
|
if (step) {
|
|
@@ -122,7 +120,7 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
|
|
|
122
120
|
};
|
|
123
121
|
const handleDefaultColorChange = (color)=>{
|
|
124
122
|
if (thresholds !== undefined) {
|
|
125
|
-
onChange((0, _immer.
|
|
123
|
+
onChange((0, _immer.produce)(thresholds, (draft)=>{
|
|
126
124
|
draft.defaultColor = color;
|
|
127
125
|
}));
|
|
128
126
|
} else {
|
|
@@ -139,7 +137,7 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
|
|
|
139
137
|
];
|
|
140
138
|
sortedSteps.sort((a, b)=>a.value - b.value);
|
|
141
139
|
if (thresholds !== undefined) {
|
|
142
|
-
onChange((0, _immer.
|
|
140
|
+
onChange((0, _immer.produce)(thresholds, (draft)=>{
|
|
143
141
|
draft.steps = sortedSteps;
|
|
144
142
|
}));
|
|
145
143
|
}
|
|
@@ -147,7 +145,7 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
|
|
|
147
145
|
};
|
|
148
146
|
const deleteThreshold = (i)=>{
|
|
149
147
|
if (thresholds !== undefined) {
|
|
150
|
-
const updatedThresholds = (0, _immer.
|
|
148
|
+
const updatedThresholds = (0, _immer.produce)(thresholds, (draft)=>{
|
|
151
149
|
if (draft.steps) {
|
|
152
150
|
draft.steps.splice(i, 1);
|
|
153
151
|
}
|
|
@@ -166,7 +164,7 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
|
|
|
166
164
|
]
|
|
167
165
|
});
|
|
168
166
|
} else if (thresholds && thresholds.steps === undefined) {
|
|
169
|
-
onChange((0, _immer.
|
|
167
|
+
onChange((0, _immer.produce)(thresholds, (draft)=>{
|
|
170
168
|
draft.steps = [
|
|
171
169
|
{
|
|
172
170
|
value: DEFAULT_STEP
|
|
@@ -174,16 +172,14 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
|
|
|
174
172
|
];
|
|
175
173
|
}));
|
|
176
174
|
} else {
|
|
177
|
-
onChange((0, _immer.
|
|
175
|
+
onChange((0, _immer.produce)(thresholds, (draft)=>{
|
|
178
176
|
const steps = draft.steps;
|
|
179
|
-
if (steps
|
|
177
|
+
if (steps?.length) {
|
|
180
178
|
const lastStep = steps[steps.length - 1];
|
|
181
|
-
|
|
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: (
|
|
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({
|
|
@@ -196,7 +192,7 @@ function ThresholdsEditor({ thresholds, onChange, hideDefault, disablePercentMod
|
|
|
196
192
|
const handleModeChange = (event, value)=>{
|
|
197
193
|
const mode = value === 'percent' ? 'percent' : undefined;
|
|
198
194
|
if (thresholds !== undefined) {
|
|
199
|
-
onChange((0, _immer.
|
|
195
|
+
onChange((0, _immer.produce)(thresholds, (draft)=>{
|
|
200
196
|
draft.mode = mode;
|
|
201
197
|
}));
|
|
202
198
|
} else {
|
|
@@ -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:
|
|
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:
|
|
251
|
+
color: step.color ?? palette[i] ?? defaultThresholdColor,
|
|
259
252
|
value: step.value,
|
|
260
|
-
mode: thresholds
|
|
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)();
|
|
@@ -153,7 +152,7 @@ const TimeChart = /*#__PURE__*/ (0, _react.forwardRef)(function TimeChart({ heig
|
|
|
153
152
|
const values = d.values.map(([timestamp, value])=>{
|
|
154
153
|
const val = value === null ? '-' : value; // echarts use '-' to represent null data
|
|
155
154
|
return [
|
|
156
|
-
isLocalTimeZone ? timestamp : (0, _datefnstz.
|
|
155
|
+
isLocalTimeZone ? timestamp : (0, _datefnstz.toZonedTime)(timestamp, timeZone),
|
|
157
156
|
val
|
|
158
157
|
];
|
|
159
158
|
});
|
|
@@ -172,17 +171,16 @@ 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,
|
|
179
177
|
xAxis: {
|
|
180
178
|
type: 'time',
|
|
181
|
-
min: isLocalTimeZone ? timeScale.startMs : (0, _datefnstz.
|
|
182
|
-
max: isLocalTimeZone ? timeScale.endMs : (0, _datefnstz.
|
|
179
|
+
min: isLocalTimeZone ? timeScale.startMs : (0, _datefnstz.toZonedTime)(timeScale.startMs, timeZone),
|
|
180
|
+
max: isLocalTimeZone ? timeScale.endMs : (0, _datefnstz.toZonedTime)(timeScale.endMs, timeZone),
|
|
183
181
|
axisLabel: {
|
|
184
182
|
hideOverlap: true,
|
|
185
|
-
formatter: (0, _utils.getFormattedAxisLabel)(
|
|
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 =
|
|
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 &&
|
|
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,
|
|
@@ -24,7 +24,7 @@ const _jsxruntime = require("react/jsx-runtime");
|
|
|
24
24
|
const _react = require("react");
|
|
25
25
|
const _material = require("@mui/material");
|
|
26
26
|
const _xdatepickers = require("@mui/x-date-pickers");
|
|
27
|
-
const
|
|
27
|
+
const _AdapterDateFnsV3 = require("@mui/x-date-pickers/AdapterDateFnsV3");
|
|
28
28
|
const _context = require("../context");
|
|
29
29
|
const _ErrorBoundary = require("../ErrorBoundary");
|
|
30
30
|
const _ErrorAlert = require("../ErrorAlert");
|
|
@@ -86,7 +86,7 @@ const DateTimeRangePicker = ({ initialTimeRange, onChange, onCancel })=>{
|
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
88
|
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_xdatepickers.LocalizationProvider, {
|
|
89
|
-
dateAdapter:
|
|
89
|
+
dateAdapter: _AdapterDateFnsV3.AdapterDateFns,
|
|
90
90
|
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_material.Stack, {
|
|
91
91
|
spacing: 2,
|
|
92
92
|
sx: (theme)=>({
|
|
@@ -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
|
-
|
|
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
|
|
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
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
63
|
-
const
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
168
|
-
const
|
|
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
|
-
|
|
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
|
-
|
|
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 (
|
|
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 (
|
|
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
|
-
|
|
336
|
-
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
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:
|
|
150
|
+
value: value.spec.column ?? '',
|
|
154
151
|
sx: {
|
|
155
152
|
width: '100%'
|
|
156
153
|
},
|
|
@@ -35,14 +35,12 @@ function _interop_require_default(obj) {
|
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
function TransformEditorContainer({ index, value, isCollapsed, onChange, onCollapse, onDelete, ...props }) {
|
|
38
|
-
var _value_spec, _value_spec1;
|
|
39
38
|
function handleTransformDisable() {
|
|
40
|
-
var _value_spec;
|
|
41
39
|
onChange({
|
|
42
40
|
...value,
|
|
43
41
|
spec: {
|
|
44
42
|
...value.spec,
|
|
45
|
-
disabled: !
|
|
43
|
+
disabled: !value.spec?.disabled
|
|
46
44
|
}
|
|
47
45
|
});
|
|
48
46
|
}
|
|
@@ -90,7 +88,7 @@ function TransformEditorContainer({ index, value, isCollapsed, onChange, onColla
|
|
|
90
88
|
isCollapsed && /*#__PURE__*/ (0, _jsxruntime.jsxs)(_jsxruntime.Fragment, {
|
|
91
89
|
children: [
|
|
92
90
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Tooltip, {
|
|
93
|
-
title:
|
|
91
|
+
title: value.spec?.disabled ? 'Enable transformation' : 'Disable transformation',
|
|
94
92
|
placement: "top",
|
|
95
93
|
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.IconButton, {
|
|
96
94
|
size: "small",
|
|
@@ -98,7 +96,7 @@ function TransformEditorContainer({ index, value, isCollapsed, onChange, onColla
|
|
|
98
96
|
marginLeft: 'auto'
|
|
99
97
|
},
|
|
100
98
|
onClick: handleTransformDisable,
|
|
101
|
-
children:
|
|
99
|
+
children: value.spec?.disabled ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_EyeOffOutline.default, {}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_EyeOutline.default, {})
|
|
102
100
|
})
|
|
103
101
|
}),
|
|
104
102
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Divider, {
|
|
@@ -81,17 +81,14 @@ function TransformsEditor({ value, onChange, ...props }) {
|
|
|
81
81
|
gap: 1,
|
|
82
82
|
...props,
|
|
83
83
|
children: [
|
|
84
|
-
value.map((transform, i)
|
|
85
|
-
var _transformsCollapsed_i;
|
|
86
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)(_TransformEditorContainer.TransformEditorContainer, {
|
|
84
|
+
value.map((transform, i)=>/*#__PURE__*/ (0, _jsxruntime.jsx)(_TransformEditorContainer.TransformEditorContainer, {
|
|
87
85
|
index: i,
|
|
88
86
|
value: transform,
|
|
89
|
-
isCollapsed:
|
|
87
|
+
isCollapsed: transformsCollapsed[i] ?? true,
|
|
90
88
|
onChange: (updatedTransform)=>handleTransformChange(i, updatedTransform),
|
|
91
89
|
onDelete: ()=>handleTransformDelete(i),
|
|
92
90
|
onCollapse: (collapsed)=>handleTransformCollapseExpand(i, collapsed)
|
|
93
|
-
}, i)
|
|
94
|
-
}),
|
|
91
|
+
}, i)),
|
|
95
92
|
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, {
|
|
96
93
|
variant: "contained",
|
|
97
94
|
startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_Plus.default, {}),
|