@grafana/scenes 5.13.1--canary.889.10720020573.0 → 5.14.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
@@ -241,6 +241,7 @@ class SceneObjectBase {
241
241
  this._deactivationHandlers = /* @__PURE__ */ new Map();
242
242
  this._subs = new rxjs.Subscription();
243
243
  this._refCount = 0;
244
+ this._UNSAFE_PARENT_ACTIVATION = false;
244
245
  if (!state.key) {
245
246
  state.key = uuid.v4();
246
247
  }
@@ -397,12 +398,19 @@ class SceneObjectBase {
397
398
  }
398
399
  }
399
400
  activate() {
401
+ let parentDeactivate;
402
+ if (this.parent && !this.parent.isActive && this._UNSAFE_PARENT_ACTIVATION) {
403
+ parentDeactivate = this.parent.activate();
404
+ }
400
405
  if (!this.isActive) {
401
406
  this._internalActivate();
402
407
  }
403
408
  this._refCount++;
404
409
  let called = false;
405
410
  return () => {
411
+ if (parentDeactivate) {
412
+ parentDeactivate();
413
+ }
406
414
  this._refCount--;
407
415
  if (called) {
408
416
  const msg = `SceneObject cancelation handler returned by activate() called a second time`;
@@ -3628,7 +3636,7 @@ var __objRest$3 = (source, exclude) => {
3628
3636
  };
3629
3637
  const DropdownItem = React.forwardRef(
3630
3638
  function DropdownItem2(_a, ref) {
3631
- var _b = _a, { children, active, addGroupBottomBorder, isMultiValueEdit, checked } = _b, rest = __objRest$3(_b, ["children", "active", "addGroupBottomBorder", "isMultiValueEdit", "checked"]);
3639
+ var _b = _a, { children, active, addGroupBottomBorder } = _b, rest = __objRest$3(_b, ["children", "active", "addGroupBottomBorder"]);
3632
3640
  const styles = ui.useStyles2(getStyles$c);
3633
3641
  const id = React.useId();
3634
3642
  return /* @__PURE__ */ React__default["default"].createElement("div", __spreadValues$B({
@@ -3640,11 +3648,7 @@ const DropdownItem = React.forwardRef(
3640
3648
  }, rest), /* @__PURE__ */ React__default["default"].createElement("div", {
3641
3649
  className: styles.optionBody,
3642
3650
  "data-testid": `data-testid ad hoc filter option value ${children}`
3643
- }, /* @__PURE__ */ React__default["default"].createElement("span", null, isMultiValueEdit ? /* @__PURE__ */ React__default["default"].createElement(ui.Checkbox, {
3644
- tabIndex: -1,
3645
- checked,
3646
- className: styles.checkbox
3647
- }) : null, children)));
3651
+ }, /* @__PURE__ */ React__default["default"].createElement("span", null, children)));
3648
3652
  }
3649
3653
  );
3650
3654
  const getStyles$c = (theme) => ({
@@ -3684,22 +3688,6 @@ const getStyles$c = (theme) => ({
3684
3688
  }),
3685
3689
  groupBottomBorder: css.css({
3686
3690
  borderBottom: `1px solid ${theme.colors.border.weak}`
3687
- }),
3688
- checkbox: css.css({
3689
- paddingRight: theme.spacing(0.5)
3690
- }),
3691
- multiValueApply: css.css({
3692
- position: "absolute",
3693
- top: 0,
3694
- left: 0,
3695
- display: "flex"
3696
- }),
3697
- dropdownWrapper: css.css({
3698
- backgroundColor: theme.colors.background.primary,
3699
- color: theme.colors.text.primary,
3700
- boxShadow: theme.shadows.z2,
3701
- overflowY: "auto",
3702
- zIndex: theme.zIndex.dropdown
3703
3691
  })
3704
3692
  });
3705
3693
  const LoadingOptionsPlaceholder = () => {
@@ -3717,28 +3705,11 @@ const OptionsErrorPlaceholder = ({ handleFetchOptions }) => {
3717
3705
  onClick: handleFetchOptions
3718
3706
  }, "An error has occurred fetching labels. Click to retry");
3719
3707
  };
3720
- const MultiValueApplyButton = ({ onClick, floatingElement, maxOptionWidth }) => {
3721
- const styles = ui.useStyles2(getStyles$c);
3722
- const floatingElementRect = floatingElement == null ? void 0 : floatingElement.getBoundingClientRect();
3723
- return /* @__PURE__ */ React__default["default"].createElement("div", {
3724
- className: css.cx(styles.dropdownWrapper, styles.multiValueApply),
3725
- style: {
3726
- width: `${maxOptionWidth}px`,
3727
- transform: `translate(${floatingElementRect == null ? void 0 : floatingElementRect.left}px,${floatingElementRect == null ? void 0 : floatingElementRect.bottom}px)`
3728
- }
3729
- }, /* @__PURE__ */ React__default["default"].createElement(ui.Button, {
3730
- onClick,
3731
- fill: "text",
3732
- fullWidth: true,
3733
- tabIndex: -1
3734
- }, "Apply"));
3735
- };
3736
3708
 
3737
3709
  const VIRTUAL_LIST_WIDTH_ESTIMATE_MULTIPLIER = 8;
3738
3710
  const VIRTUAL_LIST_PADDING = 8;
3739
3711
  const VIRTUAL_LIST_OVERSCAN = 5;
3740
3712
  const VIRTUAL_LIST_ITEM_HEIGHT = 38;
3741
- const VIRTUAL_LIST_ITEM_HEIGHT_WITH_DESCRIPTION = 60;
3742
3713
  const ERROR_STATE_DROPDOWN_WIDTH = 366;
3743
3714
  function fuzzySearchOptions(options) {
3744
3715
  const ufuzzy = new uFuzzy__default["default"]();
@@ -3789,7 +3760,7 @@ function fuzzySearchOptions(options) {
3789
3760
  }
3790
3761
  const flattenOptionGroups = (options) => options.flatMap((option) => option.options ? [option, ...option.options] : [option]);
3791
3762
  const setupDropdownAccessibility = (options, listRef, disabledIndicesRef) => {
3792
- var _a, _b, _c, _d;
3763
+ var _a, _b, _c;
3793
3764
  let maxOptionWidth = 182;
3794
3765
  const listRefArr = [];
3795
3766
  const disabledIndices = [];
@@ -3799,9 +3770,6 @@ const setupDropdownAccessibility = (options, listRef, disabledIndicesRef) => {
3799
3770
  disabledIndices.push(i);
3800
3771
  }
3801
3772
  let label = (_c = (_b = options[i].label) != null ? _b : options[i].value) != null ? _c : "";
3802
- if (label.length < (((_d = options[i].description) == null ? void 0 : _d.length) || 0)) {
3803
- label = options[i].description;
3804
- }
3805
3773
  const widthEstimate = (options[i].isCustom ? label.length + 18 : label.length) * VIRTUAL_LIST_WIDTH_ESTIMATE_MULTIPLIER + VIRTUAL_LIST_PADDING * 2;
3806
3774
  if (widthEstimate > maxOptionWidth) {
3807
3775
  maxOptionWidth = widthEstimate;
@@ -3851,7 +3819,7 @@ const useFloatingInteractions = ({
3851
3819
  onOpenChange,
3852
3820
  activeIndex,
3853
3821
  setActiveIndex,
3854
- outsidePressIdsToIgnore,
3822
+ operatorIdentifier,
3855
3823
  listRef,
3856
3824
  disabledIndicesRef
3857
3825
  }) => {
@@ -3875,13 +3843,7 @@ const useFloatingInteractions = ({
3875
3843
  const role = react.useRole(context, { role: "listbox" });
3876
3844
  const dismiss = react.useDismiss(context, {
3877
3845
  outsidePress: (event) => {
3878
- var _a;
3879
- const target = event.currentTarget || event.target;
3880
- let idToCompare = (target == null ? void 0 : target.id) || "";
3881
- if ((target == null ? void 0 : target.nodeName) === "path") {
3882
- idToCompare = ((_a = target.parentElement) == null ? void 0 : _a.id) || "";
3883
- }
3884
- if (outsidePressIdsToIgnore.includes(idToCompare)) {
3846
+ if (event.currentTarget instanceof HTMLElement && event.currentTarget.id === operatorIdentifier) {
3885
3847
  return false;
3886
3848
  }
3887
3849
  return true;
@@ -3935,14 +3897,6 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
3935
3897
  const [activeIndex, setActiveIndex] = React.useState(null);
3936
3898
  const [filterInputType, setInputType] = React.useState(!isAlwaysWip ? "value" : "key");
3937
3899
  const styles = ui.useStyles2(getStyles$b);
3938
- const [filterMultiValues, setFilterMultiValues] = React.useState([]);
3939
- const [_, setForceRefresh] = React.useState({});
3940
- const multiValueOperators = React.useMemo(
3941
- () => OPERATORS.reduce((acc, operator) => operator.isMulti ? [...acc, operator.value] : acc, []),
3942
- []
3943
- );
3944
- const hasMultiValueOperator = multiValueOperators.includes((filter == null ? void 0 : filter.operator) || "");
3945
- const isMultiValueEdit = hasMultiValueOperator && filterInputType === "value";
3946
3900
  const operatorIdentifier = React.useId();
3947
3901
  const listRef = React.useRef([]);
3948
3902
  const disabledIndicesRef = React.useRef([]);
@@ -3954,60 +3908,22 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
3954
3908
  setInputValue("");
3955
3909
  }
3956
3910
  }, [model, isAlwaysWip]);
3957
- const handleMultiValueUpdate = React.useCallback(
3958
- (model2, filter2, filterMultiValues2) => {
3959
- if (filterMultiValues2.length) {
3960
- const valueLabels = [];
3961
- const values = [];
3962
- filterMultiValues2.forEach((item) => {
3963
- var _a2;
3964
- valueLabels.push((_a2 = item.label) != null ? _a2 : item.value);
3965
- values.push(item.value);
3966
- });
3967
- model2._updateFilter(filter2, { valueLabels, values, value: values[0] });
3968
- setFilterMultiValues([]);
3969
- }
3970
- setTimeout(() => {
3971
- var _a2;
3972
- return (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
3973
- });
3974
- },
3975
- []
3976
- );
3977
- const handleAddMultiValue = React.useCallback((selectedItem) => {
3978
- setFilterMultiValues((items) => {
3979
- if (items.some((item) => item.value === selectedItem.value)) {
3980
- return items.filter((item) => item.value !== selectedItem.value);
3981
- }
3982
- return [...items, selectedItem];
3983
- });
3984
- }, []);
3985
- const handleRemoveMultiValue = React.useCallback(
3986
- (item) => setFilterMultiValues((selected) => selected.filter((option) => option.value !== item.value)),
3987
- []
3988
- );
3989
3911
  const onOpenChange = React.useCallback(
3990
- (nextOpen, _2, reason) => {
3912
+ (nextOpen, _, reason) => {
3991
3913
  setOpen(nextOpen);
3992
3914
  if (reason && ["outside-press", "escape-key"].includes(reason)) {
3993
- if (isMultiValueEdit) {
3994
- handleMultiValueUpdate(model, filter, filterMultiValues);
3995
- }
3996
3915
  handleResetWip();
3997
3916
  handleChangeViewMode == null ? void 0 : handleChangeViewMode();
3998
3917
  }
3999
3918
  },
4000
- [filter, filterMultiValues, handleChangeViewMode, handleMultiValueUpdate, handleResetWip, isMultiValueEdit, model]
3919
+ [handleChangeViewMode, handleResetWip]
4001
3920
  );
4002
- const outsidePressIdsToIgnore = React.useMemo(() => {
4003
- return [operatorIdentifier, ...filterMultiValues.map((item, i) => `${item.value}-${i}`)];
4004
- }, [operatorIdentifier, filterMultiValues]);
4005
3921
  const { refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps } = useFloatingInteractions({
4006
3922
  open,
4007
3923
  onOpenChange,
4008
3924
  activeIndex,
4009
3925
  setActiveIndex,
4010
- outsidePressIdsToIgnore,
3926
+ operatorIdentifier,
4011
3927
  listRef,
4012
3928
  disabledIndicesRef
4013
3929
  });
@@ -4058,41 +3974,24 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4058
3974
  const rowVirtualizer = reactVirtual.useVirtualizer({
4059
3975
  count: filteredDropDownItems.length,
4060
3976
  getScrollElement: () => refs.floating.current,
4061
- estimateSize: (index) => filteredDropDownItems[index].description ? VIRTUAL_LIST_ITEM_HEIGHT_WITH_DESCRIPTION : VIRTUAL_LIST_ITEM_HEIGHT,
3977
+ estimateSize: () => VIRTUAL_LIST_ITEM_HEIGHT,
4062
3978
  overscan: VIRTUAL_LIST_OVERSCAN
4063
3979
  });
4064
3980
  const handleBackspaceInput = React.useCallback(
4065
- (event, multiValueEdit) => {
4066
- if (event.key === "Backspace" && !inputValue) {
4067
- if (multiValueEdit) {
4068
- setFilterMultiValues((items) => {
4069
- const updated = [...items];
4070
- updated.splice(-1, 1);
4071
- return updated;
4072
- });
4073
- } else if (filterInputType === "key") {
4074
- model._removeLastFilter();
4075
- handleFetchOptions(filterInputType);
4076
- }
4077
- }
4078
- },
4079
- [inputValue, filterInputType, model, handleFetchOptions]
4080
- );
4081
- const handleTabInput = React.useCallback(
4082
- (event, multiValueEdit) => {
4083
- var _a2;
4084
- if (event.key === "Tab" && !event.shiftKey) {
4085
- if (multiValueEdit) {
4086
- event.preventDefault();
4087
- handleMultiValueUpdate(model, filter, filterMultiValues);
4088
- (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
4089
- }
4090
- handleChangeViewMode == null ? void 0 : handleChangeViewMode();
4091
- handleResetWip();
3981
+ (event) => {
3982
+ if (event.key === "Backspace" && !inputValue && filterInputType === "key") {
3983
+ model._removeLastFilter();
3984
+ handleFetchOptions(filterInputType);
4092
3985
  }
4093
3986
  },
4094
- [filter, filterMultiValues, handleChangeViewMode, handleMultiValueUpdate, handleResetWip, model, refs.domReference]
3987
+ [inputValue, filterInputType]
4095
3988
  );
3989
+ const handleTabInput = React.useCallback((event) => {
3990
+ if (event.key === "Tab" && !event.shiftKey) {
3991
+ handleChangeViewMode == null ? void 0 : handleChangeViewMode();
3992
+ handleResetWip();
3993
+ }
3994
+ }, []);
4096
3995
  const handleShiftTabInput = React.useCallback((event) => {
4097
3996
  if (event.key === "Tab" && event.shiftKey) {
4098
3997
  handleChangeViewMode == null ? void 0 : handleChangeViewMode();
@@ -4100,32 +3999,18 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4100
3999
  }
4101
4000
  }, []);
4102
4001
  const handleEnterInput = React.useCallback(
4103
- (event, multiValueEdit) => {
4002
+ (event) => {
4104
4003
  if (event.key === "Enter" && activeIndex != null) {
4105
4004
  if (!filteredDropDownItems[activeIndex]) {
4106
4005
  return;
4107
4006
  }
4108
- const selectedItem = filteredDropDownItems[activeIndex];
4109
- if (multiValueEdit) {
4110
- handleAddMultiValue(selectedItem);
4111
- } else {
4112
- model._updateFilter(filter, generateFilterUpdatePayload(filterInputType, selectedItem));
4113
- switchToNextInputType(filterInputType, setInputType, handleChangeViewMode, refs.domReference.current);
4114
- setActiveIndex(0);
4115
- }
4007
+ model._updateFilter(filter, generateFilterUpdatePayload(filterInputType, filteredDropDownItems[activeIndex]));
4116
4008
  setInputValue("");
4009
+ setActiveIndex(0);
4010
+ switchToNextInputType(filterInputType, setInputType, handleChangeViewMode, refs.domReference.current);
4117
4011
  }
4118
4012
  },
4119
- [
4120
- activeIndex,
4121
- filter,
4122
- filterInputType,
4123
- filteredDropDownItems,
4124
- handleAddMultiValue,
4125
- handleChangeViewMode,
4126
- model,
4127
- refs.domReference
4128
- ]
4013
+ [activeIndex, filter, filterInputType, filteredDropDownItems, model]
4129
4014
  );
4130
4015
  React.useEffect(() => {
4131
4016
  if (open) {
@@ -4133,34 +4018,13 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4133
4018
  }
4134
4019
  }, [open, filterInputType]);
4135
4020
  React.useEffect(() => {
4136
- var _a2, _b2;
4021
+ var _a2;
4137
4022
  if (!isAlwaysWip) {
4138
4023
  setInputType("value");
4139
4024
  setInputValue("");
4140
- if (hasMultiValueOperator && ((_a2 = filter == null ? void 0 : filter.values) == null ? void 0 : _a2.length)) {
4141
- const multiValueOptions = filter.values.reduce(
4142
- (acc, value, i) => {
4143
- var _a3;
4144
- return [
4145
- ...acc,
4146
- {
4147
- label: ((_a3 = filter.valueLabels) == null ? void 0 : _a3[i]) || value,
4148
- value
4149
- }
4150
- ];
4151
- },
4152
- []
4153
- );
4154
- setFilterMultiValues(multiValueOptions);
4155
- }
4156
- (_b2 = refs.domReference.current) == null ? void 0 : _b2.focus();
4025
+ (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
4157
4026
  }
4158
4027
  }, []);
4159
- React.useEffect(() => {
4160
- if (isMultiValueEdit && filterMultiValues) {
4161
- setTimeout(() => setForceRefresh({}));
4162
- }
4163
- }, [filterMultiValues, isMultiValueEdit]);
4164
4028
  React.useLayoutEffect(() => {
4165
4029
  var _a2, _b2;
4166
4030
  if (activeIndex !== null && rowVirtualizer.range && (activeIndex > ((_a2 = rowVirtualizer.range) == null ? void 0 : _a2.endIndex) || activeIndex < ((_b2 = rowVirtualizer.range) == null ? void 0 : _b2.startIndex))) {
@@ -4191,12 +4055,9 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4191
4055
  switchInputType("operator", setInputType, void 0, refs.domReference.current);
4192
4056
  }
4193
4057
  }
4194
- }, filter.operator) : null, isMultiValueEdit ? filterMultiValues.map((item, i) => /* @__PURE__ */ React__default["default"].createElement(MultiValuePill, {
4195
- key: `${item.value}-${i}`,
4196
- item,
4197
- index: i,
4198
- handleRemoveMultiValue
4199
- })) : null) : null, /* @__PURE__ */ React__default["default"].createElement("input", __spreadProps$n(__spreadValues$A({}, getReferenceProps({
4058
+ }, filter.operator) : null, (filter == null ? void 0 : filter.key) && (filter == null ? void 0 : filter.operator) && (filter == null ? void 0 : filter.value) && !["operator", "value"].includes(filterInputType) ? /* @__PURE__ */ React__default["default"].createElement("div", {
4059
+ className: css.cx(styles.basePill, styles.valuePill)
4060
+ }, valueLabel) : null) : null, /* @__PURE__ */ React__default["default"].createElement("input", __spreadProps$n(__spreadValues$A({}, getReferenceProps({
4200
4061
  ref: refs.setReference,
4201
4062
  onChange,
4202
4063
  value: inputValue,
@@ -4210,9 +4071,9 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4210
4071
  if (filterInputType === "operator") {
4211
4072
  handleShiftTabInput(event);
4212
4073
  }
4213
- handleBackspaceInput(event, isMultiValueEdit);
4214
- handleTabInput(event, isMultiValueEdit);
4215
- handleEnterInput(event, isMultiValueEdit);
4074
+ handleBackspaceInput(event);
4075
+ handleTabInput(event);
4076
+ handleEnterInput(event);
4216
4077
  }
4217
4078
  })), {
4218
4079
  className: css.cx(styles.inputStyle, { [styles.loadingInputPadding]: !optionsLoading }),
@@ -4232,7 +4093,7 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4232
4093
  initialFocus: -1,
4233
4094
  visuallyHiddenDismiss: true,
4234
4095
  modal: false
4235
- }, /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null, /* @__PURE__ */ React__default["default"].createElement("div", {
4096
+ }, /* @__PURE__ */ React__default["default"].createElement("div", {
4236
4097
  style: __spreadProps$n(__spreadValues$A({}, floatingStyles), {
4237
4098
  width: `${optionsError ? ERROR_STATE_DROPDOWN_WIDTH : maxOptionWidth}px`
4238
4099
  }),
@@ -4273,24 +4134,17 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4273
4134
  listRef.current[index] = node;
4274
4135
  },
4275
4136
  onClick(event) {
4276
- var _a3;
4277
4137
  if (filterInputType !== "value") {
4278
4138
  event.stopPropagation();
4279
4139
  }
4280
- if (isMultiValueEdit) {
4281
- event.stopPropagation();
4282
- handleAddMultiValue(item);
4283
- (_a3 = refs.domReference.current) == null ? void 0 : _a3.focus();
4284
- } else {
4285
- model._updateFilter(filter, generateFilterUpdatePayload(filterInputType, item));
4286
- setInputValue("");
4287
- switchToNextInputType(
4288
- filterInputType,
4289
- setInputType,
4290
- handleChangeViewMode,
4291
- refs.domReference.current
4292
- );
4293
- }
4140
+ model._updateFilter(filter, generateFilterUpdatePayload(filterInputType, item));
4141
+ setInputValue("");
4142
+ switchToNextInputType(
4143
+ filterInputType,
4144
+ setInputType,
4145
+ handleChangeViewMode,
4146
+ refs.domReference.current
4147
+ );
4294
4148
  }
4295
4149
  })), {
4296
4150
  active: activeIndex === index,
@@ -4300,56 +4154,19 @@ const AdHocCombobox = React.forwardRef(function AdHocCombobox2({ filter, model,
4300
4154
  transform: `translateY(${virtualItem.start}px)`
4301
4155
  },
4302
4156
  "aria-setsize": filteredDropDownItems.length,
4303
- "aria-posinset": virtualItem.index + 1,
4304
- isMultiValueEdit,
4305
- checked: filterMultiValues.some((val) => val.value === item.value)
4306
- }), /* @__PURE__ */ React__default["default"].createElement("span", null, item.isCustom ? "Use custom value: " : "", " ", (_a2 = item.label) != null ? _a2 : item.value), item.description ? /* @__PURE__ */ React__default["default"].createElement("div", {
4307
- className: styles.descriptionText
4308
- }, item.description) : null);
4309
- }))), isMultiValueEdit && !optionsLoading && !optionsError && filteredDropDownItems.length ? /* @__PURE__ */ React__default["default"].createElement(MultiValueApplyButton, {
4310
- onClick: () => handleMultiValueUpdate(model, filter, filterMultiValues),
4311
- floatingElement: refs.floating.current,
4312
- maxOptionWidth
4313
- }) : null))));
4157
+ "aria-posinset": virtualItem.index + 1
4158
+ }), item.isCustom ? "Use custom value: " : "", " ", (_a2 = item.label) != null ? _a2 : item.value);
4159
+ }))))));
4314
4160
  });
4315
- const MultiValuePill = ({ item, handleRemoveMultiValue, index }) => {
4316
- var _a, _b;
4317
- const styles = ui.useStyles2(getStyles$b);
4318
- return /* @__PURE__ */ React__default["default"].createElement("div", {
4319
- className: css.cx(styles.basePill, styles.valuePill)
4320
- }, /* @__PURE__ */ React__default["default"].createElement("span", null, " ", (_a = item.label) != null ? _a : item.value), /* @__PURE__ */ React__default["default"].createElement(ui.Button, {
4321
- onClick: (e) => {
4322
- e.stopPropagation();
4323
- e.preventDefault();
4324
- handleRemoveMultiValue(item);
4325
- },
4326
- onKeyDownCapture: (e) => {
4327
- if (e.key === "Enter") {
4328
- e.preventDefault();
4329
- e.stopPropagation();
4330
- handleRemoveMultiValue(item);
4331
- }
4332
- },
4333
- fill: "text",
4334
- size: "sm",
4335
- variant: "secondary",
4336
- className: styles.removeButton,
4337
- tooltip: `Remove filter value - ${(_b = item.label) != null ? _b : item.value}`
4338
- }, /* @__PURE__ */ React__default["default"].createElement(ui.Icon, {
4339
- name: "times",
4340
- size: "md",
4341
- id: `${item.value}-${index}`
4342
- })));
4343
- };
4344
4161
  const getStyles$b = (theme) => ({
4345
4162
  comboboxWrapper: css.css({
4346
4163
  display: "flex",
4347
- flexWrap: "wrap"
4164
+ flexWrap: "nowrap"
4348
4165
  }),
4349
4166
  pillWrapper: css.css({
4350
4167
  display: "flex",
4351
4168
  alignItems: "center",
4352
- flexWrap: "wrap"
4169
+ whiteSpace: "nowrap"
4353
4170
  }),
4354
4171
  basePill: css.css(__spreadProps$n(__spreadValues$A({
4355
4172
  display: "flex",
@@ -4374,8 +4191,7 @@ const getStyles$b = (theme) => ({
4374
4191
  }
4375
4192
  }),
4376
4193
  valuePill: css.css({
4377
- background: theme.colors.action.selected,
4378
- padding: theme.spacing(0.125, 0, 0.125, 1)
4194
+ background: theme.colors.action.selected
4379
4195
  }),
4380
4196
  dropdownWrapper: css.css({
4381
4197
  backgroundColor: theme.colors.background.primary,
@@ -4408,25 +4224,6 @@ const getStyles$b = (theme) => ({
4408
4224
  "&:not(:first-child)": {
4409
4225
  borderTop: `1px solid ${theme.colors.border.weak}`
4410
4226
  }
4411
- }),
4412
- removeButton: css.css({
4413
- marginInline: theme.spacing(0.5),
4414
- height: "100%",
4415
- padding: 0,
4416
- cursor: "pointer",
4417
- "&:hover": {
4418
- color: theme.colors.text.primary
4419
- }
4420
- }),
4421
- descriptionText: css.css(__spreadProps$n(__spreadValues$A({}, theme.typography.bodySmall), {
4422
- color: theme.colors.text.secondary,
4423
- paddingTop: theme.spacing(0.5)
4424
- })),
4425
- multiValueApply: css.css({
4426
- position: "absolute",
4427
- top: 0,
4428
- left: 0,
4429
- display: "flex"
4430
4227
  })
4431
4228
  });
4432
4229
 
@@ -4456,7 +4253,7 @@ function AdHocFilterPill({ filter, model, readOnly }) {
4456
4253
  const [shouldFocus, setShouldFocus] = React.useState(false);
4457
4254
  const pillWrapperRef = React.useRef(null);
4458
4255
  const keyLabel = (_a = filter.keyLabel) != null ? _a : filter.key;
4459
- const valueLabel = ((_b = filter.valueLabels) == null ? void 0 : _b.join(", ")) || ((_c = filter.values) == null ? void 0 : _c.join(", ")) || filter.value;
4256
+ const valueLabel = (_c = (_b = filter.valueLabels) == null ? void 0 : _b[0]) != null ? _c : filter.value;
4460
4257
  const handleChangeViewMode = React.useCallback(
4461
4258
  (event) => {
4462
4259
  event == null ? void 0 : event.stopPropagation();
@@ -4488,9 +4285,7 @@ function AdHocFilterPill({ filter, model, readOnly }) {
4488
4285
  "aria-label": `Edit filter with key ${keyLabel}`,
4489
4286
  tabIndex: 0,
4490
4287
  ref: pillWrapperRef
4491
- }, /* @__PURE__ */ React__default["default"].createElement("span", {
4492
- className: styles.pillText
4493
- }, keyLabel, " ", filter.operator, " ", valueLabel), !readOnly ? /* @__PURE__ */ React__default["default"].createElement(ui.IconButton, {
4288
+ }, /* @__PURE__ */ React__default["default"].createElement("span", null, keyLabel, " ", filter.operator, " ", valueLabel), !readOnly ? /* @__PURE__ */ React__default["default"].createElement(ui.IconButton, {
4494
4289
  onClick: (e) => {
4495
4290
  e.stopPropagation();
4496
4291
  model._removeFilter(filter);
@@ -4546,9 +4341,6 @@ const getStyles$a = (theme) => ({
4546
4341
  "&:hover": {
4547
4342
  color: theme.colors.text.primary
4548
4343
  }
4549
- }),
4550
- pillText: css.css({
4551
- whiteSpace: "break-spaces"
4552
4344
  })
4553
4345
  });
4554
4346
 
@@ -4814,7 +4606,7 @@ function renderExpression(builder, filters) {
4814
4606
  function AdHocFiltersVariableRenderer({ model }) {
4815
4607
  const { filters, readOnly, addFilterButtonText } = model.useState();
4816
4608
  const styles = ui.useStyles2(getStyles$8);
4817
- if (model.state.layout === "combobox") {
4609
+ if (!model.state.supportsMultiValueOperators && model.state.layout === "combobox") {
4818
4610
  return /* @__PURE__ */ React__default["default"].createElement(AdHocFiltersComboboxRenderer, {
4819
4611
  model
4820
4612
  });