@ansible/ansible-ui-framework 2.4.323 → 2.4.325

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,9 +4,11 @@ export interface PageAsyncSingleSelectQueryResult<ValueT> {
4
4
  total: number;
5
5
  options: PageSelectOption<ValueT>[];
6
6
  }
7
+ export type PageAsyncSingleSelectOptionsFn<ValueT> = (page: number, signal: AbortSignal) => Promise<PageAsyncSingleSelectQueryResult<ValueT>>;
8
+ export type PageAsyncQueryErrorTextType = string | ((error: Error) => string);
7
9
  export interface PageAsyncSingleSelectProps<ValueT> extends Omit<PageSingleSelectProps<ValueT>, 'options'> {
8
- queryOptions: (page: number, signal: AbortSignal) => Promise<PageAsyncSingleSelectQueryResult<ValueT>>;
10
+ queryOptions: PageAsyncSingleSelectOptionsFn<ValueT>;
9
11
  queryPlaceholder?: string;
10
- queryErrorText?: string | ((error: Error) => string);
12
+ queryErrorText?: PageAsyncQueryErrorTextType;
11
13
  }
12
14
  export declare function PageAsyncSingleSelect<ValueT>(props: PageAsyncSingleSelectProps<ValueT>): import("react/jsx-runtime").JSX.Element;
@@ -1,4 +1,5 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
+ import { IToolbarAsyncSingleSelectFilter } from './PageToolbarFilters/ToolbarAsyncSingleSelectFilter';
2
3
  import { IToolbarDateRangeFilter } from './PageToolbarFilters/ToolbarDateRangeFilter';
3
4
  import { IToolbarMultiSelectFilter } from './PageToolbarFilters/ToolbarMultiSelectFilter';
4
5
  import { IToolbarSingleSelectFilter } from './PageToolbarFilters/ToolbarSingleSelectFilter';
@@ -7,9 +8,10 @@ export declare enum ToolbarFilterType {
7
8
  Text = 0,
8
9
  SingleSelect = 1,
9
10
  MultiSelect = 2,
10
- DateRange = 3
11
+ DateRange = 3,
12
+ AsyncSingleSelect = 4
11
13
  }
12
- export type IToolbarFilter = IToolbarTextFilter | IToolbarDateRangeFilter | IToolbarSingleSelectFilter | IToolbarMultiSelectFilter;
14
+ export type IToolbarFilter = IToolbarTextFilter | IToolbarDateRangeFilter | IToolbarSingleSelectFilter | IToolbarMultiSelectFilter | IToolbarAsyncSingleSelectFilter;
13
15
  export type IFilterState = Record<string, string[] | undefined>;
14
16
  export type PageToolbarFiltersProps = {
15
17
  toolbarFilters?: IToolbarFilter[];
@@ -0,0 +1,11 @@
1
+ import { ToolbarFilterType } from '../PageToolbarFilter';
2
+ import { PageAsyncQueryErrorTextType, PageAsyncSingleSelectOptionsFn } from './../../PageInputs/PageAsyncSingleSelect';
3
+ import { ToolbarFilterCommon } from './ToolbarFilterCommon';
4
+ export interface IToolbarAsyncSingleSelectFilter extends ToolbarFilterCommon {
5
+ type: ToolbarFilterType.AsyncSingleSelect;
6
+ queryOptions: PageAsyncSingleSelectOptionsFn<string>;
7
+ queryPlaceholder?: string;
8
+ queryErrorText?: PageAsyncQueryErrorTextType;
9
+ openBrowse?: (onSelect: (value: string) => void, defaultSelection?: string) => void;
10
+ isRequired?: boolean;
11
+ }