diff --git a/.gitignore b/.gitignore index a0681df009..0cf35acfd8 100644 --- a/.gitignore +++ b/.gitignore @@ -142,4 +142,5 @@ out/ *.tsbuildinfo lodashReplacer.js muiReplacer.js +ajvReplacer.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 44294670f2..fd8a6599b5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,20 @@ it according to semantic versioning. For example, if your PR adds a breaking cha should change the heading of the (upcoming) version to include a major version bump. --> +# 5.24.8 + +## @rjsf/antd + +- Fixed the total disable of the `RadioWidget`, fixing [#4481](https://github.com/rjsf-team/react-jsonschema-form/issues/4481) + +## @rjsf/validator-ajv8 + +- Fixed up the ESM build to properly handle ESM imports for `compileSchemaValidatorsCode()` by adding a new `ajvReplacer.ts` and using it + +## Dev / docs / playground + +- Updated `snapshot-tests` to add validation of disable `RadioWidget` via the `Form` prop as well as `uiSchema` + # 5.24.7 ## Dev / docs / playground diff --git a/packages/antd/test/__snapshots__/Form.test.tsx.snap b/packages/antd/test/__snapshots__/Form.test.tsx.snap index b30d98564c..75efe19585 100644 --- a/packages/antd/test/__snapshots__/Form.test.tsx.snap +++ b/packages/antd/test/__snapshots__/Form.test.tsx.snap @@ -3554,6 +3554,116 @@ exports[`single fields select field single choice enumDisabled using radio widge `; +exports[`single fields select field single choice form disabled using radio widget 1`] = ` +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ +
+`; + exports[`single fields select field single choice formData 1`] = `
`; +exports[`single fields select field single choice uiSchema disabled using radio widget 1`] = ` + +
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+ +
+`; + exports[`single fields slider field 1`] = `
`; +exports[`single fields select field single choice form disabled using radio widget 1`] = ` + +
+
+
+
+
+ +
+
+`; + exports[`single fields select field single choice formData 1`] = `
`; +exports[`single fields select field single choice uiSchema disabled using radio widget 1`] = ` + +
+
+
+
+
+ +
+
+`; + exports[`single fields slider field 1`] = `
`; +exports[`single fields select field single choice form disabled using radio widget 1`] = ` +.emotion-1 { + margin-bottom: 1px; +} + +.emotion-3 { + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.emotion-3>*:not(style)~*:not(style) { + margin-top: 0.5rem; + -webkit-margin-end: 0px; + margin-inline-end: 0px; + margin-bottom: 0px; + -webkit-margin-start: 0px; + margin-inline-start: 0px; +} + +.emotion-4 { + display: inline-flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + vertical-align: top; + cursor: pointer; +} + +.emotion-5 { + 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; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.emotion-6 { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-margin-start: 0.5rem; + margin-inline-start: 0.5rem; +} + +.emotion-10 { + margin-top: 3px; +} + +.emotion-11 { + 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 select field single choice formData 1`] = ` .emotion-1 { margin-bottom: 1px; @@ -5069,6 +5305,242 @@ exports[`single fields select field single choice formData 1`] = ` `; +exports[`single fields select field single choice uiSchema disabled using radio widget 1`] = ` +.emotion-1 { + margin-bottom: 1px; +} + +.emotion-3 { + display: flex; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; +} + +.emotion-3>*:not(style)~*:not(style) { + margin-top: 0.5rem; + -webkit-margin-end: 0px; + margin-inline-end: 0px; + margin-bottom: 0px; + -webkit-margin-start: 0px; + margin-inline-start: 0px; +} + +.emotion-4 { + display: inline-flex; + -webkit-align-items: center; + -webkit-box-align: center; + -ms-flex-align: center; + align-items: center; + vertical-align: top; + cursor: pointer; +} + +.emotion-5 { + 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; + -webkit-flex-shrink: 0; + -ms-flex-negative: 0; + flex-shrink: 0; +} + +.emotion-6 { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + -webkit-margin-start: 0.5rem; + margin-inline-start: 0.5rem; +} + +.emotion-10 { + margin-top: 3px; +} + +.emotion-11 { + 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 slider field 1`] = ` .emotion-1 { margin-bottom: 1px; diff --git a/packages/core/test/__snapshots__/FormSnap.test.jsx.snap b/packages/core/test/__snapshots__/FormSnap.test.jsx.snap index 2bc49762b8..6b9cf7873e 100644 --- a/packages/core/test/__snapshots__/FormSnap.test.jsx.snap +++ b/packages/core/test/__snapshots__/FormSnap.test.jsx.snap @@ -1437,6 +1437,81 @@ exports[`single fields select field single choice enumDisabled using radio widge `; +exports[`single fields select field single choice form disabled using radio widget 1`] = ` +
+
+
+
+ +
+
+ +
+
+
+
+ +
+
+`; + exports[`single fields select field single choice formData 1`] = `
`; +exports[`single fields select field single choice uiSchema disabled using radio widget 1`] = ` + +
+
+
+ +
+
+ +
+
+
+
+ +
+
+`; + exports[`single fields slider field 1`] = `