@public-ui/react-hook-form-adapter 3.0.8-rc.0 → 3.0.8-rc.2
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.cjs +0 -1
- package/dist/index.d.cts +7 -4
- package/dist/index.d.mts +7 -4
- package/dist/index.d.ts +7 -4
- package/dist/index.mjs +1 -1
- package/package.json +6 -6
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.cjs
CHANGED
|
@@ -94,4 +94,3 @@ exports.KolInputTextController = KolInputTextController;
|
|
|
94
94
|
exports.KolSelectController = KolSelectController;
|
|
95
95
|
exports.KolSingleSelectController = KolSingleSelectController;
|
|
96
96
|
exports.KolTextareaController = KolTextareaController;
|
|
97
|
-
exports.withController = withController;
|
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;
|
|
@@ -789,9 +794,7 @@ type ControllerBaseProps = {
|
|
|
789
794
|
shouldUnregister?: boolean;
|
|
790
795
|
disabled?: boolean;
|
|
791
796
|
};
|
|
792
|
-
type ExtractProps<T> = T extends React.ComponentType<infer P> ? P : T extends React.ForwardRefExoticComponent<infer P> ? P : never;
|
|
793
797
|
type ControllerComponent<P> = React.ForwardRefExoticComponent<P & ControllerBaseProps & RefAttributes<HTMLElement>>;
|
|
794
|
-
declare function withController<T extends React.ComponentType<any>>(Component: T, valueProp?: string): ControllerComponent<ExtractProps<T>>;
|
|
795
798
|
declare const KolInputTextController: ControllerComponent<any>;
|
|
796
799
|
declare const KolInputPasswordController: ControllerComponent<any>;
|
|
797
800
|
declare const KolInputEmailController: ControllerComponent<any>;
|
|
@@ -807,5 +810,5 @@ declare const KolSingleSelectController: ControllerComponent<any>;
|
|
|
807
810
|
declare const KolInputRadioController: ControllerComponent<any>;
|
|
808
811
|
declare const KolInputCheckboxController: ControllerComponent<any>;
|
|
809
812
|
|
|
810
|
-
export { KolComboboxController, KolInputCheckboxController, KolInputColorController, KolInputDateController, KolInputEmailController, KolInputFileController, KolInputNumberController, KolInputPasswordController, KolInputRadioController, KolInputRangeController, KolInputTextController, KolSelectController, KolSingleSelectController, KolTextareaController
|
|
813
|
+
export { KolComboboxController, KolInputCheckboxController, KolInputColorController, KolInputDateController, KolInputEmailController, KolInputFileController, KolInputNumberController, KolInputPasswordController, KolInputRadioController, KolInputRangeController, KolInputTextController, KolSelectController, KolSingleSelectController, KolTextareaController };
|
|
811
814
|
export type { ComboboxAPI, InputCheckboxAPI, InputColorAPI, InputDateAPI, InputEmailAPI, InputFileAPI, InputNumberAPI, InputPasswordAPI, InputRadioAPI, InputRangeAPI, InputTextAPI, SelectAPI, SingleSelectAPI, TextareaAPI };
|
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;
|
|
@@ -789,9 +794,7 @@ type ControllerBaseProps = {
|
|
|
789
794
|
shouldUnregister?: boolean;
|
|
790
795
|
disabled?: boolean;
|
|
791
796
|
};
|
|
792
|
-
type ExtractProps<T> = T extends React.ComponentType<infer P> ? P : T extends React.ForwardRefExoticComponent<infer P> ? P : never;
|
|
793
797
|
type ControllerComponent<P> = React.ForwardRefExoticComponent<P & ControllerBaseProps & RefAttributes<HTMLElement>>;
|
|
794
|
-
declare function withController<T extends React.ComponentType<any>>(Component: T, valueProp?: string): ControllerComponent<ExtractProps<T>>;
|
|
795
798
|
declare const KolInputTextController: ControllerComponent<any>;
|
|
796
799
|
declare const KolInputPasswordController: ControllerComponent<any>;
|
|
797
800
|
declare const KolInputEmailController: ControllerComponent<any>;
|
|
@@ -807,5 +810,5 @@ declare const KolSingleSelectController: ControllerComponent<any>;
|
|
|
807
810
|
declare const KolInputRadioController: ControllerComponent<any>;
|
|
808
811
|
declare const KolInputCheckboxController: ControllerComponent<any>;
|
|
809
812
|
|
|
810
|
-
export { KolComboboxController, KolInputCheckboxController, KolInputColorController, KolInputDateController, KolInputEmailController, KolInputFileController, KolInputNumberController, KolInputPasswordController, KolInputRadioController, KolInputRangeController, KolInputTextController, KolSelectController, KolSingleSelectController, KolTextareaController
|
|
813
|
+
export { KolComboboxController, KolInputCheckboxController, KolInputColorController, KolInputDateController, KolInputEmailController, KolInputFileController, KolInputNumberController, KolInputPasswordController, KolInputRadioController, KolInputRangeController, KolInputTextController, KolSelectController, KolSingleSelectController, KolTextareaController };
|
|
811
814
|
export type { ComboboxAPI, InputCheckboxAPI, InputColorAPI, InputDateAPI, InputEmailAPI, InputFileAPI, InputNumberAPI, InputPasswordAPI, InputRadioAPI, InputRangeAPI, InputTextAPI, SelectAPI, SingleSelectAPI, TextareaAPI };
|
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;
|
|
@@ -789,9 +794,7 @@ type ControllerBaseProps = {
|
|
|
789
794
|
shouldUnregister?: boolean;
|
|
790
795
|
disabled?: boolean;
|
|
791
796
|
};
|
|
792
|
-
type ExtractProps<T> = T extends React.ComponentType<infer P> ? P : T extends React.ForwardRefExoticComponent<infer P> ? P : never;
|
|
793
797
|
type ControllerComponent<P> = React.ForwardRefExoticComponent<P & ControllerBaseProps & RefAttributes<HTMLElement>>;
|
|
794
|
-
declare function withController<T extends React.ComponentType<any>>(Component: T, valueProp?: string): ControllerComponent<ExtractProps<T>>;
|
|
795
798
|
declare const KolInputTextController: ControllerComponent<any>;
|
|
796
799
|
declare const KolInputPasswordController: ControllerComponent<any>;
|
|
797
800
|
declare const KolInputEmailController: ControllerComponent<any>;
|
|
@@ -807,5 +810,5 @@ declare const KolSingleSelectController: ControllerComponent<any>;
|
|
|
807
810
|
declare const KolInputRadioController: ControllerComponent<any>;
|
|
808
811
|
declare const KolInputCheckboxController: ControllerComponent<any>;
|
|
809
812
|
|
|
810
|
-
export { KolComboboxController, KolInputCheckboxController, KolInputColorController, KolInputDateController, KolInputEmailController, KolInputFileController, KolInputNumberController, KolInputPasswordController, KolInputRadioController, KolInputRangeController, KolInputTextController, KolSelectController, KolSingleSelectController, KolTextareaController
|
|
813
|
+
export { KolComboboxController, KolInputCheckboxController, KolInputColorController, KolInputDateController, KolInputEmailController, KolInputFileController, KolInputNumberController, KolInputPasswordController, KolInputRadioController, KolInputRangeController, KolInputTextController, KolSelectController, KolSingleSelectController, KolTextareaController };
|
|
811
814
|
export type { ComboboxAPI, InputCheckboxAPI, InputColorAPI, InputDateAPI, InputEmailAPI, InputFileAPI, InputNumberAPI, InputPasswordAPI, InputRadioAPI, InputRangeAPI, InputTextAPI, SelectAPI, SingleSelectAPI, TextareaAPI };
|
package/dist/index.mjs
CHANGED
|
@@ -74,4 +74,4 @@ const KolSingleSelectController = withController(KolSingleSelect, "_value");
|
|
|
74
74
|
const KolInputRadioController = withController(KolInputRadio, "_value");
|
|
75
75
|
const KolInputCheckboxController = withController(KolInputCheckbox, "_checked");
|
|
76
76
|
|
|
77
|
-
export { KolComboboxController, KolInputCheckboxController, KolInputColorController, KolInputDateController, KolInputEmailController, KolInputFileController, KolInputNumberController, KolInputPasswordController, KolInputRadioController, KolInputRangeController, KolInputTextController, KolSelectController, KolSingleSelectController, KolTextareaController
|
|
77
|
+
export { KolComboboxController, KolInputCheckboxController, KolInputColorController, KolInputDateController, KolInputEmailController, KolInputFileController, KolInputNumberController, KolInputPasswordController, KolInputRadioController, KolInputRangeController, KolInputTextController, KolSelectController, KolSingleSelectController, KolTextareaController };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/react-hook-form-adapter",
|
|
3
|
-
"version": "3.0.8-rc.
|
|
3
|
+
"version": "3.0.8-rc.2",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": {
|
|
@@ -46,25 +46,25 @@
|
|
|
46
46
|
"react-hook-form"
|
|
47
47
|
],
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@types/react": "18.3.
|
|
49
|
+
"@types/react": "18.3.27",
|
|
50
50
|
"@types/react-dom": "18.3.7",
|
|
51
51
|
"@typescript-eslint/eslint-plugin": "7.18.0",
|
|
52
52
|
"@typescript-eslint/parser": "7.18.0",
|
|
53
53
|
"eslint": "8.57.1",
|
|
54
|
-
"prettier": "3.
|
|
54
|
+
"prettier": "3.7.0",
|
|
55
55
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
56
56
|
"react": "19.1.1",
|
|
57
57
|
"react-dom": "19.2.0",
|
|
58
58
|
"react-hook-form": "7.63.0",
|
|
59
59
|
"typescript": "5.9.3",
|
|
60
60
|
"unbuild": "3.6.1",
|
|
61
|
-
"@public-ui/
|
|
62
|
-
"@public-ui/
|
|
61
|
+
"@public-ui/components": "3.0.8-rc.2",
|
|
62
|
+
"@public-ui/react-v19": "3.0.8-rc.2"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
65
|
"react": "^19",
|
|
66
66
|
"react-hook-form": "^7",
|
|
67
|
-
"@public-ui/react-v19": "3.0.8-rc.
|
|
67
|
+
"@public-ui/react-v19": "3.0.8-rc.2"
|
|
68
68
|
},
|
|
69
69
|
"sideEffects": false,
|
|
70
70
|
"type": "module",
|