react-hook-form-cloudscape 1.7.1 → 1.7.3
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/components/attribute-editor/attribute-editor.d.ts +2 -2
- package/components/autosuggest/autosuggest.d.ts +3 -3
- package/components/cards/cards.d.ts +2 -2
- package/components/checkbox/checkbox.d.ts +3 -3
- package/components/code-editor/code-editor.d.ts +3 -3
- package/components/date-picker/date-picker.d.ts +5 -5
- package/components/date-range-picker/date-range-picker.d.ts +2 -2
- package/components/file-upload/file-upload.d.ts +2 -2
- package/components/input/input.d.ts +3 -3
- package/components/multiselect/multiselect.d.ts +3 -3
- package/components/property-filter/property-filter.d.ts +3 -3
- package/components/radio-group/radio-group.d.ts +3 -3
- package/components/s3-resource-selector/s3-resource-selector.d.ts +2 -2
- package/components/select/select.d.ts +3 -3
- package/components/slider/slider.d.ts +3 -3
- package/components/tag-editor/tag-editor.d.ts +3 -3
- package/components/text-filter/text-filter.d.ts +3 -3
- package/components/textarea/textarea.d.ts +2 -2
- package/components/tiles/tiles.d.ts +3 -3
- package/components/time-input/time-input.d.ts +3 -3
- package/components/toggle/toggle.d.ts +3 -3
- package/package.json +5 -2
- package/react-hook-form-cloudscape.es.js +64 -15
- package/react-hook-form-cloudscape.es.js.map +1 -1
- package/react-hook-form-cloudscape.umd.js.map +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { AttributeEditorProps, NonCancelableCustomEvent } from '@cloudscape-design/components';
|
|
2
2
|
import { ArrayPath, Control, FieldArray, FieldArrayPath, FieldValues, UseFieldArrayAppend, UseFieldArrayRemove } from 'react-hook-form';
|
|
3
|
-
export interface Definition<T> extends Omit<AttributeEditorProps.FieldDefinition<T>,
|
|
3
|
+
export interface Definition<T> extends Omit<AttributeEditorProps.FieldDefinition<T>, "errorText"> {
|
|
4
4
|
label: string;
|
|
5
5
|
errorName?: (item: T, index: number) => string;
|
|
6
6
|
}
|
|
7
|
-
export interface CAttributeEditorProps<T extends FieldValues> extends Omit<AttributeEditorProps<T>,
|
|
7
|
+
export interface CAttributeEditorProps<T extends FieldValues> extends Omit<AttributeEditorProps<T>, "items" | "onRemoveButtonClick" | "onAddButtonClick"> {
|
|
8
8
|
name: FieldArrayPath<T>;
|
|
9
9
|
control: Control<T>;
|
|
10
10
|
definition: Definition<T>[];
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { AutosuggestProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CAutosuggestProps<T extends FieldValues> extends Omit<AutosuggestProps, "value"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare const CAutosuggest: <T extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onBlur, onChange, ...props }: CAutosuggestProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { CardsProps } from '@cloudscape-design/components';
|
|
2
2
|
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
-
export interface ControlledCardsProps<T extends FieldValues> extends Omit<Required<Pick<CardsProps,
|
|
3
|
+
export interface ControlledCardsProps<T extends FieldValues> extends Omit<Required<Pick<CardsProps, "trackBy">> & Required<Pick<CardsProps, "selectionType">> & CardsProps, "value"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
shouldUnregister?: boolean;
|
|
7
7
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
8
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
8
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
9
9
|
}
|
|
10
10
|
export declare const CCards: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onSelectionChange, ...props }: ControlledCardsProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
export default CCards;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { CheckboxProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CCheckboxProps<T extends FieldValues> extends Omit<CheckboxProps, "checked"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CCheckbox: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onChange, ...props }: CCheckboxProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { CodeEditorProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CCodeEditorProps<T extends FieldValues> extends Omit<CodeEditorProps, "value"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CCodeEditor: <TFieldValues extends FieldValues>({ name, control, onChange, defaultValue, rules, shouldUnregister, ...props }: CCodeEditorProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { DatePickerProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CDatePickerProps<T extends FieldValues> extends Omit<DatePickerProps, "value"> {
|
|
4
4
|
name: FieldPath<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
|
-
onBlur?: DatePickerProps[
|
|
10
|
-
onChange?: DatePickerProps[
|
|
9
|
+
onBlur?: DatePickerProps["onBlur"];
|
|
10
|
+
onChange?: DatePickerProps["onChange"];
|
|
11
11
|
}
|
|
12
12
|
declare const CDatePicker: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onBlur, onChange, ...props }: CDatePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export default CDatePicker;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DateRangePickerProps } from '@cloudscape-design/components';
|
|
2
2
|
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
-
export interface CDateRangePickerProps<T extends FieldValues> extends Omit<DateRangePickerProps,
|
|
3
|
+
export interface CDateRangePickerProps<T extends FieldValues> extends Omit<DateRangePickerProps, "value"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CDateRangePicker: <TFieldValues extends FieldValues>({ name, control, onBlur, onChange, defaultValue, rules, shouldUnregister, ...props }: CDateRangePickerProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { FileUploadProps } from '@cloudscape-design/components';
|
|
2
2
|
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
3
|
-
export interface ControlledFileUploadProps<T extends FieldValues> extends Omit<FileUploadProps,
|
|
3
|
+
export interface ControlledFileUploadProps<T extends FieldValues> extends Omit<FileUploadProps, "value"> {
|
|
4
4
|
name: FieldPath<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare const CFileUpload: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onChange, ...props }: ControlledFileUploadProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { InputProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CInputProps<T extends FieldValues> extends Omit<InputProps, "value"> {
|
|
4
4
|
name: FieldPath<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CInput: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onBlur, onChange, ...props }: CInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { MultiselectProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface ControlledMultiselectProps<T extends FieldValues> extends Omit<MultiselectProps, "selectedOptions"> {
|
|
4
4
|
name: FieldPath<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
options?: MultiselectProps.Options;
|
|
7
7
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
8
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
8
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
9
9
|
shouldUnregister?: boolean;
|
|
10
10
|
}
|
|
11
11
|
declare const CMultiselect: <TFieldValues extends FieldValues>({ name, control, options, defaultValue, rules, onBlur, onChange, shouldUnregister, ...props }: ControlledMultiselectProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { PropertyFilterProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface ControlledPropertyFilterProps<T extends FieldValues> extends Omit<PropertyFilterProps, "query" | "onChange"> {
|
|
4
4
|
name: FieldPath<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare const CPropertyFilter: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, ...props }: ControlledPropertyFilterProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { RadioGroupProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CRadioGroupProps<T extends FieldValues> extends Omit<RadioGroupProps, "value"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CRadioGroup: <TFieldValues extends FieldValues>({ name, control, onChange, rules, defaultValue, shouldUnregister, ...props }: CRadioGroupProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { S3ResourceSelectorProps } from '@cloudscape-design/components';
|
|
2
2
|
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
3
|
-
export interface ControlledS3ResourceSelectorProps<T extends FieldValues> extends Omit<S3ResourceSelectorProps,
|
|
3
|
+
export interface ControlledS3ResourceSelectorProps<T extends FieldValues> extends Omit<S3ResourceSelectorProps, "resource"> {
|
|
4
4
|
name: FieldPath<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
export declare const CS3ResourceSelector: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onChange, ...props }: ControlledS3ResourceSelectorProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { SelectProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CSelectProps<T extends FieldValues> extends Omit<SelectProps, "selectedOption"> {
|
|
4
4
|
name: FieldPath<T>;
|
|
5
5
|
control: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CSelect: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onBlur, onChange, ...props }: CSelectProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { NonCancelableCustomEvent, SliderProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CSliderProps<T extends FieldValues> extends Omit<SliderProps, "value" | "onChange"> {
|
|
4
4
|
name: FieldPath<T>;
|
|
5
5
|
control: Control<T>;
|
|
6
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
6
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
7
7
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
onChange?: (event: NonCancelableCustomEvent<SliderProps.ChangeDetail>) => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { TagEditorProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CTagEditorProps<T extends FieldValues> extends Omit<TagEditorProps, "tags"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CTagEditor: <TFieldValues extends FieldValues>({ name, control, onChange, defaultValue, rules, shouldUnregister, ...props }: CTagEditorProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { TextFilterProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CTextFilterProps<T extends FieldValues> extends Omit<TextFilterProps, "filteringText"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CTextFilter: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onChange, ...props }: CTextFilterProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TextareaProps } from '@cloudscape-design/components';
|
|
2
2
|
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
-
export interface CTextareaProps<T extends FieldValues> extends Omit<TextareaProps,
|
|
3
|
+
export interface CTextareaProps<T extends FieldValues> extends Omit<TextareaProps, "value"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CTextarea: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onBlur, onChange, ...props }: CTextareaProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { TilesProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CTilesProps<T extends FieldValues> extends Omit<TilesProps, "value"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CTiles: <TFieldValues extends FieldValues>({ name, control, onChange, defaultValue, rules, shouldUnregister, ...props }: CTilesProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { TimeInputProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CTimeInputProps<T extends FieldValues> extends Omit<TimeInputProps, "value"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control?: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CTimeInput: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onBlur, onChange, ...props }: CTimeInputProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
2
1
|
import { ToggleProps } from '@cloudscape-design/components';
|
|
3
|
-
|
|
2
|
+
import { Control, FieldPath, FieldPathValue, FieldValues, Path, RegisterOptions } from 'react-hook-form';
|
|
3
|
+
export interface CToggleProps<T extends FieldValues> extends Omit<ToggleProps, "checked"> {
|
|
4
4
|
name: Path<T>;
|
|
5
5
|
control: Control<T>;
|
|
6
6
|
defaultValue?: FieldPathValue<T, FieldPath<T>>;
|
|
7
|
-
rules?: Omit<RegisterOptions<T, FieldPath<T>>,
|
|
7
|
+
rules?: Omit<RegisterOptions<T, FieldPath<T>>, "valueAsNumber" | "valueAsDate" | "setValueAs" | "disabled">;
|
|
8
8
|
shouldUnregister?: boolean;
|
|
9
9
|
}
|
|
10
10
|
declare const CToggle: <TFieldValues extends FieldValues>({ name, control, defaultValue, rules, shouldUnregister, onChange, ...props }: CToggleProps<TFieldValues>) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-hook-form-cloudscape",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.3",
|
|
4
4
|
"description": "A React Hook Form wrapper designed for effortless integration of validations into Cloudscape forms and inputs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -33,7 +33,9 @@
|
|
|
33
33
|
"build": "npm run clean && npm run test:coverage && vite build",
|
|
34
34
|
"clean": "rm -rf dist/ index.d.ts index.js index.js.map components/ react-hook-form-cloudscape.es.js react-hook-form-cloudscape.es.js.map react-hook-form-cloudscape.umd.js react-hook-form-cloudscape.umd.js.map",
|
|
35
35
|
"dry-run": "npx semantic-release --dry-run > dry-run-output.txt",
|
|
36
|
-
"
|
|
36
|
+
"format": "prettier --write .",
|
|
37
|
+
"lint": "eslint .",
|
|
38
|
+
"lint:fix": "eslint . --fix",
|
|
37
39
|
"prepare": "husky",
|
|
38
40
|
"test": "vitest",
|
|
39
41
|
"test:coverage": "vitest run --coverage"
|
|
@@ -62,6 +64,7 @@
|
|
|
62
64
|
"@vitest/coverage-v8": "^3.1.2",
|
|
63
65
|
"eslint": "^9.27.0",
|
|
64
66
|
"eslint-config-prettier": "^10.1.5",
|
|
67
|
+
"eslint-plugin-import": "^2.31.0",
|
|
65
68
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
66
69
|
"eslint-plugin-package-json": "^0.31.0",
|
|
67
70
|
"eslint-plugin-react": "^7.37.5",
|
|
@@ -728,7 +728,15 @@ const zr = ({
|
|
|
728
728
|
control: f,
|
|
729
729
|
defaultValue: s,
|
|
730
730
|
name: u,
|
|
731
|
-
render: ({ field: { ref: n, onChange: a, value: i = !1 } }) => /* @__PURE__ */ h.jsx(
|
|
731
|
+
render: ({ field: { ref: n, onChange: a, value: i = !1 } }) => /* @__PURE__ */ h.jsx(
|
|
732
|
+
mr,
|
|
733
|
+
{
|
|
734
|
+
ref: n,
|
|
735
|
+
checked: i,
|
|
736
|
+
onChange: p.bind(null, a),
|
|
737
|
+
...l
|
|
738
|
+
}
|
|
739
|
+
),
|
|
732
740
|
rules: c,
|
|
733
741
|
shouldUnregister: d
|
|
734
742
|
}
|
|
@@ -754,7 +762,14 @@ const zr = ({
|
|
|
754
762
|
control: f,
|
|
755
763
|
defaultValue: s,
|
|
756
764
|
name: u,
|
|
757
|
-
render: ({ field: { onChange: n, value: a } }) => /* @__PURE__ */ h.jsx(
|
|
765
|
+
render: ({ field: { onChange: n, value: a } }) => /* @__PURE__ */ h.jsx(
|
|
766
|
+
Rr,
|
|
767
|
+
{
|
|
768
|
+
selectedItems: a,
|
|
769
|
+
onSelectionChange: p.bind(null, n),
|
|
770
|
+
...l
|
|
771
|
+
}
|
|
772
|
+
),
|
|
758
773
|
rules: c,
|
|
759
774
|
shouldUnregister: d
|
|
760
775
|
}
|
|
@@ -956,16 +971,22 @@ const zr = ({
|
|
|
956
971
|
shouldUnregister: d
|
|
957
972
|
}
|
|
958
973
|
);
|
|
959
|
-
}, te = (u = []) => u != null && u.length ? u.map((f) => "options" in f ? te(f.options) : f.value).flat() : [], ne = (u = [], f = []) => u != null && u.length && (f != null && f.length) ? u.reduce(
|
|
960
|
-
|
|
961
|
-
if (
|
|
962
|
-
|
|
963
|
-
|
|
974
|
+
}, te = (u = []) => u != null && u.length ? u.map((f) => "options" in f ? te(f.options) : f.value).flat() : [], ne = (u = [], f = []) => u != null && u.length && (f != null && f.length) ? u.reduce(
|
|
975
|
+
(s, c) => {
|
|
976
|
+
if (u != null && u.length) {
|
|
977
|
+
if ("options" in c) {
|
|
978
|
+
const d = ne(
|
|
979
|
+
c.options,
|
|
980
|
+
f
|
|
981
|
+
);
|
|
982
|
+
d != null && d.length && s.push(...d);
|
|
983
|
+
}
|
|
984
|
+
"value" in c && f.find((d) => d === c.value) && s.push(c);
|
|
964
985
|
}
|
|
965
|
-
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
|
|
986
|
+
return s;
|
|
987
|
+
},
|
|
988
|
+
[]
|
|
989
|
+
).flat() : [], nt = { transformMultiselectOptionsToArray: te, mapSelectedOptionsWithOptions: ne }, at = ({
|
|
969
990
|
name: u,
|
|
970
991
|
control: f,
|
|
971
992
|
options: s,
|
|
@@ -1054,7 +1075,15 @@ const zr = ({
|
|
|
1054
1075
|
control: f,
|
|
1055
1076
|
defaultValue: d,
|
|
1056
1077
|
name: u,
|
|
1057
|
-
render: ({ field: { onChange: n, value: a } }) => /* @__PURE__ */ h.jsx(
|
|
1078
|
+
render: ({ field: { onChange: n, value: a } }) => /* @__PURE__ */ h.jsx(
|
|
1079
|
+
Pr,
|
|
1080
|
+
{
|
|
1081
|
+
items: l.items,
|
|
1082
|
+
value: a,
|
|
1083
|
+
onChange: p.bind(null, n),
|
|
1084
|
+
...l
|
|
1085
|
+
}
|
|
1086
|
+
),
|
|
1058
1087
|
rules: c,
|
|
1059
1088
|
shouldUnregister: t
|
|
1060
1089
|
}
|
|
@@ -1098,7 +1127,10 @@ const zr = ({
|
|
|
1098
1127
|
return u && f && (s = u.reduce(
|
|
1099
1128
|
(c, d) => {
|
|
1100
1129
|
if ("options" in d) {
|
|
1101
|
-
const t = De(
|
|
1130
|
+
const t = De(
|
|
1131
|
+
d.options,
|
|
1132
|
+
f
|
|
1133
|
+
);
|
|
1102
1134
|
t && c.push(t);
|
|
1103
1135
|
}
|
|
1104
1136
|
return "value" in d && d.value === f && c.push(d), c;
|
|
@@ -1314,7 +1346,15 @@ const zr = ({
|
|
|
1314
1346
|
control: f,
|
|
1315
1347
|
defaultValue: c,
|
|
1316
1348
|
name: u,
|
|
1317
|
-
render: ({ field: { onChange: n, value: a } }) => /* @__PURE__ */ h.jsx(
|
|
1349
|
+
render: ({ field: { onChange: n, value: a } }) => /* @__PURE__ */ h.jsx(
|
|
1350
|
+
Ir,
|
|
1351
|
+
{
|
|
1352
|
+
items: l.items,
|
|
1353
|
+
value: a,
|
|
1354
|
+
onChange: p.bind(null, n),
|
|
1355
|
+
...l
|
|
1356
|
+
}
|
|
1357
|
+
),
|
|
1318
1358
|
rules: d,
|
|
1319
1359
|
shouldUnregister: t
|
|
1320
1360
|
}
|
|
@@ -1382,7 +1422,16 @@ const zr = ({
|
|
|
1382
1422
|
control: f,
|
|
1383
1423
|
defaultValue: s,
|
|
1384
1424
|
name: u,
|
|
1385
|
-
render: ({ field: { ref: n, onChange: a, value: i = !1 } }) => /* @__PURE__ */ h.jsx(
|
|
1425
|
+
render: ({ field: { ref: n, onChange: a, value: i = !1 } }) => /* @__PURE__ */ h.jsx(
|
|
1426
|
+
Wr,
|
|
1427
|
+
{
|
|
1428
|
+
ref: n,
|
|
1429
|
+
checked: i,
|
|
1430
|
+
name: u,
|
|
1431
|
+
onChange: p.bind(null, a),
|
|
1432
|
+
...l
|
|
1433
|
+
}
|
|
1434
|
+
),
|
|
1386
1435
|
rules: c,
|
|
1387
1436
|
shouldUnregister: d
|
|
1388
1437
|
}
|