@grafana/scenes 6.37.0--canary.1250.17838203603.0 → 6.37.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.
- package/CHANGELOG.md +12 -0
- package/dist/esm/components/SceneTimePicker.js +19 -3
- package/dist/esm/components/SceneTimePicker.js.map +1 -1
- package/dist/esm/locales/en-US/grafana-scenes.json.js +4 -0
- package/dist/esm/locales/en-US/grafana-scenes.json.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFilterRenderer.js +1 -4
- package/dist/esm/variables/adhoc/AdHocFilterRenderer.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js +3 -9
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js.map +1 -1
- package/dist/{grafana-scenes-C_CT7peT.js → grafana-scenes-Bnbq8XI2.js} +5 -1
- package/dist/{grafana-scenes-C_CT7peT.js.map → grafana-scenes-Bnbq8XI2.js.map} +1 -1
- package/dist/index.js +20 -14
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grafana-scenes-
|
|
1
|
+
{"version":3,"file":"grafana-scenes-Bnbq8XI2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
package/dist/index.js
CHANGED
|
@@ -4273,13 +4273,11 @@ function AdHocFilterRenderer({ filter, model }) {
|
|
|
4273
4273
|
});
|
|
4274
4274
|
}
|
|
4275
4275
|
};
|
|
4276
|
-
const operatorDefinition = OPERATORS.find((op) => filter.operator === op.value);
|
|
4277
4276
|
const valueSelect = /* @__PURE__ */ React__default.default.createElement(
|
|
4278
4277
|
ui.Select,
|
|
4279
4278
|
{
|
|
4280
4279
|
virtualized: true,
|
|
4281
4280
|
allowCustomValue: (_b = model.state.allowCustomValue) != null ? _b : true,
|
|
4282
|
-
createOptionPosition: (operatorDefinition == null ? void 0 : operatorDefinition.isRegex) ? "first" : "last",
|
|
4283
4281
|
isValidNewOption: (inputValue) => inputValue.trim().length > 0,
|
|
4284
4282
|
allowCreateWhileLoading: true,
|
|
4285
4283
|
formatCreateLabel: (inputValue) => `Use custom value: ${inputValue}`,
|
|
@@ -4337,7 +4335,6 @@ function AdHocFilterRenderer({ filter, model }) {
|
|
|
4337
4335
|
className: css.cx(styles.key, isKeysOpen ? styles.widthWhenOpen : void 0),
|
|
4338
4336
|
width: "auto",
|
|
4339
4337
|
allowCustomValue: (_c = model.state.allowCustomValue) != null ? _c : true,
|
|
4340
|
-
createOptionPosition: (operatorDefinition == null ? void 0 : operatorDefinition.isRegex) ? "first" : "last",
|
|
4341
4338
|
value: keyValue,
|
|
4342
4339
|
placeholder: i18n.t(
|
|
4343
4340
|
"grafana-scenes.variables.ad-hoc-filter-renderer.key-select.placeholder-select-label",
|
|
@@ -5173,17 +5170,11 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
|
|
|
5173
5170
|
handleOptionGroups(optionsSearcher(preventFiltering ? "" : inputValue))
|
|
5174
5171
|
);
|
|
5175
5172
|
if (allowCustomValue && filterInputType !== "operator" && inputValue) {
|
|
5176
|
-
|
|
5177
|
-
const customOptionValue = {
|
|
5173
|
+
filteredDropDownItems.push({
|
|
5178
5174
|
value: inputValue.trim(),
|
|
5179
5175
|
label: inputValue.trim(),
|
|
5180
5176
|
isCustom: true
|
|
5181
|
-
};
|
|
5182
|
-
if (operatorDefinition == null ? void 0 : operatorDefinition.isRegex) {
|
|
5183
|
-
filteredDropDownItems.unshift(customOptionValue);
|
|
5184
|
-
} else {
|
|
5185
|
-
filteredDropDownItems.push(customOptionValue);
|
|
5186
|
-
}
|
|
5177
|
+
});
|
|
5187
5178
|
}
|
|
5188
5179
|
const onAddCustomValue = model.state.onAddCustomValue;
|
|
5189
5180
|
const maxOptionWidth = setupDropdownAccessibility(filteredDropDownItems, listRef, disabledIndicesRef);
|
|
@@ -12566,7 +12557,7 @@ class SceneTimePicker extends SceneObjectBase {
|
|
|
12566
12557
|
const {
|
|
12567
12558
|
state: { value: range }
|
|
12568
12559
|
} = timeRange;
|
|
12569
|
-
timeRange.onTimeRangeChange(getShiftedTimeRange(0 /* Backward */, range
|
|
12560
|
+
timeRange.onTimeRangeChange(getShiftedTimeRange(0 /* Backward */, range));
|
|
12570
12561
|
};
|
|
12571
12562
|
this.onMoveForward = () => {
|
|
12572
12563
|
const timeRange = sceneGraph.getTimeRange(this);
|
|
@@ -12592,6 +12583,13 @@ function SceneTimePickerRenderer({ model }) {
|
|
|
12592
12583
|
return null;
|
|
12593
12584
|
}
|
|
12594
12585
|
const rangesToUse = quickRanges || defaultQuickRanges;
|
|
12586
|
+
const halfSpanMs = (timeRangeState.value.to.valueOf() - timeRangeState.value.from.valueOf()) / 2;
|
|
12587
|
+
const moveBackwardDuration = data.intervalToAbbreviatedDurationString({
|
|
12588
|
+
start: new Date(timeRangeState.value.from.valueOf()),
|
|
12589
|
+
end: new Date(timeRangeState.value.from.valueOf() + halfSpanMs)
|
|
12590
|
+
});
|
|
12591
|
+
const canMoveForward = timeRangeState.value.to.valueOf() + halfSpanMs <= Date.now();
|
|
12592
|
+
const moveForwardDuration = canMoveForward ? moveBackwardDuration : void 0;
|
|
12595
12593
|
return /* @__PURE__ */ React__default.default.createElement(
|
|
12596
12594
|
ui.TimeRangePicker,
|
|
12597
12595
|
{
|
|
@@ -12607,6 +12605,14 @@ function SceneTimePickerRenderer({ model }) {
|
|
|
12607
12605
|
fiscalYearStartMonth: timeRangeState.fiscalYearStartMonth,
|
|
12608
12606
|
onMoveBackward: model.onMoveBackward,
|
|
12609
12607
|
onMoveForward: model.onMoveForward,
|
|
12608
|
+
moveForwardTooltip: moveForwardDuration ? i18n.t("grafana-scenes.components.time-picker.move-forward-tooltip", "Move {{moveForwardDuration}} forward", {
|
|
12609
|
+
moveForwardDuration
|
|
12610
|
+
}) : void 0,
|
|
12611
|
+
moveBackwardTooltip: i18n.t(
|
|
12612
|
+
"grafana-scenes.components.time-picker.move-backward-tooltip",
|
|
12613
|
+
"Move {{moveBackwardDuration}} backward",
|
|
12614
|
+
{ moveBackwardDuration }
|
|
12615
|
+
),
|
|
12610
12616
|
onZoom: model.onZoom,
|
|
12611
12617
|
onChangeTimeZone: timeRange.onTimeZoneChange,
|
|
12612
12618
|
onChangeFiscalYearStartMonth: model.onChangeFiscalYearStartMonth,
|
|
@@ -12636,7 +12642,7 @@ function getShiftedTimeRange(dir, timeRange, upperLimit) {
|
|
|
12636
12642
|
} else {
|
|
12637
12643
|
fromRaw = oldFrom + halfSpan;
|
|
12638
12644
|
toRaw = oldTo + halfSpan;
|
|
12639
|
-
if (toRaw > upperLimit && oldTo < upperLimit) {
|
|
12645
|
+
if (upperLimit !== void 0 && toRaw > upperLimit && oldTo < upperLimit) {
|
|
12640
12646
|
toRaw = upperLimit;
|
|
12641
12647
|
fromRaw = oldFrom;
|
|
12642
12648
|
}
|
|
@@ -15118,7 +15124,7 @@ function __variableDynamicImportRuntime0__(path) {
|
|
|
15118
15124
|
switch (path) {
|
|
15119
15125
|
case '../locales/cs-CZ/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-BcDO8gk4.js'); });
|
|
15120
15126
|
case '../locales/de-DE/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-CzZTvOrf.js'); });
|
|
15121
|
-
case '../locales/en-US/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-
|
|
15127
|
+
case '../locales/en-US/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-Bnbq8XI2.js'); });
|
|
15122
15128
|
case '../locales/es-ES/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-zGpJY4O3.js'); });
|
|
15123
15129
|
case '../locales/fr-FR/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-CfoPR_PZ.js'); });
|
|
15124
15130
|
case '../locales/hu-HU/grafana-scenes.json': return Promise.resolve().then(function () { return require('./grafana-scenes-CoXR5Z7T.js'); });
|