@ansible/ansible-ui-framework 2.4.2585 → 2.4.2587

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,7 +4,7 @@ import { IPageAction } from '../PageActions/PageAction';
4
4
  import { PageTableViewType } from '../PageToolbar/PageTableViewType';
5
5
  import { IFilterState, IToolbarFilter } from '../PageToolbar/PageToolbarFilter';
6
6
  import { ITableColumn } from './PageTableColumn';
7
- export type PageTableProps<T extends object> = {
7
+ export type PageTableCommonProps<T extends object> = {
8
8
  id?: string;
9
9
  keyFn: (item: T) => string | number;
10
10
  itemCount?: number;
@@ -38,15 +38,7 @@ export type PageTableProps<T extends object> = {
38
38
  onSelect?: (item: T) => void;
39
39
  errorStateTitle: string;
40
40
  error?: Error;
41
- emptyStateTitle: string;
42
- emptyStateDescription?: string | null;
43
- emptyStateIcon?: React.ComponentClass;
44
- emptyStateNoDataIcon?: React.ComponentClass;
45
- emptyStateActions?: IPageAction<T>[];
46
- emptyStateButtonIcon?: React.ReactNode;
47
- emptyStateButtonText?: string | null;
48
- emptyStateButtonClick?: () => void;
49
- emptyStateVariant?: 'default' | 'light' | 'dark' | 'darker';
41
+ emptyState?: ReactNode;
50
42
  showSelect?: boolean;
51
43
  disableTableView?: boolean;
52
44
  disableListView?: boolean;
@@ -65,4 +57,30 @@ export type PageTableProps<T extends object> = {
65
57
  limitFiltersToOneOrOperation?: boolean;
66
58
  defaultExpandedRows?: boolean;
67
59
  };
68
- export declare function PageTable<T extends object>(props: PageTableProps<T>): import("react/jsx-runtime").JSX.Element;
60
+ export type PageTableProps<T extends object> = WithEmptyState<T> | WithoutEmptyState<T>;
61
+ interface WithEmptyState<T extends object> extends PageTableCommonProps<T> {
62
+ emptyState: ReactNode;
63
+ emptyStateTitle?: never;
64
+ emptyStateDescription?: never;
65
+ emptyStateIcon?: never;
66
+ emptyStateNoDataIcon?: never;
67
+ emptyStateActions?: never;
68
+ emptyStateButtonIcon?: never;
69
+ emptyStateButtonText?: never;
70
+ emptyStateButtonClick?: never;
71
+ emptyStateVariant?: never;
72
+ }
73
+ interface WithoutEmptyState<T extends object> extends PageTableCommonProps<T> {
74
+ emptyState?: never;
75
+ emptyStateTitle?: string;
76
+ emptyStateDescription?: string | null;
77
+ emptyStateIcon?: React.ComponentClass;
78
+ emptyStateNoDataIcon?: React.ComponentClass;
79
+ emptyStateActions?: IPageAction<T>[];
80
+ emptyStateButtonIcon?: React.ReactNode;
81
+ emptyStateButtonText?: string | null;
82
+ emptyStateButtonClick?: () => void;
83
+ emptyStateVariant?: 'default' | 'light' | 'dark' | 'darker';
84
+ }
85
+ export declare function PageTable<T extends object>(props: PageTableProps<T>): string | number | true | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element;
86
+ export {};
@@ -0,0 +1,7 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ export declare function PageTableEmptyState(props: {
3
+ icon?: ComponentType;
4
+ title: string;
5
+ description?: string;
6
+ children?: ReactNode;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { ButtonProps } from '@patternfly/react-core';
2
+ import { SetRequired } from 'type-fest';
3
+ export declare function ButtonLink(props: Omit<SetRequired<ButtonProps, 'href'>, 'onClick'> & {
4
+ icon?: React.ReactNode;
5
+ }): import("react/jsx-runtime").JSX.Element;