diff --git a/CHANGELOG.md b/CHANGELOG.md index b594f05f06..36a54e1f9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,8 @@ should change the heading of the (upcoming) version to include a major version b --> # 5.0.0-beta-15 +## @rjsf/semantic-ui +- Fix CheckboxWidget missing label [#3302](https://github.com/rjsf-team/react-jsonschema-form/issues/3302) ## @rjsf/core - Pass the `schema` along to the `ArrayFieldItemTemplate` as part of the fix for [#3253](https://github.com/rjsf-team/react-jsonschema-form/issues/3253) diff --git a/package-lock.json b/package-lock.json index e7f7033014..b032c5846f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,7 +5,6 @@ "requires": true, "packages": { "": { - "name": "react-jsonschema-form", "hasInstallScript": true, "license": "Apache-2.0", "devDependencies": { diff --git a/package.json b/package.json index ebc8dd7746..10b33d0f4e 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,9 @@ "build-serial": "lerna run --concurrency 1 --stream build", "start": "lerna run start --stream --parallel", "pre-commit:husky": "lerna run --concurrency 1 --stream precommit", - "prepare": "husky install" + "prepare": "husky install", + "clean:modules": "rimraf node_modules && rimraf packages/*/node_modules", + "r": "node ./scripts/run.js" }, "license": "Apache-2.0", "homepage": "https://github.com/rjsf-team/react-jsonschema-form", diff --git a/packages/antd/package-lock.json b/packages/antd/package-lock.json index 7c2b0544e2..e79bd95b46 100644 --- a/packages/antd/package-lock.json +++ b/packages/antd/package-lock.json @@ -18,6 +18,7 @@ "@babel/preset-env": "^7.19.4", "@babel/preset-react": "^7.18.6", "@babel/register": "^7.18.9", + "@rjsf/validator-ajv8": "*", "@rollup/plugin-replace": "^5.0.1", "@types/lodash": "^4.14.186", "@types/react": "^17.0.39", @@ -25978,6 +25979,68 @@ "resolved": "../utils", "link": true }, + "node_modules/@rjsf/validator-ajv8": { + "version": "5.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.14.tgz", + "integrity": "sha512-0zxjU5xLzQeGI8Eh31lZCBY0Duq1DQowenLFDRl4CsaE3B63NYhfWpGuYaSs9IL1hFSO669ub1uokdm+zpNX4Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "ajv-formats": "^2.1.1", + "ajv8": "npm:ajv@^8.11.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.15" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@rjsf/utils": "^5.0.0-beta.12" + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/@rollup/plugin-babel": { "version": "5.3.1", "dev": true, @@ -26704,6 +26767,29 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv8": { + "name": "ajv", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv8/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "node_modules/ansi-escapes": { "version": "4.3.2", "dev": true, @@ -34615,6 +34701,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resize-observer-polyfill": { "version": "1.5.1", "dev": true, @@ -60263,6 +60358,49 @@ } } }, + "@rjsf/validator-ajv8": { + "version": "5.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.14.tgz", + "integrity": "sha512-0zxjU5xLzQeGI8Eh31lZCBY0Duq1DQowenLFDRl4CsaE3B63NYhfWpGuYaSs9IL1hFSO669ub1uokdm+zpNX4Q==", + "dev": true, + "requires": { + "ajv-formats": "^2.1.1", + "ajv8": "npm:ajv@^8.11.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.15" + }, + "dependencies": { + "ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "requires": {} + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "optional": true, + "peer": true + } + } + }, "@rollup/plugin-babel": { "version": "5.3.1", "dev": true, @@ -60734,6 +60872,26 @@ "uri-js": "^4.2.2" } }, + "ajv8": { + "version": "npm:ajv@8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "dependencies": { + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, "ansi-escapes": { "version": "4.3.2", "dev": true, @@ -65937,6 +66095,12 @@ "version": "2.1.1", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "resize-observer-polyfill": { "version": "1.5.1", "dev": true diff --git a/packages/antd/test/Form.test.tsx b/packages/antd/test/Form.test.tsx index da30a2d38f..649c70d3e3 100644 --- a/packages/antd/test/Form.test.tsx +++ b/packages/antd/test/Form.test.tsx @@ -183,9 +183,10 @@ describe("single fields", () => { .toJSON(); expect(tree).toMatchSnapshot(); }); - test("checkbox field", () => { + test("checkbox field with label", () => { const schema: RJSFSchema = { type: "boolean", + title: "test", }; const tree = renderer .create(
) diff --git a/packages/antd/test/__snapshots__/Form.test.tsx.snap b/packages/antd/test/__snapshots__/Form.test.tsx.snap index c0f8faf063..cc3b7630cb 100644 --- a/packages/antd/test/__snapshots__/Form.test.tsx.snap +++ b/packages/antd/test/__snapshots__/Form.test.tsx.snap @@ -53,7 +53,7 @@ exports[`single fields checkbox field 1`] = `
`; -exports[`single fields checkbox field 2`] = ` +exports[`single fields checkbox field with label 1`] = `
- + test diff --git a/packages/bootstrap-4/package-lock.json b/packages/bootstrap-4/package-lock.json index 78303973f2..e2a7452fe0 100644 --- a/packages/bootstrap-4/package-lock.json +++ b/packages/bootstrap-4/package-lock.json @@ -17,6 +17,7 @@ "@babel/plugin-transform-modules-commonjs": "^7.19.6", "@babel/preset-env": "^7.19.4", "@babel/preset-react": "^7.18.6", + "@rjsf/validator-ajv8": "*", "@types/react": "^17.0.48", "@types/react-dom": "^17.0.17", "@types/react-test-renderer": "^17.0.2", @@ -25841,6 +25842,68 @@ "resolved": "../utils", "link": true }, + "node_modules/@rjsf/validator-ajv8": { + "version": "5.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.14.tgz", + "integrity": "sha512-0zxjU5xLzQeGI8Eh31lZCBY0Duq1DQowenLFDRl4CsaE3B63NYhfWpGuYaSs9IL1hFSO669ub1uokdm+zpNX4Q==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "ajv-formats": "^2.1.1", + "ajv8": "npm:ajv@^8.11.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.15" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@rjsf/utils": "^5.0.0-beta.12" + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/@rollup/plugin-babel": { "version": "5.3.1", "dev": true, @@ -26643,6 +26706,29 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv8": { + "name": "ajv", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv8/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "node_modules/ansi-colors": { "version": "4.1.3", "dev": true, @@ -32516,6 +32602,12 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, "node_modules/lodash.debounce": { "version": "4.0.8", "dev": true, @@ -33758,6 +33850,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve": { "version": "1.22.1", "dev": true, @@ -59280,6 +59381,49 @@ } } }, + "@rjsf/validator-ajv8": { + "version": "5.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.14.tgz", + "integrity": "sha512-0zxjU5xLzQeGI8Eh31lZCBY0Duq1DQowenLFDRl4CsaE3B63NYhfWpGuYaSs9IL1hFSO669ub1uokdm+zpNX4Q==", + "dev": true, + "requires": { + "ajv-formats": "^2.1.1", + "ajv8": "npm:ajv@^8.11.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.15" + }, + "dependencies": { + "ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "requires": {} + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "optional": true, + "peer": true + } + } + }, "@rollup/plugin-babel": { "version": "5.3.1", "dev": true, @@ -59792,6 +59936,26 @@ "uri-js": "^4.2.2" } }, + "ajv8": { + "version": "npm:ajv@8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "dependencies": { + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, "ansi-colors": { "version": "4.1.3", "dev": true @@ -63640,6 +63804,12 @@ "version": "4.17.21", "dev": true }, + "lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, "lodash.debounce": { "version": "4.0.8", "dev": true @@ -64459,6 +64629,12 @@ "version": "2.1.1", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "resolve": { "version": "1.22.1", "dev": true, diff --git a/packages/bootstrap-4/test/Form.test.tsx b/packages/bootstrap-4/test/Form.test.tsx index f87dd7d222..028d00dc64 100644 --- a/packages/bootstrap-4/test/Form.test.tsx +++ b/packages/bootstrap-4/test/Form.test.tsx @@ -182,9 +182,10 @@ describe("single fields", () => { .toJSON(); expect(tree).toMatchSnapshot(); }); - test("checkbox field", () => { + test("checkbox field with label", () => { const schema: RJSFSchema = { type: "boolean", + title: "test", }; const tree = renderer .create() diff --git a/packages/bootstrap-4/test/__snapshots__/Form.test.tsx.snap b/packages/bootstrap-4/test/__snapshots__/Form.test.tsx.snap index f19063fea8..4715d21995 100644 --- a/packages/bootstrap-4/test/__snapshots__/Form.test.tsx.snap +++ b/packages/bootstrap-4/test/__snapshots__/Form.test.tsx.snap @@ -46,7 +46,7 @@ exports[`single fields checkbox field 1`] = `
`; -exports[`single fields checkbox field 2`] = ` +exports[`single fields checkbox field with label 1`] = `
+ diff --git a/packages/chakra-ui/test/Form.test.tsx b/packages/chakra-ui/test/Form.test.tsx index abad779764..bbf7d992c2 100644 --- a/packages/chakra-ui/test/Form.test.tsx +++ b/packages/chakra-ui/test/Form.test.tsx @@ -288,6 +288,16 @@ describe("single fields", () => { .toJSON(); expect(tree).toMatchSnapshot(); }); + test("checkbox field with label", () => { + const schema: RJSFSchema = { + type: "boolean", + title: "test", + }; + const tree = renderer + .create() + .toJSON(); + expect(tree).toMatchSnapshot(); + }); test("checkbox field", () => { const schema: RJSFSchema = { type: "boolean", diff --git a/packages/chakra-ui/test/__snapshots__/Form.test.tsx.snap b/packages/chakra-ui/test/__snapshots__/Form.test.tsx.snap index 2e5c839f09..80d8010338 100644 --- a/packages/chakra-ui/test/__snapshots__/Form.test.tsx.snap +++ b/packages/chakra-ui/test/__snapshots__/Form.test.tsx.snap @@ -155,6 +155,176 @@ exports[`single fields checkbox field 1`] = `
`; +exports[`single fields checkbox field with label 1`] = ` +.emotion-1 { + margin-bottom: 1px; +} + +.emotion-2 { + cursor: pointer; + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + vertical-align: top; + position: relative; +} + +.emotion-2[disabled], +.emotion-2[aria-disabled=true], +.emotion-2[data-disabled] { + cursor: not-allowed; +} + +.emotion-3 { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + vertical-align: top; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.emotion-4 { + -webkit-margin-start: 0.5rem; + margin-inline-start: 0.5rem; +} + +.emotion-6 { + margin-top: 3px; +} + +.emotion-7 { + display: -webkit-inline-box; + display: -webkit-inline-flex; + display: -ms-inline-flexbox; + display: inline-flex; + -webkit-appearance: none; + -moz-appearance: none; + -ms-appearance: none; + appearance: none; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + -webkit-box-pack: center; + -ms-flex-pack: center; + -webkit-justify-content: center; + justify-content: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + position: relative; + white-space: nowrap; + vertical-align: middle; + outline: 2px solid transparent; + outline-offset: 2px; + width: auto; +} + +
+
+
+
+ +
+
+
+
+ +
+
+`; + exports[`single fields checkboxes field 1`] = ` .emotion-1 { margin-bottom: 1px; diff --git a/packages/fluent-ui/package-lock.json b/packages/fluent-ui/package-lock.json index 82eaed634f..93d86219b8 100644 --- a/packages/fluent-ui/package-lock.json +++ b/packages/fluent-ui/package-lock.json @@ -19,6 +19,7 @@ "@babel/preset-env": "^7.19.4", "@babel/preset-react": "^7.18.6", "@fluentui/react": "^7.190.3", + "@rjsf/validator-ajv8": "*", "@types/lodash": "^4.14.186", "@types/react": "^17.0.48", "@types/react-dom": "^17.0.17", @@ -26204,6 +26205,67 @@ "resolved": "../utils", "link": true }, + "node_modules/@rjsf/validator-ajv8": { + "version": "5.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.14.tgz", + "integrity": "sha512-0zxjU5xLzQeGI8Eh31lZCBY0Duq1DQowenLFDRl4CsaE3B63NYhfWpGuYaSs9IL1hFSO669ub1uokdm+zpNX4Q==", + "dev": true, + "dependencies": { + "ajv-formats": "^2.1.1", + "ajv8": "npm:ajv@^8.11.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.15" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@rjsf/utils": "^5.0.0-beta.12" + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/@rollup/plugin-babel": { "version": "5.3.1", "dev": true, @@ -26997,6 +27059,29 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv8": { + "name": "ajv", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv8/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "node_modules/ansi-colors": { "version": "4.1.3", "dev": true, @@ -34192,6 +34277,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve": { "version": "1.22.1", "dev": true, @@ -60000,6 +60094,49 @@ } } }, + "@rjsf/validator-ajv8": { + "version": "5.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.14.tgz", + "integrity": "sha512-0zxjU5xLzQeGI8Eh31lZCBY0Duq1DQowenLFDRl4CsaE3B63NYhfWpGuYaSs9IL1hFSO669ub1uokdm+zpNX4Q==", + "dev": true, + "requires": { + "ajv-formats": "^2.1.1", + "ajv8": "npm:ajv@^8.11.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.15" + }, + "dependencies": { + "ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "requires": {} + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "optional": true, + "peer": true + } + } + }, "@rollup/plugin-babel": { "version": "5.3.1", "dev": true, @@ -60535,6 +60672,26 @@ "uri-js": "^4.2.2" } }, + "ajv8": { + "version": "npm:ajv@8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "dependencies": { + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, "ansi-colors": { "version": "4.1.3", "dev": true @@ -65245,6 +65402,12 @@ "version": "2.1.1", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "resolve": { "version": "1.22.1", "dev": true, diff --git a/packages/fluent-ui/test/Form.test.tsx b/packages/fluent-ui/test/Form.test.tsx index f87dd7d222..028d00dc64 100644 --- a/packages/fluent-ui/test/Form.test.tsx +++ b/packages/fluent-ui/test/Form.test.tsx @@ -182,9 +182,10 @@ describe("single fields", () => { .toJSON(); expect(tree).toMatchSnapshot(); }); - test("checkbox field", () => { + test("checkbox field with label", () => { const schema: RJSFSchema = { type: "boolean", + title: "test", }; const tree = renderer .create(
) diff --git a/packages/fluent-ui/test/__snapshots__/Form.test.tsx.snap b/packages/fluent-ui/test/__snapshots__/Form.test.tsx.snap index 2cc70f09bd..4a9e566b3a 100644 --- a/packages/fluent-ui/test/__snapshots__/Form.test.tsx.snap +++ b/packages/fluent-ui/test/__snapshots__/Form.test.tsx.snap @@ -76,7 +76,7 @@ exports[`single fields checkbox field 1`] = ` > Submit @@ -88,7 +88,7 @@ exports[`single fields checkbox field 1`] = `
`; -exports[`single fields checkbox field 2`] = ` +exports[`single fields checkbox field with label 1`] = `
+ @@ -164,7 +171,7 @@ exports[`single fields checkbox field 2`] = ` > Submit diff --git a/packages/material-ui/package-lock.json b/packages/material-ui/package-lock.json index f47f97732c..f4d66567ce 100644 --- a/packages/material-ui/package-lock.json +++ b/packages/material-ui/package-lock.json @@ -17,6 +17,7 @@ "@babel/preset-react": "^7.18.6", "@material-ui/core": "^4.12.4", "@material-ui/icons": "^4.11.3", + "@rjsf/validator-ajv8": "*", "@types/material-ui": "^0.21.12", "@types/react": "^17.0.37", "@types/react-dom": "^17.0.11", @@ -25986,6 +25987,67 @@ "resolved": "../utils", "link": true }, + "node_modules/@rjsf/validator-ajv8": { + "version": "5.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.14.tgz", + "integrity": "sha512-0zxjU5xLzQeGI8Eh31lZCBY0Duq1DQowenLFDRl4CsaE3B63NYhfWpGuYaSs9IL1hFSO669ub1uokdm+zpNX4Q==", + "dev": true, + "dependencies": { + "ajv-formats": "^2.1.1", + "ajv8": "npm:ajv@^8.11.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.15" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@rjsf/utils": "^5.0.0-beta.12" + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "dependencies": { + "ajv": "^8.0.0" + }, + "peerDependencies": { + "ajv": "^8.0.0" + }, + "peerDependenciesMeta": { + "ajv": { + "optional": true + } + } + }, + "node_modules/@rjsf/validator-ajv8/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/@rollup/plugin-babel": { "version": "5.3.1", "dev": true, @@ -26692,6 +26754,29 @@ "url": "https://github.com/sponsors/epoberezkin" } }, + "node_modules/ajv8": { + "name": "ajv", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ajv8/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + }, "node_modules/ansi-colors": { "version": "4.1.3", "dev": true, @@ -32686,6 +32771,12 @@ "dev": true, "license": "MIT" }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, "node_modules/lodash.debounce": { "version": "4.0.8", "dev": true, @@ -33872,6 +33963,15 @@ "node": ">=0.10.0" } }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/resolve": { "version": "1.22.1", "dev": true, @@ -59448,6 +59548,49 @@ } } }, + "@rjsf/validator-ajv8": { + "version": "5.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.14.tgz", + "integrity": "sha512-0zxjU5xLzQeGI8Eh31lZCBY0Duq1DQowenLFDRl4CsaE3B63NYhfWpGuYaSs9IL1hFSO669ub1uokdm+zpNX4Q==", + "dev": true, + "requires": { + "ajv-formats": "^2.1.1", + "ajv8": "npm:ajv@^8.11.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.15" + }, + "dependencies": { + "ajv": { + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, + "ajv-formats": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", + "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", + "dev": true, + "requires": {} + }, + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "optional": true, + "peer": true + } + } + }, "@rollup/plugin-babel": { "version": "5.3.1", "dev": true, @@ -59910,6 +60053,26 @@ "uri-js": "^4.2.2" } }, + "ajv8": { + "version": "npm:ajv@8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "dependencies": { + "json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true + } + } + }, "ansi-colors": { "version": "4.1.3", "dev": true @@ -63861,6 +64024,12 @@ "version": "4.17.21", "dev": true }, + "lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==", + "dev": true + }, "lodash.debounce": { "version": "4.0.8", "dev": true @@ -64638,6 +64807,12 @@ "version": "2.1.1", "dev": true }, + "require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true + }, "resolve": { "version": "1.22.1", "dev": true, diff --git a/packages/material-ui/test/Form.test.tsx b/packages/material-ui/test/Form.test.tsx index a1a548a2c7..1a20fb01b6 100644 --- a/packages/material-ui/test/Form.test.tsx +++ b/packages/material-ui/test/Form.test.tsx @@ -189,9 +189,10 @@ describe("single fields", () => { .toJSON(); expect(tree).toMatchSnapshot(); }); - test("checkbox field", () => { + test("checkbox field with label", () => { const schema: RJSFSchema = { type: "boolean", + title: "test", }; const tree = renderer .create() diff --git a/packages/material-ui/test/__snapshots__/Form.test.tsx.snap b/packages/material-ui/test/__snapshots__/Form.test.tsx.snap index 653cf88442..fb91c97f47 100644 --- a/packages/material-ui/test/__snapshots__/Form.test.tsx.snap +++ b/packages/material-ui/test/__snapshots__/Form.test.tsx.snap @@ -57,6 +57,9 @@ exports[`single fields checkbox field 1`] = ` /> +
`; -exports[`single fields checkbox field 2`] = ` +exports[`single fields checkbox field with label 1`] = `
- - + test
diff --git a/packages/mui/package-lock.json b/packages/mui/package-lock.json index dcfe692870..72ecc96c11 100644 --- a/packages/mui/package-lock.json +++ b/packages/mui/package-lock.json @@ -24,7 +24,7 @@ "@types/react-dom": "^17.0.11", "@types/react-test-renderer": "^17.0.1", "dts-cli": "^1.6.0", - "eslint": "^8.23.0", + "eslint": "^8.26.0", "jest-watch-typeahead": "^2.1.1", "react": "^17.0.2", "react-dom": "^17.0.2", @@ -25646,14 +25646,15 @@ "license": "MIT" }, "node_modules/@eslint/eslintrc": { - "version": "1.3.1", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", + "integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==", "dev": true, - "license": "MIT", "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", - "globals": "^13.15.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -25669,13 +25670,15 @@ }, "node_modules/@eslint/eslintrc/node_modules/argparse": { "version": "2.0.1", - "dev": true, - "license": "Python-2.0" + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.17.0", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -25688,8 +25691,9 @@ }, "node_modules/@eslint/eslintrc/node_modules/js-yaml": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, - "license": "MIT", "dependencies": { "argparse": "^2.0.1" }, @@ -25699,8 +25703,9 @@ }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -25709,27 +25714,19 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.10.4", + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" }, "engines": { "node": ">=10.10.0" } }, - "node_modules/@humanwhocodes/gitignore-to-minimatch": { - "version": "1.0.2", - "dev": true, - "license": "Apache-2.0", - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, "node_modules/@humanwhocodes/module-importer": { "version": "1.0.1", "dev": true, @@ -25744,8 +25741,9 @@ }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", - "dev": true, - "license": "BSD-3-Clause" + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true }, "node_modules/@istanbuljs/load-nyc-config": { "version": "1.1.0", @@ -27509,8 +27507,9 @@ }, "node_modules/acorn-jsx": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, - "license": "MIT", "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -27540,8 +27539,9 @@ }, "node_modules/ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "license": "MIT", "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -30584,14 +30584,15 @@ } }, "node_modules/eslint": { - "version": "8.23.0", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz", + "integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==", "dev": true, - "license": "MIT", "dependencies": { - "@eslint/eslintrc": "^1.3.1", - "@humanwhocodes/config-array": "^0.10.4", - "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", + "@eslint/eslintrc": "^1.4.0", + "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -30607,15 +30608,15 @@ "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.15.0", - "globby": "^11.1.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", @@ -31009,9 +31010,10 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.16.0", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, - "license": "MIT", "dependencies": { "type-fest": "^0.20.2" }, @@ -31151,8 +31153,9 @@ }, "node_modules/eslint/node_modules/type-fest": { "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, - "license": "(MIT OR CC0-1.0)", "engines": { "node": ">=10" }, @@ -31161,9 +31164,10 @@ } }, "node_modules/espree": { - "version": "9.4.0", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, - "license": "BSD-2-Clause", "dependencies": { "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", @@ -31177,9 +31181,10 @@ } }, "node_modules/espree/node_modules/acorn": { - "version": "8.8.0", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true, - "license": "MIT", "bin": { "acorn": "bin/acorn" }, @@ -34735,6 +34740,16 @@ "dev": true, "license": "MIT" }, + "node_modules/js-sdsl": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.2.0.tgz", + "integrity": "sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "dev": true, @@ -34770,8 +34785,9 @@ }, "node_modules/json-schema-traverse": { "version": "0.4.1", - "dev": true, - "license": "MIT" + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true }, "node_modules/json-stable-stringify-without-jsonify": { "version": "1.0.1", @@ -38286,13 +38302,15 @@ "dev": true }, "@eslint/eslintrc": { - "version": "1.3.1", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.0.tgz", + "integrity": "sha512-7yfvXy6MWLgWSFsLhz5yH3iQ52St8cdUY6FoGieKkRDVxuxmrNuUetIuu6cmjNWwniUHiWXjxCr5tTXDrbYS5A==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", "espree": "^9.4.0", - "globals": "^13.15.0", + "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", "js-yaml": "^4.1.0", @@ -38302,10 +38320,14 @@ "dependencies": { "argparse": { "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true }, "globals": { - "version": "13.17.0", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -38313,6 +38335,8 @@ }, "js-yaml": { "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "requires": { "argparse": "^2.0.1" @@ -38320,29 +38344,31 @@ }, "type-fest": { "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true } } }, "@humanwhocodes/config-array": { - "version": "0.10.4", + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", - "minimatch": "^3.0.4" + "minimatch": "^3.0.5" } }, - "@humanwhocodes/gitignore-to-minimatch": { - "version": "1.0.2", - "dev": true - }, "@humanwhocodes/module-importer": { "version": "1.0.1", "dev": true }, "@humanwhocodes/object-schema": { "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", "dev": true }, "@istanbuljs/load-nyc-config": { @@ -62560,6 +62586,8 @@ }, "acorn-jsx": { "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "requires": {} }, @@ -62580,6 +62608,8 @@ }, "ajv": { "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -64594,13 +64624,15 @@ "dev": true }, "eslint": { - "version": "8.23.0", + "version": "8.30.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.30.0.tgz", + "integrity": "sha512-MGADB39QqYuzEGov+F/qb18r4i7DohCDOfatHaxI2iGlPuC65bwG2gxgO+7DkyL38dRFaRH7RaRAgU6JKL9rMQ==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.3.1", - "@humanwhocodes/config-array": "^0.10.4", - "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", + "@eslint/eslintrc": "^1.4.0", + "@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -64616,15 +64648,15 @@ "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", "find-up": "^5.0.0", - "functional-red-black-tree": "^1.0.1", - "glob-parent": "^6.0.1", - "globals": "^13.15.0", - "globby": "^11.1.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", "js-yaml": "^4.1.0", "json-stable-stringify-without-jsonify": "^1.0.1", "levn": "^0.4.1", @@ -64693,7 +64725,9 @@ } }, "globals": { - "version": "13.16.0", + "version": "13.19.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.19.0.tgz", + "integrity": "sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ==", "dev": true, "requires": { "type-fest": "^0.20.2" @@ -64775,6 +64809,8 @@ }, "type-fest": { "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true } } @@ -64964,7 +65000,9 @@ "dev": true }, "espree": { - "version": "9.4.0", + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "dev": true, "requires": { "acorn": "^8.8.0", @@ -64973,7 +65011,9 @@ }, "dependencies": { "acorn": { - "version": "8.8.0", + "version": "8.8.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.1.tgz", + "integrity": "sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA==", "dev": true } } @@ -67257,6 +67297,12 @@ "version": "1.2.1", "dev": true }, + "js-sdsl": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.2.0.tgz", + "integrity": "sha512-dyBIzQBDkCqCu+0upx25Y2jGdbTGxE9fshMsCdK0ViOongpV+n5tXRcZY9v7CaVQ79AGS9KA1KHtojxiM7aXSQ==", + "dev": true + }, "js-tokens": { "version": "4.0.0", "dev": true @@ -67279,6 +67325,8 @@ }, "json-schema-traverse": { "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { diff --git a/packages/mui/package.json b/packages/mui/package.json index bfcf71cae7..de6b059bc0 100644 --- a/packages/mui/package.json +++ b/packages/mui/package.json @@ -55,7 +55,7 @@ "@types/react-dom": "^17.0.11", "@types/react-test-renderer": "^17.0.1", "dts-cli": "^1.6.0", - "eslint": "^8.23.0", + "eslint": "^8.26.0", "jest-watch-typeahead": "^2.1.1", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/packages/mui/test/Form.test.tsx b/packages/mui/test/Form.test.tsx index af18613f75..a997ee62cb 100644 --- a/packages/mui/test/Form.test.tsx +++ b/packages/mui/test/Form.test.tsx @@ -212,9 +212,10 @@ describe("single fields", () => { .toJSON(); expect(tree).toMatchSnapshot(); }); - test("checkbox field", () => { + test("checkbox field with label", () => { const schema: RJSFSchema = { type: "boolean", + title: "test", }; const tree = renderer .create(
) diff --git a/packages/mui/test/__snapshots__/Form.test.tsx.snap b/packages/mui/test/__snapshots__/Form.test.tsx.snap index f793ad438e..7a3f6dfad0 100644 --- a/packages/mui/test/__snapshots__/Form.test.tsx.snap +++ b/packages/mui/test/__snapshots__/Form.test.tsx.snap @@ -146,18 +146,6 @@ exports[`single fields checkbox field 1`] = ` } .emotion-5 { - overflow: hidden; - pointer-events: none; - position: absolute; - z-index: 0; - top: 0; - right: 0; - bottom: 0; - left: 0; - border-radius: inherit; -} - -.emotion-6 { margin: 0; font-family: "Roboto","Helvetica","Arial",sans-serif; font-weight: 400; @@ -166,11 +154,11 @@ exports[`single fields checkbox field 1`] = ` letter-spacing: 0.00938em; } -.emotion-7 { +.emotion-6 { margin-top: 24px; } -.emotion-8 { +.emotion-7 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -219,23 +207,23 @@ exports[`single fields checkbox field 1`] = ` box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12); } -.emotion-8::-moz-focus-inner { +.emotion-7::-moz-focus-inner { border-style: none; } -.emotion-8.Mui-disabled { +.emotion-7.Mui-disabled { pointer-events: none; cursor: default; } @media print { - .emotion-8 { + .emotion-7 { -webkit-print-color-adjust: exact; color-adjust: exact; } } -.emotion-8:hover { +.emotion-7:hover { -webkit-text-decoration: none; text-decoration: none; background-color: #1565c0; @@ -243,20 +231,20 @@ exports[`single fields checkbox field 1`] = ` } @media (hover: none) { - .emotion-8:hover { + .emotion-7:hover { background-color: #1976d2; } } -.emotion-8:active { +.emotion-7:active { box-shadow: 0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12); } -.emotion-8.Mui-focusVisible { +.emotion-7.Mui-focusVisible { box-shadow: 0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12); } -.emotion-8.Mui-disabled { +.emotion-7.Mui-disabled { color: rgba(0, 0, 0, 0.26); box-shadow: none; background-color: rgba(0, 0, 0, 0.12); @@ -315,12 +303,9 @@ exports[`single fields checkbox field 1`] = ` d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" /> - @@ -328,10 +313,10 @@ exports[`single fields checkbox field 1`] = `
`; -exports[`single fields checkbox field 2`] = ` +exports[`single fields checkbox field with label 1`] = ` .emotion-0 { display: -webkit-inline-box; display: -webkit-inline-flex; @@ -503,6 +485,18 @@ exports[`single fields checkbox field 2`] = ` } .emotion-5 { + overflow: hidden; + pointer-events: none; + position: absolute; + z-index: 0; + top: 0; + right: 0; + bottom: 0; + left: 0; + border-radius: inherit; +} + +.emotion-6 { margin: 0; font-family: "Roboto","Helvetica","Arial",sans-serif; font-weight: 400; @@ -511,11 +505,11 @@ exports[`single fields checkbox field 2`] = ` letter-spacing: 0.00938em; } -.emotion-6 { +.emotion-7 { margin-top: 24px; } -.emotion-7 { +.emotion-8 { display: -webkit-inline-box; display: -webkit-inline-flex; display: -ms-inline-flexbox; @@ -564,23 +558,23 @@ exports[`single fields checkbox field 2`] = ` box-shadow: 0px 3px 1px -2px rgba(0,0,0,0.2),0px 2px 2px 0px rgba(0,0,0,0.14),0px 1px 5px 0px rgba(0,0,0,0.12); } -.emotion-7::-moz-focus-inner { +.emotion-8::-moz-focus-inner { border-style: none; } -.emotion-7.Mui-disabled { +.emotion-8.Mui-disabled { pointer-events: none; cursor: default; } @media print { - .emotion-7 { + .emotion-8 { -webkit-print-color-adjust: exact; color-adjust: exact; } } -.emotion-7:hover { +.emotion-8:hover { -webkit-text-decoration: none; text-decoration: none; background-color: #1565c0; @@ -588,20 +582,20 @@ exports[`single fields checkbox field 2`] = ` } @media (hover: none) { - .emotion-7:hover { + .emotion-8:hover { background-color: #1976d2; } } -.emotion-7:active { +.emotion-8:active { box-shadow: 0px 5px 5px -3px rgba(0,0,0,0.2),0px 8px 10px 1px rgba(0,0,0,0.14),0px 3px 14px 2px rgba(0,0,0,0.12); } -.emotion-7.Mui-focusVisible { +.emotion-8.Mui-focusVisible { box-shadow: 0px 3px 5px -1px rgba(0,0,0,0.2),0px 6px 10px 0px rgba(0,0,0,0.14),0px 1px 18px 0px rgba(0,0,0,0.12); } -.emotion-7.Mui-disabled { +.emotion-8.Mui-disabled { color: rgba(0, 0, 0, 0.26); box-shadow: none; background-color: rgba(0, 0, 0, 0.12); @@ -660,20 +654,23 @@ exports[`single fields checkbox field 2`] = ` d="M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z" /> + - + test
diff --git a/packages/playground/package-lock.json b/packages/playground/package-lock.json index de4d734f9c..da485ccf1a 100644 --- a/packages/playground/package-lock.json +++ b/packages/playground/package-lock.json @@ -16,6 +16,7 @@ "@fluentui/react": "^7.190.3", "@material-ui/core": "^4.12.4", "@mui/material": "^5.10.11", + "@rjsf/validator-ajv8": "*", "ajv": "^8.11.0", "ajv-formats": "^2.1.1", "ajv-i18n": "^4.2.0", @@ -5027,6 +5028,23 @@ "react": ">=16.8.0" } }, + "node_modules/@rjsf/validator-ajv8": { + "version": "5.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.14.tgz", + "integrity": "sha512-0zxjU5xLzQeGI8Eh31lZCBY0Duq1DQowenLFDRl4CsaE3B63NYhfWpGuYaSs9IL1hFSO669ub1uokdm+zpNX4Q==", + "dependencies": { + "ajv-formats": "^2.1.1", + "ajv8": "npm:ajv@^8.11.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.15" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@rjsf/utils": "^5.0.0-beta.12" + } + }, "node_modules/@types/html-minifier-terser": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", @@ -5320,6 +5338,22 @@ "ajv": "^8.8.2" } }, + "node_modules/ajv8": { + "name": "ajv", + "version": "8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, "node_modules/ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -8809,6 +8843,11 @@ "version": "4.17.21", "license": "MIT" }, + "node_modules/lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -15190,6 +15229,17 @@ "dequal": "^2.0.2" } }, + "@rjsf/validator-ajv8": { + "version": "5.0.0-beta.14", + "resolved": "https://registry.npmjs.org/@rjsf/validator-ajv8/-/validator-ajv8-5.0.0-beta.14.tgz", + "integrity": "sha512-0zxjU5xLzQeGI8Eh31lZCBY0Duq1DQowenLFDRl4CsaE3B63NYhfWpGuYaSs9IL1hFSO669ub1uokdm+zpNX4Q==", + "requires": { + "ajv-formats": "^2.1.1", + "ajv8": "npm:ajv@^8.11.0", + "lodash": "^4.17.15", + "lodash-es": "^4.17.15" + } + }, "@types/html-minifier-terser": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/@types/html-minifier-terser/-/html-minifier-terser-6.1.0.tgz", @@ -15421,6 +15471,17 @@ "fast-deep-equal": "^3.1.3" } }, + "ajv8": { + "version": "npm:ajv@8.11.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.2.tgz", + "integrity": "sha512-E4bfmKAhGiSTvMfL1Myyycaub+cUEU2/IvpylXkUu7CHBkBj1f/ikdzbD7YQ6FKUbixDxeYvB/xY4fvyroDlQg==", + "requires": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + } + }, "ansi-regex": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", @@ -17861,6 +17922,11 @@ "lodash": { "version": "4.17.21" }, + "lodash-es": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", + "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" + }, "lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", diff --git a/packages/semantic-ui/src/CheckboxWidget/CheckboxWidget.tsx b/packages/semantic-ui/src/CheckboxWidget/CheckboxWidget.tsx index 147b809aea..ca9952c0be 100644 --- a/packages/semantic-ui/src/CheckboxWidget/CheckboxWidget.tsx +++ b/packages/semantic-ui/src/CheckboxWidget/CheckboxWidget.tsx @@ -17,9 +17,7 @@ function CheckboxWidget(props: WidgetProps) { options, onFocus, formContext, - schema, uiSchema, - registry, rawErrors = [], } = props; const semanticProps = getSemanticProps({ @@ -30,8 +28,6 @@ function CheckboxWidget(props: WidgetProps) { inverted: false, }, }); - const { schemaUtils } = registry; - const displayLabel = schemaUtils.getDisplayLabel(schema, uiSchema); const _onChange = ( _: React.FormEvent, data: CheckboxProps @@ -52,7 +48,7 @@ function CheckboxWidget(props: WidgetProps) { onBlur={_onBlur} onFocus={_onFocus} required={required} - label={displayLabel ? label || schema.title : false} + label={label || ""} /> ); } diff --git a/packages/semantic-ui/test/Form.test.tsx b/packages/semantic-ui/test/Form.test.tsx index 9fab306524..e1eb5a87bf 100644 --- a/packages/semantic-ui/test/Form.test.tsx +++ b/packages/semantic-ui/test/Form.test.tsx @@ -188,9 +188,10 @@ describe("single fields", () => { .toJSON(); expect(tree).toMatchSnapshot(); }); - test("checkbox field", () => { + test("checkbox field with label", () => { const schema: RJSFSchema = { type: "boolean", + title: "test", }; const tree = renderer .create(
) diff --git a/packages/semantic-ui/test/__snapshots__/Form.test.tsx.snap b/packages/semantic-ui/test/__snapshots__/Form.test.tsx.snap index e12d97956d..0ea61e80c3 100644 --- a/packages/semantic-ui/test/__snapshots__/Form.test.tsx.snap +++ b/packages/semantic-ui/test/__snapshots__/Form.test.tsx.snap @@ -39,7 +39,9 @@ exports[`single fields checkbox field 1`] = ` /> @@ -54,7 +56,7 @@ exports[`single fields checkbox field 1`] = `
`; -exports[`single fields checkbox field 2`] = ` +exports[`single fields checkbox field with label 1`] = `
diff --git a/packages/validator-ajv8/package-lock.json b/packages/validator-ajv8/package-lock.json index f6e2e35bcc..76cc8d53be 100644 --- a/packages/validator-ajv8/package-lock.json +++ b/packages/validator-ajv8/package-lock.json @@ -2870,6 +2870,8 @@ "version": "8.11.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "optional": true, + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -11977,6 +11979,8 @@ "version": "8.11.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.11.0.tgz", "integrity": "sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==", + "optional": true, + "peer": true, "requires": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -11988,9 +11992,7 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/ajv-formats/-/ajv-formats-2.1.1.tgz", "integrity": "sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA==", - "requires": { - "ajv": "^8.0.0" - } + "requires": {} }, "ajv8": { "version": "npm:ajv@8.11.0", diff --git a/scripts/run.js b/scripts/run.js new file mode 100644 index 0000000000..e77b1d4575 --- /dev/null +++ b/scripts/run.js @@ -0,0 +1,23 @@ +// npm run r [package-short-name] [command] +const { exec } = require('child_process'); + +const companyDir = '@rjsf/'; +const args = process.argv.slice(2); +if (!args || args.length < 2) { + return console.error('Expecting 2 arguments or more'); +} +const [arg0, arg1, ...argRest] = args; + +const command = `lerna run --scope ${ + arg0 === '*' ? 'lerna run' : ` ${companyDir}${arg0}` +} ${arg1}`; +console.log(`Running command '${command} ${argRest}'`); + +const commandProcess = exec(command, (err, _stdout, stderr) => { + if (err) return console.error(err); + console.log(stderr); +}); + +commandProcess.stdout.on('data', (data) => { + console.log(data); +});