@ansible/ansible-ui-framework 0.0.479 → 0.0.481
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/BulkConfirmationDialog.js +1 -1
- package/cjs/PageActions/PageDropdownAction.js +5 -3
- package/cjs/PageForm/Inputs/PageFormCheckbox.d.ts +2 -2
- package/cjs/PageForm/Inputs/PageFormTextArea.d.ts +2 -2
- package/cjs/PageForm/Inputs/PageFormTextInput.d.ts +1 -1
- package/cjs/components/ErrorBoundary.d.ts +1 -1
- package/package.json +1 -1
@@ -46,7 +46,7 @@ function BulkConfirmationDialog(props) {
|
|
46
46
|
}, [onClose, setDialog]);
|
47
47
|
var _c = (0, useTableItems_1.usePaged)(items), paged = _c.paged, page = _c.page, perPage = _c.perPage, setPage = _c.setPage, setPerPage = _c.setPerPage;
|
48
48
|
var _d = __read((0, react_1.useState)(!confirmText), 2), confirmed = _d[0], setConfirmed = _d[1];
|
49
|
-
return ((0, jsx_runtime_1.jsx)(react_core_1.Modal, __assign({ titleIconVariant: isDanger ? 'warning' : undefined, title: title, description: prompt, variant: react_core_1.ModalVariant.medium, isOpen: true, onClose: onCloseClicked, actions: [
|
49
|
+
return ((0, jsx_runtime_1.jsx)(react_core_1.Modal, __assign({ titleIconVariant: isDanger ? 'warning' : undefined, title: title, description: prompt ? (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: prompt }) : undefined, variant: react_core_1.ModalVariant.medium, isOpen: true, onClose: onCloseClicked, actions: [
|
50
50
|
(0, jsx_runtime_1.jsx)(react_core_1.Button, __assign({ variant: isDanger ? 'danger' : 'primary', onClick: function () {
|
51
51
|
onCloseClicked();
|
52
52
|
onConfirm();
|
@@ -81,9 +81,9 @@ function PageDropdownActionItem(props) {
|
|
81
81
|
var tooltip = action.tooltip;
|
82
82
|
var isDisabled = action.isDisabled !== undefined && selectedItem ? action.isDisabled(selectedItem) : false;
|
83
83
|
tooltip = isDisabled ? isDisabled : tooltip;
|
84
|
-
return ((0, jsx_runtime_1.jsx)(react_core_1.Tooltip, __assign({ content: tooltip, trigger: tooltip ? undefined : 'manual' }, { children: (0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, __assign({ onClick: action.onClick ? function () { return selectedItem && action.onClick(selectedItem); } : undefined, component: action.href
|
84
|
+
return ((0, jsx_runtime_1.jsx)(react_core_1.Tooltip, __assign({ content: tooltip, trigger: tooltip ? undefined : 'manual' }, { children: (0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, __assign({ onClick: action.onClick ? function () { return selectedItem && action.onClick(selectedItem); } : undefined, component: (action.href
|
85
85
|
? function (props) { return ((0, jsx_runtime_1.jsx)(react_router_dom_1.Link, __assign({}, props, { to: selectedItem ? action.href(selectedItem) : '' }))); }
|
86
|
-
: undefined, isAriaDisabled: Boolean(isDisabled), icon: Icon ? ((0, jsx_runtime_1.jsx)("span", __assign({ style: { paddingRight: 4 } }, { children: (0, jsx_runtime_1.jsx)(Icon, {}) }))) : undefined, style: {
|
86
|
+
: undefined), isAriaDisabled: Boolean(isDisabled), icon: Icon ? ((0, jsx_runtime_1.jsx)("span", __assign({ style: { paddingRight: 4 } }, { children: (0, jsx_runtime_1.jsx)(Icon, {}) }))) : undefined, style: {
|
87
87
|
color: action.isDanger && !isDisabled ? 'var(--pf-global--danger-color--100)' : undefined,
|
88
88
|
} }, { children: action.label })) }), action.label));
|
89
89
|
}
|
@@ -98,7 +98,9 @@ function PageDropdownActionItem(props) {
|
|
98
98
|
tooltip = 'No selections';
|
99
99
|
isDisabled = true;
|
100
100
|
}
|
101
|
-
return ((0, jsx_runtime_1.jsx)(react_core_1.Tooltip, __assign({ content: tooltip, trigger: tooltip ? undefined : 'manual' }, { children: (0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, __assign({ onClick: action.onClick ? function () { return action.onClick(selectedItems); } : undefined, component: !action.onClick
|
101
|
+
return ((0, jsx_runtime_1.jsx)(react_core_1.Tooltip, __assign({ content: tooltip, trigger: tooltip ? undefined : 'manual' }, { children: (0, jsx_runtime_1.jsx)(react_core_1.DropdownItem, __assign({ onClick: action.onClick ? function () { return action.onClick(selectedItems); } : undefined, component: (!action.onClick
|
102
|
+
? function (props) { return (0, jsx_runtime_1.jsx)(react_router_dom_1.Link, __assign({}, props, { to: action.href })); }
|
103
|
+
: undefined), isAriaDisabled: isDisabled, icon: Icon ? ((0, jsx_runtime_1.jsx)("span", __assign({ style: { paddingRight: 4 } }, { children: (0, jsx_runtime_1.jsx)(Icon, {}) }))) : undefined, style: {
|
102
104
|
color: action.isDanger && !isDisabled ? 'var(--pf-global--danger-color--100)' : undefined,
|
103
105
|
} }, { children: action.label })) }), action.label));
|
104
106
|
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { CheckboxProps } from '@patternfly/react-core';
|
3
|
-
import { FieldPath,
|
3
|
+
import { FieldPath, FieldValues, Validate } from 'react-hook-form';
|
4
4
|
export type PageFormCheckboxProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
5
5
|
id?: string;
|
6
6
|
name: TFieldName;
|
7
|
-
validate?: Validate<
|
7
|
+
validate?: Validate<boolean, TFieldValues> | Record<string, Validate<boolean, TFieldValues>>;
|
8
8
|
} & Omit<CheckboxProps, 'id' | 'onChange' | 'value'>;
|
9
9
|
/** PatternFly Checkbox wrapper for use with react-hook-form */
|
10
10
|
export declare function PageFormCheckbox<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: PageFormCheckboxProps<TFieldValues, TFieldName>): JSX.Element;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { FieldPath,
|
2
|
+
import { FieldPath, FieldValues, Validate, ValidationRule } from 'react-hook-form';
|
3
3
|
import { FormGroupTextAreaProps } from './FormGroupTextArea';
|
4
4
|
export type PageFormTextAreaProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
5
5
|
name: TFieldName;
|
6
6
|
minLength?: number | ValidationRule<number>;
|
7
7
|
maxLength?: number | ValidationRule<number>;
|
8
8
|
pattern?: ValidationRule<RegExp>;
|
9
|
-
validate?: Validate<
|
9
|
+
validate?: Validate<string, TFieldValues> | Record<string, Validate<string, TFieldValues>>;
|
10
10
|
} & Omit<FormGroupTextAreaProps, 'onChange' | 'value'>;
|
11
11
|
/** PatternFly TextArea wrapper for use with react-hook-form */
|
12
12
|
export declare function PageFormTextArea<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: PageFormTextAreaProps<TFieldValues, TFieldName>): JSX.Element;
|
@@ -6,7 +6,7 @@ export type PageFormTextInputProps<TFieldValues extends FieldValues = FieldValue
|
|
6
6
|
minLength?: number | ValidationRule<number>;
|
7
7
|
maxLength?: number | ValidationRule<number>;
|
8
8
|
pattern?: ValidationRule<RegExp>;
|
9
|
-
validate?: Validate<
|
9
|
+
validate?: Validate<string, TFieldValues> | Record<string, Validate<string, TFieldValues>>;
|
10
10
|
selectTitle?: string;
|
11
11
|
selectValue?: (selection: TSelection) => FieldPathValue<TSelection, FieldPath<TSelection>>;
|
12
12
|
selectOpen?: (callback: (selection: TSelection) => void, title: string) => void;
|
@@ -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():
|
13
|
+
render(): string | number | boolean | import("react").ReactFragment | JSX.Element | null | undefined;
|
14
14
|
}
|
15
15
|
export default ErrorBoundary;
|