@grafana/scenes 6.4.0--canary.1062.13834982917.0 → 6.4.0--canary.1062.13918599453.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/dist/index.js CHANGED
@@ -4720,6 +4720,9 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4720
4720
  return;
4721
4721
  }
4722
4722
  }
4723
+ if (filter == null ? void 0 : filter.origin) {
4724
+ return;
4725
+ }
4723
4726
  setInputType("operator");
4724
4727
  return;
4725
4728
  }
@@ -4915,9 +4918,10 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4915
4918
  operatorIdentifier
4916
4919
  ),
4917
4920
  "aria-label": "Edit filter operator",
4918
- tabIndex: 0,
4921
+ tabIndex: filter.origin ? -1 : 0,
4919
4922
  onClick: (event) => {
4920
4923
  if (filter.origin) {
4924
+ handleChangeViewMode == null ? void 0 : handleChangeViewMode();
4921
4925
  return;
4922
4926
  }
4923
4927
  event.stopPropagation();
@@ -4925,6 +4929,9 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4925
4929
  switchInputType("operator", setInputType, void 0, refs.domReference.current);
4926
4930
  },
4927
4931
  onKeyDown: (event) => {
4932
+ if (filter.origin) {
4933
+ return;
4934
+ }
4928
4935
  handleShiftTabInput(event, hasMultiValueOperator);
4929
4936
  if (event.key === "Enter") {
4930
4937
  setInputValue("");
@@ -5580,7 +5587,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
5580
5587
  ...scopeFilters.filter((filter) => !editedScopeFilterKeys.includes(filter.key))
5581
5588
  ];
5582
5589
  }
5583
- const newFilters = [...finalFilters, ...remainingFilters];
5590
+ const newFilters = [...remainingFilters, ...finalFilters];
5584
5591
  this.setState({ baseFilters: newFilters });
5585
5592
  };
5586
5593
  if (this.state.applyMode === "auto") {
@@ -5685,6 +5692,7 @@ class AdHocFiltersVariable extends SceneObjectBase {
5685
5692
  }
5686
5693
  }
5687
5694
  _handleComboboxBackspace(filter) {
5695
+ var _a;
5688
5696
  if (this.state.filters.length) {
5689
5697
  let filterToForceIndex = this.state.filters.length - 1;
5690
5698
  if (filter !== this.state._wip) {
@@ -5706,6 +5714,27 @@ class AdHocFiltersVariable extends SceneObjectBase {
5706
5714
  return [...acc, f];
5707
5715
  }, [])
5708
5716
  });
5717
+ } else if ((_a = this.state.baseFilters) == null ? void 0 : _a.length) {
5718
+ let filterToForceIndex = this.state.baseFilters.length - 1;
5719
+ if (filter !== this.state._wip) {
5720
+ filterToForceIndex = -1;
5721
+ }
5722
+ this.setState({
5723
+ baseFilters: this.state.baseFilters.reduce((acc, f, index) => {
5724
+ if (index === filterToForceIndex) {
5725
+ return [
5726
+ ...acc,
5727
+ __spreadProps$n(__spreadValues$z({}, f), {
5728
+ forceEdit: true
5729
+ })
5730
+ ];
5731
+ }
5732
+ if (f === filter) {
5733
+ return acc;
5734
+ }
5735
+ return [...acc, f];
5736
+ }, [])
5737
+ });
5709
5738
  }
5710
5739
  }
5711
5740
  async _getKeys(currentKey) {