@ansible/ansible-ui-framework 0.0.720 → 0.0.722
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.
- package/framework/PageActions/PageAction.d.ts +79 -46
- package/framework/PageActions/PageActionButton.d.ts +10 -0
- package/framework/PageActions/{PageDropdownAction.d.ts → PageActionDropdown.d.ts} +10 -8
- package/framework/PageActions/PageActionLink.d.ts +9 -0
- package/framework/PageActions/PageActionSwitch.d.ts +8 -0
- package/framework/PageActions/PageActionUtils.d.ts +3 -0
- package/framework/PageActions/PageActions.d.ts +4 -3
- package/framework/PageActions/{PagePinnedActions.d.ts → PageActionsPinned.d.ts} +7 -4
- package/framework/PageAlertToaster.d.ts +1 -0
- package/framework/components/ErrorBoundary.d.ts +1 -1
- package/framework/index.d.ts +0 -1
- package/framework/useFrameworkTranslations.d.ts +15 -13
- package/index.js +3093 -2987
- package/index.umd.cjs +37 -37
- package/package.json +1 -1
- package/framework/PageActions/PageActionType.d.ts +0 -8
- package/framework/PageActions/PageBulkAction.d.ts +0 -7
- package/framework/PageActions/PageButtonAction.d.ts +0 -8
- package/framework/PageActions/PageSingleAction.d.ts +0 -8
@@ -1,60 +1,93 @@
|
|
1
1
|
import { ButtonVariant } from '@patternfly/react-core';
|
2
2
|
import { ComponentClass } from 'react';
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
export declare const enum PageActionType {
|
4
|
+
Button = 0,
|
5
|
+
Link = 1,
|
6
|
+
Switch = 2,
|
7
|
+
Dropdown = 3,
|
8
|
+
Seperator = 4
|
9
|
+
}
|
10
|
+
export declare const enum PageActionSelection {
|
11
|
+
None = 0,
|
12
|
+
Single = 1,
|
13
|
+
Multiple = 2
|
14
|
+
}
|
15
|
+
export type IPageAction<T extends object> = IPageActionButton | IPageActionButtonSingle<T> | IPageActionButtonMultiple<T> | IPageActionLink | IPageActionLinkSingle<T> | IPageActionSwitch | IPageActionSwitchSingle<T> | IPageActionDropdown<T> | IPageActionDropdownSingle<T> | IPageActionDropdownMultiple<T> | IPageActionSeperator;
|
16
|
+
interface IPageActionCommon {
|
6
17
|
icon?: ComponentClass;
|
7
18
|
label: string;
|
8
|
-
shortLabel?: string;
|
9
19
|
tooltip?: string;
|
10
20
|
isDanger?: boolean;
|
11
21
|
ouiaId?: string;
|
22
|
+
isPinned?: boolean;
|
12
23
|
}
|
13
|
-
|
14
|
-
|
24
|
+
interface IPageActionNoneCommon extends IPageActionCommon {
|
25
|
+
selection?: PageActionSelection.None;
|
26
|
+
isHidden?: () => boolean;
|
27
|
+
isDisabled?: string | (() => string | undefined);
|
15
28
|
}
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
isDisabled?: string | undefined;
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
29
|
+
interface IPageActionSingleCommon<T extends object> extends IPageActionCommon {
|
30
|
+
selection?: PageActionSelection.Single;
|
31
|
+
isHidden?: (item: T) => boolean;
|
32
|
+
isDisabled?: string | ((item: T) => string | undefined);
|
33
|
+
}
|
34
|
+
interface IPageActionMultipleCommon<T extends object> extends IPageActionCommon {
|
35
|
+
selection?: PageActionSelection.Multiple;
|
36
|
+
isDisabled?: string | ((items: T[]) => string | undefined);
|
37
|
+
}
|
38
|
+
export interface IPageActionButton extends IPageActionNoneCommon {
|
39
|
+
type: PageActionType.Button;
|
40
|
+
selection: PageActionSelection.None;
|
25
41
|
variant?: ButtonVariant;
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
export type IPageBulkAction<T extends object> = IPageActionCommon & {
|
32
|
-
type: PageActionType.bulk;
|
42
|
+
onClick: () => unknown | Promise<unknown>;
|
43
|
+
}
|
44
|
+
export interface IPageActionButtonSingle<T extends object> extends IPageActionSingleCommon<T> {
|
45
|
+
type: PageActionType.Button;
|
46
|
+
selection: PageActionSelection.Single;
|
33
47
|
variant?: ButtonVariant;
|
34
|
-
onClick: (
|
35
|
-
}
|
36
|
-
|
37
|
-
type: PageActionType.
|
48
|
+
onClick: (item: T) => unknown | Promise<unknown>;
|
49
|
+
}
|
50
|
+
export interface IPageActionButtonMultiple<T extends object> extends IPageActionMultipleCommon<T> {
|
51
|
+
type: PageActionType.Button;
|
52
|
+
selection: PageActionSelection.Multiple;
|
38
53
|
variant?: ButtonVariant;
|
54
|
+
onClick: (items: T[]) => unknown | Promise<unknown>;
|
55
|
+
}
|
56
|
+
export interface IPageActionLink extends IPageActionNoneCommon {
|
57
|
+
type: PageActionType.Link;
|
58
|
+
href: string;
|
59
|
+
}
|
60
|
+
export interface IPageActionLinkSingle<T extends object> extends IPageActionSingleCommon<T> {
|
61
|
+
type: PageActionType.Link;
|
39
62
|
href: (item: T) => string;
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
63
|
+
}
|
64
|
+
export interface IPageActionSwitch extends IPageActionNoneCommon {
|
65
|
+
type: PageActionType.Switch;
|
66
|
+
onToggle: (enable: boolean) => unknown | Promise<unknown>;
|
67
|
+
isSwitchOn: () => boolean;
|
68
|
+
showPinnedLabel?: boolean;
|
69
|
+
labelOff?: string;
|
70
|
+
}
|
71
|
+
export interface IPageActionSwitchSingle<T extends object> extends IPageActionSingleCommon<T> {
|
72
|
+
type: PageActionType.Switch;
|
73
|
+
onToggle: (item: T, enable: boolean) => unknown | Promise<unknown>;
|
74
|
+
isSwitchOn: (item: T) => boolean;
|
75
|
+
showPinnedLabel?: boolean;
|
76
|
+
labelOff?: string;
|
77
|
+
}
|
78
|
+
export interface IPageActionDropdown<T extends object> extends IPageActionNoneCommon {
|
79
|
+
type: PageActionType.Dropdown;
|
80
|
+
actions: IPageAction<T>[];
|
81
|
+
}
|
82
|
+
export interface IPageActionDropdownSingle<T extends object> extends IPageActionSingleCommon<T> {
|
83
|
+
type: PageActionType.Dropdown;
|
84
|
+
actions: IPageAction<T>[];
|
85
|
+
}
|
86
|
+
export interface IPageActionDropdownMultiple<T extends object> extends IPageActionMultipleCommon<T> {
|
87
|
+
type: PageActionType.Dropdown;
|
88
|
+
actions: IPageAction<T>[];
|
89
|
+
}
|
90
|
+
export interface IPageActionSeperator {
|
91
|
+
type: PageActionType.Seperator;
|
92
|
+
}
|
60
93
|
export {};
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { ComponentClass, FunctionComponent } from 'react';
|
2
|
+
import { IPageActionButton, IPageActionButtonMultiple, IPageActionButtonSingle } from './PageAction';
|
3
|
+
export declare function PageActionButton<T extends object>(props: {
|
4
|
+
action: IPageActionButton | IPageActionButtonSingle<T> | IPageActionButtonMultiple<T>;
|
5
|
+
isSecondary?: boolean;
|
6
|
+
wrapper?: ComponentClass | FunctionComponent;
|
7
|
+
iconOnly?: boolean;
|
8
|
+
selectedItem?: T;
|
9
|
+
selectedItems?: T[];
|
10
|
+
}): JSX.Element;
|
@@ -1,17 +1,19 @@
|
|
1
1
|
import { ButtonVariant, DropdownPosition } from '@patternfly/react-core';
|
2
2
|
import { ComponentClass, FunctionComponent } from 'react';
|
3
3
|
import { IPageAction } from './PageAction';
|
4
|
-
|
4
|
+
interface PageActionDropdownProps<T extends object> {
|
5
5
|
actions: IPageAction<T>[];
|
6
|
-
label?: string;
|
7
6
|
icon?: ComponentClass | FunctionComponent;
|
8
|
-
isDisabled?: boolean;
|
9
|
-
tooltip?: string;
|
10
|
-
selectedItems?: T[];
|
11
|
-
selectedItem?: T;
|
12
|
-
position?: DropdownPosition;
|
13
7
|
iconOnly?: boolean;
|
8
|
+
isDisabled?: string | undefined;
|
9
|
+
label?: string;
|
14
10
|
onOpen?: (label: string, open: boolean) => void;
|
11
|
+
position?: DropdownPosition;
|
12
|
+
selectedItem?: T;
|
13
|
+
selectedItems?: T[];
|
14
|
+
tooltip?: string;
|
15
15
|
variant?: ButtonVariant;
|
16
|
-
}
|
16
|
+
}
|
17
|
+
export declare function PageActionDropdown<T extends object>(props: PageActionDropdownProps<T>): JSX.Element;
|
17
18
|
export declare function filterActionSeperators<T extends object>(actions: IPageAction<T>[]): IPageAction<T>[];
|
19
|
+
export {};
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { ComponentClass, FunctionComponent } from 'react';
|
2
|
+
import { IPageActionLink, IPageActionLinkSingle } from './PageAction';
|
3
|
+
export declare function PageActionLink<T extends object>(props: {
|
4
|
+
action: IPageActionLink | IPageActionLinkSingle<T>;
|
5
|
+
wrapper?: ComponentClass | FunctionComponent;
|
6
|
+
iconOnly?: boolean;
|
7
|
+
selectedItem?: T;
|
8
|
+
selectedItems?: T[];
|
9
|
+
}): JSX.Element;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { ComponentClass, FunctionComponent } from 'react';
|
2
|
+
import { IPageActionSwitch, IPageActionSwitchSingle } from './PageAction';
|
3
|
+
export declare function PageActionSwitch<T extends object>(props: {
|
4
|
+
action: IPageActionSwitch | IPageActionSwitchSingle<T>;
|
5
|
+
wrapper?: ComponentClass | FunctionComponent;
|
6
|
+
selectedItem?: T;
|
7
|
+
iconOnly?: boolean;
|
8
|
+
}): JSX.Element;
|
@@ -0,0 +1,3 @@
|
|
1
|
+
import { IPageAction } from './PageAction';
|
2
|
+
export declare function isPageActionHidden<T extends object>(action: IPageAction<T>, selectedItem: T | undefined): boolean;
|
3
|
+
export declare function usePageActionDisabled<T extends object>(): (action: IPageAction<T>, selectedItem: T | undefined, selectedItems?: T[] | undefined) => string | undefined;
|
@@ -2,7 +2,7 @@ import { DropdownPosition } from '@patternfly/react-core';
|
|
2
2
|
import { ComponentClass, FunctionComponent } from 'react';
|
3
3
|
import { WindowSize } from '../components/useBreakPoint';
|
4
4
|
import { IPageAction } from './PageAction';
|
5
|
-
|
5
|
+
interface PageActionProps<T extends object> {
|
6
6
|
actions: IPageAction<T>[];
|
7
7
|
selectedItem?: T;
|
8
8
|
selectedItems?: T[];
|
@@ -11,5 +11,6 @@ export declare function PageActions<T extends object>(props: {
|
|
11
11
|
position?: DropdownPosition;
|
12
12
|
iconOnly?: boolean;
|
13
13
|
onOpen?: (open: boolean) => void;
|
14
|
-
}
|
15
|
-
export declare function
|
14
|
+
}
|
15
|
+
export declare function PageActions<T extends object>(props: PageActionProps<T>): JSX.Element;
|
16
|
+
export {};
|
@@ -1,18 +1,21 @@
|
|
1
1
|
import { ComponentClass, FunctionComponent } from 'react';
|
2
2
|
import { IPageAction } from './PageAction';
|
3
|
-
|
3
|
+
interface PageActionsPinnedProps<T extends object> {
|
4
4
|
actions: IPageAction<T>[];
|
5
5
|
selectedItem?: T;
|
6
6
|
selectedItems?: T[];
|
7
7
|
wrapper?: ComponentClass | FunctionComponent;
|
8
8
|
iconOnly?: boolean;
|
9
9
|
onOpen?: (label: string, open: boolean) => void;
|
10
|
-
}
|
11
|
-
export declare function
|
10
|
+
}
|
11
|
+
export declare function PageActionsPinned<T extends object>(props: PageActionsPinnedProps<T>): JSX.Element;
|
12
|
+
interface PageActionPinnedProps<T extends object> {
|
12
13
|
action: IPageAction<T>;
|
13
14
|
selectedItem?: T;
|
14
15
|
selectedItems?: T[];
|
15
16
|
wrapper?: ComponentClass | FunctionComponent;
|
16
17
|
iconOnly?: boolean;
|
17
18
|
onOpen?: (label: string, open: boolean) => void;
|
18
|
-
}
|
19
|
+
}
|
20
|
+
export declare function PageActionPinned<T extends object>(props: PageActionPinnedProps<T>): JSX.Element;
|
21
|
+
export {};
|
@@ -10,6 +10,6 @@ declare class ErrorBoundary extends Component<Props, State> {
|
|
10
10
|
state: State;
|
11
11
|
static getDerivedStateFromError(_: Error): State;
|
12
12
|
componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
|
13
|
-
render(): string | number | boolean |
|
13
|
+
render(): string | number | boolean | import("react").ReactFragment | JSX.Element | null | undefined;
|
14
14
|
}
|
15
15
|
export default ErrorBoundary;
|
package/framework/index.d.ts
CHANGED
@@ -1,32 +1,34 @@
|
|
1
1
|
import { Dispatch, ReactNode, SetStateAction } from 'react';
|
2
2
|
export interface IFrameworkTranslations {
|
3
|
+
by: string;
|
3
4
|
cancelText: string;
|
4
5
|
canceledText: string;
|
6
|
+
clearAllFilters: string;
|
7
|
+
clickToRefresh: string;
|
5
8
|
closeText: string;
|
6
9
|
confirmText: string;
|
10
|
+
countMore: string;
|
11
|
+
documentation: string;
|
7
12
|
errorText: string;
|
13
|
+
manageColumns: string;
|
14
|
+
moreInformation: string;
|
8
15
|
noItemsFound: string;
|
16
|
+
noResultsFound: string;
|
17
|
+
noResultsMatchCriteria: string;
|
18
|
+
noSelection: string;
|
19
|
+
noSelections: string;
|
9
20
|
ofText: string;
|
10
21
|
pendingText: string;
|
22
|
+
pleaseFixValidationErrors: string;
|
11
23
|
processingText: string;
|
24
|
+
selectNone: string;
|
12
25
|
selectedText: string;
|
26
|
+
showLess: string;
|
13
27
|
submitText: string;
|
14
28
|
submittingText: string;
|
15
29
|
successText: string;
|
16
|
-
manageColumns: string;
|
17
|
-
moreInformation: string;
|
18
|
-
showLess: string;
|
19
|
-
countMore: string;
|
20
|
-
documentation: string;
|
21
|
-
noResultsFound: string;
|
22
|
-
noResultsMatchCriteria: string;
|
23
|
-
clearAllFilters: string;
|
24
|
-
by: string;
|
25
|
-
selectNone: string;
|
26
|
-
pleaseFixValidationErrors: string;
|
27
|
-
validating: string;
|
28
|
-
clickToRefresh: string;
|
29
30
|
unknownError: string;
|
31
|
+
validating: string;
|
30
32
|
}
|
31
33
|
export declare function FrameworkTranslationsProvider(props: {
|
32
34
|
children: ReactNode;
|