@ansible/ansible-ui-framework 2.4.57 → 2.4.59

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,7 @@ import { IPageAction } from '../PageActions/PageAction';
3
3
  import { PageTableViewType } from './PageTableViewType';
4
4
  import './PageToolbar.css';
5
5
  import { IToolbarFilter } from './PageToolbarFilter';
6
+ import { PageTableSortOption } from './PageToolbarSort';
6
7
  export type PagetableToolbarProps<T extends object> = {
7
8
  openColumnModal?: () => void;
8
9
  keyFn: (item: T) => string | number;
@@ -24,6 +25,10 @@ export type PagetableToolbarProps<T extends object> = {
24
25
  unselectAll?: () => void;
25
26
  onSelect?: (item: T) => void;
26
27
  showSelect?: boolean;
28
+ sort?: string;
29
+ setSort?: (sort: string) => void;
30
+ sortDirection?: 'asc' | 'desc';
31
+ setSortDirection?: (sortDirection: 'asc' | 'desc') => void;
27
32
  viewType: PageTableViewType;
28
33
  setViewType: (viewType: PageTableViewType) => void;
29
34
  disableTableView?: boolean;
@@ -31,5 +36,6 @@ export type PagetableToolbarProps<T extends object> = {
31
36
  disableCardView?: boolean;
32
37
  disableColumnManagement?: boolean;
33
38
  bottomBorder?: boolean;
39
+ sortOptions?: PageTableSortOption[];
34
40
  };
35
41
  export declare function PageTableToolbar<T extends object>(props: PagetableToolbarProps<T>): JSX.Element;
@@ -24,9 +24,9 @@ export interface IToolbarSelectFilter {
24
24
  }
25
25
  export type IToolbarFilter = IToolbarStringFilter | IToolbarSelectFilter;
26
26
  export type IFilterState = Record<string, string[] | undefined>;
27
- export type PageTableToolbarFiltersProps = {
27
+ export type PageToolbarFiltersProps = {
28
28
  toolbarFilters?: IToolbarFilter[];
29
29
  filters?: Record<string, string[]>;
30
30
  setFilters?: Dispatch<SetStateAction<Record<string, string[]>>>;
31
31
  };
32
- export declare function PageTableToolbarFilters(props: PageTableToolbarFiltersProps): JSX.Element;
32
+ export declare function PageToolbarFilters(props: PageToolbarFiltersProps): JSX.Element;
@@ -0,0 +1,16 @@
1
+ /// <reference types="react" />
2
+ import { ITableColumn } from './PageTableColumn';
3
+ export type PageToolbarSortProps = {
4
+ sort?: string;
5
+ setSort?: (sort: string) => void;
6
+ sortDirection?: 'asc' | 'desc';
7
+ setSortDirection?: (sortDirection: 'asc' | 'desc') => void;
8
+ sortOptions?: PageTableSortOption[];
9
+ };
10
+ export interface PageTableSortOption {
11
+ label: string;
12
+ value: string;
13
+ type?: 'text' | 'number' | undefined;
14
+ }
15
+ export declare function PageToolbarSort(props: PageToolbarSortProps): JSX.Element;
16
+ export declare function usePageToolbarSortOptionsFromColumns<T extends object>(tableColumns: ITableColumn<T>[]): PageTableSortOption[];
@@ -0,0 +1,12 @@
1
+ /// <reference types="react" />
2
+ import { PageTableViewType } from './PageTableViewType';
3
+ export type PageToolbarViewProps = {
4
+ disableTableView?: boolean;
5
+ disableCardView?: boolean;
6
+ disableListView?: boolean;
7
+ disableColumnManagement?: boolean;
8
+ openColumnModal?: () => void;
9
+ viewType: PageTableViewType;
10
+ setViewType: (viewType: PageTableViewType) => void;
11
+ };
12
+ export declare function PageToolbarView(props: PageToolbarViewProps): JSX.Element;
@@ -3,6 +3,7 @@ export interface IFrameworkTranslations {
3
3
  by: string;
4
4
  cancelText: string;
5
5
  canceledText: string;
6
+ cardView: string;
6
7
  clearAllFilters: string;
7
8
  clickToRefresh: string;
8
9
  closeText: string;
@@ -10,6 +11,8 @@ export interface IFrameworkTranslations {
10
11
  countMore: string;
11
12
  documentation: string;
12
13
  errorText: string;
14
+ filter: string;
15
+ listView: string;
13
16
  manageColumns: string;
14
17
  moreInformation: string;
15
18
  noItemsFound: string;
@@ -24,9 +27,11 @@ export interface IFrameworkTranslations {
24
27
  selectNone: string;
25
28
  selectedText: string;
26
29
  showLess: string;
30
+ sort: string;
27
31
  submitText: string;
28
32
  submittingText: string;
29
33
  successText: string;
34
+ tableView: string;
30
35
  unknownError: string;
31
36
  validating: string;
32
37
  }