@ansible/ansible-ui-framework 2.4.262 → 2.4.265

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,8 +1,10 @@
1
1
  import { SelectProps } from '@patternfly/react-core';
2
- import React from 'react';
2
+ import { ReactNode } from 'react';
3
3
  import { PageFormGroupProps } from './PageFormGroup';
4
- export type FormGroupSelectProps = Pick<SelectProps, 'footer' | 'isCreatable' | 'isGrouped' | 'onSelect' | 'placeholderText' | 'value' | 'isDisabled'> & PageFormGroupProps & {
4
+ export type FormGroupSelectProps = Pick<SelectProps, 'footer' | 'isCreatable' | 'isGrouped' | 'onSelect' | 'placeholderText' | 'isDisabled'> & PageFormGroupProps & {
5
+ value?: string;
5
6
  isReadOnly?: boolean;
6
- placeholderText: string | React.ReactNode;
7
+ placeholderText: string | ReactNode;
8
+ selectedIcon?: ReactNode;
7
9
  };
8
10
  export declare function FormGroupSelect(props: FormGroupSelectProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ export declare function PageSingleSelect(props: {
3
+ id?: string;
4
+ children: ReactNode;
5
+ value: string;
6
+ onChange: (value: string) => void;
7
+ placeholder?: string;
8
+ icon?: ReactNode;
9
+ }): import("react/jsx-runtime").JSX.Element;
@@ -4,7 +4,7 @@ import { PageTableViewType } from './PageTableViewType';
4
4
  import './PageToolbar.css';
5
5
  import { IToolbarFilter } from './PageToolbarFilter';
6
6
  import { PageTableSortOption } from './PageToolbarSort';
7
- export type PagetableToolbarProps<T extends object> = {
7
+ export type PageTableToolbarProps<T extends object> = {
8
8
  openColumnModal?: () => void;
9
9
  keyFn: (item: T) => string | number;
10
10
  itemCount?: number;
@@ -39,4 +39,4 @@ export type PagetableToolbarProps<T extends object> = {
39
39
  bottomBorder?: boolean;
40
40
  sortOptions?: PageTableSortOption[];
41
41
  };
42
- export declare function PageTableToolbar<T extends object>(props: PagetableToolbarProps<T>): import("react/jsx-runtime").JSX.Element;
42
+ export declare function PageTableToolbar<T extends object>(props: PageTableToolbarProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -1,12 +1,18 @@
1
1
  import { Dispatch, SetStateAction } from 'react';
2
+ import { IToolbarDateRangeFilter } from './PageToolbarFilterTypes/ToolbarDateRangeFilter';
3
+ import { IToolbarMultiSelectFilter, IToolbarSingleSelectFilter } from './PageToolbarFilterTypes/ToolbarSelectFilter';
2
4
  import { IToolbarTextFilter } from './PageToolbarFilterTypes/ToolbarTextFilter';
3
- import { IToolbarSelectFilter } from './PageToolbarFilterTypes/ToolbarSelectFilter';
4
- import { IToolbarDateFilter } from './PageToolbarFilterTypes/ToolbarDateFilter';
5
- export type IToolbarFilter = IToolbarTextFilter | IToolbarSelectFilter | IToolbarDateFilter;
6
- export type IFilterState = Record<string, string[] | undefined>;
5
+ export declare enum ToolbarFilterType {
6
+ Text = "text",
7
+ SingleSelect = "singleselect",
8
+ MultiSelect = "multiselect",
9
+ DateRange = "daterange"
10
+ }
11
+ export type IToolbarFilter = IToolbarTextFilter | IToolbarSingleSelectFilter | IToolbarMultiSelectFilter | IToolbarDateRangeFilter;
12
+ export type IFilterState = Record<string, string[]>;
7
13
  export type PageToolbarFiltersProps = {
8
14
  toolbarFilters?: IToolbarFilter[];
9
- filters?: Record<string, string[]>;
10
- setFilters?: Dispatch<SetStateAction<Record<string, string[]>>>;
15
+ filterState: IFilterState;
16
+ setFilterState?: Dispatch<SetStateAction<IFilterState>>;
11
17
  };
12
18
  export declare function PageToolbarFilters(props: PageToolbarFiltersProps): import("react/jsx-runtime").JSX.Element;
@@ -1,8 +1,4 @@
1
1
  import { SelectOptionObject } from '@patternfly/react-core';
2
- import { ToolbarFilterCommon } from './ToolbarFilterCommon';
3
- export interface IToolbarDateFilter extends ToolbarFilterCommon {
4
- type: 'date';
5
- }
6
2
  type AttributeType = string | string[] | SelectOptionObject | SelectOptionObject[] | boolean;
7
3
  export declare function ToolbarDateFilter(props: {
8
4
  endDate: string;
@@ -0,0 +1,33 @@
1
+ import { ToolbarFilterType } from '../PageToolbarFilter';
2
+ import { ToolbarFilterCommon } from './ToolbarFilterCommon';
3
+ export interface IToolbarDateRangeFilter extends ToolbarFilterCommon {
4
+ type: ToolbarFilterType.DateRange;
5
+ options: IToolbarDateFilterOption[];
6
+ isRequired?: boolean;
7
+ defaultValue?: string;
8
+ isPinned?: true;
9
+ }
10
+ interface IToolbarDateFilterOption {
11
+ label: string;
12
+ description?: string;
13
+ value: string;
14
+ isCustom?: boolean;
15
+ }
16
+ export interface IToolbarDateRangeFilterProps {
17
+ id?: string;
18
+ label?: string;
19
+ placeholder?: string;
20
+ values: string[];
21
+ setValues: (values: string[]) => void;
22
+ options: IToolbarDateFilterOption[];
23
+ isRequired?: boolean;
24
+ defaultValue?: string;
25
+ }
26
+ export declare function ToolbarDateRangeFilter(props: IToolbarDateRangeFilterProps): import("react/jsx-runtime").JSX.Element;
27
+ export declare function DateRange(props: {
28
+ to?: string;
29
+ setTo: (value?: string) => void;
30
+ from?: string;
31
+ setFrom: (value?: string) => void;
32
+ }): import("react/jsx-runtime").JSX.Element;
33
+ export {};
@@ -1,18 +1,28 @@
1
1
  import { SelectVariant } from '@patternfly/react-core';
2
+ import { ToolbarFilterType } from '../PageToolbarFilter';
2
3
  import { ToolbarFilterCommon } from './ToolbarFilterCommon';
3
- export interface IToolbarSelectFilterOption {
4
- label: string;
5
- description?: string;
6
- value: string;
4
+ import './ToolbarSelectFilter.css';
5
+ export interface IToolbarSingleSelectFilter extends ToolbarFilterCommon {
6
+ type: ToolbarFilterType.SingleSelect;
7
+ options: IToolbarFilterOption[];
8
+ isRequired?: boolean;
9
+ defaultValue?: string;
10
+ hasSearch?: boolean;
11
+ onSearchTextChange?: (searchText: string) => void;
7
12
  }
8
- export interface IToolbarSelectFilter extends ToolbarFilterCommon {
9
- type: 'select' | 'selectTypeAhead';
10
- options: IToolbarSelectFilterOption[];
13
+ export interface IToolbarMultiSelectFilter extends ToolbarFilterCommon {
14
+ type: ToolbarFilterType.MultiSelect;
15
+ options: IToolbarFilterOption[];
11
16
  hasSearch?: boolean;
12
17
  onSearchTextChange?: (searchText: string) => void;
13
- variant?: SelectVariant;
18
+ }
19
+ export interface IToolbarFilterOption {
20
+ label: string;
21
+ description?: string;
22
+ value: string;
14
23
  }
15
24
  export declare function ToolbarSelectFilter(props: {
25
+ id?: string;
16
26
  addFilter: (value: string) => void;
17
27
  removeFilter: (value: string) => void;
18
28
  options: {
@@ -24,4 +34,8 @@ export declare function ToolbarSelectFilter(props: {
24
34
  hasSearch?: boolean;
25
35
  variant?: SelectVariant;
26
36
  onSearchTextChange?: (text: string) => void;
37
+ label?: string;
38
+ hasClear?: boolean;
39
+ isRequired?: boolean;
40
+ defaultValue?: string;
27
41
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,13 @@
1
+ import { ToolbarFilterType } from '../PageToolbarFilter';
1
2
  import { ToolbarFilterCommon } from './ToolbarFilterCommon';
2
3
  export interface IToolbarTextFilter extends ToolbarFilterCommon {
3
- type: 'string';
4
+ type: ToolbarFilterType.Text;
4
5
  comparison: 'contains' | 'startsWith' | 'endsWith' | 'equals';
5
6
  }
6
- export declare function ToolbarTextFilter(props: {
7
+ export interface IToolbarTextFilterProps {
7
8
  id?: string;
8
9
  addFilter: (value: string) => void;
9
- } & Pick<IToolbarTextFilter, 'comparison' | 'placeholder'>): import("react/jsx-runtime").JSX.Element;
10
+ placeholder?: string;
11
+ comparison: 'contains' | 'startsWith' | 'endsWith' | 'equals';
12
+ }
13
+ export declare function ToolbarTextFilter(props: IToolbarTextFilterProps): import("react/jsx-runtime").JSX.Element;