fix(json-schema-2020-12): fix in collapsible behavior

Refs #8513
This commit is contained in:
Vladimir Gorej
2023-04-21 08:22:42 +02:00
committed by Vladimír Gorej
parent 4ea28a9310
commit f41c6ba0d7
6 changed files with 18 additions and 13 deletions

View File

@@ -52,12 +52,13 @@ const JSONSchema = ({ schema, name }) => {
/**
* Event handlers.
*/
const handleExpansion = useCallback(() => {
setExpanded((prev) => !prev)
const handleExpansion = useCallback((e, expandedNew) => {
setExpanded(expandedNew)
!expandedNew && setExpandedDeeply(false)
}, [])
const handleExpansionDeep = useCallback(() => {
setExpanded((prev) => !prev)
setExpandedDeeply((prev) => !prev)
const handleExpansionDeep = useCallback((e, expandedDeepNew) => {
setExpanded(expandedDeepNew)
setExpandedDeeply(expandedDeepNew)
}, [])
/**

View File

@@ -18,8 +18,8 @@
}
&-body {
@include expansion-border;
margin: 2px 0;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
}
&__limit {

View File

@@ -1,3 +1,8 @@
@mixin expansion-border {
margin: 0 0 0 20px;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
}
@import './JSONSchema/json-schema';
@import './Accordion/accordion';
@import './ExpandDeepButton/expand-deep-button';

View File

@@ -1,9 +1,8 @@
.json-schema-2020-12 {
&__\$defs {
& ul {
@include expansion-border;
padding: 0;
margin: 0 0 0 20px;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
}
}

View File

@@ -1,8 +1,7 @@
.json-schema-2020-12 {
&__\$vocabulary {
ul {
margin: 0 0 0 20px;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
@include expansion-border;
}
}

View File

@@ -1,9 +1,10 @@
.json-schema-2020-12 {
&__allOf {
& ul {
margin: 5px 0 5px 0;
& > ul {
@include expansion-border;
padding: 0;
margin: 0 0 0 20px;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
}
}