-
Notifications
You must be signed in to change notification settings - Fork 9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(json-schema-2020-12): add support for not keyword
Refs #8513
- Loading branch information
Showing
10 changed files
with
62 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
src/core/plugins/json-schema-2020-12/components/keywords/Not/Not.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/** | ||
* @prettier | ||
*/ | ||
import React from "react" | ||
|
||
import { schema } from "../../../prop-types" | ||
import { useComponent } from "../../../hooks" | ||
|
||
const Not = ({ schema }) => { | ||
if (!schema?.not) return null | ||
|
||
const JSONSchema = useComponent("JSONSchema") | ||
const name = ( | ||
<span className="json-schema-2020-12-core-keyword json-schema-2020-12-core-keyword--not"> | ||
Not | ||
</span> | ||
) | ||
|
||
return ( | ||
<div className="json-schema-2020-12__not"> | ||
<JSONSchema name={name} schema={schema.not} /> | ||
</div> | ||
) | ||
} | ||
|
||
Not.propTypes = { | ||
schema: schema.isRequired, | ||
} | ||
|
||
export default Not |
10 changes: 10 additions & 0 deletions
10
src/core/plugins/json-schema-2020-12/components/keywords/Not/_not.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.json-schema-2020-12 { | ||
&__not { | ||
.json-schema-2020-12-core-keyword--not { | ||
@extend .json-schema-2020-12-core-keyword--allOf; | ||
} | ||
} | ||
} | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters