@conform-to/react 1.1.3 → 1.1.4
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/helpers.js +1 -1
- package/helpers.mjs +1 -1
- package/package.json +68 -69
package/helpers.js
CHANGED
|
@@ -112,7 +112,7 @@ function getInputProps(metadata, options) {
|
|
|
112
112
|
if (typeof options.value === 'undefined' || options.value) {
|
|
113
113
|
if (options.type === 'checkbox' || options.type === 'radio') {
|
|
114
114
|
props.value = typeof options.value === 'string' ? options.value : 'on';
|
|
115
|
-
props.defaultChecked =
|
|
115
|
+
props.defaultChecked = Array.isArray(metadata.initialValue) ? metadata.initialValue.includes(options.value) : metadata.initialValue === props.value;
|
|
116
116
|
} else if (typeof metadata.initialValue === 'string') {
|
|
117
117
|
props.defaultValue = metadata.initialValue;
|
|
118
118
|
}
|
package/helpers.mjs
CHANGED
|
@@ -108,7 +108,7 @@ function getInputProps(metadata, options) {
|
|
|
108
108
|
if (typeof options.value === 'undefined' || options.value) {
|
|
109
109
|
if (options.type === 'checkbox' || options.type === 'radio') {
|
|
110
110
|
props.value = typeof options.value === 'string' ? options.value : 'on';
|
|
111
|
-
props.defaultChecked =
|
|
111
|
+
props.defaultChecked = Array.isArray(metadata.initialValue) ? metadata.initialValue.includes(options.value) : metadata.initialValue === props.value;
|
|
112
112
|
} else if (typeof metadata.initialValue === 'string') {
|
|
113
113
|
props.defaultValue = metadata.initialValue;
|
|
114
114
|
}
|
package/package.json
CHANGED
|
@@ -1,70 +1,69 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
2
|
+
"name": "@conform-to/react",
|
|
3
|
+
"description": "Conform view adapter for react",
|
|
4
|
+
"homepage": "https://conform.guide",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"version": "1.1.4",
|
|
7
|
+
"main": "index.js",
|
|
8
|
+
"module": "index.mjs",
|
|
9
|
+
"types": "index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./index.d.ts",
|
|
13
|
+
"module": "./index.mjs",
|
|
14
|
+
"import": "./index.mjs",
|
|
15
|
+
"require": "./index.js",
|
|
16
|
+
"default": "./index.mjs"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "https://github.com/edmundhung/conform",
|
|
22
|
+
"directory": "packages/conform-react"
|
|
23
|
+
},
|
|
24
|
+
"author": {
|
|
25
|
+
"name": "Edmund Hung",
|
|
26
|
+
"email": "me@edmund.dev",
|
|
27
|
+
"url": "https://edmund.dev"
|
|
28
|
+
},
|
|
29
|
+
"bugs": {
|
|
30
|
+
"url": "https://github.com/edmundhung/conform/issues"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@conform-to/dom": "1.1.4"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@babel/core": "^7.17.8",
|
|
37
|
+
"@babel/preset-env": "^7.20.2",
|
|
38
|
+
"@babel/preset-react": "^7.18.6",
|
|
39
|
+
"@babel/preset-typescript": "^7.20.2",
|
|
40
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
41
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
42
|
+
"@types/react": "^18.2.43",
|
|
43
|
+
"react": "^18.2.0",
|
|
44
|
+
"rollup-plugin-copy": "^3.4.0",
|
|
45
|
+
"rollup": "^2.79.1"
|
|
46
|
+
},
|
|
47
|
+
"peerDependencies": {
|
|
48
|
+
"react": ">=18"
|
|
49
|
+
},
|
|
50
|
+
"keywords": [
|
|
51
|
+
"constraint-validation",
|
|
52
|
+
"form",
|
|
53
|
+
"form-validation",
|
|
54
|
+
"html",
|
|
55
|
+
"progressive-enhancement",
|
|
56
|
+
"validation",
|
|
57
|
+
"react",
|
|
58
|
+
"remix"
|
|
59
|
+
],
|
|
60
|
+
"sideEffects": false,
|
|
61
|
+
"scripts": {
|
|
62
|
+
"build:js": "rollup -c",
|
|
63
|
+
"build:ts": "tsc",
|
|
64
|
+
"build": "pnpm run \"/^build:.*/\"",
|
|
65
|
+
"dev:js": "pnpm run build:js --watch",
|
|
66
|
+
"dev:ts": "pnpm run build:ts --watch",
|
|
67
|
+
"dev": "pnpm run \"/^dev:.*/\""
|
|
68
|
+
}
|
|
69
|
+
}
|