@ansible/ansible-ui-framework 0.0.476 → 0.0.478
Sign up to get free protection for your applications and to get access to all the features.
- package/cjs/PageForm/Inputs/PageFormCheckbox.d.ts +5 -5
- package/cjs/PageForm/Inputs/PageFormSelectOption.d.ts +6 -6
- package/cjs/PageForm/Inputs/PageFormTextArea.d.ts +5 -5
- package/cjs/PageForm/Inputs/PageFormTextInput.d.ts +7 -7
- package/cjs/PageForm/Inputs/PageFormTextInput.js +3 -1
- package/package.json +1 -1
@@ -1,10 +1,10 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { CheckboxProps } from '@patternfly/react-core';
|
3
|
-
import { Validate } from 'react-hook-form';
|
4
|
-
export type PageFormCheckboxProps = {
|
3
|
+
import { FieldPath, FieldPathValue, FieldValues, Validate } from 'react-hook-form';
|
4
|
+
export type PageFormCheckboxProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
5
5
|
id?: string;
|
6
|
-
name:
|
7
|
-
validate?: Validate<
|
6
|
+
name: TFieldName;
|
7
|
+
validate?: Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues> | Record<string, Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues>>;
|
8
8
|
} & Omit<CheckboxProps, 'id' | 'onChange' | 'value'>;
|
9
9
|
/** PatternFly Checkbox wrapper for use with react-hook-form */
|
10
|
-
export declare function PageFormCheckbox(props: PageFormCheckboxProps): JSX.Element;
|
10
|
+
export declare function PageFormCheckbox<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: PageFormCheckboxProps<TFieldValues, TFieldName>): JSX.Element;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Validate } from 'react-hook-form';
|
2
|
+
import { FieldPath, FieldPathValue, FieldValues, Validate } from 'react-hook-form';
|
3
3
|
import { FormGroupSelectOptionProps } from './FormGroupSelectOption';
|
4
|
-
export type PageFormSelectOptionProps<
|
5
|
-
name:
|
6
|
-
validate?: Validate<
|
7
|
-
} & Omit<FormGroupSelectOptionProps<
|
4
|
+
export type PageFormSelectOptionProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TSelection = unknown> = {
|
5
|
+
name: TFieldName;
|
6
|
+
validate?: Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues> | Record<string, Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues>>;
|
7
|
+
} & Omit<FormGroupSelectOptionProps<TSelection>, 'onSelect' | 'value'>;
|
8
8
|
/** Select wrapper for use with react-hook-form */
|
9
|
-
export declare function PageFormSelectOption<
|
9
|
+
export declare function PageFormSelectOption<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TSelection = unknown>(props: PageFormSelectOptionProps<TFieldValues, TFieldName, TSelection>): JSX.Element;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Validate, ValidationRule } from 'react-hook-form';
|
2
|
+
import { FieldPath, FieldPathValue, FieldValues, Validate, ValidationRule } from 'react-hook-form';
|
3
3
|
import { FormGroupTextAreaProps } from './FormGroupTextArea';
|
4
|
-
export type PageFormTextAreaProps = {
|
5
|
-
name:
|
4
|
+
export type PageFormTextAreaProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
|
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<FieldPathValue<TFieldValues, TFieldName>, TFieldValues> | Record<string, Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues>>;
|
10
10
|
} & Omit<FormGroupTextAreaProps, 'onChange' | 'value'>;
|
11
11
|
/** PatternFly TextArea wrapper for use with react-hook-form */
|
12
|
-
export declare function PageFormTextArea(props: PageFormTextAreaProps): JSX.Element;
|
12
|
+
export declare function PageFormTextArea<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>>(props: PageFormTextAreaProps<TFieldValues, TFieldName>): JSX.Element;
|
@@ -1,15 +1,15 @@
|
|
1
1
|
/// <reference types="react" />
|
2
|
-
import { Validate, ValidationRule } from 'react-hook-form';
|
2
|
+
import { FieldPath, FieldPathValue, FieldValues, Validate, ValidationRule } from 'react-hook-form';
|
3
3
|
import { FormGroupTextInputProps } from './FormGroupTextInput';
|
4
|
-
export type PageFormTextInputProps<
|
5
|
-
name:
|
4
|
+
export type PageFormTextInputProps<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TSelection extends FieldValues = FieldValues> = {
|
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<FieldPathValue<TFieldValues, TFieldName>, TFieldValues> | Record<string, Validate<FieldPathValue<TFieldValues, TFieldName>, TFieldValues>>;
|
10
10
|
selectTitle?: string;
|
11
|
-
selectValue?: (
|
12
|
-
selectOpen?: (callback: (
|
11
|
+
selectValue?: (selection: TSelection) => FieldPathValue<TSelection, FieldPath<TSelection>>;
|
12
|
+
selectOpen?: (callback: (selection: TSelection) => void, title: string) => void;
|
13
13
|
} & Omit<FormGroupTextInputProps, 'onChange' | 'value'>;
|
14
14
|
/** PatternFly TextInput wrapper for use with react-hook-form */
|
15
|
-
export declare function PageFormTextInput<
|
15
|
+
export declare function PageFormTextInput<TFieldValues extends FieldValues = FieldValues, TFieldName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>, TSelection extends FieldValues = FieldValues>(props: PageFormTextInputProps<TFieldValues, TFieldName, TSelection>): JSX.Element;
|
@@ -30,7 +30,9 @@ function PageFormTextInput(props) {
|
|
30
30
|
return (_a = props.selectOpen) === null || _a === void 0 ? void 0 : _a.call(props, function (item) {
|
31
31
|
if (props.selectValue) {
|
32
32
|
var value_1 = props.selectValue(item);
|
33
|
-
setValue(name, value_1, {
|
33
|
+
setValue(name, value_1, {
|
34
|
+
shouldValidate: true,
|
35
|
+
});
|
34
36
|
}
|
35
37
|
}, props.selectTitle);
|
36
38
|
}, "aria-label": "Options menu", isDisabled: isSubmitting }, { children: (0, jsx_runtime_1.jsx)(react_icons_1.SearchIcon, {}) }))) })));
|