@public-ui/react-hook-form-adapter 3.0.7 → 3.0.8-rc.1
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/README.md +8 -13
- package/dist/index.d.cts +6 -1
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -18,18 +18,13 @@ import { useForm } from 'react-hook-form';
|
|
|
18
18
|
import { KolInputTextController } from '@public-ui/react-hook-form-adapter';
|
|
19
19
|
|
|
20
20
|
const MyForm = () => {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
rules={{ required: 'Please enter your name' }}
|
|
30
|
-
_label="First name"
|
|
31
|
-
/>
|
|
32
|
-
</form>
|
|
33
|
-
);
|
|
21
|
+
const { control, handleSubmit } = useForm({
|
|
22
|
+
defaultValues: { firstName: '' },
|
|
23
|
+
});
|
|
24
|
+
return (
|
|
25
|
+
<form onSubmit={handleSubmit(console.log)}>
|
|
26
|
+
<KolInputTextController name="firstName" control={control} rules={{ required: 'Please enter your name' }} _label="First name" />
|
|
27
|
+
</form>
|
|
28
|
+
);
|
|
34
29
|
};
|
|
35
30
|
```
|
package/dist/index.d.cts
CHANGED
|
@@ -250,6 +250,9 @@ type InputTypeOnFocus = {
|
|
|
250
250
|
type InputTypeOnInput = {
|
|
251
251
|
[Callback$1.onInput]?: EventValueOrEventCallback<Event, unknown>;
|
|
252
252
|
};
|
|
253
|
+
type InputTypeOnKeyDown = {
|
|
254
|
+
[Callback$1.onKeyDown]?: EventCallback<KeyboardEvent>;
|
|
255
|
+
};
|
|
253
256
|
type Option<T> = {
|
|
254
257
|
disabled?: boolean;
|
|
255
258
|
label: string | number;
|
|
@@ -264,7 +267,7 @@ type Optgroup<T> = {
|
|
|
264
267
|
options: Option<T>[];
|
|
265
268
|
};
|
|
266
269
|
type SelectOption<T> = Option<T> | Optgroup<T> | RadioOption<T>;
|
|
267
|
-
type InputTypeOnDefault = InputTypeOnBlur & InputTypeOnClick & InputTypeOnChange & InputTypeOnFocus & InputTypeOnInput;
|
|
270
|
+
type InputTypeOnDefault = InputTypeOnBlur & InputTypeOnClick & InputTypeOnChange & InputTypeOnFocus & InputTypeOnInput & InputTypeOnKeyDown;
|
|
268
271
|
|
|
269
272
|
type W3CInputValue = string | number;
|
|
270
273
|
|
|
@@ -471,6 +474,7 @@ type ButtonProps = Generic.Element.Members<RequiredButtonProps, OptionalButtonPr
|
|
|
471
474
|
|
|
472
475
|
type RequiredProps$d = PropLabelWithExpertSlot & PropSuggestions;
|
|
473
476
|
type OptionalProps$d = {
|
|
477
|
+
hideClearButton: boolean;
|
|
474
478
|
msg: Stringified<MsgPropType>;
|
|
475
479
|
on: InputTypeOnDefault;
|
|
476
480
|
placeholder: string;
|
|
@@ -478,6 +482,7 @@ type OptionalProps$d = {
|
|
|
478
482
|
} & PropAccessKey & PropDisabled & PropHideMsg & PropHideLabel & PropHint & PropHorizontalIcons & PropName & PropRequired & PropShortKey & PropSyncValueBySelector & PropTouched;
|
|
479
483
|
type RequiredStates$d = {
|
|
480
484
|
hasValue: boolean;
|
|
485
|
+
hideClearButton: boolean;
|
|
481
486
|
suggestions: W3CInputValue[];
|
|
482
487
|
value: string;
|
|
483
488
|
} & PropId & PropHideMsg & PropLabelWithExpertSlot;
|
package/dist/index.d.mts
CHANGED
|
@@ -250,6 +250,9 @@ type InputTypeOnFocus = {
|
|
|
250
250
|
type InputTypeOnInput = {
|
|
251
251
|
[Callback$1.onInput]?: EventValueOrEventCallback<Event, unknown>;
|
|
252
252
|
};
|
|
253
|
+
type InputTypeOnKeyDown = {
|
|
254
|
+
[Callback$1.onKeyDown]?: EventCallback<KeyboardEvent>;
|
|
255
|
+
};
|
|
253
256
|
type Option<T> = {
|
|
254
257
|
disabled?: boolean;
|
|
255
258
|
label: string | number;
|
|
@@ -264,7 +267,7 @@ type Optgroup<T> = {
|
|
|
264
267
|
options: Option<T>[];
|
|
265
268
|
};
|
|
266
269
|
type SelectOption<T> = Option<T> | Optgroup<T> | RadioOption<T>;
|
|
267
|
-
type InputTypeOnDefault = InputTypeOnBlur & InputTypeOnClick & InputTypeOnChange & InputTypeOnFocus & InputTypeOnInput;
|
|
270
|
+
type InputTypeOnDefault = InputTypeOnBlur & InputTypeOnClick & InputTypeOnChange & InputTypeOnFocus & InputTypeOnInput & InputTypeOnKeyDown;
|
|
268
271
|
|
|
269
272
|
type W3CInputValue = string | number;
|
|
270
273
|
|
|
@@ -471,6 +474,7 @@ type ButtonProps = Generic.Element.Members<RequiredButtonProps, OptionalButtonPr
|
|
|
471
474
|
|
|
472
475
|
type RequiredProps$d = PropLabelWithExpertSlot & PropSuggestions;
|
|
473
476
|
type OptionalProps$d = {
|
|
477
|
+
hideClearButton: boolean;
|
|
474
478
|
msg: Stringified<MsgPropType>;
|
|
475
479
|
on: InputTypeOnDefault;
|
|
476
480
|
placeholder: string;
|
|
@@ -478,6 +482,7 @@ type OptionalProps$d = {
|
|
|
478
482
|
} & PropAccessKey & PropDisabled & PropHideMsg & PropHideLabel & PropHint & PropHorizontalIcons & PropName & PropRequired & PropShortKey & PropSyncValueBySelector & PropTouched;
|
|
479
483
|
type RequiredStates$d = {
|
|
480
484
|
hasValue: boolean;
|
|
485
|
+
hideClearButton: boolean;
|
|
481
486
|
suggestions: W3CInputValue[];
|
|
482
487
|
value: string;
|
|
483
488
|
} & PropId & PropHideMsg & PropLabelWithExpertSlot;
|
package/dist/index.d.ts
CHANGED
|
@@ -250,6 +250,9 @@ type InputTypeOnFocus = {
|
|
|
250
250
|
type InputTypeOnInput = {
|
|
251
251
|
[Callback$1.onInput]?: EventValueOrEventCallback<Event, unknown>;
|
|
252
252
|
};
|
|
253
|
+
type InputTypeOnKeyDown = {
|
|
254
|
+
[Callback$1.onKeyDown]?: EventCallback<KeyboardEvent>;
|
|
255
|
+
};
|
|
253
256
|
type Option<T> = {
|
|
254
257
|
disabled?: boolean;
|
|
255
258
|
label: string | number;
|
|
@@ -264,7 +267,7 @@ type Optgroup<T> = {
|
|
|
264
267
|
options: Option<T>[];
|
|
265
268
|
};
|
|
266
269
|
type SelectOption<T> = Option<T> | Optgroup<T> | RadioOption<T>;
|
|
267
|
-
type InputTypeOnDefault = InputTypeOnBlur & InputTypeOnClick & InputTypeOnChange & InputTypeOnFocus & InputTypeOnInput;
|
|
270
|
+
type InputTypeOnDefault = InputTypeOnBlur & InputTypeOnClick & InputTypeOnChange & InputTypeOnFocus & InputTypeOnInput & InputTypeOnKeyDown;
|
|
268
271
|
|
|
269
272
|
type W3CInputValue = string | number;
|
|
270
273
|
|
|
@@ -471,6 +474,7 @@ type ButtonProps = Generic.Element.Members<RequiredButtonProps, OptionalButtonPr
|
|
|
471
474
|
|
|
472
475
|
type RequiredProps$d = PropLabelWithExpertSlot & PropSuggestions;
|
|
473
476
|
type OptionalProps$d = {
|
|
477
|
+
hideClearButton: boolean;
|
|
474
478
|
msg: Stringified<MsgPropType>;
|
|
475
479
|
on: InputTypeOnDefault;
|
|
476
480
|
placeholder: string;
|
|
@@ -478,6 +482,7 @@ type OptionalProps$d = {
|
|
|
478
482
|
} & PropAccessKey & PropDisabled & PropHideMsg & PropHideLabel & PropHint & PropHorizontalIcons & PropName & PropRequired & PropShortKey & PropSyncValueBySelector & PropTouched;
|
|
479
483
|
type RequiredStates$d = {
|
|
480
484
|
hasValue: boolean;
|
|
485
|
+
hideClearButton: boolean;
|
|
481
486
|
suggestions: W3CInputValue[];
|
|
482
487
|
value: string;
|
|
483
488
|
} & PropId & PropHideMsg & PropLabelWithExpertSlot;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/react-hook-form-adapter",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.8-rc.1",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": {
|
|
@@ -58,13 +58,13 @@
|
|
|
58
58
|
"react-hook-form": "7.63.0",
|
|
59
59
|
"typescript": "5.9.3",
|
|
60
60
|
"unbuild": "3.6.1",
|
|
61
|
-
"@public-ui/components": "3.0.
|
|
62
|
-
"@public-ui/react-v19": "3.0.
|
|
61
|
+
"@public-ui/components": "3.0.8-rc.1",
|
|
62
|
+
"@public-ui/react-v19": "3.0.8-rc.1"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"react": "^19",
|
|
66
66
|
"react-hook-form": "^7",
|
|
67
|
-
"@public-ui/react-v19": "3.0.
|
|
67
|
+
"@public-ui/react-v19": "3.0.8-rc.1"
|
|
68
68
|
},
|
|
69
69
|
"sideEffects": false,
|
|
70
70
|
"type": "module",
|