@ansible/ansible-ui-framework 0.0.670 → 0.0.671

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ITableColumn } from './PageTable/PageTable';
2
+ import { ITableColumn } from '../PageTable/PageTable';
3
3
  export interface BulkActionDialogProps<T extends object> {
4
4
  title: string;
5
5
  items: T[];
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
+ import { ITableColumn } from '../PageTable/PageTable';
2
3
  import { BulkActionDialogProps } from './BulkActionDialog';
3
- import { ITableColumn } from './PageTable/PageTable';
4
4
  export interface BulkConfirmationDialog<T extends object> {
5
5
  title: string;
6
6
  prompt?: string;
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import { ITableColumn } from '../PageTable/PageTable';
3
+ import { IToolbarFilter } from '../PageTable/PageToolbar';
4
+ import { ISelected } from '../PageTable/useTableItems';
5
+ import { IView } from '../useView';
6
+ export type MultiSelectDialogProps<T extends object> = {
7
+ title: string;
8
+ view: IView & ISelected<T> & {
9
+ itemCount?: number;
10
+ pageItems: T[] | undefined;
11
+ };
12
+ tableColumns: ITableColumn<T>[];
13
+ toolbarFilters: IToolbarFilter[];
14
+ onSelect: (items: T[]) => void;
15
+ confirmText?: string;
16
+ cancelText?: string;
17
+ emptyStateTitle?: string;
18
+ errorStateTitle?: string;
19
+ };
20
+ export declare function MultiSelectDialog<T extends object>(props: MultiSelectDialogProps<T>): JSX.Element;
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ import { ITableColumn } from '../PageTable/PageTable';
3
+ import { IToolbarFilter } from '../PageTable/PageToolbar';
4
+ import { ISelected } from '../PageTable/useTableItems';
5
+ import { IView } from '../useView';
6
+ export type SelectSingleDialogProps<T extends object> = {
7
+ title: string;
8
+ view: IView & ISelected<T> & {
9
+ itemCount?: number;
10
+ pageItems: T[] | undefined;
11
+ };
12
+ tableColumns: ITableColumn<T>[];
13
+ toolbarFilters: IToolbarFilter[];
14
+ onSelect: (item: T) => void;
15
+ confirmText?: string;
16
+ cancelText?: string;
17
+ emptyStateTitle?: string;
18
+ errorStateTitle?: string;
19
+ };
20
+ export declare function SelectSingleDialog<T extends object>(props: SelectSingleDialogProps<T>): JSX.Element;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
- import { ITableColumn } from './PageTable/PageTable';
3
- import { IToolbarFilter } from './PageTable/PageToolbar';
4
- import { ISelected } from './PageTable/useTableItems';
5
- import { IView } from './useView';
2
+ import { ITableColumn } from '../PageTable/PageTable';
3
+ import { IToolbarFilter } from '../PageTable/PageToolbar';
4
+ import { ISelected } from '../PageTable/useTableItems';
5
+ import { IView } from '../useView';
6
6
  interface ISelectDialogOptions<T extends object, TMultiple> {
7
7
  view: IView & ISelected<T> & {
8
8
  itemCount?: number;
@@ -0,0 +1,42 @@
1
+ /// <reference types="react" />
2
+ import { FieldPath, FieldValues } from 'react-hook-form';
3
+ export interface PageFormAsyncSelectProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, SelectionType = unknown> {
4
+ id?: string;
5
+ name: TFieldName;
6
+ label: string;
7
+ placeholder: string;
8
+ loadingPlaceholder: string;
9
+ loadingErrorText: string;
10
+ query: (page: number) => Promise<{
11
+ total: number;
12
+ values: SelectionType[];
13
+ }>;
14
+ valueToString: (value: SelectionType | undefined) => string;
15
+ isRequired?: boolean;
16
+ isReadOnly?: boolean;
17
+ openSelectDialog?: (onSelect: (value: SelectionType | undefined) => void, defaultSelection?: SelectionType) => void;
18
+ limit: number;
19
+ }
20
+ export declare function PageFormAsyncSelect<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, SelectionType = any>(props: PageFormAsyncSelectProps<TFieldValues, TFieldName, SelectionType>): JSX.Element;
21
+ export interface AsyncSelectProps<SelectionType> {
22
+ id?: string;
23
+ value: SelectionType | undefined;
24
+ valueToString: (value: SelectionType | undefined) => string;
25
+ onSelect: (value: SelectionType | undefined) => void;
26
+ query: (pageSize: number) => Promise<{
27
+ total: number;
28
+ values: SelectionType[];
29
+ }>;
30
+ placeholder: string;
31
+ loadingPlaceholder: string;
32
+ labeledBy?: string;
33
+ isReadOnly?: boolean;
34
+ helperTextInvalid?: string;
35
+ validated?: 'success' | 'warning' | 'error' | 'default';
36
+ showRefreshButton?: boolean;
37
+ isRequired?: boolean;
38
+ limit: number;
39
+ loadingError?: boolean;
40
+ openSelectDialog?: (onSelect: (value: SelectionType | undefined) => void, defaultSelection?: SelectionType) => void;
41
+ }
42
+ export declare function AsyncSelect<SelectionType>(props: AsyncSelectProps<SelectionType>): JSX.Element;
@@ -1,5 +1,3 @@
1
- export * from './BulkActionDialog';
2
- export * from './BulkConfirmationDialog';
3
1
  export * from './components/BulkSelector';
4
2
  export * from './components/Collapse';
5
3
  export * from './components/Help';
@@ -22,7 +20,11 @@ export * from './PageCells/TextCell';
22
20
  export * from './PageDetails/PageDetail';
23
21
  export * from './PageDetails/PageDetails';
24
22
  export * from './PageDetails/PageDetailsFromColumns';
25
- export * from './PageDialog';
23
+ export * from './PageDialogs/BulkActionDialog';
24
+ export * from './PageDialogs/BulkConfirmationDialog';
25
+ export * from './PageDialogs/MultiSelectDialog';
26
+ export * from './PageDialogs/PageDialog';
27
+ export * from './PageDialogs/useSelectDialog';
26
28
  export * from './PageForm/Inputs/FormGroupSelect';
27
29
  export * from './PageForm/Inputs/FormGroupSelectOption';
28
30
  export * from './PageForm/Inputs/FormGroupTextArea';
@@ -47,6 +49,4 @@ export * from './PageTabs';
47
49
  export * from './Settings';
48
50
  export * from './useFrameworkTranslations';
49
51
  export * from './useInMemoryView';
50
- export * from './useSelectDialog';
51
- export * from './useSelectMultipleDialog';
52
52
  export * from './utils/compare';
@@ -25,6 +25,8 @@ export interface IFrameworkTranslations {
25
25
  selectNone: string;
26
26
  pleaseFixValidationErrors: string;
27
27
  validating: string;
28
+ clickToRefresh: string;
29
+ unknownError: string;
28
30
  }
29
31
  export declare function FrameworkTranslationsProvider(props: {
30
32
  children: ReactNode;