Export CatalogAutocomplete so it can be used externally

Fixes #28685

Signed-off-by: Anner Visser <anner.visser@alliander.com>
This commit is contained in:
Anner Visser
2025-02-05 13:13:48 +01:00
parent 39f0543e6d
commit 75a3551ceb
4 changed files with 47 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-react': patch
---
Export CatalogAutocomplete so it can be used externally
+35
View File
@@ -6,6 +6,7 @@
/// <reference types="react" />
import { ApiRef } from '@backstage/core-plugin-api';
import { AutocompleteProps } from '@material-ui/lab/Autocomplete';
import { CATALOG_FILTER_EXISTS } from '@backstage/catalog-client';
import { CatalogApi } from '@backstage/catalog-client';
import { ComponentEntity } from '@backstage/catalog-model';
@@ -17,6 +18,7 @@ import { IconComponent } from '@backstage/core-plugin-api';
import { InfoCardVariants } from '@backstage/core-components';
import { LinkProps } from '@backstage/core-components';
import { Observable } from '@backstage/types';
import { OutlinedTextFieldProps } from '@material-ui/core/TextField';
import { Overrides } from '@material-ui/core/styles/overrides';
import { PropsWithChildren } from 'react';
import { default as React_2 } from 'react';
@@ -28,6 +30,7 @@ import { SystemEntity } from '@backstage/catalog-model';
import { TableColumn } from '@backstage/core-components';
import { TableOptions } from '@backstage/core-components';
import { TextFieldProps } from '@material-ui/core/TextField';
import { TypographyProps } from '@material-ui/core/Typography';
// @public (undocumented)
export type AllowedEntityFilters<T extends DefaultEntityFilters> = {
@@ -71,6 +74,38 @@ export { CatalogApi };
// @public
export const catalogApiRef: ApiRef<CatalogApi>;
// @public (undocumented)
export function CatalogAutocomplete<
T,
Multiple extends boolean | undefined = undefined,
DisableClearable extends boolean | undefined = undefined,
FreeSolo extends boolean | undefined = undefined,
>(
props: CatalogAutocompleteProps<T, Multiple, DisableClearable, FreeSolo>,
): React_2.JSX.Element;
// @public
export type CatalogAutocompleteProps<
T,
Multiple extends boolean | undefined = undefined,
DisableClearable extends boolean | undefined = undefined,
FreeSolo extends boolean | undefined = undefined,
> = Omit<
AutocompleteProps<T, Multiple, DisableClearable, FreeSolo>,
'PopperComponent' | 'PaperComponent' | 'popupIcon' | 'renderInput'
> & {
name: string;
label?: string;
LabelProps?: TypographyProps<'label'>;
TextFieldProps?: Omit<OutlinedTextFieldProps, 'variant'>;
renderInput?: AutocompleteProps<
T,
Multiple,
DisableClearable,
FreeSolo
>['renderInput'];
};
// @public (undocumented)
export const CatalogFilterLayout: {
(props: { children: React_2.ReactNode }): React_2.JSX.Element;
@@ -124,6 +124,11 @@ const PaperComponent = (props: PaperProps) => (
<Paper {...props} elevation={8} />
);
/**
* Props for {@link CatalogAutocomplete}
*
* @public
*/
export type CatalogAutocompleteProps<
T,
Multiple extends boolean | undefined = undefined,
@@ -145,6 +150,7 @@ export type CatalogAutocompleteProps<
>['renderInput'];
};
/** @public */
export function CatalogAutocomplete<
T,
Multiple extends boolean | undefined = undefined,
@@ -14,6 +14,7 @@
* limitations under the License.
*/
export * from './CatalogAutocomplete';
export * from './CatalogFilterLayout';
export * from './DefaultFilters';
export * from './EntityKindPicker';