@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.
Files changed (3) hide show
  1. package/helpers.js +1 -1
  2. package/helpers.mjs +1 -1
  3. 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 = typeof metadata.initialValue === 'boolean' ? metadata.initialValue : metadata.initialValue === props.value;
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 = typeof metadata.initialValue === 'boolean' ? metadata.initialValue : metadata.initialValue === props.value;
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
- "name": "@conform-to/react",
3
- "description": "Conform view adapter for react",
4
- "homepage": "https://conform.guide",
5
- "license": "MIT",
6
- "version": "1.1.3",
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
- "scripts": {
20
- "build:js": "rollup -c",
21
- "build:ts": "tsc",
22
- "build": "pnpm run \"/^build:.*/\"",
23
- "dev:js": "pnpm run build:js --watch",
24
- "dev:ts": "pnpm run build:ts --watch",
25
- "dev": "pnpm run \"/^dev:.*/\"",
26
- "prepare": "pnpm run build"
27
- },
28
- "repository": {
29
- "type": "git",
30
- "url": "https://github.com/edmundhung/conform",
31
- "directory": "packages/conform-react"
32
- },
33
- "author": {
34
- "name": "Edmund Hung",
35
- "email": "me@edmund.dev",
36
- "url": "https://edmund.dev"
37
- },
38
- "bugs": {
39
- "url": "https://github.com/edmundhung/conform/issues"
40
- },
41
- "dependencies": {
42
- "@conform-to/dom": "1.1.3"
43
- },
44
- "devDependencies": {
45
- "@babel/core": "^7.17.8",
46
- "@babel/preset-env": "^7.20.2",
47
- "@babel/preset-react": "^7.18.6",
48
- "@babel/preset-typescript": "^7.20.2",
49
- "@rollup/plugin-babel": "^5.3.1",
50
- "@rollup/plugin-node-resolve": "^13.3.0",
51
- "@types/react": "^18.2.43",
52
- "react": "^18.2.0",
53
- "rollup-plugin-copy": "^3.4.0",
54
- "rollup": "^2.79.1"
55
- },
56
- "peerDependencies": {
57
- "react": ">=18"
58
- },
59
- "keywords": [
60
- "constraint-validation",
61
- "form",
62
- "form-validation",
63
- "html",
64
- "progressive-enhancement",
65
- "validation",
66
- "react",
67
- "remix"
68
- ],
69
- "sideEffects": false
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
+ }