@grafana/scenes 5.22.3--canary.955.11685084435.0 → 5.23.0

Sign up to get free protection for your applications and to get access to all the features.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ # v5.23.0 (Tue Nov 05 2024)
2
+
3
+ #### 🚀 Enhancement
4
+
5
+ - VizPanel: Adjust forceRender logic [#954](https://github.com/grafana/scenes/pull/954) ([@kaydelaney](https://github.com/kaydelaney))
6
+
7
+ #### Authors: 1
8
+
9
+ - kay delaney ([@kaydelaney](https://github.com/kaydelaney))
10
+
11
+ ---
12
+
1
13
  # v5.22.2 (Tue Nov 05 2024)
2
14
 
3
15
  #### 🐛 Bug Fix
@@ -198,6 +198,10 @@ class VizPanel extends SceneObjectBase {
198
198
  this._loadPlugin(this.state.pluginId);
199
199
  }
200
200
  }
201
+ forceRender() {
202
+ var _a;
203
+ this.setState({ _renderCounter: ((_a = this.state._renderCounter) != null ? _a : 0) + 1 });
204
+ }
201
205
  async _loadPlugin(pluginId, overwriteOptions, overwriteFieldConfig, isAfterPluginChange) {
202
206
  const plugin = loadPanelPluginSync(pluginId);
203
207
  if (plugin) {
@@ -1 +1 @@
1
- {"version":3,"file":"VizPanel.js","sources":["../../../../src/components/VizPanel/VizPanel.tsx"],"sourcesContent":["import {\n AbsoluteTimeRange,\n FieldConfigSource,\n PanelModel,\n PanelPlugin,\n toUtc,\n getPanelOptionsWithDefaults,\n ScopedVars,\n InterpolateFunction,\n CoreApp,\n DashboardCursorSync,\n PanelData,\n compareArrayValues,\n compareDataFrameStructures,\n applyFieldOverrides,\n PluginType,\n renderMarkdown,\n PanelPluginDataSupport,\n} from '@grafana/data';\nimport { PanelContext, SeriesVisibilityChangeMode, VizLegendOptions } from '@grafana/ui';\nimport { config, getAppEvents, getPluginImportUtils } from '@grafana/runtime';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { DeepPartial, SceneObject, SceneObjectState } from '../../core/types';\n\nimport { VizPanelRenderer } from './VizPanelRenderer';\nimport { VizPanelMenu } from './VizPanelMenu';\nimport { VariableDependencyConfig } from '../../variables/VariableDependencyConfig';\nimport { VariableCustomFormatterFn } from '../../variables/types';\nimport { seriesVisibilityConfigFactory } from './seriesVisibilityConfigFactory';\nimport { emptyPanelData } from '../../core/SceneDataNode';\nimport { changeSeriesColorConfigFactory } from './colorSeriesConfigFactory';\nimport { loadPanelPluginSync } from './registerRuntimePanelPlugin';\nimport { getCursorSyncScope } from '../../behaviors/CursorSync';\nimport { cloneDeep, isArray, isEmpty, merge, mergeWith } from 'lodash';\nimport { UserActionEvent } from '../../core/events';\nimport { evaluateTimeRange } from '../../utils/evaluateTimeRange';\nimport { LiveNowTimer } from '../../behaviors/LiveNowTimer';\n\nexport interface VizPanelState<TOptions = {}, TFieldConfig = {}> extends SceneObjectState {\n /**\n * This is usually a plugin id that references a core plugin or an external plugin. But this can also reference a\n * runtime registered PanelPlugin registered via function registerScenePanelPlugin.\n */\n pluginId: string;\n title: string;\n description?: string;\n options: DeepPartial<TOptions>;\n fieldConfig: FieldConfigSource<DeepPartial<TFieldConfig>>;\n pluginVersion?: string;\n displayMode?: 'default' | 'transparent';\n /**\n * Only shows header on hover, absolutly positioned above the panel.\n */\n hoverHeader?: boolean;\n /**\n * Offset hoverHeader position on the y axis\n */\n hoverHeaderOffset?: number;\n /**\n * Defines a menu in the top right of the panel. The menu object is only activated when the dropdown menu itself is shown.\n * So the best way to add dynamic menu actions and links is by adding them in a behavior attached to the menu.\n */\n menu?: VizPanelMenu;\n /**\n * Defines a menu that renders panel link.\n **/\n titleItems?: React.ReactNode | SceneObject | SceneObject[];\n /**\n * Add action to the top right panel header\n */\n headerActions?: React.ReactNode | SceneObject | SceneObject[];\n /**\n * Mainly for advanced use cases that need custom handling of PanelContext callbacks.\n */\n extendPanelContext?: (vizPanel: VizPanel, context: PanelContext) => void;\n /**\n * @internal\n * Only for use from core to handle migration from old angular panels\n **/\n _UNSAFE_customMigrationHandler?: (panel: PanelModel, plugin: PanelPlugin) => void;\n /** Internal */\n _pluginLoadError?: string;\n /** Internal */\n _pluginInstanceState?: any;\n _renderCounter?: number;\n}\n\nexport class VizPanel<TOptions = {}, TFieldConfig extends {} = {}> extends SceneObjectBase<\n VizPanelState<TOptions, TFieldConfig>\n> {\n public static Component = VizPanelRenderer;\n\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['title', 'options', 'fieldConfig'],\n });\n\n // Not part of state as this is not serializable\n protected _panelContext?: PanelContext;\n private _plugin?: PanelPlugin;\n private _prevData?: PanelData;\n private _dataWithFieldConfig?: PanelData;\n private _structureRev: number = 0;\n\n public constructor(state: Partial<VizPanelState<TOptions, TFieldConfig>>) {\n super({\n options: {} as TOptions,\n fieldConfig: { defaults: {}, overrides: [] },\n title: 'Title',\n pluginId: 'timeseries',\n _renderCounter: 0,\n ...state,\n });\n\n this.addActivationHandler(() => {\n this._onActivate();\n });\n\n state.menu?.addActivationHandler(() => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-menu-shown' }), true);\n });\n }\n\n private _onActivate() {\n if (!this._plugin) {\n this._loadPlugin(this.state.pluginId);\n }\n }\n\n private async _loadPlugin(pluginId: string, overwriteOptions?: DeepPartial<{}>, overwriteFieldConfig?: FieldConfigSource, isAfterPluginChange?: boolean) {\n const plugin = loadPanelPluginSync(pluginId);\n\n if (plugin) {\n this._pluginLoaded(plugin, overwriteOptions, overwriteFieldConfig, isAfterPluginChange);\n } else {\n const { importPanelPlugin } = getPluginImportUtils();\n\n try {\n const result = await importPanelPlugin(pluginId);\n this._pluginLoaded(result, overwriteOptions, overwriteFieldConfig, isAfterPluginChange);\n } catch (err: unknown) {\n this._pluginLoaded(getPanelPluginNotFound(pluginId));\n\n if (err instanceof Error) {\n this.setState({ _pluginLoadError: err.message });\n }\n }\n }\n }\n\n public getLegacyPanelId() {\n const panelId = parseInt(this.state.key!.replace('panel-', ''), 10);\n if (isNaN(panelId)) {\n return 0;\n }\n\n return panelId;\n }\n\n private async _pluginLoaded(plugin: PanelPlugin, overwriteOptions?: DeepPartial<{}>, overwriteFieldConfig?: FieldConfigSource, isAfterPluginChange?: boolean) {\n const { options, fieldConfig, title, pluginVersion, _UNSAFE_customMigrationHandler } = this.state;\n\n const panel: PanelModel = {\n title,\n options,\n fieldConfig,\n id: this.getLegacyPanelId(),\n type: plugin.meta.id,\n pluginVersion: pluginVersion,\n };\n\n if (overwriteOptions) {\n panel.options = overwriteOptions;\n }\n\n if (overwriteFieldConfig) {\n panel.fieldConfig = overwriteFieldConfig;\n }\n\n const currentVersion = this._getPluginVersion(plugin);\n\n _UNSAFE_customMigrationHandler?.(panel, plugin);\n\n if (plugin.onPanelMigration && currentVersion !== pluginVersion && !isAfterPluginChange) {\n // These migration handlers also mutate panel.fieldConfig to migrate fieldConfig\n panel.options = await plugin.onPanelMigration(panel);\n }\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin,\n currentOptions: panel.options,\n currentFieldConfig: panel.fieldConfig,\n isAfterPluginChange: isAfterPluginChange ?? false,\n });\n\n this._plugin = plugin;\n\n this.setState({\n options: withDefaults.options as DeepPartial<TOptions>,\n fieldConfig: withDefaults.fieldConfig,\n pluginVersion: currentVersion,\n pluginId: plugin.meta.id,\n });\n\n // Non data panels needs to be re-rendered when time range change\n if (plugin.meta.skipDataQuery) {\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n this._subs.add(sceneTimeRange.subscribeToState(() => this.forceRender()));\n }\n }\n\n private _getPluginVersion(plugin: PanelPlugin): string {\n return plugin && plugin.meta.info.version ? plugin.meta.info.version : config.buildInfo.version;\n }\n\n public getPlugin(): PanelPlugin | undefined {\n return this._plugin;\n }\n\n public getPanelContext(): PanelContext {\n this._panelContext ??= this.buildPanelContext();\n\n return this._panelContext!;\n }\n\n public onTimeRangeChange = (timeRange: AbsoluteTimeRange) => {\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n sceneTimeRange.onTimeRangeChange({\n raw: {\n from: toUtc(timeRange.from),\n to: toUtc(timeRange.to),\n },\n from: toUtc(timeRange.from),\n to: toUtc(timeRange.to),\n });\n };\n\n public getTimeRange = (data?: PanelData) => {\n const liveNowTimer = sceneGraph.findObject(this, (o) => o instanceof LiveNowTimer);\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n if (liveNowTimer instanceof LiveNowTimer && liveNowTimer.isEnabled) {\n return evaluateTimeRange(\n sceneTimeRange.state.from,\n sceneTimeRange.state.to,\n sceneTimeRange.getTimeZone(),\n sceneTimeRange.state.fiscalYearStartMonth,\n sceneTimeRange.state.UNSAFE_nowDelay\n );\n }\n\n const plugin = this.getPlugin();\n if (plugin && !plugin.meta.skipDataQuery && data && data.timeRange) {\n return data.timeRange;\n }\n\n return sceneTimeRange.state.value;\n };\n\n public async changePluginType(pluginId: string, newOptions?: DeepPartial<{}>, newFieldConfig?: FieldConfigSource) {\n const {\n options: prevOptions,\n fieldConfig: prevFieldConfig,\n pluginId: prevPluginId,\n } = this.state;\n\n //clear field config cache to update it later\n this._dataWithFieldConfig = undefined;\n\n // If state.pluginId is already the correct plugin we don't treat this as plain user panel type change\n const isAfterPluginChange = this.state.pluginId !== pluginId; \n await this._loadPlugin(pluginId, newOptions ?? {}, newFieldConfig, isAfterPluginChange);\n\n const panel: PanelModel = {\n title: this.state.title,\n options: this.state.options,\n fieldConfig: this.state.fieldConfig,\n id: 1,\n type: pluginId,\n };\n\n // onPanelTypeChanged is mainly used by plugins to migrate from Angular to React. \n // For example, this will migrate options from 'graph' to 'timeseries' if the previous and new plugin ID matches. \n const updatedOptions = this._plugin?.onPanelTypeChanged?.(panel, prevPluginId, prevOptions, prevFieldConfig);\n\n if (updatedOptions && !isEmpty(updatedOptions)) {\n this.onOptionsChange(updatedOptions, true, true);\n }\n }\n\n public onTitleChange = (title: string) => {\n this.setState({ title });\n };\n\n public onDescriptionChange = (description: string) => {\n this.setState({ description });\n };\n\n public onDisplayModeChange = (displayMode: 'default' | 'transparent') => {\n this.setState({ displayMode });\n };\n\n public onOptionsChange = (optionsUpdate: DeepPartial<TOptions>, replace = false, isAfterPluginChange = false) => {\n const { fieldConfig, options } = this.state;\n\n // When replace is true, we want to replace the entire options object. Default will be applied.\n const nextOptions = replace\n ? optionsUpdate\n : mergeWith(cloneDeep(options), optionsUpdate, (objValue, srcValue, key, obj) => {\n if (isArray(srcValue)) {\n return srcValue;\n }\n // If customizer returns undefined, merging is handled by the method instead\n // so we need to override the value in the object instead\n if (objValue !== srcValue && typeof srcValue === 'undefined') {\n obj[key] = srcValue;\n return;\n }\n return;\n });\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin: this._plugin!,\n currentOptions: nextOptions,\n currentFieldConfig: fieldConfig,\n isAfterPluginChange: isAfterPluginChange,\n });\n\n this.setState({\n options: withDefaults.options as DeepPartial<TOptions>,\n _renderCounter: (this.state._renderCounter ?? 0) + 1,\n });\n };\n\n public onFieldConfigChange = (fieldConfigUpdate: FieldConfigSource<DeepPartial<TFieldConfig>>, replace?: boolean) => {\n const { fieldConfig, options } = this.state;\n\n // When replace is true, we want to replace the entire field config. Default will be applied.\n const nextFieldConfig = replace ? fieldConfigUpdate : merge(cloneDeep(fieldConfig), fieldConfigUpdate);\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin: this._plugin!,\n currentOptions: options,\n currentFieldConfig: nextFieldConfig,\n isAfterPluginChange: false,\n });\n\n this._dataWithFieldConfig = undefined;\n this.setState({ fieldConfig: withDefaults.fieldConfig });\n };\n\n public interpolate = ((value: string, scoped?: ScopedVars, format?: string | VariableCustomFormatterFn) => {\n return sceneGraph.interpolate(this, value, scoped, format);\n }) as InterpolateFunction;\n\n public getDescription = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-description-shown' }), true);\n\n const { description } = this.state;\n if (description) {\n const markdown = this.interpolate(description);\n return renderMarkdown(markdown);\n }\n return '';\n };\n\n public clearFieldConfigCache() {\n this._dataWithFieldConfig = undefined;\n }\n\n /**\n * Called from the react render path to apply the field config to the data provided by the data provider\n */\n public applyFieldConfig(rawData?: PanelData): PanelData {\n const plugin = this._plugin;\n\n if (!plugin || plugin.meta.skipDataQuery || !rawData) {\n // TODO setup time range subscription instead\n return emptyPanelData;\n }\n\n // If the data is the same as last time, we can skip the field config apply step and just return same result as last time\n if (this._prevData === rawData && this._dataWithFieldConfig) {\n return this._dataWithFieldConfig;\n }\n\n const pluginDataSupport: PanelPluginDataSupport = plugin.dataSupport || { alertStates: false, annotations: false };\n\n const fieldConfigRegistry = plugin.fieldConfigRegistry;\n const prevFrames = this._dataWithFieldConfig?.series ?? [];\n const newFrames = applyFieldOverrides({\n data: rawData.series,\n fieldConfig: this.state.fieldConfig,\n fieldConfigRegistry,\n replaceVariables: this.interpolate,\n theme: config.theme2,\n timeZone: rawData.request?.timezone,\n });\n\n if (!compareArrayValues(newFrames, prevFrames, compareDataFrameStructures)) {\n this._structureRev++;\n }\n\n this._dataWithFieldConfig = {\n ...rawData,\n structureRev: this._structureRev,\n series: newFrames,\n };\n\n if (this._dataWithFieldConfig.annotations) {\n this._dataWithFieldConfig.annotations = applyFieldOverrides({\n data: this._dataWithFieldConfig.annotations,\n fieldConfig: {\n defaults: {},\n overrides: [],\n },\n fieldConfigRegistry,\n replaceVariables: this.interpolate,\n theme: config.theme2,\n timeZone: rawData.request?.timezone,\n });\n }\n\n if (!pluginDataSupport.alertStates) {\n this._dataWithFieldConfig.alertState = undefined;\n }\n\n if (!pluginDataSupport.annotations) {\n this._dataWithFieldConfig.annotations = undefined;\n }\n\n this._prevData = rawData;\n return this._dataWithFieldConfig;\n }\n\n public onCancelQuery = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-cancel-query-clicked' }), true);\n const data = sceneGraph.getData(this);\n data.cancelQuery?.();\n };\n\n public onStatusMessageClick = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-status-message-clicked' }), true);\n };\n\n /**\n * Panel context functions\n */\n private _onSeriesColorChange = (label: string, color: string) => {\n this.onFieldConfigChange(changeSeriesColorConfigFactory(label, color, this.state.fieldConfig));\n };\n\n private _onSeriesVisibilityChange = (label: string, mode: SeriesVisibilityChangeMode) => {\n if (!this._dataWithFieldConfig) {\n return;\n }\n\n this.onFieldConfigChange(\n seriesVisibilityConfigFactory(label, mode, this.state.fieldConfig, this._dataWithFieldConfig.series),\n true\n );\n };\n\n private _onInstanceStateChange = (state: any) => {\n if (this._panelContext) {\n this._panelContext = {\n ...this._panelContext,\n instanceState: state,\n };\n }\n\n this.setState({ _pluginInstanceState: state });\n };\n\n private _onToggleLegendSort = (sortKey: string) => {\n const legendOptions: VizLegendOptions = (this.state.options as any).legend;\n\n // We don't want to do anything when legend options are not available\n if (!legendOptions) {\n return;\n }\n\n let sortDesc = legendOptions.sortDesc;\n let sortBy = legendOptions.sortBy;\n if (sortKey !== sortBy) {\n sortDesc = undefined;\n }\n\n // if already sort ascending, disable sorting\n if (sortDesc === false) {\n sortBy = undefined;\n sortDesc = undefined;\n } else {\n sortDesc = !sortDesc;\n sortBy = sortKey;\n }\n\n this.onOptionsChange(\n {\n ...this.state.options,\n legend: { ...legendOptions, sortBy, sortDesc },\n } as TOptions,\n true\n );\n };\n\n private buildPanelContext(): PanelContext {\n const sync = getCursorSyncScope(this);\n\n const context = {\n eventsScope: sync ? sync.getEventsScope() : '__global_',\n eventBus: sync ? sync.getEventsBus(this) : getAppEvents(),\n app: CoreApp.Unknown,\n sync: () => {\n if (sync) {\n return sync.state.sync;\n }\n return DashboardCursorSync.Off;\n },\n onSeriesColorChange: this._onSeriesColorChange,\n onToggleSeriesVisibility: this._onSeriesVisibilityChange,\n onToggleLegendSort: this._onToggleLegendSort,\n onInstanceStateChange: this._onInstanceStateChange,\n };\n\n if (this.state.extendPanelContext) {\n this.state.extendPanelContext(this, context);\n }\n\n return context;\n }\n}\n\nfunction getPanelPluginNotFound(id: string): PanelPlugin {\n const plugin = new PanelPlugin(() => null);\n\n plugin.meta = {\n id: id,\n name: id,\n sort: 100,\n type: PluginType.panel,\n module: '',\n baseUrl: '',\n info: {\n author: {\n name: '',\n },\n description: '',\n links: [],\n logos: {\n large: '',\n small: 'public/img/grafana_icon.svg',\n },\n screenshots: [],\n updated: '',\n version: '',\n },\n };\n\n return plugin;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFO,MAAM,iBAA8D,eAEzE,CAAA;AAAA,EAcO,YAAY,KAAuD,EAAA;AAxG5E,IAAA,IAAA,EAAA,CAAA;AAyGI,IAAM,KAAA,CAAA,cAAA,CAAA;AAAA,MACJ,SAAS,EAAC;AAAA,MACV,aAAa,EAAE,QAAA,EAAU,EAAI,EAAA,SAAA,EAAW,EAAG,EAAA;AAAA,MAC3C,KAAO,EAAA,OAAA;AAAA,MACP,QAAU,EAAA,YAAA;AAAA,MACV,cAAgB,EAAA,CAAA;AAAA,KAAA,EACb,KACJ,CAAA,CAAA,CAAA;AAnBH,IAAU,IAAA,CAAA,mBAAA,GAAsB,IAAI,wBAAA,CAAyB,IAAM,EAAA;AAAA,MACjE,UAAY,EAAA,CAAC,OAAS,EAAA,SAAA,EAAW,aAAa,CAAA;AAAA,KAC/C,CAAA,CAAA;AAOD,IAAA,IAAA,CAAQ,aAAwB,GAAA,CAAA,CAAA;AA2HhC,IAAO,IAAA,CAAA,iBAAA,GAAoB,CAAC,SAAiC,KAAA;AAC3D,MAAM,MAAA,cAAA,GAAiB,UAAW,CAAA,YAAA,CAAa,IAAI,CAAA,CAAA;AACnD,MAAA,cAAA,CAAe,iBAAkB,CAAA;AAAA,QAC/B,GAAK,EAAA;AAAA,UACH,IAAA,EAAM,KAAM,CAAA,SAAA,CAAU,IAAI,CAAA;AAAA,UAC1B,EAAA,EAAI,KAAM,CAAA,SAAA,CAAU,EAAE,CAAA;AAAA,SACxB;AAAA,QACA,IAAA,EAAM,KAAM,CAAA,SAAA,CAAU,IAAI,CAAA;AAAA,QAC1B,EAAA,EAAI,KAAM,CAAA,SAAA,CAAU,EAAE,CAAA;AAAA,OACv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,OACT;AAAA,MACA,aAAa,EAAC;AAAA,MACd,OAAS,EAAA,EAAA;AAAA,MACT,OAAS,EAAA,EAAA;AAAA,KACX;AAAA,GACF,CAAA;AAEA,EAAO,OAAA,MAAA,CAAA;AACT;;;;"}
1
+ {"version":3,"file":"VizPanel.js","sources":["../../../../src/components/VizPanel/VizPanel.tsx"],"sourcesContent":["import {\n AbsoluteTimeRange,\n FieldConfigSource,\n PanelModel,\n PanelPlugin,\n toUtc,\n getPanelOptionsWithDefaults,\n ScopedVars,\n InterpolateFunction,\n CoreApp,\n DashboardCursorSync,\n PanelData,\n compareArrayValues,\n compareDataFrameStructures,\n applyFieldOverrides,\n PluginType,\n renderMarkdown,\n PanelPluginDataSupport,\n} from '@grafana/data';\nimport { PanelContext, SeriesVisibilityChangeMode, VizLegendOptions } from '@grafana/ui';\nimport { config, getAppEvents, getPluginImportUtils } from '@grafana/runtime';\nimport { SceneObjectBase } from '../../core/SceneObjectBase';\nimport { sceneGraph } from '../../core/sceneGraph';\nimport { DeepPartial, SceneObject, SceneObjectState } from '../../core/types';\n\nimport { VizPanelRenderer } from './VizPanelRenderer';\nimport { VizPanelMenu } from './VizPanelMenu';\nimport { VariableDependencyConfig } from '../../variables/VariableDependencyConfig';\nimport { VariableCustomFormatterFn } from '../../variables/types';\nimport { seriesVisibilityConfigFactory } from './seriesVisibilityConfigFactory';\nimport { emptyPanelData } from '../../core/SceneDataNode';\nimport { changeSeriesColorConfigFactory } from './colorSeriesConfigFactory';\nimport { loadPanelPluginSync } from './registerRuntimePanelPlugin';\nimport { getCursorSyncScope } from '../../behaviors/CursorSync';\nimport { cloneDeep, isArray, isEmpty, merge, mergeWith } from 'lodash';\nimport { UserActionEvent } from '../../core/events';\nimport { evaluateTimeRange } from '../../utils/evaluateTimeRange';\nimport { LiveNowTimer } from '../../behaviors/LiveNowTimer';\n\nexport interface VizPanelState<TOptions = {}, TFieldConfig = {}> extends SceneObjectState {\n /**\n * This is usually a plugin id that references a core plugin or an external plugin. But this can also reference a\n * runtime registered PanelPlugin registered via function registerScenePanelPlugin.\n */\n pluginId: string;\n title: string;\n description?: string;\n options: DeepPartial<TOptions>;\n fieldConfig: FieldConfigSource<DeepPartial<TFieldConfig>>;\n pluginVersion?: string;\n displayMode?: 'default' | 'transparent';\n /**\n * Only shows header on hover, absolutly positioned above the panel.\n */\n hoverHeader?: boolean;\n /**\n * Offset hoverHeader position on the y axis\n */\n hoverHeaderOffset?: number;\n /**\n * Defines a menu in the top right of the panel. The menu object is only activated when the dropdown menu itself is shown.\n * So the best way to add dynamic menu actions and links is by adding them in a behavior attached to the menu.\n */\n menu?: VizPanelMenu;\n /**\n * Defines a menu that renders panel link.\n **/\n titleItems?: React.ReactNode | SceneObject | SceneObject[];\n /**\n * Add action to the top right panel header\n */\n headerActions?: React.ReactNode | SceneObject | SceneObject[];\n /**\n * Mainly for advanced use cases that need custom handling of PanelContext callbacks.\n */\n extendPanelContext?: (vizPanel: VizPanel, context: PanelContext) => void;\n /**\n * @internal\n * Only for use from core to handle migration from old angular panels\n **/\n _UNSAFE_customMigrationHandler?: (panel: PanelModel, plugin: PanelPlugin) => void;\n /** Internal */\n _pluginLoadError?: string;\n /** Internal */\n _pluginInstanceState?: any;\n _renderCounter?: number;\n}\n\nexport class VizPanel<TOptions = {}, TFieldConfig extends {} = {}> extends SceneObjectBase<\n VizPanelState<TOptions, TFieldConfig>\n> {\n public static Component = VizPanelRenderer;\n\n protected _variableDependency = new VariableDependencyConfig(this, {\n statePaths: ['title', 'options', 'fieldConfig'],\n });\n\n // Not part of state as this is not serializable\n protected _panelContext?: PanelContext;\n private _plugin?: PanelPlugin;\n private _prevData?: PanelData;\n private _dataWithFieldConfig?: PanelData;\n private _structureRev: number = 0;\n\n public constructor(state: Partial<VizPanelState<TOptions, TFieldConfig>>) {\n super({\n options: {} as TOptions,\n fieldConfig: { defaults: {}, overrides: [] },\n title: 'Title',\n pluginId: 'timeseries',\n _renderCounter: 0,\n ...state,\n });\n\n this.addActivationHandler(() => {\n this._onActivate();\n });\n\n state.menu?.addActivationHandler(() => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-menu-shown' }), true);\n });\n }\n\n private _onActivate() {\n if (!this._plugin) {\n this._loadPlugin(this.state.pluginId);\n }\n }\n\n public forceRender(): void {\n // Incrementing the render counter means VizRepeater and its children will also re-render\n this.setState({ _renderCounter: (this.state._renderCounter ?? 0) + 1});\n }\n\n private async _loadPlugin(pluginId: string, overwriteOptions?: DeepPartial<{}>, overwriteFieldConfig?: FieldConfigSource, isAfterPluginChange?: boolean) {\n const plugin = loadPanelPluginSync(pluginId);\n\n if (plugin) {\n this._pluginLoaded(plugin, overwriteOptions, overwriteFieldConfig, isAfterPluginChange);\n } else {\n const { importPanelPlugin } = getPluginImportUtils();\n\n try {\n const result = await importPanelPlugin(pluginId);\n this._pluginLoaded(result, overwriteOptions, overwriteFieldConfig, isAfterPluginChange);\n } catch (err: unknown) {\n this._pluginLoaded(getPanelPluginNotFound(pluginId));\n\n if (err instanceof Error) {\n this.setState({ _pluginLoadError: err.message });\n }\n }\n }\n }\n\n public getLegacyPanelId() {\n const panelId = parseInt(this.state.key!.replace('panel-', ''), 10);\n if (isNaN(panelId)) {\n return 0;\n }\n\n return panelId;\n }\n\n private async _pluginLoaded(plugin: PanelPlugin, overwriteOptions?: DeepPartial<{}>, overwriteFieldConfig?: FieldConfigSource, isAfterPluginChange?: boolean) {\n const { options, fieldConfig, title, pluginVersion, _UNSAFE_customMigrationHandler } = this.state;\n\n const panel: PanelModel = {\n title,\n options,\n fieldConfig,\n id: this.getLegacyPanelId(),\n type: plugin.meta.id,\n pluginVersion: pluginVersion,\n };\n\n if (overwriteOptions) {\n panel.options = overwriteOptions;\n }\n\n if (overwriteFieldConfig) {\n panel.fieldConfig = overwriteFieldConfig;\n }\n\n const currentVersion = this._getPluginVersion(plugin);\n\n _UNSAFE_customMigrationHandler?.(panel, plugin);\n\n if (plugin.onPanelMigration && currentVersion !== pluginVersion && !isAfterPluginChange) {\n // These migration handlers also mutate panel.fieldConfig to migrate fieldConfig\n panel.options = await plugin.onPanelMigration(panel);\n }\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin,\n currentOptions: panel.options,\n currentFieldConfig: panel.fieldConfig,\n isAfterPluginChange: isAfterPluginChange ?? false,\n });\n\n this._plugin = plugin;\n\n this.setState({\n options: withDefaults.options as DeepPartial<TOptions>,\n fieldConfig: withDefaults.fieldConfig,\n pluginVersion: currentVersion,\n pluginId: plugin.meta.id,\n });\n\n // Non data panels needs to be re-rendered when time range change\n if (plugin.meta.skipDataQuery) {\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n this._subs.add(sceneTimeRange.subscribeToState(() => this.forceRender()));\n }\n }\n\n private _getPluginVersion(plugin: PanelPlugin): string {\n return plugin && plugin.meta.info.version ? plugin.meta.info.version : config.buildInfo.version;\n }\n\n public getPlugin(): PanelPlugin | undefined {\n return this._plugin;\n }\n\n public getPanelContext(): PanelContext {\n this._panelContext ??= this.buildPanelContext();\n\n return this._panelContext!;\n }\n\n public onTimeRangeChange = (timeRange: AbsoluteTimeRange) => {\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n sceneTimeRange.onTimeRangeChange({\n raw: {\n from: toUtc(timeRange.from),\n to: toUtc(timeRange.to),\n },\n from: toUtc(timeRange.from),\n to: toUtc(timeRange.to),\n });\n };\n\n public getTimeRange = (data?: PanelData) => {\n const liveNowTimer = sceneGraph.findObject(this, (o) => o instanceof LiveNowTimer);\n const sceneTimeRange = sceneGraph.getTimeRange(this);\n if (liveNowTimer instanceof LiveNowTimer && liveNowTimer.isEnabled) {\n return evaluateTimeRange(\n sceneTimeRange.state.from,\n sceneTimeRange.state.to,\n sceneTimeRange.getTimeZone(),\n sceneTimeRange.state.fiscalYearStartMonth,\n sceneTimeRange.state.UNSAFE_nowDelay\n );\n }\n\n const plugin = this.getPlugin();\n if (plugin && !plugin.meta.skipDataQuery && data && data.timeRange) {\n return data.timeRange;\n }\n\n return sceneTimeRange.state.value;\n };\n\n public async changePluginType(pluginId: string, newOptions?: DeepPartial<{}>, newFieldConfig?: FieldConfigSource) {\n const {\n options: prevOptions,\n fieldConfig: prevFieldConfig,\n pluginId: prevPluginId,\n } = this.state;\n\n //clear field config cache to update it later\n this._dataWithFieldConfig = undefined;\n\n // If state.pluginId is already the correct plugin we don't treat this as plain user panel type change\n const isAfterPluginChange = this.state.pluginId !== pluginId; \n await this._loadPlugin(pluginId, newOptions ?? {}, newFieldConfig, isAfterPluginChange);\n\n const panel: PanelModel = {\n title: this.state.title,\n options: this.state.options,\n fieldConfig: this.state.fieldConfig,\n id: 1,\n type: pluginId,\n };\n\n // onPanelTypeChanged is mainly used by plugins to migrate from Angular to React. \n // For example, this will migrate options from 'graph' to 'timeseries' if the previous and new plugin ID matches. \n const updatedOptions = this._plugin?.onPanelTypeChanged?.(panel, prevPluginId, prevOptions, prevFieldConfig);\n\n if (updatedOptions && !isEmpty(updatedOptions)) {\n this.onOptionsChange(updatedOptions, true, true);\n }\n }\n\n public onTitleChange = (title: string) => {\n this.setState({ title });\n };\n\n public onDescriptionChange = (description: string) => {\n this.setState({ description });\n };\n\n public onDisplayModeChange = (displayMode: 'default' | 'transparent') => {\n this.setState({ displayMode });\n };\n\n public onOptionsChange = (optionsUpdate: DeepPartial<TOptions>, replace = false, isAfterPluginChange = false) => {\n const { fieldConfig, options } = this.state;\n\n // When replace is true, we want to replace the entire options object. Default will be applied.\n const nextOptions = replace\n ? optionsUpdate\n : mergeWith(cloneDeep(options), optionsUpdate, (objValue, srcValue, key, obj) => {\n if (isArray(srcValue)) {\n return srcValue;\n }\n // If customizer returns undefined, merging is handled by the method instead\n // so we need to override the value in the object instead\n if (objValue !== srcValue && typeof srcValue === 'undefined') {\n obj[key] = srcValue;\n return;\n }\n return;\n });\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin: this._plugin!,\n currentOptions: nextOptions,\n currentFieldConfig: fieldConfig,\n isAfterPluginChange: isAfterPluginChange,\n });\n\n this.setState({\n options: withDefaults.options as DeepPartial<TOptions>,\n _renderCounter: (this.state._renderCounter ?? 0) + 1,\n });\n };\n\n public onFieldConfigChange = (fieldConfigUpdate: FieldConfigSource<DeepPartial<TFieldConfig>>, replace?: boolean) => {\n const { fieldConfig, options } = this.state;\n\n // When replace is true, we want to replace the entire field config. Default will be applied.\n const nextFieldConfig = replace ? fieldConfigUpdate : merge(cloneDeep(fieldConfig), fieldConfigUpdate);\n\n const withDefaults = getPanelOptionsWithDefaults({\n plugin: this._plugin!,\n currentOptions: options,\n currentFieldConfig: nextFieldConfig,\n isAfterPluginChange: false,\n });\n\n this._dataWithFieldConfig = undefined;\n this.setState({ fieldConfig: withDefaults.fieldConfig });\n };\n\n public interpolate = ((value: string, scoped?: ScopedVars, format?: string | VariableCustomFormatterFn) => {\n return sceneGraph.interpolate(this, value, scoped, format);\n }) as InterpolateFunction;\n\n public getDescription = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-description-shown' }), true);\n\n const { description } = this.state;\n if (description) {\n const markdown = this.interpolate(description);\n return renderMarkdown(markdown);\n }\n return '';\n };\n\n public clearFieldConfigCache() {\n this._dataWithFieldConfig = undefined;\n }\n\n /**\n * Called from the react render path to apply the field config to the data provided by the data provider\n */\n public applyFieldConfig(rawData?: PanelData): PanelData {\n const plugin = this._plugin;\n\n if (!plugin || plugin.meta.skipDataQuery || !rawData) {\n // TODO setup time range subscription instead\n return emptyPanelData;\n }\n\n // If the data is the same as last time, we can skip the field config apply step and just return same result as last time\n if (this._prevData === rawData && this._dataWithFieldConfig) {\n return this._dataWithFieldConfig;\n }\n\n const pluginDataSupport: PanelPluginDataSupport = plugin.dataSupport || { alertStates: false, annotations: false };\n\n const fieldConfigRegistry = plugin.fieldConfigRegistry;\n const prevFrames = this._dataWithFieldConfig?.series ?? [];\n const newFrames = applyFieldOverrides({\n data: rawData.series,\n fieldConfig: this.state.fieldConfig,\n fieldConfigRegistry,\n replaceVariables: this.interpolate,\n theme: config.theme2,\n timeZone: rawData.request?.timezone,\n });\n\n if (!compareArrayValues(newFrames, prevFrames, compareDataFrameStructures)) {\n this._structureRev++;\n }\n\n this._dataWithFieldConfig = {\n ...rawData,\n structureRev: this._structureRev,\n series: newFrames,\n };\n\n if (this._dataWithFieldConfig.annotations) {\n this._dataWithFieldConfig.annotations = applyFieldOverrides({\n data: this._dataWithFieldConfig.annotations,\n fieldConfig: {\n defaults: {},\n overrides: [],\n },\n fieldConfigRegistry,\n replaceVariables: this.interpolate,\n theme: config.theme2,\n timeZone: rawData.request?.timezone,\n });\n }\n\n if (!pluginDataSupport.alertStates) {\n this._dataWithFieldConfig.alertState = undefined;\n }\n\n if (!pluginDataSupport.annotations) {\n this._dataWithFieldConfig.annotations = undefined;\n }\n\n this._prevData = rawData;\n return this._dataWithFieldConfig;\n }\n\n public onCancelQuery = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-cancel-query-clicked' }), true);\n const data = sceneGraph.getData(this);\n data.cancelQuery?.();\n };\n\n public onStatusMessageClick = () => {\n this.publishEvent(new UserActionEvent({ origin: this, interaction: 'panel-status-message-clicked' }), true);\n };\n\n /**\n * Panel context functions\n */\n private _onSeriesColorChange = (label: string, color: string) => {\n this.onFieldConfigChange(changeSeriesColorConfigFactory(label, color, this.state.fieldConfig));\n };\n\n private _onSeriesVisibilityChange = (label: string, mode: SeriesVisibilityChangeMode) => {\n if (!this._dataWithFieldConfig) {\n return;\n }\n\n this.onFieldConfigChange(\n seriesVisibilityConfigFactory(label, mode, this.state.fieldConfig, this._dataWithFieldConfig.series),\n true\n );\n };\n\n private _onInstanceStateChange = (state: any) => {\n if (this._panelContext) {\n this._panelContext = {\n ...this._panelContext,\n instanceState: state,\n };\n }\n\n this.setState({ _pluginInstanceState: state });\n };\n\n private _onToggleLegendSort = (sortKey: string) => {\n const legendOptions: VizLegendOptions = (this.state.options as any).legend;\n\n // We don't want to do anything when legend options are not available\n if (!legendOptions) {\n return;\n }\n\n let sortDesc = legendOptions.sortDesc;\n let sortBy = legendOptions.sortBy;\n if (sortKey !== sortBy) {\n sortDesc = undefined;\n }\n\n // if already sort ascending, disable sorting\n if (sortDesc === false) {\n sortBy = undefined;\n sortDesc = undefined;\n } else {\n sortDesc = !sortDesc;\n sortBy = sortKey;\n }\n\n this.onOptionsChange(\n {\n ...this.state.options,\n legend: { ...legendOptions, sortBy, sortDesc },\n } as TOptions,\n true\n );\n };\n\n private buildPanelContext(): PanelContext {\n const sync = getCursorSyncScope(this);\n\n const context = {\n eventsScope: sync ? sync.getEventsScope() : '__global_',\n eventBus: sync ? sync.getEventsBus(this) : getAppEvents(),\n app: CoreApp.Unknown,\n sync: () => {\n if (sync) {\n return sync.state.sync;\n }\n return DashboardCursorSync.Off;\n },\n onSeriesColorChange: this._onSeriesColorChange,\n onToggleSeriesVisibility: this._onSeriesVisibilityChange,\n onToggleLegendSort: this._onToggleLegendSort,\n onInstanceStateChange: this._onInstanceStateChange,\n };\n\n if (this.state.extendPanelContext) {\n this.state.extendPanelContext(this, context);\n }\n\n return context;\n }\n}\n\nfunction getPanelPluginNotFound(id: string): PanelPlugin {\n const plugin = new PanelPlugin(() => null);\n\n plugin.meta = {\n id: id,\n name: id,\n sort: 100,\n type: PluginType.panel,\n module: '',\n baseUrl: '',\n info: {\n author: {\n name: '',\n },\n description: '',\n links: [],\n logos: {\n large: '',\n small: 'public/img/grafana_icon.svg',\n },\n screenshots: [],\n updated: '',\n version: '',\n },\n };\n\n return plugin;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFO,MAAM,iBAA8D,eAEzE,CAAA;AAAA,EAcO,YAAY,KAAuD,EAAA;AAxG5E,IAAA,IAAA,EAAA,CAAA;AAyGI,IAAM,KAAA,CAAA,cAAA,CAAA;AAAA,MACJ,SAAS,EAAC;AAAA,MACV,aAAa,EAAE,QAAA,EAAU,EAAI,EAAA,SAAA,EAAW,EAAG,EAAA;AAAA,MAC3C,KAAO,E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Id, useMemo, useCallback, useImperativeHandle, useEffect, useLayoutEffect } from 'react';
2
2
  import { FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
3
- import { useStyles2, Spinner, Text } from '@grafana/ui';
3
+ import { useStyles2, Spinner, Text, Button, Icon } from '@grafana/ui';
4
4
  import { cx, css } from '@emotion/css';
5
5
  import { isMultiValueOperator } from '../AdHocFiltersVariable.js';
6
6
  import { useVirtualizer } from '@tanstack/react-virtual';
@@ -8,7 +8,6 @@ import { LoadingOptionsPlaceholder, OptionsErrorPlaceholder, NoOptionsPlaceholde
8
8
  import { fuzzySearchOptions, flattenOptionGroups, setupDropdownAccessibility, VIRTUAL_LIST_ITEM_HEIGHT_WITH_DESCRIPTION, VIRTUAL_LIST_ITEM_HEIGHT, VIRTUAL_LIST_OVERSCAN, generateFilterUpdatePayload, switchToNextInputType, switchInputType, generatePlaceholder, ERROR_STATE_DROPDOWN_WIDTH } from './utils.js';
9
9
  import { handleOptionGroups } from '../../utils.js';
10
10
  import { useFloatingInteractions, MAX_MENU_HEIGHT } from './useFloatingInteractions.js';
11
- import { MultiValuePill } from './MultiValuePill.js';
12
11
 
13
12
  var __defProp = Object.defineProperty;
14
13
  var __defProps = Object.defineProperties;
@@ -35,7 +34,7 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
35
34
  const [options, setOptions] = useState([]);
36
35
  const [optionsLoading, setOptionsLoading] = useState(false);
37
36
  const [optionsError, setOptionsError] = useState(false);
38
- const [inputValue, setInputValue] = useState(!isAlwaysWip ? (filter == null ? void 0 : filter.value) || "" : "");
37
+ const [inputValue, setInputValue] = useState("");
39
38
  const [activeIndex, setActiveIndex] = useState(null);
40
39
  const [filterInputType, setInputType] = useState(!isAlwaysWip ? "value" : "key");
41
40
  const styles = useStyles2(getStyles);
@@ -116,13 +115,7 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
116
115
  ]
117
116
  );
118
117
  const outsidePressIdsToIgnore = useMemo(() => {
119
- return [
120
- operatorIdentifier,
121
- ...filterMultiValues.reduce(
122
- (acc, item, i) => [...acc, `${item.value}-${i}`, `${item.value}-${i}-close-icon`],
123
- []
124
- )
125
- ];
118
+ return [operatorIdentifier, ...filterMultiValues.map((item, i) => `${item.value}-${i}`)];
126
119
  }, [operatorIdentifier, filterMultiValues]);
127
120
  const { refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps } = useFloatingInteractions({
128
121
  open,
@@ -313,16 +306,6 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
313
306
  focusOnWipInputRef
314
307
  ]
315
308
  );
316
- const handleEditMultiValuePill = useCallback(
317
- (value) => {
318
- var _a2;
319
- const valueLabel = value.label || value.value;
320
- setFilterMultiValues((prev) => prev.filter((item) => item.value !== value.value));
321
- setInputValue(valueLabel);
322
- (_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
323
- },
324
- [refs.domReference]
325
- );
326
309
  useEffect(() => {
327
310
  if (open) {
328
311
  handleFetchOptions(filterInputType);
@@ -331,6 +314,8 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
331
314
  useEffect(() => {
332
315
  var _a2, _b2;
333
316
  if (!isAlwaysWip) {
317
+ setInputType("value");
318
+ setInputValue("");
334
319
  if (hasMultiValueOperator && ((_a2 = filter == null ? void 0 : filter.values) == null ? void 0 : _a2.length)) {
335
320
  const multiValueOptions = filter.values.reduce(
336
321
  (acc, value, i) => {
@@ -346,7 +331,6 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
346
331
  []
347
332
  );
348
333
  setFilterMultiValues(multiValueOptions);
349
- setInputValue("");
350
334
  }
351
335
  (_b2 = refs.domReference.current) == null ? void 0 : _b2.focus();
352
336
  }
@@ -391,8 +375,7 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
391
375
  key: `${item.value}-${i}`,
392
376
  item,
393
377
  index: i,
394
- handleRemoveMultiValue,
395
- handleEditMultiValuePill
378
+ handleRemoveMultiValue
396
379
  })) : null) : null, /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({}, getReferenceProps({
397
380
  ref: refs.setReference,
398
381
  onChange,
@@ -479,7 +462,6 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
479
462
  event.preventDefault();
480
463
  event.stopPropagation();
481
464
  handleLocalMultiValueChange(item);
482
- setInputValue("");
483
465
  (_a3 = refs.domReference.current) == null ? void 0 : _a3.focus();
484
466
  } else {
485
467
  model._updateFilter(
@@ -524,6 +506,35 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
524
506
  menuHeight: Math.min(rowVirtualizer.getTotalSize(), MAX_MENU_HEIGHT)
525
507
  }) : null))));
526
508
  });
509
+ const MultiValuePill = ({ item, handleRemoveMultiValue, index }) => {
510
+ var _a, _b;
511
+ const styles = useStyles2(getStyles);
512
+ return /* @__PURE__ */ React.createElement("div", {
513
+ className: cx(styles.basePill, styles.valuePill)
514
+ }, /* @__PURE__ */ React.createElement("span", null, " ", (_a = item.label) != null ? _a : item.value), /* @__PURE__ */ React.createElement(Button, {
515
+ onClick: (e) => {
516
+ e.stopPropagation();
517
+ e.preventDefault();
518
+ handleRemoveMultiValue(item);
519
+ },
520
+ onKeyDownCapture: (e) => {
521
+ if (e.key === "Enter") {
522
+ e.preventDefault();
523
+ e.stopPropagation();
524
+ handleRemoveMultiValue(item);
525
+ }
526
+ },
527
+ fill: "text",
528
+ size: "sm",
529
+ variant: "secondary",
530
+ className: styles.removeButton,
531
+ tooltip: `Remove filter value - ${(_b = item.label) != null ? _b : item.value}`
532
+ }, /* @__PURE__ */ React.createElement(Icon, {
533
+ name: "times",
534
+ size: "md",
535
+ id: `${item.value}-${index}`
536
+ })));
537
+ };
527
538
  const getStyles = (theme) => ({
528
539
  comboboxWrapper: css({
529
540
  display: "flex",
@@ -556,6 +567,10 @@ const getStyles = (theme) => ({
556
567
  background: theme.colors.action.hover
557
568
  }
558
569
  }),
570
+ valuePill: css({
571
+ background: theme.colors.action.selected,
572
+ padding: theme.spacing(0.125, 0, 0.125, 1)
573
+ }),
559
574
  dropdownWrapper: css({
560
575
  backgroundColor: theme.colors.background.primary,
561
576
  color: theme.colors.text.primary,
@@ -588,10 +603,25 @@ const getStyles = (theme) => ({
588
603
  borderTop: `1px solid ${theme.colors.border.weak}`
589
604
  }
590
605
  }),
606
+ removeButton: css({
607
+ marginInline: theme.spacing(0.5),
608
+ height: "100%",
609
+ padding: 0,
610
+ cursor: "pointer",
611
+ "&:hover": {
612
+ color: theme.colors.text.primary
613
+ }
614
+ }),
591
615
  descriptionText: css(__spreadProps(__spreadValues({}, theme.typography.bodySmall), {
592
616
  color: theme.colors.text.secondary,
593
617
  paddingTop: theme.spacing(0.5)
594
- }))
618
+ })),
619
+ multiValueApply: css({
620
+ position: "absolute",
621
+ top: 0,
622
+ left: 0,
623
+ display: "flex"
624
+ })
595
625
  });
596
626
 
597
627
  export { AdHocCombobox };
@@ -1 +1 @@
1
- {"version":3,"file":"AdHocFiltersCombobox.js","sources":["../../../../../src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FloatingFocusManager, FloatingPortal, UseFloatingOptions } from '@floating-ui/react';\nimport { Spinner, Text, useStyles2 } from '@grafana/ui';\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { css, cx } from '@emotion/css';\nimport { AdHocFilterWithLabels, AdHocFiltersVariable, isMultiValueOperator } from '../AdHocFiltersVariable';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport {\n DropdownItem,\n LoadingOptionsPlaceholder,\n MultiValueApplyButton,\n NoOptionsPlaceholder,\n OptionsErrorPlaceholder,\n} from './DropdownItem';\nimport {\n ERROR_STATE_DROPDOWN_WIDTH,\n flattenOptionGroups,\n fuzzySearchOptions,\n generateFilterUpdatePayload,\n generatePlaceholder,\n setupDropdownAccessibility,\n switchInputType,\n switchToNextInputType,\n VIRTUAL_LIST_ITEM_HEIGHT,\n VIRTUAL_LIST_ITEM_HEIGHT_WITH_DESCRIPTION,\n VIRTUAL_LIST_OVERSCAN,\n} from './utils';\nimport { handleOptionGroups } from '../../utils';\nimport { useFloatingInteractions, MAX_MENU_HEIGHT } from './useFloatingInteractions';\nimport { MultiValuePill } from './MultiValuePill';\n\ninterface AdHocComboboxProps {\n filter?: AdHocFilterWithLabels;\n isAlwaysWip?: boolean;\n model: AdHocFiltersVariable;\n handleChangeViewMode?: (event?: React.MouseEvent, shouldFocusOnPillWrapperOverride?: boolean) => void;\n focusOnWipInputRef?: () => void;\n}\n\nexport type AdHocInputType = 'key' | 'operator' | 'value';\n\nexport const AdHocCombobox = forwardRef(function AdHocCombobox(\n { filter, model, isAlwaysWip, handleChangeViewMode, focusOnWipInputRef }: AdHocComboboxProps,\n parentRef\n) {\n const [open, setOpen] = useState(false);\n const [options, setOptions] = useState<Array<SelectableValue<string>>>([]);\n const [optionsLoading, setOptionsLoading] = useState<boolean>(false);\n const [optionsError, setOptionsError] = useState<boolean>(false);\n const [inputValue, setInputValue] = useState(!isAlwaysWip ? filter?.value || '' : '');\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n const [filterInputType, setInputType] = useState<AdHocInputType>(!isAlwaysWip ? 'value' : 'key');\n const styles = useStyles2(getStyles);\n // control multi values with local state in order to commit all values at once and avoid _wip reset mid creation\n const [filterMultiValues, setFilterMultiValues] = useState<Array<SelectableValue<string>>>([]);\n const [_, setForceRefresh] = useState({});\n\n const multiValuePillWrapperRef = useRef<HTMLDivElement>(null);\n\n const hasMultiValueOperator = isMultiValueOperator(filter?.operator || '');\n const isMultiValueEdit = hasMultiValueOperator && filterInputType === 'value';\n\n // used to identify operator element and prevent dismiss because it registers as outside click\n const operatorIdentifier = useId();\n\n const listRef = useRef<Array<HTMLElement | null>>([]);\n const disabledIndicesRef = useRef<number[]>([]);\n\n const optionsSearcher = useMemo(() => fuzzySearchOptions(options), [options]);\n\n const isLastFilter = useMemo(() => {\n if (isAlwaysWip) {\n return false;\n }\n\n if (model.state.filters.at(-1) === filter) {\n return true;\n }\n return false;\n }, [filter, isAlwaysWip, model.state.filters]);\n\n // reset wip filter. Used when navigating away with incomplete wip filer or when selecting wip filter value\n const handleResetWip = useCallback(() => {\n if (isAlwaysWip) {\n model._addWip();\n setInputType('key');\n setInputValue('');\n }\n }, [model, isAlwaysWip]);\n\n const handleMultiValueFilterCommit = useCallback(\n (\n model: AdHocFiltersVariable,\n filter: AdHocFilterWithLabels,\n filterMultiValues: Array<SelectableValue<string>>,\n preventFocus?: boolean\n ) => {\n if (filterMultiValues.length) {\n const valueLabels: string[] = [];\n const values: string[] = [];\n filterMultiValues.forEach((item) => {\n valueLabels.push(item.label ?? item.value!);\n values.push(item.value!);\n });\n // TODO remove when we're on the latest version of @grafana/data\n //@ts-expect-error\n model._updateFilter(filter!, { valueLabels, values, value: values[0] });\n setFilterMultiValues([]);\n }\n if (!preventFocus) {\n setTimeout(() => refs.domReference.current?.focus());\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n const handleLocalMultiValueChange = useCallback((selectedItem: SelectableValue<string>) => {\n setFilterMultiValues((items) => {\n if (items.some((item) => item.value === selectedItem.value)) {\n return items.filter((item) => item.value !== selectedItem.value);\n }\n return [...items, selectedItem];\n });\n }, []);\n\n const onOpenChange = useCallback<NonNullable<UseFloatingOptions['onOpenChange']>>(\n (nextOpen, _, reason) => {\n setOpen(nextOpen);\n // change from filter edit mode to filter view mode when clicked\n // outside input or dropdown\n\n if (reason && ['outside-press', 'escape-key'].includes(reason)) {\n if (isMultiValueEdit) {\n // commit multi value filter values on escape and click-away\n handleMultiValueFilterCommit(model, filter!, filterMultiValues);\n }\n handleResetWip();\n handleChangeViewMode?.();\n }\n },\n [\n filter,\n filterMultiValues,\n handleChangeViewMode,\n handleMultiValueFilterCommit,\n handleResetWip,\n isMultiValueEdit,\n model,\n ]\n );\n\n // generate ids from multi values in order to prevent outside click based on those ids\n const outsidePressIdsToIgnore = useMemo(() => {\n return [\n operatorIdentifier,\n ...filterMultiValues.reduce<string[]>(\n (acc, item, i) => [...acc, `${item.value}-${i}`, `${item.value}-${i}-close-icon`],\n []\n ),\n ];\n }, [operatorIdentifier, filterMultiValues]);\n\n const { refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps } = useFloatingInteractions({\n open,\n onOpenChange,\n activeIndex,\n setActiveIndex,\n outsidePressIdsToIgnore,\n listRef,\n disabledIndicesRef,\n });\n\n // pass ability to focus on input element back to parent\n // parentRef is coming from AdHocFiltersComboboxRenderer\n useImperativeHandle(parentRef, () => () => refs.domReference.current?.focus(), [refs.domReference]);\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>) {\n const value = event.target.value;\n setInputValue(value);\n setActiveIndex(0);\n }\n\n const handleRemoveMultiValue = useCallback(\n (item: SelectableValue<string>) => {\n setFilterMultiValues((selected) => selected.filter((option) => option.value !== item.value));\n setTimeout(() => refs.domReference.current?.focus());\n },\n [refs.domReference]\n );\n\n // operation order on fetched options:\n // fuzzy search -> extract into groups -> flatten group labels and options\n const filteredDropDownItems = flattenOptionGroups(handleOptionGroups(optionsSearcher(inputValue, filterInputType)));\n\n // adding custom option this way so that virtualiser is aware of it and can scroll to\n if (filterInputType !== 'operator' && inputValue) {\n filteredDropDownItems.push({\n value: inputValue.trim(),\n label: inputValue.trim(),\n isCustom: true,\n });\n }\n\n // calculate width and populate listRef and disabledIndicesRef for arrow key navigation\n const maxOptionWidth = setupDropdownAccessibility(filteredDropDownItems, listRef, disabledIndicesRef);\n\n const handleFetchOptions = useCallback(\n async (inputType: AdHocInputType) => {\n setOptionsError(false);\n setOptionsLoading(true);\n setOptions([]);\n let options: Array<SelectableValue<string>> = [];\n try {\n if (inputType === 'key') {\n options = await model._getKeys(null);\n } else if (inputType === 'operator') {\n options = model._getOperators();\n } else if (inputType === 'value') {\n options = await model._getValuesFor(filter!);\n }\n\n setOptions(options);\n if (options[0]?.group) {\n setActiveIndex(1);\n } else {\n setActiveIndex(0);\n }\n } catch (e) {\n setOptionsError(true);\n }\n setOptionsLoading(false);\n },\n [filter, model]\n );\n\n const rowVirtualizer = useVirtualizer({\n count: filteredDropDownItems.length,\n getScrollElement: () => refs.floating.current,\n estimateSize: (index) =>\n filteredDropDownItems[index].description ? VIRTUAL_LIST_ITEM_HEIGHT_WITH_DESCRIPTION : VIRTUAL_LIST_ITEM_HEIGHT,\n overscan: VIRTUAL_LIST_OVERSCAN,\n });\n\n //\n // Keyboard interactions\n //\n\n const handleBackspaceInput = useCallback(\n (event: React.KeyboardEvent, multiValueEdit: boolean) => {\n if (event.key === 'Backspace' && !inputValue) {\n if (filterInputType === 'value') {\n if (multiValueEdit) {\n if (filterMultiValues.length) {\n setFilterMultiValues((items) => {\n const updated = [...items];\n updated.splice(-1, 1);\n\n return updated;\n });\n return;\n }\n }\n setInputType('operator');\n return;\n }\n\n // focus back on alway wip input when you delete filter with backspace\n focusOnWipInputRef?.();\n\n model._handleComboboxBackspace(filter!);\n\n if (isAlwaysWip) {\n handleResetWip();\n }\n }\n },\n [\n inputValue,\n filterInputType,\n model,\n filter,\n isAlwaysWip,\n filterMultiValues.length,\n handleResetWip,\n focusOnWipInputRef,\n ]\n );\n\n const handleTabInput = useCallback(\n (event: React.KeyboardEvent, multiValueEdit?: boolean) => {\n // change filter to view mode when navigating away with Tab key\n // this is needed because useDismiss only reacts to mousedown\n if (event.key === 'Tab' && !event.shiftKey) {\n if (multiValueEdit) {\n // commit multi value filter values on tab away\n event.preventDefault();\n handleMultiValueFilterCommit(model, filter!, filterMultiValues);\n refs.domReference.current?.focus();\n }\n\n handleChangeViewMode?.();\n handleResetWip();\n }\n },\n [\n filter,\n filterMultiValues,\n handleChangeViewMode,\n handleMultiValueFilterCommit,\n handleResetWip,\n model,\n refs.domReference,\n ]\n );\n\n const handleShiftTabInput = useCallback(\n (event: React.KeyboardEvent, multiValueEdit?: boolean) => {\n if (event.key === 'Tab' && event.shiftKey) {\n if (multiValueEdit) {\n // commit multi value filter values on shift tab away\n event.preventDefault();\n handleMultiValueFilterCommit(model, filter!, filterMultiValues, true);\n }\n handleChangeViewMode?.();\n handleResetWip();\n }\n },\n [filter, filterMultiValues, handleChangeViewMode, handleMultiValueFilterCommit, handleResetWip, model]\n );\n\n const handleEnterInput = useCallback(\n (event: React.KeyboardEvent, multiValueEdit?: boolean) => {\n if (event.key === 'Enter' && activeIndex != null) {\n // safeguard for non existing items\n if (!filteredDropDownItems[activeIndex]) {\n return;\n }\n const selectedItem = filteredDropDownItems[activeIndex];\n\n if (multiValueEdit) {\n handleLocalMultiValueChange(selectedItem);\n } else {\n model._updateFilter(\n filter!,\n generateFilterUpdatePayload({\n filterInputType,\n item: selectedItem,\n filter: filter!,\n setFilterMultiValues,\n })\n );\n\n switchToNextInputType(\n filterInputType,\n setInputType,\n handleChangeViewMode,\n refs.domReference.current,\n // preventing focus on filter pill only when last filter for better backspace experience\n isLastFilter ? false : undefined\n );\n setActiveIndex(null);\n if (isLastFilter) {\n focusOnWipInputRef?.();\n }\n }\n\n setInputValue('');\n }\n },\n [\n activeIndex,\n filteredDropDownItems,\n handleLocalMultiValueChange,\n model,\n filter,\n filterInputType,\n handleChangeViewMode,\n refs.domReference,\n isLastFilter,\n focusOnWipInputRef,\n ]\n );\n\n const handleEditMultiValuePill = useCallback(\n (value: SelectableValue<string>) => {\n const valueLabel = value.label || value.value!;\n setFilterMultiValues((prev) => prev.filter((item) => item.value !== value.value));\n setInputValue(valueLabel);\n refs.domReference.current?.focus();\n },\n [refs.domReference]\n );\n\n //\n // Effects\n //\n\n useEffect(() => {\n // fetch options when dropdown is opened.\n if (open) {\n handleFetchOptions(filterInputType);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, filterInputType]);\n\n // when not in wip mode this is the point of switching from view to edit mode\n // and in this case we default to 'value' input type and focus input\n useEffect(() => {\n if (!isAlwaysWip) {\n // TODO remove when we're on the latest version of @grafana/data\n //@ts-expect-error\n if (hasMultiValueOperator && filter?.values?.length) {\n // TODO remove when we're on the latest version of @grafana/data\n //@ts-expect-error\n const multiValueOptions = (filter.values as string[]).reduce<Array<SelectableValue<string>>>(\n (acc, value, i) => [\n ...acc,\n {\n label: filter.valueLabels?.[i] || value,\n value: value,\n },\n ],\n []\n );\n // populate filter multi values to local state on pill edit enter\n setFilterMultiValues(multiValueOptions);\n setInputValue('');\n }\n\n refs.domReference.current?.focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // this is required only with multi value select in order to update position\n // of the multi value apply button\n useEffect(() => {\n if (isMultiValueEdit && filterMultiValues) {\n setTimeout(() => setForceRefresh({}));\n }\n }, [filterMultiValues, isMultiValueEdit]);\n\n useLayoutEffect(() => {\n // this is needed to scroll virtual list to the position of currently selected\n // dropdown item when navigating with arrow up/down keys to end/start of list\n if (\n activeIndex !== null &&\n rowVirtualizer.range &&\n (activeIndex > rowVirtualizer.range?.endIndex || activeIndex < rowVirtualizer.range?.startIndex)\n ) {\n rowVirtualizer.scrollToIndex(activeIndex);\n }\n }, [activeIndex, rowVirtualizer]);\n\n const keyLabel = filter?.keyLabel ?? filter?.key;\n\n return (\n <div className={styles.comboboxWrapper}>\n {filter ? (\n <div className={styles.pillWrapper}>\n {/* Filter key pill render */}\n {filter?.key ? <div className={cx(styles.basePill, styles.keyPill)}>{keyLabel}</div> : null}\n {/* Filter operator pill render */}\n {filter?.key && filter?.operator && filterInputType !== 'operator' ? (\n <div\n id={operatorIdentifier}\n className={cx(styles.basePill, styles.operatorPill, operatorIdentifier)}\n role=\"button\"\n aria-label=\"Edit filter operator\"\n tabIndex={0}\n onClick={(event) => {\n event.stopPropagation();\n switchInputType('operator', setInputType, undefined, refs.domReference.current);\n }}\n onKeyDown={(event) => {\n handleShiftTabInput(event, hasMultiValueOperator);\n if (event.key === 'Enter') {\n switchInputType('operator', setInputType, undefined, refs.domReference.current);\n }\n }}\n >\n {filter.operator}\n </div>\n ) : null}\n\n <div ref={multiValuePillWrapperRef}></div>\n {isMultiValueEdit\n ? filterMultiValues.map((item, i) => (\n <MultiValuePill\n key={`${item.value}-${i}`}\n item={item}\n index={i}\n handleRemoveMultiValue={handleRemoveMultiValue}\n handleEditMultiValuePill={handleEditMultiValuePill}\n />\n ))\n : null}\n </div>\n ) : null}\n\n <input\n {...getReferenceProps({\n ref: refs.setReference,\n onChange,\n value: inputValue,\n // dynamic placeholder to display operator and/or value in filter edit mode\n placeholder: generatePlaceholder(filter!, filterInputType, isMultiValueEdit, isAlwaysWip),\n 'aria-autocomplete': 'list',\n onKeyDown(event) {\n if (!open) {\n setOpen(true);\n return;\n }\n\n if (filterInputType === 'operator') {\n handleShiftTabInput(event);\n }\n handleBackspaceInput(event, isMultiValueEdit);\n handleTabInput(event, isMultiValueEdit);\n handleEnterInput(event, isMultiValueEdit);\n },\n })}\n className={cx(styles.inputStyle, { [styles.loadingInputPadding]: !optionsLoading })}\n onClick={(event) => {\n event.stopPropagation();\n setOpen(true);\n }}\n onFocus={() => {\n setActiveIndex(0);\n setOpen(true);\n }}\n />\n {optionsLoading ? <Spinner className={styles.loadingIndicator} inline={true} /> : null}\n <FloatingPortal>\n {open && (\n <FloatingFocusManager context={context} initialFocus={-1} visuallyHiddenDismiss modal={false}>\n <>\n <div\n style={{\n ...floatingStyles,\n width: `${optionsError ? ERROR_STATE_DROPDOWN_WIDTH : maxOptionWidth}px`,\n transform: isMultiValueEdit\n ? `translate(${multiValuePillWrapperRef.current?.getBoundingClientRect().left || 0}px, ${\n (refs.domReference.current?.getBoundingClientRect().bottom || 0) + 10\n }px )`\n : floatingStyles.transform,\n }}\n ref={refs.setFloating}\n className={styles.dropdownWrapper}\n tabIndex={-1}\n >\n <div\n style={{\n height: `${rowVirtualizer.getTotalSize() || VIRTUAL_LIST_ITEM_HEIGHT}px`, // fallback to 38px for loading/error/no options placeholders\n }}\n {...getFloatingProps()}\n tabIndex={-1}\n >\n {optionsLoading ? (\n <LoadingOptionsPlaceholder />\n ) : optionsError ? (\n <OptionsErrorPlaceholder handleFetchOptions={() => handleFetchOptions(filterInputType)} />\n ) : !filteredDropDownItems.length && (filterInputType === 'operator' || !inputValue) ? (\n <NoOptionsPlaceholder />\n ) : (\n rowVirtualizer.getVirtualItems().map((virtualItem) => {\n const item = filteredDropDownItems[virtualItem.index];\n const index = virtualItem.index;\n\n // render group label\n if (item.options) {\n return (\n <div\n key={`${item.label}+${index}`}\n className={cx(styles.optionGroupLabel, styles.groupTopBorder)}\n style={{\n height: `${virtualItem.size}px`,\n transform: `translateY(${virtualItem.start}px)`,\n }}\n >\n <Text weight=\"bold\" variant=\"bodySmall\" color=\"secondary\">\n {item.label!}\n </Text>\n </div>\n );\n }\n\n const nextItem: SelectableValue<string> | undefined =\n filteredDropDownItems[virtualItem.index + 1];\n const shouldAddBottomBorder = nextItem && !nextItem.group && !nextItem.options && item.group;\n\n return (\n // key is included in getItemProps()\n // eslint-disable-next-line react/jsx-key\n <DropdownItem\n {...getItemProps({\n key: `${item.value!}-${index}`,\n ref(node) {\n listRef.current[index] = node;\n },\n onClick(event) {\n if (filterInputType !== 'value') {\n event.stopPropagation();\n }\n if (isMultiValueEdit) {\n event.preventDefault();\n event.stopPropagation();\n handleLocalMultiValueChange(item);\n setInputValue('');\n refs.domReference.current?.focus();\n } else {\n model._updateFilter(\n filter!,\n generateFilterUpdatePayload({\n filterInputType,\n item,\n filter: filter!,\n setFilterMultiValues,\n })\n );\n setInputValue('');\n\n switchToNextInputType(\n filterInputType,\n setInputType,\n handleChangeViewMode,\n refs.domReference.current,\n // explicitly preventing focus on filter pill due to a11y error\n false\n );\n }\n },\n })}\n active={activeIndex === index}\n addGroupBottomBorder={shouldAddBottomBorder}\n // virtual item positioning and accessibility\n style={{\n height: `${virtualItem.size}px`,\n transform: `translateY(${virtualItem.start}px)`,\n }}\n aria-setsize={filteredDropDownItems.length}\n aria-posinset={virtualItem.index + 1}\n isMultiValueEdit={isMultiValueEdit}\n checked={filterMultiValues.some((val) => val.value === item.value)}\n >\n <span>\n {item.isCustom ? 'Use custom value: ' : ''} {item.label ?? item.value}\n </span>\n {item.description ? <div className={styles.descriptionText}>{item.description}</div> : null}\n </DropdownItem>\n );\n })\n )}\n </div>\n </div>\n {isMultiValueEdit && !optionsLoading && !optionsError && filteredDropDownItems.length ? (\n <MultiValueApplyButton\n onApply={() => {\n handleMultiValueFilterCommit(model, filter!, filterMultiValues);\n }}\n floatingElement={refs.floating.current}\n maxOptionWidth={maxOptionWidth}\n menuHeight={Math.min(rowVirtualizer.getTotalSize(), MAX_MENU_HEIGHT)}\n />\n ) : null}\n </>\n </FloatingFocusManager>\n )}\n </FloatingPortal>\n </div>\n );\n});\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n comboboxWrapper: css({\n display: 'flex',\n flexWrap: 'wrap',\n }),\n pillWrapper: css({\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n }),\n basePill: css({\n display: 'flex',\n alignItems: 'center',\n background: theme.colors.action.disabledBackground,\n border: `1px solid ${theme.colors.border.weak}`,\n padding: theme.spacing(0.125, 1, 0.125, 1),\n color: theme.colors.text.primary,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n minHeight: theme.spacing(2.75),\n ...theme.typography.bodySmall,\n cursor: 'pointer',\n }),\n keyPill: css({\n fontWeight: theme.typography.fontWeightBold,\n cursor: 'default',\n }),\n operatorPill: css({\n '&:hover': {\n background: theme.colors.action.hover,\n },\n }),\n dropdownWrapper: css({\n backgroundColor: theme.colors.background.primary,\n color: theme.colors.text.primary,\n boxShadow: theme.shadows.z2,\n overflowY: 'auto',\n zIndex: theme.zIndex.dropdown,\n }),\n inputStyle: css({\n paddingBlock: 0,\n '&:focus': {\n outline: 'none',\n },\n }),\n loadingIndicator: css({\n color: theme.colors.text.secondary,\n marginLeft: theme.spacing(0.5),\n }),\n loadingInputPadding: css({\n paddingRight: theme.spacing(2.5),\n }),\n optionGroupLabel: css({\n padding: theme.spacing(1),\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n }),\n groupTopBorder: css({\n '&:not(:first-child)': {\n borderTop: `1px solid ${theme.colors.border.weak}`,\n },\n }),\n descriptionText: css({\n ...theme.typography.bodySmall,\n color: theme.colors.text.secondary,\n paddingTop: theme.spacing(0.5),\n }),\n});\n"],"names":["AdHocCombobox","model","filter","filterMultiValues","_a","_","options","_b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmDa,MAAA,aAAA,GAAgB,UAAW,CAAA,SAASA,cAC/C,CAAA,EAAE,MAAQ,EAAA,KAAA,EAAO,WAAa,EAAA,oBAAA,EAAsB,kBAAmB,EAAA,EACvE,SACA,EAAA;AAtDF,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAuDE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AACtC,EAAA,MAAM,CAAC,OAAS,EAAA,UAAU,CAAI,GAAA,QAAA,CAAyC,EAAE,CAAA,CAAA;AACzE,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAkB,KAAK,CAAA,CAAA;AACnE,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAkB,KAAK,CAAA,CAAA;AAC/D,EAAM,MAAA,CAAC,UAAY,EAAA,aAAa,CAAI,GAAA,QAAA,CAAS,CAAC,WAAc,GAAA,CAAA,MAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,MAAA,CAAQ,KAAS,KAAA,EAAA,GAAK,EAAE,CAAA,CAAA;AACpF,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAwB,IAAI,CAAA,CAAA;AAClE,EAAM,MAAA,CAAC,iBAAiB,YAAY,CAAA,GAAI,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A,CAAA;AAAA,KAC9C;AAAA,GACD,CAAA;AAAA,EACD,eAAiB,EAAA,GAAA,CAAI,aAChB,CAAA,cAAA,CAAA,EAAA,EAAA,KAAA,CAAM,WAAW,SADD,CAAA,EAAA;AAAA,IAEnB,KAAA,EAAO,KAAM,CAAA,MAAA,CAAO,IAAK,CAAA,SAAA;AAAA,IACzB,UAAA,EAAY,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,GAC9B,CAAA,CAAA;AACH,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"AdHocFiltersCombobox.js","sources":["../../../../../src/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.tsx"],"sourcesContent":["import React, {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useImperativeHandle,\n useLayoutEffect,\n useMemo,\n useRef,\n useState,\n} from 'react';\nimport { FloatingFocusManager, FloatingPortal, UseFloatingOptions } from '@floating-ui/react';\nimport { Button, Icon, Spinner, Text, useStyles2 } from '@grafana/ui';\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { css, cx } from '@emotion/css';\nimport { AdHocFilterWithLabels, AdHocFiltersVariable, isMultiValueOperator } from '../AdHocFiltersVariable';\nimport { useVirtualizer } from '@tanstack/react-virtual';\nimport {\n DropdownItem,\n LoadingOptionsPlaceholder,\n MultiValueApplyButton,\n NoOptionsPlaceholder,\n OptionsErrorPlaceholder,\n} from './DropdownItem';\nimport {\n ERROR_STATE_DROPDOWN_WIDTH,\n flattenOptionGroups,\n fuzzySearchOptions,\n generateFilterUpdatePayload,\n generatePlaceholder,\n setupDropdownAccessibility,\n switchInputType,\n switchToNextInputType,\n VIRTUAL_LIST_ITEM_HEIGHT,\n VIRTUAL_LIST_ITEM_HEIGHT_WITH_DESCRIPTION,\n VIRTUAL_LIST_OVERSCAN,\n} from './utils';\nimport { handleOptionGroups } from '../../utils';\nimport { useFloatingInteractions, MAX_MENU_HEIGHT } from './useFloatingInteractions';\n\ninterface AdHocComboboxProps {\n filter?: AdHocFilterWithLabels;\n isAlwaysWip?: boolean;\n model: AdHocFiltersVariable;\n handleChangeViewMode?: (event?: React.MouseEvent, shouldFocusOnPillWrapperOverride?: boolean) => void;\n focusOnWipInputRef?: () => void;\n}\n\nexport type AdHocInputType = 'key' | 'operator' | 'value';\n\nexport const AdHocCombobox = forwardRef(function AdHocCombobox(\n { filter, model, isAlwaysWip, handleChangeViewMode, focusOnWipInputRef }: AdHocComboboxProps,\n parentRef\n) {\n const [open, setOpen] = useState(false);\n const [options, setOptions] = useState<Array<SelectableValue<string>>>([]);\n const [optionsLoading, setOptionsLoading] = useState<boolean>(false);\n const [optionsError, setOptionsError] = useState<boolean>(false);\n const [inputValue, setInputValue] = useState('');\n const [activeIndex, setActiveIndex] = useState<number | null>(null);\n const [filterInputType, setInputType] = useState<AdHocInputType>(!isAlwaysWip ? 'value' : 'key');\n const styles = useStyles2(getStyles);\n // control multi values with local state in order to commit all values at once and avoid _wip reset mid creation\n const [filterMultiValues, setFilterMultiValues] = useState<Array<SelectableValue<string>>>([]);\n const [_, setForceRefresh] = useState({});\n\n const multiValuePillWrapperRef = useRef<HTMLDivElement>(null);\n\n const hasMultiValueOperator = isMultiValueOperator(filter?.operator || '');\n const isMultiValueEdit = hasMultiValueOperator && filterInputType === 'value';\n\n // used to identify operator element and prevent dismiss because it registers as outside click\n const operatorIdentifier = useId();\n\n const listRef = useRef<Array<HTMLElement | null>>([]);\n const disabledIndicesRef = useRef<number[]>([]);\n\n const optionsSearcher = useMemo(() => fuzzySearchOptions(options), [options]);\n\n const isLastFilter = useMemo(() => {\n if (isAlwaysWip) {\n return false;\n }\n\n if (model.state.filters.at(-1) === filter) {\n return true;\n }\n return false;\n }, [filter, isAlwaysWip, model.state.filters]);\n\n // reset wip filter. Used when navigating away with incomplete wip filer or when selecting wip filter value\n const handleResetWip = useCallback(() => {\n if (isAlwaysWip) {\n model._addWip();\n setInputType('key');\n setInputValue('');\n }\n }, [model, isAlwaysWip]);\n\n const handleMultiValueFilterCommit = useCallback(\n (\n model: AdHocFiltersVariable,\n filter: AdHocFilterWithLabels,\n filterMultiValues: Array<SelectableValue<string>>,\n preventFocus?: boolean\n ) => {\n if (filterMultiValues.length) {\n const valueLabels: string[] = [];\n const values: string[] = [];\n filterMultiValues.forEach((item) => {\n valueLabels.push(item.label ?? item.value!);\n values.push(item.value!);\n });\n // TODO remove when we're on the latest version of @grafana/data\n //@ts-expect-error\n model._updateFilter(filter!, { valueLabels, values, value: values[0] });\n setFilterMultiValues([]);\n }\n if (!preventFocus) {\n setTimeout(() => refs.domReference.current?.focus());\n }\n },\n // eslint-disable-next-line react-hooks/exhaustive-deps\n []\n );\n\n const handleLocalMultiValueChange = useCallback((selectedItem: SelectableValue<string>) => {\n setFilterMultiValues((items) => {\n if (items.some((item) => item.value === selectedItem.value)) {\n return items.filter((item) => item.value !== selectedItem.value);\n }\n return [...items, selectedItem];\n });\n }, []);\n\n const onOpenChange = useCallback<NonNullable<UseFloatingOptions['onOpenChange']>>(\n (nextOpen, _, reason) => {\n setOpen(nextOpen);\n // change from filter edit mode to filter view mode when clicked\n // outside input or dropdown\n\n if (reason && ['outside-press', 'escape-key'].includes(reason)) {\n if (isMultiValueEdit) {\n // commit multi value filter values on escape and click-away\n handleMultiValueFilterCommit(model, filter!, filterMultiValues);\n }\n handleResetWip();\n handleChangeViewMode?.();\n }\n },\n [\n filter,\n filterMultiValues,\n handleChangeViewMode,\n handleMultiValueFilterCommit,\n handleResetWip,\n isMultiValueEdit,\n model,\n ]\n );\n\n // generate ids from multi values in order to prevent outside click based on those ids\n const outsidePressIdsToIgnore = useMemo(() => {\n return [operatorIdentifier, ...filterMultiValues.map((item, i) => `${item.value}-${i}`)];\n }, [operatorIdentifier, filterMultiValues]);\n\n const { refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps } = useFloatingInteractions({\n open,\n onOpenChange,\n activeIndex,\n setActiveIndex,\n outsidePressIdsToIgnore,\n listRef,\n disabledIndicesRef,\n });\n\n // pass ability to focus on input element back to parent\n // parentRef is coming from AdHocFiltersComboboxRenderer\n useImperativeHandle(parentRef, () => () => refs.domReference.current?.focus(), [refs.domReference]);\n\n function onChange(event: React.ChangeEvent<HTMLInputElement>) {\n const value = event.target.value;\n setInputValue(value);\n setActiveIndex(0);\n }\n\n const handleRemoveMultiValue = useCallback(\n (item: SelectableValue<string>) => {\n setFilterMultiValues((selected) => selected.filter((option) => option.value !== item.value));\n setTimeout(() => refs.domReference.current?.focus());\n },\n [refs.domReference]\n );\n\n // operation order on fetched options:\n // fuzzy search -> extract into groups -> flatten group labels and options\n const filteredDropDownItems = flattenOptionGroups(handleOptionGroups(optionsSearcher(inputValue, filterInputType)));\n\n // adding custom option this way so that virtualiser is aware of it and can scroll to\n if (filterInputType !== 'operator' && inputValue) {\n filteredDropDownItems.push({\n value: inputValue.trim(),\n label: inputValue.trim(),\n isCustom: true,\n });\n }\n\n // calculate width and populate listRef and disabledIndicesRef for arrow key navigation\n const maxOptionWidth = setupDropdownAccessibility(filteredDropDownItems, listRef, disabledIndicesRef);\n\n const handleFetchOptions = useCallback(\n async (inputType: AdHocInputType) => {\n setOptionsError(false);\n setOptionsLoading(true);\n setOptions([]);\n let options: Array<SelectableValue<string>> = [];\n try {\n if (inputType === 'key') {\n options = await model._getKeys(null);\n } else if (inputType === 'operator') {\n options = model._getOperators();\n } else if (inputType === 'value') {\n options = await model._getValuesFor(filter!);\n }\n\n setOptions(options);\n if (options[0]?.group) {\n setActiveIndex(1);\n } else {\n setActiveIndex(0);\n }\n } catch (e) {\n setOptionsError(true);\n }\n setOptionsLoading(false);\n },\n [filter, model]\n );\n\n const rowVirtualizer = useVirtualizer({\n count: filteredDropDownItems.length,\n getScrollElement: () => refs.floating.current,\n estimateSize: (index) =>\n filteredDropDownItems[index].description ? VIRTUAL_LIST_ITEM_HEIGHT_WITH_DESCRIPTION : VIRTUAL_LIST_ITEM_HEIGHT,\n overscan: VIRTUAL_LIST_OVERSCAN,\n });\n\n //\n // Keyboard interactions\n //\n\n const handleBackspaceInput = useCallback(\n (event: React.KeyboardEvent, multiValueEdit: boolean) => {\n if (event.key === 'Backspace' && !inputValue) {\n if (filterInputType === 'value') {\n if (multiValueEdit) {\n if (filterMultiValues.length) {\n setFilterMultiValues((items) => {\n const updated = [...items];\n updated.splice(-1, 1);\n\n return updated;\n });\n return;\n }\n }\n setInputType('operator');\n return;\n }\n\n // focus back on alway wip input when you delete filter with backspace\n focusOnWipInputRef?.();\n\n model._handleComboboxBackspace(filter!);\n\n if (isAlwaysWip) {\n handleResetWip();\n }\n }\n },\n [\n inputValue,\n filterInputType,\n model,\n filter,\n isAlwaysWip,\n filterMultiValues.length,\n handleResetWip,\n focusOnWipInputRef,\n ]\n );\n\n const handleTabInput = useCallback(\n (event: React.KeyboardEvent, multiValueEdit?: boolean) => {\n // change filter to view mode when navigating away with Tab key\n // this is needed because useDismiss only reacts to mousedown\n if (event.key === 'Tab' && !event.shiftKey) {\n if (multiValueEdit) {\n // commit multi value filter values on tab away\n event.preventDefault();\n handleMultiValueFilterCommit(model, filter!, filterMultiValues);\n refs.domReference.current?.focus();\n }\n\n handleChangeViewMode?.();\n handleResetWip();\n }\n },\n [\n filter,\n filterMultiValues,\n handleChangeViewMode,\n handleMultiValueFilterCommit,\n handleResetWip,\n model,\n refs.domReference,\n ]\n );\n\n const handleShiftTabInput = useCallback(\n (event: React.KeyboardEvent, multiValueEdit?: boolean) => {\n if (event.key === 'Tab' && event.shiftKey) {\n if (multiValueEdit) {\n // commit multi value filter values on shift tab away\n event.preventDefault();\n handleMultiValueFilterCommit(model, filter!, filterMultiValues, true);\n }\n handleChangeViewMode?.();\n handleResetWip();\n }\n },\n [filter, filterMultiValues, handleChangeViewMode, handleMultiValueFilterCommit, handleResetWip, model]\n );\n\n const handleEnterInput = useCallback(\n (event: React.KeyboardEvent, multiValueEdit?: boolean) => {\n if (event.key === 'Enter' && activeIndex != null) {\n // safeguard for non existing items\n if (!filteredDropDownItems[activeIndex]) {\n return;\n }\n const selectedItem = filteredDropDownItems[activeIndex];\n\n if (multiValueEdit) {\n handleLocalMultiValueChange(selectedItem);\n } else {\n model._updateFilter(\n filter!,\n generateFilterUpdatePayload({\n filterInputType,\n item: selectedItem,\n filter: filter!,\n setFilterMultiValues,\n })\n );\n\n switchToNextInputType(\n filterInputType,\n setInputType,\n handleChangeViewMode,\n refs.domReference.current,\n // preventing focus on filter pill only when last filter for better backspace experience\n isLastFilter ? false : undefined\n );\n setActiveIndex(null);\n if (isLastFilter) {\n focusOnWipInputRef?.();\n }\n }\n\n setInputValue('');\n }\n },\n [\n activeIndex,\n filteredDropDownItems,\n handleLocalMultiValueChange,\n model,\n filter,\n filterInputType,\n handleChangeViewMode,\n refs.domReference,\n isLastFilter,\n focusOnWipInputRef,\n ]\n );\n\n //\n // Effects\n //\n\n useEffect(() => {\n // fetch options when dropdown is opened.\n if (open) {\n handleFetchOptions(filterInputType);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open, filterInputType]);\n\n // when not in wip mode this is the point of switching from view to edit mode\n // and in this case we default to 'value' input type and focus input\n useEffect(() => {\n if (!isAlwaysWip) {\n setInputType('value');\n setInputValue('');\n\n // TODO remove when we're on the latest version of @grafana/data\n //@ts-expect-error\n if (hasMultiValueOperator && filter?.values?.length) {\n // TODO remove when we're on the latest version of @grafana/data\n //@ts-expect-error\n const multiValueOptions = (filter.values as string[]).reduce<Array<SelectableValue<string>>>(\n (acc, value, i) => [\n ...acc,\n {\n label: filter.valueLabels?.[i] || value,\n value: value,\n },\n ],\n []\n );\n // populate filter multi values to local state on pill edit enter\n setFilterMultiValues(multiValueOptions);\n }\n\n refs.domReference.current?.focus();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // this is required only with multi value select in order to update position\n // of the multi value apply button\n useEffect(() => {\n if (isMultiValueEdit && filterMultiValues) {\n setTimeout(() => setForceRefresh({}));\n }\n }, [filterMultiValues, isMultiValueEdit]);\n\n useLayoutEffect(() => {\n // this is needed to scroll virtual list to the position of currently selected\n // dropdown item when navigating with arrow up/down keys to end/start of list\n if (\n activeIndex !== null &&\n rowVirtualizer.range &&\n (activeIndex > rowVirtualizer.range?.endIndex || activeIndex < rowVirtualizer.range?.startIndex)\n ) {\n rowVirtualizer.scrollToIndex(activeIndex);\n }\n }, [activeIndex, rowVirtualizer]);\n\n const keyLabel = filter?.keyLabel ?? filter?.key;\n\n return (\n <div className={styles.comboboxWrapper}>\n {filter ? (\n <div className={styles.pillWrapper}>\n {/* Filter key pill render */}\n {filter?.key ? <div className={cx(styles.basePill, styles.keyPill)}>{keyLabel}</div> : null}\n {/* Filter operator pill render */}\n {filter?.key && filter?.operator && filterInputType !== 'operator' ? (\n <div\n id={operatorIdentifier}\n className={cx(styles.basePill, styles.operatorPill, operatorIdentifier)}\n role=\"button\"\n aria-label=\"Edit filter operator\"\n tabIndex={0}\n onClick={(event) => {\n event.stopPropagation();\n switchInputType('operator', setInputType, undefined, refs.domReference.current);\n }}\n onKeyDown={(event) => {\n handleShiftTabInput(event, hasMultiValueOperator);\n if (event.key === 'Enter') {\n switchInputType('operator', setInputType, undefined, refs.domReference.current);\n }\n }}\n >\n {filter.operator}\n </div>\n ) : null}\n\n <div ref={multiValuePillWrapperRef}></div>\n {isMultiValueEdit\n ? filterMultiValues.map((item, i) => (\n <MultiValuePill\n key={`${item.value}-${i}`}\n item={item}\n index={i}\n handleRemoveMultiValue={handleRemoveMultiValue}\n />\n ))\n : null}\n </div>\n ) : null}\n\n <input\n {...getReferenceProps({\n ref: refs.setReference,\n onChange,\n value: inputValue,\n // dynamic placeholder to display operator and/or value in filter edit mode\n placeholder: generatePlaceholder(filter!, filterInputType, isMultiValueEdit, isAlwaysWip),\n 'aria-autocomplete': 'list',\n onKeyDown(event) {\n if (!open) {\n setOpen(true);\n return;\n }\n\n if (filterInputType === 'operator') {\n handleShiftTabInput(event);\n }\n handleBackspaceInput(event, isMultiValueEdit);\n handleTabInput(event, isMultiValueEdit);\n handleEnterInput(event, isMultiValueEdit);\n },\n })}\n className={cx(styles.inputStyle, { [styles.loadingInputPadding]: !optionsLoading })}\n onClick={(event) => {\n event.stopPropagation();\n setOpen(true);\n }}\n onFocus={() => {\n setActiveIndex(0);\n setOpen(true);\n }}\n />\n {optionsLoading ? <Spinner className={styles.loadingIndicator} inline={true} /> : null}\n <FloatingPortal>\n {open && (\n <FloatingFocusManager context={context} initialFocus={-1} visuallyHiddenDismiss modal={false}>\n <>\n <div\n style={{\n ...floatingStyles,\n width: `${optionsError ? ERROR_STATE_DROPDOWN_WIDTH : maxOptionWidth}px`,\n transform: isMultiValueEdit\n ? `translate(${multiValuePillWrapperRef.current?.getBoundingClientRect().left || 0}px, ${\n (refs.domReference.current?.getBoundingClientRect().bottom || 0) + 10\n }px )`\n : floatingStyles.transform,\n }}\n ref={refs.setFloating}\n className={styles.dropdownWrapper}\n tabIndex={-1}\n >\n <div\n style={{\n height: `${rowVirtualizer.getTotalSize() || VIRTUAL_LIST_ITEM_HEIGHT}px`, // fallback to 38px for loading/error/no options placeholders\n }}\n {...getFloatingProps()}\n tabIndex={-1}\n >\n {optionsLoading ? (\n <LoadingOptionsPlaceholder />\n ) : optionsError ? (\n <OptionsErrorPlaceholder handleFetchOptions={() => handleFetchOptions(filterInputType)} />\n ) : !filteredDropDownItems.length && (filterInputType === 'operator' || !inputValue) ? (\n <NoOptionsPlaceholder />\n ) : (\n rowVirtualizer.getVirtualItems().map((virtualItem) => {\n const item = filteredDropDownItems[virtualItem.index];\n const index = virtualItem.index;\n\n // render group label\n if (item.options) {\n return (\n <div\n key={`${item.label}+${index}`}\n className={cx(styles.optionGroupLabel, styles.groupTopBorder)}\n style={{\n height: `${virtualItem.size}px`,\n transform: `translateY(${virtualItem.start}px)`,\n }}\n >\n <Text weight=\"bold\" variant=\"bodySmall\" color=\"secondary\">\n {item.label!}\n </Text>\n </div>\n );\n }\n\n const nextItem: SelectableValue<string> | undefined =\n filteredDropDownItems[virtualItem.index + 1];\n const shouldAddBottomBorder = nextItem && !nextItem.group && !nextItem.options && item.group;\n\n return (\n // key is included in getItemProps()\n // eslint-disable-next-line react/jsx-key\n <DropdownItem\n {...getItemProps({\n key: `${item.value!}-${index}`,\n ref(node) {\n listRef.current[index] = node;\n },\n onClick(event) {\n if (filterInputType !== 'value') {\n event.stopPropagation();\n }\n if (isMultiValueEdit) {\n event.preventDefault();\n event.stopPropagation();\n handleLocalMultiValueChange(item);\n refs.domReference.current?.focus();\n } else {\n model._updateFilter(\n filter!,\n generateFilterUpdatePayload({\n filterInputType,\n item,\n filter: filter!,\n setFilterMultiValues,\n })\n );\n setInputValue('');\n\n switchToNextInputType(\n filterInputType,\n setInputType,\n handleChangeViewMode,\n refs.domReference.current,\n // explicitly preventing focus on filter pill due to a11y error\n false\n );\n }\n },\n })}\n active={activeIndex === index}\n addGroupBottomBorder={shouldAddBottomBorder}\n // virtual item positioning and accessibility\n style={{\n height: `${virtualItem.size}px`,\n transform: `translateY(${virtualItem.start}px)`,\n }}\n aria-setsize={filteredDropDownItems.length}\n aria-posinset={virtualItem.index + 1}\n isMultiValueEdit={isMultiValueEdit}\n checked={filterMultiValues.some((val) => val.value === item.value)}\n >\n <span>\n {item.isCustom ? 'Use custom value: ' : ''} {item.label ?? item.value}\n </span>\n {item.description ? <div className={styles.descriptionText}>{item.description}</div> : null}\n </DropdownItem>\n );\n })\n )}\n </div>\n </div>\n {isMultiValueEdit && !optionsLoading && !optionsError && filteredDropDownItems.length ? (\n <MultiValueApplyButton\n onApply={() => {\n handleMultiValueFilterCommit(model, filter!, filterMultiValues);\n }}\n floatingElement={refs.floating.current}\n maxOptionWidth={maxOptionWidth}\n menuHeight={Math.min(rowVirtualizer.getTotalSize(), MAX_MENU_HEIGHT)}\n />\n ) : null}\n </>\n </FloatingFocusManager>\n )}\n </FloatingPortal>\n </div>\n );\n});\n\ninterface MultiValuePillProps {\n item: SelectableValue<string>;\n handleRemoveMultiValue: (item: SelectableValue<string>) => void;\n index: number;\n}\nconst MultiValuePill = ({ item, handleRemoveMultiValue, index }: MultiValuePillProps) => {\n const styles = useStyles2(getStyles);\n\n return (\n <div className={cx(styles.basePill, styles.valuePill)}>\n <span> {item.label ?? item.value}</span>\n <Button\n onClick={(e) => {\n e.stopPropagation();\n e.preventDefault();\n handleRemoveMultiValue(item);\n }}\n onKeyDownCapture={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n handleRemoveMultiValue(item);\n }\n }}\n fill=\"text\"\n size=\"sm\"\n variant=\"secondary\"\n className={styles.removeButton}\n tooltip={`Remove filter value - ${item.label ?? item.value}`}\n >\n <Icon name=\"times\" size=\"md\" id={`${item.value}-${index}`} />\n </Button>\n </div>\n );\n};\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n comboboxWrapper: css({\n display: 'flex',\n flexWrap: 'wrap',\n }),\n pillWrapper: css({\n display: 'flex',\n alignItems: 'center',\n flexWrap: 'wrap',\n }),\n basePill: css({\n display: 'flex',\n alignItems: 'center',\n background: theme.colors.action.disabledBackground,\n border: `1px solid ${theme.colors.border.weak}`,\n padding: theme.spacing(0.125, 1, 0.125, 1),\n color: theme.colors.text.primary,\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n minHeight: theme.spacing(2.75),\n ...theme.typography.bodySmall,\n cursor: 'pointer',\n }),\n keyPill: css({\n fontWeight: theme.typography.fontWeightBold,\n cursor: 'default',\n }),\n operatorPill: css({\n '&:hover': {\n background: theme.colors.action.hover,\n },\n }),\n valuePill: css({\n background: theme.colors.action.selected,\n padding: theme.spacing(0.125, 0, 0.125, 1),\n }),\n dropdownWrapper: css({\n backgroundColor: theme.colors.background.primary,\n color: theme.colors.text.primary,\n boxShadow: theme.shadows.z2,\n overflowY: 'auto',\n zIndex: theme.zIndex.dropdown,\n }),\n inputStyle: css({\n paddingBlock: 0,\n '&:focus': {\n outline: 'none',\n },\n }),\n loadingIndicator: css({\n color: theme.colors.text.secondary,\n marginLeft: theme.spacing(0.5),\n }),\n loadingInputPadding: css({\n paddingRight: theme.spacing(2.5),\n }),\n optionGroupLabel: css({\n padding: theme.spacing(1),\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n }),\n groupTopBorder: css({\n '&:not(:first-child)': {\n borderTop: `1px solid ${theme.colors.border.weak}`,\n },\n }),\n removeButton: css({\n marginInline: theme.spacing(0.5),\n height: '100%',\n padding: 0,\n cursor: 'pointer',\n '&:hover': {\n color: theme.colors.text.primary,\n },\n }),\n descriptionText: css({\n ...theme.typography.bodySmall,\n color: theme.colors.text.secondary,\n paddingTop: theme.spacing(0.5),\n }),\n multiValueApply: css({\n position: 'absolute',\n top: 0,\n left: 0,\n display: 'flex',\n }),\n});\n"],"names":["AdHocCombobox","model","filter","filterMultiValues","_a","_","options","_b"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDa,MAAA,aAAA,GAAgB,UAAW,CAAA,SAASA,cAC/C,CAAA,EAAE,MAAQ,EAAA,KAAA,EAAO,WAAa,EAAA,oBAAA,EAAsB,kBAAmB,EAAA,EACvE,SACA,EAAA;AArDF,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAsDE,EAAA,MAAM,CAAC,IAAA,EAAM,OAAO,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AACtC,EAAA,MAAM,CAAC,OAAS,EAAA,UAAU,CAAI,GAAA,QAAA,CAAyC,EAAE,CAAA,CAAA;AACzE,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAkB,KAAK,CAAA,CAAA;AACnE,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAkB,KAAK,CAAA,CAAA;AAC/D,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,EAAE,CAAA,CAAA;AAC/C,EAAA,MAAM,CAAC,WAAA,EAAa,cAAc,CAAA,GAAI,SAAwB,IAAI,CAAA,CAAA;AAClE,EAAM,MAAA,CAAC,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AA,MAAA,CAAO,IAAK,CAAA,OAAA;AAAA,KAC3B;AAAA,GACD,CAAA;AAAA,EACD,eAAiB,EAAA,GAAA,CAAI,aAChB,CAAA,cAAA,CAAA,EAAA,EAAA,KAAA,CAAM,WAAW,SADD,CAAA,EAAA;AAAA,IAEnB,KAAA,EAAO,KAAM,CAAA,MAAA,CAAO,IAAK,CAAA,SAAA;AAAA,IACzB,UAAA,EAAY,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,GAC9B,CAAA,CAAA;AAAA,EACD,iBAAiB,GAAI,CAAA;AAAA,IACnB,QAAU,EAAA,UAAA;AAAA,IACV,GAAK,EAAA,CAAA;AAAA,IACL,IAAM,EAAA,CAAA;AAAA,IACN,OAAS,EAAA,MAAA;AAAA,GACV,CAAA;AACH,CAAA,CAAA;;;;"}
package/dist/index.d.ts CHANGED
@@ -1782,6 +1782,7 @@ declare class VizPanel<TOptions = {}, TFieldConfig extends {} = {}> extends Scen
1782
1782
  private _structureRev;
1783
1783
  constructor(state: Partial<VizPanelState<TOptions, TFieldConfig>>);
1784
1784
  private _onActivate;
1785
+ forceRender(): void;
1785
1786
  private _loadPlugin;
1786
1787
  getLegacyPanelId(): number;
1787
1788
  private _pluginLoaded;