Skip to content

Commit

Permalink
πŸ§Ÿβ€β™‚οΈ feat: support disabled prop for useController (#10810)
Browse files Browse the repository at this point in the history
* πŸ§Ÿβ€β™‚οΈ support disabled prop for useController

* remove useState import

* remove replayio

* udpate api
  • Loading branch information
bluebill1049 committed Aug 20, 2023
1 parent fa0daca commit abb9ada
Show file tree
Hide file tree
Showing 8 changed files with 114 additions and 192 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"author": "<bluebill1049@hotmail.com>",
"license": "MIT",
"devDependencies": {
"@replayio/cypress": "^1.0.5",
"@microsoft/api-extractor": "^7.35.2",
"@rollup/plugin-commonjs": "^22.0.2",
"@rollup/plugin-node-resolve": "^14.1.0",
Expand Down
182 changes: 0 additions & 182 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 13 additions & 1 deletion reports/api-extractor.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ export type Control<TFieldValues extends FieldValues = FieldValues, TContext = a
_getWatch: WatchInternal<TFieldValues>;
_updateFieldArray: BatchFieldArrayUpdate;
_getFieldArray: <TFieldArrayValues>(name: InternalFieldName) => Partial<TFieldArrayValues>[];
_updateDisabledField: (props: {
disabled?: boolean;
name: FieldName<any>;
} & ({
field?: Field;
fields?: undefined;
} | {
field?: undefined;
fields?: FieldRefs;
})) => void;
_executeSchema: (names: InternalFieldName[]) => Promise<{
errors: FieldErrors;
}>;
Expand Down Expand Up @@ -94,6 +104,7 @@ export type ControllerProps<TFieldValues extends FieldValues = FieldValues, TNam
export type ControllerRenderProps<TFieldValues extends FieldValues = FieldValues, TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>> = {
onChange: (...event: any[]) => void;
onBlur: Noop;
disabled?: boolean;
value: FieldPathValue<TFieldValues, TName>;
name: TName;
ref: RefCallBack;
Expand Down Expand Up @@ -555,6 +566,7 @@ export type UseControllerProps<TFieldValues extends FieldValues = FieldValues, T
shouldUnregister?: boolean;
defaultValue?: FieldPathValue<TFieldValues, TName>;
control?: Control<TFieldValues>;
disabled?: boolean;
};

// @public (undocumented)
Expand Down Expand Up @@ -828,7 +840,7 @@ export type WatchObserver<TFieldValues extends FieldValues> = (value: DeepPartia

// Warnings were encountered during analysis:
//
// src/types/form.ts:431:3 - (ae-forgotten-export) The symbol "Subscription" needs to be exported by the entry point index.d.ts
// src/types/form.ts:433:3 - (ae-forgotten-export) The symbol "Subscription" needs to be exported by the entry point index.d.ts

// (No @packageDocumentation comment for this package)

Expand Down
Loading

0 comments on commit abb9ada

Please sign in to comment.