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. * Event handlers.
*/ */
const handleExpansion = useCallback(() => { const handleExpansion = useCallback((e, expandedNew) => {
setExpanded((prev) => !prev) setExpanded(expandedNew)
!expandedNew && setExpandedDeeply(false)
}, []) }, [])
const handleExpansionDeep = useCallback(() => { const handleExpansionDeep = useCallback((e, expandedDeepNew) => {
setExpanded((prev) => !prev) setExpanded(expandedDeepNew)
setExpandedDeeply((prev) => !prev) setExpandedDeeply(expandedDeepNew)
}, []) }, [])
/** /**

View File

@@ -18,8 +18,8 @@
} }
&-body { &-body {
@include expansion-border;
margin: 2px 0; margin: 2px 0;
border-left: 1px dashed rgba($section-models-model-container-background-color, 0.1);
} }
&__limit { &__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 './JSONSchema/json-schema';
@import './Accordion/accordion'; @import './Accordion/accordion';
@import './ExpandDeepButton/expand-deep-button'; @import './ExpandDeepButton/expand-deep-button';

View File

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

View File

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