@grafana/scenes 5.23.1--canary.858.11699916776.0 → 5.23.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +18 -6
- package/dist/esm/behaviors/SceneQueryController.js +5 -60
- package/dist/esm/behaviors/SceneQueryController.js.map +1 -1
- package/dist/esm/components/SceneRefreshPicker.js +1 -4
- package/dist/esm/components/SceneRefreshPicker.js.map +1 -1
- package/dist/esm/components/VizPanel/VizPanel.js +6 -9
- package/dist/esm/components/VizPanel/VizPanel.js.map +1 -1
- package/dist/esm/core/SceneTimeRange.js +0 -3
- package/dist/esm/core/SceneTimeRange.js.map +1 -1
- package/dist/esm/core/sceneGraph/index.js +3 -3
- package/dist/esm/core/sceneGraph/index.js.map +1 -1
- package/dist/esm/core/sceneGraph/sceneGraph.js +26 -1
- package/dist/esm/core/sceneGraph/sceneGraph.js.map +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/querying/SceneQueryRunner.js +3 -1
- package/dist/esm/querying/SceneQueryRunner.js.map +1 -1
- package/dist/esm/querying/registerQueryWithController.js +2 -19
- package/dist/esm/querying/registerQueryWithController.js.map +1 -1
- package/dist/esm/utils/getDataSource.js +1 -17
- package/dist/esm/utils/getDataSource.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFilterRenderer.js +8 -12
- package/dist/esm/variables/adhoc/AdHocFilterRenderer.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFilterPill.js +14 -2
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFilterPill.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js +46 -58
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/AdHocFiltersCombobox.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/MultiValuePill.js +114 -0
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/MultiValuePill.js.map +1 -0
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/utils.js +14 -1
- package/dist/esm/variables/adhoc/AdHocFiltersCombobox/utils.js.map +1 -1
- package/dist/esm/variables/adhoc/AdHocFiltersVariableUrlSyncHandler.js +4 -1
- package/dist/esm/variables/adhoc/AdHocFiltersVariableUrlSyncHandler.js.map +1 -1
- package/dist/esm/variables/components/VariableValueSelect.js +0 -5
- package/dist/esm/variables/components/VariableValueSelect.js.map +1 -1
- package/dist/esm/variables/utils.js.map +1 -1
- package/dist/esm/variables/variants/MultiValueVariable.js.map +1 -1
- package/dist/esm/variables/variants/TestVariable.js.map +1 -1
- package/dist/index.d.ts +32 -44
- package/dist/index.js +471 -600
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/esm/behaviors/SceneRenderProfiler.js +0 -169
- package/dist/esm/behaviors/SceneRenderProfiler.js.map +0 -1
- package/dist/esm/core/sceneGraph/getQueryController.js +0 -19
- package/dist/esm/core/sceneGraph/getQueryController.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AdHocFilterRenderer.js","sources":["../../../../src/variables/adhoc/AdHocFilterRenderer.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\n\nimport { AdHocFiltersVariable, AdHocFilterWithLabels, isMultiValueOperator } from './AdHocFiltersVariable';\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { Button, Field, InputActionMeta, Select, useStyles2 } from '@grafana/ui';\nimport { css, cx } from '@emotion/css';\nimport { ControlsLabel } from '../../utils/ControlsLabel';\nimport { getAdhocOptionSearcher } from './getAdhocOptionSearcher';\nimport { handleOptionGroups } from '../utils';\nimport { OptionWithCheckbox } from '../components/VariableValueSelect';\n\ninterface Props {\n filter: AdHocFilterWithLabels;\n model: AdHocFiltersVariable;\n}\n\nfunction keyLabelToOption(key: string, label?: string): SelectableValue | null {\n return key !== ''\n ? {\n value: key,\n label: label || key,\n }\n : null;\n}\n\nconst filterNoOp = () => true;\n\nexport function AdHocFilterRenderer({ filter, model }: Props) {\n const styles = useStyles2(getStyles);\n\n const [keys, setKeys] = useState<SelectableValue[]>([]);\n const [values, setValues] = useState<SelectableValue[]>([]);\n const [isKeysLoading, setIsKeysLoading] = useState(false);\n const [isValuesLoading, setIsValuesLoading] = useState(false);\n const [isKeysOpen, setIsKeysOpen] = useState(false);\n const [isValuesOpen, setIsValuesOpen] = useState(false);\n const [isOperatorOpen, setIsOperatorOpen] = useState(false);\n const [valueInputValue, setValueInputValue] = useState('');\n const [valueHasCustomValue, setValueHasCustomValue] = useState(false);\n // To not trigger queries on every selection we store this state locally here and only update the variable onBlur\n // TODO remove expect-error when we're on the latest version of @grafana/data\n const [uncommittedValue, setUncommittedValue] = useState<SelectableValue>(\n // @ts-expect-error\n filter.values ? filter.values.map((value, index) => keyLabelToOption(value, filter.valueLabels?.[index])) : []\n );\n const isMultiValue = isMultiValueOperator(filter.operator);\n\n const keyValue = keyLabelToOption(filter.key, filter.keyLabel);\n const valueValue = keyLabelToOption(filter.value, filter.valueLabels?.[0]);\n\n const optionSearcher = useMemo(() => getAdhocOptionSearcher(values), [values]);\n\n const onValueInputChange = (value: string, { action }: InputActionMeta) => {\n if (action === 'input-change') {\n setValueInputValue(value);\n }\n return value;\n };\n\n const onOperatorChange = (v: SelectableValue) => {\n const existingOperator = filter.operator;\n const newOperator = v.value;\n\n const update: Partial<AdHocFilterWithLabels> = { operator: newOperator };\n // clear value if operator has changed from multi to single\n if (isMultiValueOperator(existingOperator) && !isMultiValueOperator(newOperator)) {\n update.value = '';\n update.valueLabels = [''];\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n update.values = undefined;\n setUncommittedValue([]);\n // set values if operator has changed from single to multi\n } else if (!isMultiValueOperator(existingOperator) && isMultiValueOperator(newOperator) && filter.value) {\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n update.values = [filter.value];\n setUncommittedValue([\n {\n value: filter.value,\n label: filter.valueLabels?.[0] ?? filter.value,\n },\n ]);\n }\n model._updateFilter(filter, update);\n };\n\n const filteredValueOptions = useMemo(\n () => handleOptionGroups(optionSearcher(valueInputValue)),\n [optionSearcher, valueInputValue]\n );\n\n const multiValueProps = {\n isMulti: true,\n value: uncommittedValue,\n components: {\n Option: OptionWithCheckbox,\n },\n hideSelectedOptions: false,\n closeMenuOnSelect: false,\n openMenuOnFocus: false,\n onChange: (v: SelectableValue) => {\n setUncommittedValue(v);\n // clear input value when creating a new custom multi value\n if (v.some((value: SelectableValue) => value.__isNew__)) {\n setValueInputValue('');\n }\n },\n onBlur: () => {\n model._updateFilter(filter, {\n value: uncommittedValue[0]?.value ?? '',\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n values: uncommittedValue.map((option: SelectableValue<string>) => option.value),\n valueLabels: uncommittedValue.map((option: SelectableValue<string>) => option.label),\n });\n },\n };\n\n const valueSelect = (\n <Select\n virtualized\n allowCustomValue\n isValidNewOption={(inputValue) => inputValue.trim().length > 0}\n allowCreateWhileLoading\n formatCreateLabel={(inputValue) => `Use custom value: ${inputValue}`}\n disabled={model.state.readOnly}\n className={cx(styles.value, isValuesOpen ? styles.widthWhenOpen : undefined)}\n width=\"auto\"\n value={valueValue}\n filterOption={filterNoOp}\n placeholder={'Select value'}\n options={filteredValueOptions}\n inputValue={valueInputValue}\n onInputChange={onValueInputChange}\n onChange={(v) => {\n model._updateFilter(filter, {\n value: v.value,\n valueLabels: v.label ? [v.label] : [v.value],\n });\n\n if (valueHasCustomValue !== v.__isNew__) {\n setValueHasCustomValue(v.__isNew__);\n }\n }}\n // there's a bug in react-select where the menu doesn't recalculate its position when the options are loaded asynchronously\n // see https://github.com/grafana/grafana/issues/63558\n // instead, we explicitly control the menu visibility and prevent showing it until the options have fully loaded\n isOpen={isValuesOpen && !isValuesLoading}\n isLoading={isValuesLoading}\n openMenuOnFocus={true}\n onOpenMenu={async () => {\n setIsValuesLoading(true);\n setIsValuesOpen(true);\n const values = await model._getValuesFor(filter);\n setIsValuesLoading(false);\n setValues(values);\n if (valueHasCustomValue) {\n setValueInputValue(valueValue?.label ?? '');\n }\n }}\n onCloseMenu={() => {\n setIsValuesOpen(false);\n setValueInputValue('');\n }}\n {...(isMultiValue && multiValueProps)}\n />\n );\n\n const keySelect = (\n <Select\n // By changing the key, we reset the Select component,\n // to ensure that the loaded values are shown after they are loaded\n key={`${isValuesLoading ? 'loading' : 'loaded'}`}\n disabled={model.state.readOnly}\n className={cx(styles.key, isKeysOpen ? styles.widthWhenOpen : undefined)}\n width=\"auto\"\n allowCustomValue={true}\n value={keyValue}\n placeholder={'Select label'}\n options={handleOptionGroups(keys)}\n onChange={(v) => {\n model._updateFilter(filter, {\n key: v.value,\n keyLabel: v.label,\n // clear value if key has changed\n value: '',\n valueLabels: [''],\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n values: undefined,\n });\n setUncommittedValue([]);\n }}\n autoFocus={filter.key === ''}\n // there's a bug in react-select where the menu doesn't recalculate its position when the options are loaded asynchronously\n // see https://github.com/grafana/grafana/issues/63558\n // instead, we explicitly control the menu visibility and prevent showing it until the options have fully loaded\n isOpen={isKeysOpen && !isKeysLoading}\n isLoading={isKeysLoading}\n onOpenMenu={async () => {\n setIsKeysOpen(true);\n setIsKeysLoading(true);\n const keys = await model._getKeys(filter.key);\n setIsKeysLoading(false);\n setKeys(keys);\n }}\n onCloseMenu={() => {\n setIsKeysOpen(false);\n }}\n onBlur={() => {\n if (filter.key === '') {\n model._removeFilter(filter);\n }\n }}\n openMenuOnFocus={true}\n />\n );\n\n const operatorSelect = (\n <Select\n className={cx(styles.operator, {\n [styles.widthWhenOpen]: isOperatorOpen,\n })}\n value={filter.operator}\n disabled={model.state.readOnly}\n options={model._getOperators()}\n onChange={onOperatorChange}\n onOpenMenu={() => {\n setIsOperatorOpen(true);\n }}\n onCloseMenu={() => {\n setIsOperatorOpen(false);\n }}\n />\n );\n\n if (model.state.layout === 'vertical') {\n if (filter.key) {\n const label = (\n <ControlsLabel layout=\"vertical\" label={filter.key ?? ''} onRemove={() => model._removeFilter(filter)} />\n );\n\n return (\n <Field label={label} data-testid={`AdHocFilter-${filter.key}`} className={styles.field}>\n <div className={styles.wrapper}>\n {operatorSelect}\n {valueSelect}\n </div>\n </Field>\n );\n } else {\n return (\n <Field label={'Select label'} data-testid={`AdHocFilter-${filter.key}`} className={styles.field}>\n {keySelect}\n </Field>\n );\n }\n }\n\n return (\n <div className={styles.wrapper} data-testid={`AdHocFilter-${filter.key}`}>\n {keySelect}\n {operatorSelect}\n {valueSelect}\n <Button\n variant=\"secondary\"\n aria-label=\"Remove filter\"\n title=\"Remove filter\"\n className={styles.removeButton}\n icon=\"times\"\n data-testid={`AdHocFilter-remove-${filter.key ?? ''}`}\n onClick={() => model._removeFilter(filter)}\n />\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n field: css({\n marginBottom: 0,\n }),\n wrapper: css({\n display: 'flex',\n '> *': {\n '&:not(:first-child)': {\n // Negative margin hides the double-border on adjacent selects\n marginLeft: -1,\n },\n\n '&:first-child': {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n\n '&:last-child': {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n\n '&:not(:first-child):not(:last-child)': {\n borderRadius: 0,\n },\n\n // Fix focus state zIndex issues\n position: 'relative',\n zIndex: 0,\n\n // Adjacent borders are overlapping, so raise children up when hovering etc\n // so all that child's borders are visible.\n '&:hover': {\n zIndex: 1,\n },\n\n '&:focus-within': {\n zIndex: 2,\n },\n },\n }),\n widthWhenOpen: css({\n minWidth: theme.spacing(16),\n }),\n value: css({\n flexBasis: 'content',\n flexShrink: 1,\n minWidth: '90px',\n }),\n key: css({\n flexBasis: 'content',\n minWidth: '90px',\n flexShrink: 1,\n }),\n operator: css({\n flexShrink: 0,\n flexBasis: 'content',\n }),\n removeButton: css({\n paddingLeft: theme.spacing(3 / 2),\n paddingRight: theme.spacing(3 / 2),\n borderLeft: 'none',\n width: theme.spacing(3),\n marginRight: theme.spacing(1),\n boxSizing: 'border-box',\n // To not have button background and last select border intersect\n position: 'relative',\n left: '1px',\n }),\n});\n"],"names":["_a","_b","values","keys"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAS,gBAAA,CAAiB,KAAa,KAAwC,EAAA;AAC7E,EAAA,OAAO,QAAQ,EACX,GAAA;AAAA,IACE,KAAO,EAAA,GAAA;AAAA,IACP,OAAO,KAAS,IAAA,GAAA;AAAA,GAElB,GAAA,IAAA,CAAA;AACN,CAAA;AAEA,MAAM,aAAa,MAAM,IAAA,CAAA;AAElB,SAAS,mBAAoB,CAAA,EAAE,MAAQ,EAAA,KAAA,EAAgB,EAAA;AA3B9D,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AA4BE,EAAM,MAAA,MAAA,GAAS,WAAW,SAAS,CAAA,CAAA;AAEnC,EAAA,MAAM,CAAC,IAAM,EAAA,OAAO,CAAI,GAAA,QAAA,CAA4B,EAAE,CAAA,CAAA;AACtD,EAAA,MAAM,CAAC,MAAQ,EAAA,SAAS,CAAI,GAAA,QAAA,CAA4B,EAAE,CAAA,CAAA;AAC1D,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AACxD,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAC5D,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAClD,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AACtD,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAC1D,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GAAI,SAAS,EAAE,CAAA,CAAA;AACzD,EAAA,MAAM,CAAC,mBAAA,EAAqB,sBA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MAAA;AAAA,IACV,UAAY,EAAA,CAAA;AAAA,GACb,CAAA;AAAA,EACD,UAAU,GAAI,CAAA;AAAA,IACZ,UAAY,EAAA,CAAA;AAAA,IACZ,SAAW,EAAA,SAAA;AAAA,GACZ,CAAA;AAAA,EACD,cAAc,GAAI,CAAA;AAAA,IAChB,WAAa,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,GAAI,CAAC,CAAA;AAAA,IAChC,YAAc,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,GAAI,CAAC,CAAA;AAAA,IACjC,UAAY,EAAA,MAAA;AAAA,IACZ,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACtB,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC5B,SAAW,EAAA,YAAA;AAAA,IAEX,QAAU,EAAA,UAAA;AAAA,IACV,IAAM,EAAA,KAAA;AAAA,GACP,CAAA;AACH,CAAA,CAAA;;;;"}
|
1
|
+
{"version":3,"file":"AdHocFilterRenderer.js","sources":["../../../../src/variables/adhoc/AdHocFilterRenderer.tsx"],"sourcesContent":["import React, { useMemo, useState } from 'react';\n\nimport { AdHocFiltersVariable, AdHocFilterWithLabels, isMultiValueOperator } from './AdHocFiltersVariable';\nimport { GrafanaTheme2, SelectableValue } from '@grafana/data';\nimport { Button, Field, InputActionMeta, Select, useStyles2 } from '@grafana/ui';\nimport { css, cx } from '@emotion/css';\nimport { ControlsLabel } from '../../utils/ControlsLabel';\nimport { getAdhocOptionSearcher } from './getAdhocOptionSearcher';\nimport { handleOptionGroups } from '../utils';\nimport { OptionWithCheckbox } from '../components/VariableValueSelect';\n\ninterface Props {\n filter: AdHocFilterWithLabels;\n model: AdHocFiltersVariable;\n}\n\nfunction keyLabelToOption(key: string, label?: string): SelectableValue | null {\n return key !== ''\n ? {\n value: key,\n label: label || key,\n }\n : null;\n}\n\nconst filterNoOp = () => true;\n\nexport function AdHocFilterRenderer({ filter, model }: Props) {\n const styles = useStyles2(getStyles);\n\n const [keys, setKeys] = useState<SelectableValue[]>([]);\n const [values, setValues] = useState<SelectableValue[]>([]);\n const [isKeysLoading, setIsKeysLoading] = useState(false);\n const [isValuesLoading, setIsValuesLoading] = useState(false);\n const [isKeysOpen, setIsKeysOpen] = useState(false);\n const [isValuesOpen, setIsValuesOpen] = useState(false);\n const [isOperatorOpen, setIsOperatorOpen] = useState(false);\n const [valueInputValue, setValueInputValue] = useState('');\n const [valueHasCustomValue, setValueHasCustomValue] = useState(false);\n // To not trigger queries on every selection we store this state locally here and only update the variable onBlur\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n const [uncommittedValue, setUncommittedValue] = useState<SelectableValue>(filter.values ? filter.values.map((value, index) => keyLabelToOption(value, filter.valueLabels?.[index])) : []);\n const isMultiValue = isMultiValueOperator(filter.operator);\n\n const keyValue = keyLabelToOption(filter.key, filter.keyLabel);\n const valueValue = keyLabelToOption(filter.value, filter.valueLabels?.[0]);\n\n const optionSearcher = useMemo(() => getAdhocOptionSearcher(values), [values]);\n\n const onValueInputChange = (value: string, { action }: InputActionMeta) => {\n if (action === 'input-change') {\n setValueInputValue(value);\n }\n return value;\n };\n\n const onOperatorChange = (v: SelectableValue) => {\n const existingOperator = filter.operator;\n const newOperator = v.value;\n\n const update: Partial<AdHocFilterWithLabels> = { operator: newOperator };\n // clear value if operator has changed from multi to single\n if (isMultiValueOperator(existingOperator) && !isMultiValueOperator(newOperator)) {\n update.value = '';\n update.valueLabels = [''];\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n update.values = undefined;\n setUncommittedValue([]);\n // set values if operator has changed from single to multi\n } else if (!isMultiValueOperator(existingOperator) && isMultiValueOperator(newOperator) && filter.value) {\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n update.values = [filter.value];\n setUncommittedValue([{\n value: filter.value,\n label: filter.valueLabels?.[0] ?? filter.value,\n }]);\n }\n model._updateFilter(filter, update);\n }\n\n const filteredValueOptions = useMemo(\n () => handleOptionGroups(optionSearcher(valueInputValue)),\n [optionSearcher, valueInputValue]\n );\n\n const multiValueProps = {\n isMulti: true,\n value: uncommittedValue,\n components: {\n Option: OptionWithCheckbox,\n },\n hideSelectedOptions: false,\n closeMenuOnSelect: false,\n openMenuOnFocus: false,\n onChange: (v: SelectableValue) => {\n setUncommittedValue(v);\n // clear input value when creating a new custom multi value\n if (v.some((value: SelectableValue) => value.__isNew__)) {\n setValueInputValue('');\n }\n },\n onBlur: () => {\n model._updateFilter(filter, {\n value: uncommittedValue[0]?.value ?? '',\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n values: uncommittedValue.map((option: SelectableValue<string>) => option.value),\n valueLabels: uncommittedValue.map((option: SelectableValue<string>) => option.label),\n });\n }\n }\n\n const valueSelect = (\n <Select\n virtualized\n allowCustomValue\n isValidNewOption={(inputValue) => inputValue.trim().length > 0}\n allowCreateWhileLoading\n formatCreateLabel={(inputValue) => `Use custom value: ${inputValue}`}\n disabled={model.state.readOnly}\n className={cx(styles.value, isValuesOpen ? styles.widthWhenOpen : undefined)}\n width=\"auto\"\n value={valueValue}\n filterOption={filterNoOp}\n placeholder={'Select value'}\n options={filteredValueOptions}\n inputValue={valueInputValue}\n onInputChange={onValueInputChange}\n onChange={(v) => {\n model._updateFilter(filter, {\n value: v.value,\n valueLabels: v.label ? [v.label] : [v.value]\n });\n\n if (valueHasCustomValue !== v.__isNew__) {\n setValueHasCustomValue(v.__isNew__);\n }\n }}\n // there's a bug in react-select where the menu doesn't recalculate its position when the options are loaded asynchronously\n // see https://github.com/grafana/grafana/issues/63558\n // instead, we explicitly control the menu visibility and prevent showing it until the options have fully loaded\n isOpen={isValuesOpen && !isValuesLoading}\n isLoading={isValuesLoading}\n openMenuOnFocus={true}\n onOpenMenu={async () => {\n setIsValuesLoading(true);\n setIsValuesOpen(true);\n const values = await model._getValuesFor(filter);\n setIsValuesLoading(false);\n setValues(values);\n if (valueHasCustomValue) {\n setValueInputValue(valueValue?.label ?? '');\n }\n }}\n onCloseMenu={() => {\n setIsValuesOpen(false);\n setValueInputValue('');\n }}\n {...(isMultiValue && multiValueProps)}\n />\n );\n\n const keySelect = (\n <Select\n // By changing the key, we reset the Select component,\n // to ensure that the loaded values are shown after they are loaded\n key={`${isValuesLoading ? 'loading' : 'loaded'}`}\n disabled={model.state.readOnly}\n className={cx(styles.key, isKeysOpen ? styles.widthWhenOpen : undefined)}\n width=\"auto\"\n allowCustomValue={true}\n value={keyValue}\n placeholder={'Select label'}\n options={handleOptionGroups(keys)}\n onChange={(v) => {\n model._updateFilter(filter, {\n key: v.value,\n keyLabel: v.label,\n // clear value if key has changed\n value: '',\n valueLabels: [''],\n // TODO remove expect-error when we're on the latest version of @grafana/data\n // @ts-expect-error\n values: undefined\n })\n setUncommittedValue([]);\n }}\n autoFocus={filter.key === ''}\n // there's a bug in react-select where the menu doesn't recalculate its position when the options are loaded asynchronously\n // see https://github.com/grafana/grafana/issues/63558\n // instead, we explicitly control the menu visibility and prevent showing it until the options have fully loaded\n isOpen={isKeysOpen && !isKeysLoading}\n isLoading={isKeysLoading}\n onOpenMenu={async () => {\n setIsKeysOpen(true);\n setIsKeysLoading(true);\n const keys = await model._getKeys(filter.key);\n setIsKeysLoading(false);\n setKeys(keys);\n }}\n onCloseMenu={() => {\n setIsKeysOpen(false);\n }}\n onBlur={() => {\n if (filter.key === '') {\n model._removeFilter(filter);\n }\n }}\n openMenuOnFocus={true}\n />\n );\n\n const operatorSelect = (\n <Select\n className={cx(styles.operator, {\n [styles.widthWhenOpen]: isOperatorOpen,\n })}\n value={filter.operator}\n disabled={model.state.readOnly}\n options={model._getOperators()}\n onChange={onOperatorChange}\n onOpenMenu={() => {\n setIsOperatorOpen(true)\n }}\n onCloseMenu={() => {\n setIsOperatorOpen(false)\n }}\n />\n );\n\n if (model.state.layout === 'vertical') {\n if (filter.key) {\n const label = (\n <ControlsLabel layout=\"vertical\" label={filter.key ?? ''} onRemove={() => model._removeFilter(filter)} />\n );\n\n return (\n <Field label={label} data-testid={`AdHocFilter-${filter.key}`} className={styles.field}>\n <div className={styles.wrapper}>\n {operatorSelect}\n {valueSelect}\n </div>\n </Field>\n );\n } else {\n return (\n <Field label={'Select label'} data-testid={`AdHocFilter-${filter.key}`} className={styles.field}>\n {keySelect}\n </Field>\n );\n }\n }\n\n return (\n <div className={styles.wrapper} data-testid={`AdHocFilter-${filter.key}`}>\n {keySelect}\n {operatorSelect}\n {valueSelect}\n <Button\n variant=\"secondary\"\n aria-label=\"Remove filter\"\n title=\"Remove filter\"\n className={styles.removeButton}\n icon=\"times\"\n data-testid={`AdHocFilter-remove-${filter.key ?? ''}`}\n onClick={() => model._removeFilter(filter)}\n />\n </div>\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n field: css({\n marginBottom: 0,\n }),\n wrapper: css({\n display: 'flex',\n '> *': {\n '&:not(:first-child)': {\n // Negative margin hides the double-border on adjacent selects\n marginLeft: -1,\n },\n\n '&:first-child': {\n borderTopRightRadius: 0,\n borderBottomRightRadius: 0,\n },\n\n '&:last-child': {\n borderTopLeftRadius: 0,\n borderBottomLeftRadius: 0,\n },\n\n '&:not(:first-child):not(:last-child)': {\n borderRadius: 0,\n },\n\n // Fix focus state zIndex issues\n position: 'relative',\n zIndex: 0,\n\n // Adjacent borders are overlapping, so raise children up when hovering etc\n // so all that child's borders are visible.\n '&:hover': {\n zIndex: 1,\n },\n\n '&:focus-within': {\n zIndex: 2,\n },\n },\n }),\n widthWhenOpen: css({\n minWidth: theme.spacing(16),\n }),\n value: css({\n flexBasis: 'content',\n flexShrink: 1,\n minWidth: '90px',\n }),\n key: css({\n flexBasis: 'content',\n minWidth: '90px',\n flexShrink: 1,\n }),\n operator: css({\n flexShrink: 0,\n flexBasis: 'content',\n }),\n removeButton: css({\n paddingLeft: theme.spacing(3 / 2),\n paddingRight: theme.spacing(3 / 2),\n borderLeft: 'none',\n width: theme.spacing(3),\n marginRight: theme.spacing(1),\n boxSizing: 'border-box',\n // To not have button background and last select border intersect\n position: 'relative',\n left: '1px',\n }),\n});\n"],"names":["_a","_b","values","keys"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAgBA,SAAS,gBAAA,CAAiB,KAAa,KAAwC,EAAA;AAC7E,EAAA,OAAO,QAAQ,EACX,GAAA;AAAA,IACE,KAAO,EAAA,GAAA;AAAA,IACP,OAAO,KAAS,IAAA,GAAA;AAAA,GAElB,GAAA,IAAA,CAAA;AACN,CAAA;AAEA,MAAM,aAAa,MAAM,IAAA,CAAA;AAElB,SAAS,mBAAoB,CAAA,EAAE,MAAQ,EAAA,KAAA,EAAgB,EAAA;AA3B9D,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AA4BE,EAAM,MAAA,MAAA,GAAS,WAAW,SAAS,CAAA,CAAA;AAEnC,EAAA,MAAM,CAAC,IAAM,EAAA,OAAO,CAAI,GAAA,QAAA,CAA4B,EAAE,CAAA,CAAA;AACtD,EAAA,MAAM,CAAC,MAAQ,EAAA,SAAS,CAAI,GAAA,QAAA,CAA4B,EAAE,CAAA,CAAA;AAC1D,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AACxD,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAC5D,EAAA,MAAM,CAAC,UAAA,EAAY,aAAa,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAClD,EAAA,MAAM,CAAC,YAAA,EAAc,eAAe,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AACtD,EAAA,MAAM,CAAC,cAAA,EAAgB,iBAAiB,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAC1D,EAAA,MAAM,CAAC,eAAA,EAAiB,kBAAkB,CAAA,GAAI,SAAS,EAAE,CAAA,CAAA;AACzD,EAAA,MAAM,CAAC,mBAAA,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X,QAAU,EAAA,MAAA;AAAA,IACV,UAAY,EAAA,CAAA;AAAA,GACb,CAAA;AAAA,EACD,UAAU,GAAI,CAAA;AAAA,IACZ,UAAY,EAAA,CAAA;AAAA,IACZ,SAAW,EAAA,SAAA;AAAA,GACZ,CAAA;AAAA,EACD,cAAc,GAAI,CAAA;AAAA,IAChB,WAAa,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,GAAI,CAAC,CAAA;AAAA,IAChC,YAAc,EAAA,KAAA,CAAM,OAAQ,CAAA,CAAA,GAAI,CAAC,CAAA;AAAA,IACjC,UAAY,EAAA,MAAA;AAAA,IACZ,KAAA,EAAO,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IACtB,WAAA,EAAa,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC5B,SAAW,EAAA,YAAA;AAAA,IAEX,QAAU,EAAA,UAAA;AAAA,IACV,IAAM,EAAA,KAAA;AAAA,GACP,CAAA;AACH,CAAA,CAAA;;;;"}
|
@@ -28,6 +28,7 @@ function AdHocFilterPill({ filter, model, readOnly, focusOnWipInputRef }) {
|
|
28
28
|
const [viewMode, setViewMode] = useState(true);
|
29
29
|
const [shouldFocusOnPillWrapper, setShouldFocusOnPillWrapper] = useState(false);
|
30
30
|
const pillWrapperRef = useRef(null);
|
31
|
+
const [populateInputOnEdit, setPopulateInputOnEdit] = useState(false);
|
31
32
|
const keyLabel = (_a = filter.keyLabel) != null ? _a : filter.key;
|
32
33
|
const valueLabel = ((_b = filter.valueLabels) == null ? void 0 : _b.join(", ")) || ((_c = filter.values) == null ? void 0 : _c.join(", ")) || filter.value;
|
33
34
|
const handleChangeViewMode = useCallback(
|
@@ -54,15 +55,25 @@ function AdHocFilterPill({ filter, model, readOnly, focusOnWipInputRef }) {
|
|
54
55
|
model._updateFilter(filter, { forceEdit: void 0 });
|
55
56
|
}
|
56
57
|
}, [filter, model, viewMode]);
|
58
|
+
useEffect(() => {
|
59
|
+
if (viewMode) {
|
60
|
+
setPopulateInputOnEdit((prevValue) => prevValue ? false : prevValue);
|
61
|
+
}
|
62
|
+
}, [viewMode]);
|
57
63
|
if (viewMode) {
|
58
64
|
const pillText = /* @__PURE__ */ React.createElement("span", {
|
59
65
|
className: styles.pillText
|
60
66
|
}, keyLabel, " ", filter.operator, " ", valueLabel);
|
61
67
|
return /* @__PURE__ */ React.createElement("div", {
|
62
68
|
className: cx(styles.combinedFilterPill, { [styles.readOnlyCombinedFilter]: readOnly }),
|
63
|
-
onClick:
|
69
|
+
onClick: (e) => {
|
70
|
+
e.stopPropagation();
|
71
|
+
setPopulateInputOnEdit(true);
|
72
|
+
handleChangeViewMode();
|
73
|
+
},
|
64
74
|
onKeyDown: (e) => {
|
65
75
|
if (e.key === "Enter") {
|
76
|
+
setPopulateInputOnEdit(true);
|
66
77
|
handleChangeViewMode();
|
67
78
|
}
|
68
79
|
},
|
@@ -99,7 +110,8 @@ function AdHocFilterPill({ filter, model, readOnly, focusOnWipInputRef }) {
|
|
99
110
|
filter,
|
100
111
|
model,
|
101
112
|
handleChangeViewMode,
|
102
|
-
focusOnWipInputRef
|
113
|
+
focusOnWipInputRef,
|
114
|
+
populateInputOnEdit
|
103
115
|
});
|
104
116
|
}
|
105
117
|
const getStyles = (theme) => ({
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AdHocFilterPill.js","sources":["../../../../../src/variables/adhoc/AdHocFiltersCombobox/AdHocFilterPill.tsx"],"sourcesContent":["import { css, cx } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2, IconButton, Tooltip } from '@grafana/ui';\nimport React, { useState, useRef, useCallback, useEffect } from 'react';\nimport { AdHocCombobox } from './AdHocFiltersCombobox';\nimport { AdHocFilterWithLabels, AdHocFiltersVariable } from '../AdHocFiltersVariable';\n\ninterface Props {\n filter: AdHocFilterWithLabels;\n model: AdHocFiltersVariable;\n readOnly?: boolean;\n focusOnWipInputRef?: () => void;\n}\n\nexport function AdHocFilterPill({ filter, model, readOnly, focusOnWipInputRef }: Props) {\n const styles = useStyles2(getStyles);\n const [viewMode, setViewMode] = useState(true);\n const [shouldFocusOnPillWrapper, setShouldFocusOnPillWrapper] = useState(false);\n const pillWrapperRef = useRef<HTMLDivElement>(null);\n\n const keyLabel = filter.keyLabel ?? filter.key;\n // TODO remove when we're on the latest version of @grafana/data\n //@ts-expect-error\n const valueLabel = filter.valueLabels?.join(', ') || filter.values?.join(', ') || filter.value;\n\n const handleChangeViewMode = useCallback(\n (event?: React.MouseEvent, shouldFocusOnPillWrapperOverride?: boolean) => {\n event?.stopPropagation();\n if (readOnly) {\n return;\n }\n\n setShouldFocusOnPillWrapper(shouldFocusOnPillWrapperOverride ?? !viewMode);\n setViewMode(!viewMode);\n },\n [readOnly, viewMode]\n );\n\n useEffect(() => {\n if (shouldFocusOnPillWrapper) {\n pillWrapperRef.current?.focus();\n setShouldFocusOnPillWrapper(false);\n }\n }, [shouldFocusOnPillWrapper]);\n\n // set viewMode to false when filter.forceEdit is defined\n useEffect(() => {\n if (filter.forceEdit && viewMode) {\n setViewMode(false);\n // immediately set forceEdit back to undefined as a clean up\n model._updateFilter(filter, { forceEdit: undefined });\n }\n }, [filter, model, viewMode]);\n\n if (viewMode) {\n const pillText = (\n <span className={styles.pillText}>\n {keyLabel} {filter.operator} {valueLabel}\n </span>\n );\n return (\n <div\n className={cx(styles.combinedFilterPill, { [styles.readOnlyCombinedFilter]: readOnly })}\n onClick={handleChangeViewMode}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n handleChangeViewMode();\n }\n }}\n role=\"button\"\n aria-label={`Edit filter with key ${keyLabel}`}\n tabIndex={0}\n ref={pillWrapperRef}\n >\n {valueLabel.length < 20 ? (\n pillText\n ) : (\n <Tooltip content={<div className={styles.tooltipText}>{valueLabel}</div>} placement=\"top\">\n {pillText}\n </Tooltip>\n )}\n\n {!readOnly ? (\n <IconButton\n onClick={(e) => {\n e.stopPropagation();\n model._removeFilter(filter);\n setTimeout(() => focusOnWipInputRef?.());\n }}\n onKeyDownCapture={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n model._removeFilter(filter);\n setTimeout(() => focusOnWipInputRef?.());\n }\n }}\n name=\"times\"\n size=\"md\"\n className={styles.removeButton}\n tooltip={`Remove filter with key ${keyLabel}`}\n />\n ) : null}\n </div>\n );\n }\n\n return (\n <AdHocCombobox\n filter={filter}\n model={model}\n handleChangeViewMode={handleChangeViewMode}\n focusOnWipInputRef={focusOnWipInputRef}\n />\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n combinedFilterPill: css({\n display: 'flex',\n alignItems: 'center',\n background: theme.colors.action.selected,\n borderRadius: theme.shape.radius.default,\n border: `1px solid ${theme.colors.border.weak}`,\n padding: theme.spacing(0.125, 0, 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 fontWeight: theme.typography.fontWeightBold,\n cursor: 'pointer',\n\n '&:hover': {\n background: theme.colors.action.hover,\n },\n }),\n readOnlyCombinedFilter: css({\n paddingRight: theme.spacing(1),\n cursor: 'text',\n '&:hover': {\n background: theme.colors.action.selected,\n },\n }),\n removeButton: css({\n marginInline: theme.spacing(0.5),\n cursor: 'pointer',\n '&:hover': {\n color: theme.colors.text.primary,\n },\n }),\n pillText: css({\n maxWidth: '200px',\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n }),\n tooltipText: css({\n textAlign: 'center',\n }),\n});\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAcO,SAAS,gBAAgB,EAAE,MAAA,EAAQ,KAAO,EAAA,QAAA,EAAU,oBAA6B,EAAA;AAdxF,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAeE,EAAM,MAAA,MAAA,GAAS,WAAW,SAAS,CAAA,CAAA;AACnC,EAAA,MAAM,CAAC,Q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B,MAAQ,EAAA,SAAA;AAAA,IACR,SAAW,EAAA;AAAA,MACT,KAAA,EAAO,KAAM,CAAA,MAAA,CAAO,IAAK,CAAA,OAAA;AAAA,KAC3B;AAAA,GACD,CAAA;AAAA,EACD,UAAU,GAAI,CAAA;AAAA,IACZ,QAAU,EAAA,OAAA;AAAA,IACV,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA,UAAA;AAAA,IACd,QAAU,EAAA,QAAA;AAAA,GACX,CAAA;AAAA,EACD,aAAa,GAAI,CAAA;AAAA,IACf,SAAW,EAAA,QAAA;AAAA,GACZ,CAAA;AACH,CAAA,CAAA;;;;"}
|
1
|
+
{"version":3,"file":"AdHocFilterPill.js","sources":["../../../../../src/variables/adhoc/AdHocFiltersCombobox/AdHocFilterPill.tsx"],"sourcesContent":["import { css, cx } from '@emotion/css';\nimport { GrafanaTheme2 } from '@grafana/data';\nimport { useStyles2, IconButton, Tooltip } from '@grafana/ui';\nimport React, { useState, useRef, useCallback, useEffect } from 'react';\nimport { AdHocCombobox } from './AdHocFiltersCombobox';\nimport { AdHocFilterWithLabels, AdHocFiltersVariable } from '../AdHocFiltersVariable';\n\ninterface Props {\n filter: AdHocFilterWithLabels;\n model: AdHocFiltersVariable;\n readOnly?: boolean;\n focusOnWipInputRef?: () => void;\n}\n\nexport function AdHocFilterPill({ filter, model, readOnly, focusOnWipInputRef }: Props) {\n const styles = useStyles2(getStyles);\n const [viewMode, setViewMode] = useState(true);\n const [shouldFocusOnPillWrapper, setShouldFocusOnPillWrapper] = useState(false);\n const pillWrapperRef = useRef<HTMLDivElement>(null);\n const [populateInputOnEdit, setPopulateInputOnEdit] = useState(false);\n\n const keyLabel = filter.keyLabel ?? filter.key;\n // TODO remove when we're on the latest version of @grafana/data\n //@ts-expect-error\n const valueLabel = filter.valueLabels?.join(', ') || filter.values?.join(', ') || filter.value;\n\n const handleChangeViewMode = useCallback(\n (event?: React.MouseEvent, shouldFocusOnPillWrapperOverride?: boolean) => {\n event?.stopPropagation();\n if (readOnly) {\n return;\n }\n\n setShouldFocusOnPillWrapper(shouldFocusOnPillWrapperOverride ?? !viewMode);\n setViewMode(!viewMode);\n },\n [readOnly, viewMode]\n );\n\n useEffect(() => {\n if (shouldFocusOnPillWrapper) {\n pillWrapperRef.current?.focus();\n setShouldFocusOnPillWrapper(false);\n }\n }, [shouldFocusOnPillWrapper]);\n\n // set viewMode to false when filter.forceEdit is defined\n useEffect(() => {\n if (filter.forceEdit && viewMode) {\n setViewMode(false);\n // immediately set forceEdit back to undefined as a clean up\n model._updateFilter(filter, { forceEdit: undefined });\n }\n }, [filter, model, viewMode]);\n\n // reset populateInputOnEdit when pill goes into view mode\n useEffect(() => {\n if (viewMode) {\n setPopulateInputOnEdit((prevValue) => (prevValue ? false : prevValue));\n }\n }, [viewMode]);\n\n if (viewMode) {\n const pillText = (\n <span className={styles.pillText}>\n {keyLabel} {filter.operator} {valueLabel}\n </span>\n );\n return (\n <div\n className={cx(styles.combinedFilterPill, { [styles.readOnlyCombinedFilter]: readOnly })}\n onClick={(e) => {\n e.stopPropagation();\n setPopulateInputOnEdit(true);\n handleChangeViewMode();\n }}\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n setPopulateInputOnEdit(true);\n handleChangeViewMode();\n }\n }}\n role=\"button\"\n aria-label={`Edit filter with key ${keyLabel}`}\n tabIndex={0}\n ref={pillWrapperRef}\n >\n {valueLabel.length < 20 ? (\n pillText\n ) : (\n <Tooltip content={<div className={styles.tooltipText}>{valueLabel}</div>} placement=\"top\">\n {pillText}\n </Tooltip>\n )}\n\n {!readOnly ? (\n <IconButton\n onClick={(e) => {\n e.stopPropagation();\n model._removeFilter(filter);\n setTimeout(() => focusOnWipInputRef?.());\n }}\n onKeyDownCapture={(e) => {\n if (e.key === 'Enter') {\n e.preventDefault();\n e.stopPropagation();\n model._removeFilter(filter);\n setTimeout(() => focusOnWipInputRef?.());\n }\n }}\n name=\"times\"\n size=\"md\"\n className={styles.removeButton}\n tooltip={`Remove filter with key ${keyLabel}`}\n />\n ) : null}\n </div>\n );\n }\n\n return (\n <AdHocCombobox\n filter={filter}\n model={model}\n handleChangeViewMode={handleChangeViewMode}\n focusOnWipInputRef={focusOnWipInputRef}\n populateInputOnEdit={populateInputOnEdit}\n />\n );\n}\n\nconst getStyles = (theme: GrafanaTheme2) => ({\n combinedFilterPill: css({\n display: 'flex',\n alignItems: 'center',\n background: theme.colors.action.selected,\n borderRadius: theme.shape.radius.default,\n border: `1px solid ${theme.colors.border.weak}`,\n padding: theme.spacing(0.125, 0, 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 fontWeight: theme.typography.fontWeightBold,\n cursor: 'pointer',\n\n '&:hover': {\n background: theme.colors.action.hover,\n },\n }),\n readOnlyCombinedFilter: css({\n paddingRight: theme.spacing(1),\n cursor: 'text',\n '&:hover': {\n background: theme.colors.action.selected,\n },\n }),\n removeButton: css({\n marginInline: theme.spacing(0.5),\n cursor: 'pointer',\n '&:hover': {\n color: theme.colors.text.primary,\n },\n }),\n pillText: css({\n maxWidth: '200px',\n width: '100%',\n textOverflow: 'ellipsis',\n overflow: 'hidden',\n }),\n tooltipText: css({\n textAlign: 'center',\n }),\n});\n"],"names":["_a"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAcO,SAAS,gBAAgB,EAAE,MAAA,EAAQ,KAAO,EAAA,QAAA,EAAU,oBAA6B,EAAA;AAdxF,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAeE,EAAM,MAAA,MAAA,GAAS,WAAW,SAAS,CAAA,CAAA;AACnC,EAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,IAAI,CAAA,CAAA;AAC7C,EAAA,MAAM,CAAC,wBAAA,EAA0B,2BAA2B,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAC9E,EAAM,MAAA,cAAA,GA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wBAAwB,GAAI,CAAA;AAAA,IAC1B,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA;AAAA,IAC7B,MAAQ,EAAA,MAAA;AAAA,IACR,SAAW,EAAA;AAAA,MACT,UAAA,EAAY,KAAM,CAAA,MAAA,CAAO,MAAO,CAAA,QAAA;AAAA,KAClC;AAAA,GACD,CAAA;AAAA,EACD,cAAc,GAAI,CAAA;AAAA,IAChB,YAAA,EAAc,KAAM,CAAA,OAAA,CAAQ,GAAG,CAAA;AAAA,IAC/B,MAAQ,EAAA,SAAA;AAAA,IACR,SAAW,EAAA;AAAA,MACT,KAAA,EAAO,KAAM,CAAA,MAAA,CAAO,IAAK,CAAA,OAAA;AAAA,KAC3B;AAAA,GACD,CAAA;AAAA,EACD,UAAU,GAAI,CAAA;AAAA,IACZ,QAAU,EAAA,OAAA;AAAA,IACV,KAAO,EAAA,MAAA;AAAA,IACP,YAAc,EAAA,UAAA;AAAA,IACd,QAAU,EAAA,QAAA;AAAA,GACX,CAAA;AAAA,EACD,aAAa,GAAI,CAAA;AAAA,IACf,SAAW,EAAA,QAAA;AAAA,GACZ,CAAA;AACH,CAAA,CAAA;;;;"}
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import React, { forwardRef, useState, useRef, useId, useMemo, useCallback, useImperativeHandle, useEffect, useLayoutEffect } from 'react';
|
2
2
|
import { FloatingPortal, FloatingFocusManager } from '@floating-ui/react';
|
3
|
-
import { useStyles2, Spinner, Text
|
3
|
+
import { useStyles2, Spinner, Text } 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';
|
7
7
|
import { LoadingOptionsPlaceholder, OptionsErrorPlaceholder, NoOptionsPlaceholder, DropdownItem, MultiValueApplyButton } from './DropdownItem.js';
|
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';
|
8
|
+
import { fuzzySearchOptions, flattenOptionGroups, setupDropdownAccessibility, VIRTUAL_LIST_ITEM_HEIGHT_WITH_DESCRIPTION, VIRTUAL_LIST_ITEM_HEIGHT, VIRTUAL_LIST_OVERSCAN, generateFilterUpdatePayload, populateInputValueOnInputTypeSwitch, 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';
|
11
12
|
|
12
13
|
var __defProp = Object.defineProperty;
|
13
14
|
var __defProps = Object.defineProperties;
|
@@ -28,7 +29,7 @@ var __spreadValues = (a, b) => {
|
|
28
29
|
return a;
|
29
30
|
};
|
30
31
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
31
|
-
const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwaysWip, handleChangeViewMode, focusOnWipInputRef }, parentRef) {
|
32
|
+
const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwaysWip, handleChangeViewMode, focusOnWipInputRef, populateInputOnEdit }, parentRef) {
|
32
33
|
var _a, _b, _c;
|
33
34
|
const [open, setOpen] = useState(false);
|
34
35
|
const [options, setOptions] = useState([]);
|
@@ -115,7 +116,13 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
115
116
|
]
|
116
117
|
);
|
117
118
|
const outsidePressIdsToIgnore = useMemo(() => {
|
118
|
-
return [
|
119
|
+
return [
|
120
|
+
operatorIdentifier,
|
121
|
+
...filterMultiValues.reduce(
|
122
|
+
(acc, item, i) => [...acc, `${item.value}-${i}`, `${item.value}-${i}-close-icon`],
|
123
|
+
[]
|
124
|
+
)
|
125
|
+
];
|
119
126
|
}, [operatorIdentifier, filterMultiValues]);
|
120
127
|
const { refs, floatingStyles, context, getReferenceProps, getFloatingProps, getItemProps } = useFloatingInteractions({
|
121
128
|
open,
|
@@ -268,6 +275,7 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
268
275
|
const selectedItem = filteredDropDownItems[activeIndex];
|
269
276
|
if (multiValueEdit) {
|
270
277
|
handleLocalMultiValueChange(selectedItem);
|
278
|
+
setInputValue("");
|
271
279
|
} else {
|
272
280
|
model._updateFilter(
|
273
281
|
filter,
|
@@ -278,6 +286,13 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
278
286
|
setFilterMultiValues
|
279
287
|
})
|
280
288
|
);
|
289
|
+
populateInputValueOnInputTypeSwitch({
|
290
|
+
populateInputOnEdit,
|
291
|
+
item: selectedItem,
|
292
|
+
filterInputType,
|
293
|
+
setInputValue,
|
294
|
+
filter
|
295
|
+
});
|
281
296
|
switchToNextInputType(
|
282
297
|
filterInputType,
|
283
298
|
setInputType,
|
@@ -290,7 +305,6 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
290
305
|
focusOnWipInputRef == null ? void 0 : focusOnWipInputRef();
|
291
306
|
}
|
292
307
|
}
|
293
|
-
setInputValue("");
|
294
308
|
}
|
295
309
|
},
|
296
310
|
[
|
@@ -300,12 +314,23 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
300
314
|
model,
|
301
315
|
filter,
|
302
316
|
filterInputType,
|
317
|
+
populateInputOnEdit,
|
303
318
|
handleChangeViewMode,
|
304
319
|
refs.domReference,
|
305
320
|
isLastFilter,
|
306
321
|
focusOnWipInputRef
|
307
322
|
]
|
308
323
|
);
|
324
|
+
const handleEditMultiValuePill = useCallback(
|
325
|
+
(value) => {
|
326
|
+
var _a2;
|
327
|
+
const valueLabel = value.label || value.value;
|
328
|
+
setFilterMultiValues((prev) => prev.filter((item) => item.value !== value.value));
|
329
|
+
setInputValue(valueLabel);
|
330
|
+
(_a2 = refs.domReference.current) == null ? void 0 : _a2.focus();
|
331
|
+
},
|
332
|
+
[refs.domReference]
|
333
|
+
);
|
309
334
|
useEffect(() => {
|
310
335
|
if (open) {
|
311
336
|
handleFetchOptions(filterInputType);
|
@@ -314,8 +339,6 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
314
339
|
useEffect(() => {
|
315
340
|
var _a2, _b2;
|
316
341
|
if (!isAlwaysWip) {
|
317
|
-
setInputType("value");
|
318
|
-
setInputValue("");
|
319
342
|
if (hasMultiValueOperator && ((_a2 = filter == null ? void 0 : filter.values) == null ? void 0 : _a2.length)) {
|
320
343
|
const multiValueOptions = filter.values.reduce(
|
321
344
|
(acc, value, i) => {
|
@@ -332,6 +355,9 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
332
355
|
);
|
333
356
|
setFilterMultiValues(multiValueOptions);
|
334
357
|
}
|
358
|
+
if (!hasMultiValueOperator && populateInputOnEdit) {
|
359
|
+
setInputValue((filter == null ? void 0 : filter.value) || "");
|
360
|
+
}
|
335
361
|
(_b2 = refs.domReference.current) == null ? void 0 : _b2.focus();
|
336
362
|
}
|
337
363
|
}, []);
|
@@ -361,11 +387,13 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
361
387
|
tabIndex: 0,
|
362
388
|
onClick: (event) => {
|
363
389
|
event.stopPropagation();
|
390
|
+
setInputValue("");
|
364
391
|
switchInputType("operator", setInputType, void 0, refs.domReference.current);
|
365
392
|
},
|
366
393
|
onKeyDown: (event) => {
|
367
394
|
handleShiftTabInput(event, hasMultiValueOperator);
|
368
395
|
if (event.key === "Enter") {
|
396
|
+
setInputValue("");
|
369
397
|
switchInputType("operator", setInputType, void 0, refs.domReference.current);
|
370
398
|
}
|
371
399
|
}
|
@@ -375,7 +403,8 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
375
403
|
key: `${item.value}-${i}`,
|
376
404
|
item,
|
377
405
|
index: i,
|
378
|
-
handleRemoveMultiValue
|
406
|
+
handleRemoveMultiValue,
|
407
|
+
handleEditMultiValuePill
|
379
408
|
})) : null) : null, /* @__PURE__ */ React.createElement("input", __spreadProps(__spreadValues({}, getReferenceProps({
|
380
409
|
ref: refs.setReference,
|
381
410
|
onChange,
|
@@ -462,6 +491,7 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
462
491
|
event.preventDefault();
|
463
492
|
event.stopPropagation();
|
464
493
|
handleLocalMultiValueChange(item);
|
494
|
+
setInputValue("");
|
465
495
|
(_a3 = refs.domReference.current) == null ? void 0 : _a3.focus();
|
466
496
|
} else {
|
467
497
|
model._updateFilter(
|
@@ -473,7 +503,13 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
473
503
|
setFilterMultiValues
|
474
504
|
})
|
475
505
|
);
|
476
|
-
|
506
|
+
populateInputValueOnInputTypeSwitch({
|
507
|
+
populateInputOnEdit,
|
508
|
+
item,
|
509
|
+
filterInputType,
|
510
|
+
setInputValue,
|
511
|
+
filter
|
512
|
+
});
|
477
513
|
switchToNextInputType(
|
478
514
|
filterInputType,
|
479
515
|
setInputType,
|
@@ -506,35 +542,6 @@ const AdHocCombobox = forwardRef(function AdHocCombobox2({ filter, model, isAlwa
|
|
506
542
|
menuHeight: Math.min(rowVirtualizer.getTotalSize(), MAX_MENU_HEIGHT)
|
507
543
|
}) : null))));
|
508
544
|
});
|
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
|
-
};
|
538
545
|
const getStyles = (theme) => ({
|
539
546
|
comboboxWrapper: css({
|
540
547
|
display: "flex",
|
@@ -567,10 +574,6 @@ const getStyles = (theme) => ({
|
|
567
574
|
background: theme.colors.action.hover
|
568
575
|
}
|
569
576
|
}),
|
570
|
-
valuePill: css({
|
571
|
-
background: theme.colors.action.selected,
|
572
|
-
padding: theme.spacing(0.125, 0, 0.125, 1)
|
573
|
-
}),
|
574
577
|
dropdownWrapper: css({
|
575
578
|
backgroundColor: theme.colors.background.primary,
|
576
579
|
color: theme.colors.text.primary,
|
@@ -603,25 +606,10 @@ const getStyles = (theme) => ({
|
|
603
606
|
borderTop: `1px solid ${theme.colors.border.weak}`
|
604
607
|
}
|
605
608
|
}),
|
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
|
-
}),
|
615
609
|
descriptionText: css(__spreadProps(__spreadValues({}, theme.typography.bodySmall), {
|
616
610
|
color: theme.colors.text.secondary,
|
617
611
|
paddingTop: theme.spacing(0.5)
|
618
|
-
}))
|
619
|
-
multiValueApply: css({
|
620
|
-
position: "absolute",
|
621
|
-
top: 0,
|
622
|
-
left: 0,
|
623
|
-
display: "flex"
|
624
|
-
})
|
612
|
+
}))
|
625
613
|
});
|
626
614
|
|
627
615
|
export { AdHocCombobox };
|