@public-ui/react-hook-form-adapter 3.1.2-rc.1 → 3.1.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/dist/index.cjs +4 -3
- package/dist/index.d.cts +0 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +4 -3
- package/package.json +10 -9
package/dist/index.cjs
CHANGED
|
@@ -10,7 +10,7 @@ const React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
10
10
|
|
|
11
11
|
function withController(Component, valueProp) {
|
|
12
12
|
const ControllerWrapper = React__default.forwardRef((props, ref) => {
|
|
13
|
-
const { name, control, rules, defaultValue, shouldUnregister,
|
|
13
|
+
const { name, control, rules, defaultValue, shouldUnregister, ...componentProps } = props;
|
|
14
14
|
return /* @__PURE__ */ React__default.createElement(
|
|
15
15
|
reactHookForm.Controller,
|
|
16
16
|
{
|
|
@@ -19,7 +19,7 @@ function withController(Component, valueProp) {
|
|
|
19
19
|
rules,
|
|
20
20
|
defaultValue,
|
|
21
21
|
shouldUnregister,
|
|
22
|
-
disabled,
|
|
22
|
+
disabled: props._disabled,
|
|
23
23
|
render: ({ field, fieldState }) => {
|
|
24
24
|
const userHandlers = componentProps._on;
|
|
25
25
|
const mergedProps = {
|
|
@@ -33,7 +33,8 @@ function withController(Component, valueProp) {
|
|
|
33
33
|
},
|
|
34
34
|
_name: name,
|
|
35
35
|
_touched: fieldState.isTouched,
|
|
36
|
-
_disabled:
|
|
36
|
+
_disabled: field.disabled,
|
|
37
|
+
// https://react-hook-form.com/docs/useform#disabled
|
|
37
38
|
_msg: fieldState.error ? {
|
|
38
39
|
_type: "error",
|
|
39
40
|
_description: fieldState.error.message || String(fieldState.error)
|
package/dist/index.d.cts
CHANGED
|
@@ -10,7 +10,6 @@ type ControllerBaseProps<TControl = Control<any>> = {
|
|
|
10
10
|
rules?: any;
|
|
11
11
|
defaultValue?: any;
|
|
12
12
|
shouldUnregister?: boolean;
|
|
13
|
-
disabled?: boolean;
|
|
14
13
|
};
|
|
15
14
|
type ControllerComponent<P> = React.ForwardRefExoticComponent<P & ControllerBaseProps<any> & RefAttributes<HTMLElement>>;
|
|
16
15
|
declare const KolInputTextController: ControllerComponent<_public_ui_components.JSX.KolInputText & Omit<React.HTMLAttributes<HTMLKolInputTextElement>, "style"> & _public_ui_react_v19.StyleReactProps & React.RefAttributes<HTMLKolInputTextElement>>;
|
package/dist/index.d.mts
CHANGED
|
@@ -10,7 +10,6 @@ type ControllerBaseProps<TControl = Control<any>> = {
|
|
|
10
10
|
rules?: any;
|
|
11
11
|
defaultValue?: any;
|
|
12
12
|
shouldUnregister?: boolean;
|
|
13
|
-
disabled?: boolean;
|
|
14
13
|
};
|
|
15
14
|
type ControllerComponent<P> = React.ForwardRefExoticComponent<P & ControllerBaseProps<any> & RefAttributes<HTMLElement>>;
|
|
16
15
|
declare const KolInputTextController: ControllerComponent<_public_ui_components.JSX.KolInputText & Omit<React.HTMLAttributes<HTMLKolInputTextElement>, "style"> & _public_ui_react_v19.StyleReactProps & React.RefAttributes<HTMLKolInputTextElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ type ControllerBaseProps<TControl = Control<any>> = {
|
|
|
10
10
|
rules?: any;
|
|
11
11
|
defaultValue?: any;
|
|
12
12
|
shouldUnregister?: boolean;
|
|
13
|
-
disabled?: boolean;
|
|
14
13
|
};
|
|
15
14
|
type ControllerComponent<P> = React.ForwardRefExoticComponent<P & ControllerBaseProps<any> & RefAttributes<HTMLElement>>;
|
|
16
15
|
declare const KolInputTextController: ControllerComponent<_public_ui_components.JSX.KolInputText & Omit<React.HTMLAttributes<HTMLKolInputTextElement>, "style"> & _public_ui_react_v19.StyleReactProps & React.RefAttributes<HTMLKolInputTextElement>>;
|
package/dist/index.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import { Controller } from 'react-hook-form';
|
|
|
4
4
|
|
|
5
5
|
function withController(Component, valueProp) {
|
|
6
6
|
const ControllerWrapper = React.forwardRef((props, ref) => {
|
|
7
|
-
const { name, control, rules, defaultValue, shouldUnregister,
|
|
7
|
+
const { name, control, rules, defaultValue, shouldUnregister, ...componentProps } = props;
|
|
8
8
|
return /* @__PURE__ */ React.createElement(
|
|
9
9
|
Controller,
|
|
10
10
|
{
|
|
@@ -13,7 +13,7 @@ function withController(Component, valueProp) {
|
|
|
13
13
|
rules,
|
|
14
14
|
defaultValue,
|
|
15
15
|
shouldUnregister,
|
|
16
|
-
disabled,
|
|
16
|
+
disabled: props._disabled,
|
|
17
17
|
render: ({ field, fieldState }) => {
|
|
18
18
|
const userHandlers = componentProps._on;
|
|
19
19
|
const mergedProps = {
|
|
@@ -27,7 +27,8 @@ function withController(Component, valueProp) {
|
|
|
27
27
|
},
|
|
28
28
|
_name: name,
|
|
29
29
|
_touched: fieldState.isTouched,
|
|
30
|
-
_disabled:
|
|
30
|
+
_disabled: field.disabled,
|
|
31
|
+
// https://react-hook-form.com/docs/useform#disabled
|
|
31
32
|
_msg: fieldState.error ? {
|
|
32
33
|
_type: "error",
|
|
33
34
|
_description: fieldState.error.message || String(fieldState.error)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/react-hook-form-adapter",
|
|
3
|
-
"version": "3.1.2
|
|
3
|
+
"version": "3.1.2",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": {
|
|
@@ -46,25 +46,26 @@
|
|
|
46
46
|
"react-hook-form"
|
|
47
47
|
],
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@
|
|
49
|
+
"@eslint/js": "9.39.2",
|
|
50
|
+
"@types/react": "19.2.13",
|
|
50
51
|
"@types/react-dom": "19.2.3",
|
|
51
|
-
"@typescript-eslint/eslint-plugin": "
|
|
52
|
-
"@typescript-eslint/parser": "
|
|
53
|
-
"eslint": "
|
|
52
|
+
"@typescript-eslint/eslint-plugin": "8.54.0",
|
|
53
|
+
"@typescript-eslint/parser": "8.54.0",
|
|
54
|
+
"eslint": "9.39.2",
|
|
54
55
|
"prettier": "3.8.1",
|
|
55
56
|
"prettier-plugin-organize-imports": "4.3.0",
|
|
56
|
-
"react": "19.2.
|
|
57
|
+
"react": "19.2.3",
|
|
57
58
|
"react-dom": "19.2.4",
|
|
58
59
|
"react-hook-form": "7.63.0",
|
|
59
60
|
"typescript": "5.9.3",
|
|
60
61
|
"unbuild": "3.6.1",
|
|
61
|
-
"@public-ui/components": "3.1.2
|
|
62
|
-
"@public-ui/react-v19": "3.1.2
|
|
62
|
+
"@public-ui/components": "3.1.2",
|
|
63
|
+
"@public-ui/react-v19": "3.1.2"
|
|
63
64
|
},
|
|
64
65
|
"peerDependencies": {
|
|
65
66
|
"react": "^19",
|
|
66
67
|
"react-hook-form": "^7",
|
|
67
|
-
"@public-ui/react-v19": "3.1.2
|
|
68
|
+
"@public-ui/react-v19": "3.1.2"
|
|
68
69
|
},
|
|
69
70
|
"sideEffects": false,
|
|
70
71
|
"type": "module",
|