diff --git a/src/lib/kit/components/Layouts/Row/Row.scss b/src/lib/kit/components/Layouts/Row/Row.scss index fd20b220..bfdc3ca6 100644 --- a/src/lib/kit/components/Layouts/Row/Row.scss +++ b/src/lib/kit/components/Layouts/Row/Row.scss @@ -1,17 +1,29 @@ @import '../../../styles/variables.scss'; .#{$ns}row { - display: flex; - width: 500px; - max-width: 500px; margin-bottom: 15px; + &_direction-horizontal { + display: flex; + width: 500px; + max-width: 500px; + } + + &_direction-vertical { + display: flex; + width: 500px; + max-width: 500px; + } + &:last-child { margin-bottom: 0; } - &__left { - width: 180px; + &__label { + &_direction-horizontal { + width: 180px; + } + min-height: 28px; display: flex; margin-bottom: auto; @@ -44,9 +56,12 @@ } &__note { - padding-right: 16px; position: relative; + &_direction-horizontal { + padding-right: 16px; + } + &-inner { position: absolute; margin-top: 1px; @@ -61,11 +76,13 @@ } } - &__right { - display: flex; - flex-direction: column; - flex-grow: 1; - margin-left: 15px; + &__value { + &_direction-horizontal { + display: flex; + flex-direction: column; + flex-grow: 1; + margin-left: 15px; + } &-inner { display: flex; diff --git a/src/lib/kit/components/Layouts/Row/Row.tsx b/src/lib/kit/components/Layouts/Row/Row.tsx index 563fe760..d6c29d22 100644 --- a/src/lib/kit/components/Layouts/Row/Row.tsx +++ b/src/lib/kit/components/Layouts/Row/Row.tsx @@ -22,6 +22,7 @@ import './Row.scss'; const b = block('row'); interface RowProps { + direction?: 'vertical' | 'horizontal'; verboseDescription?: boolean; } @@ -31,20 +32,21 @@ const RowBase = ({ input, meta, verboseDescription, + direction = 'vertical', children, }: LayoutProps & RowProps) => { const arrayItem = React.useMemo(() => isArrayItem(name), [name]); const generateButton = React.useMemo(() => withGenerateButton(spec), [spec]); return ( -
-
-
+
+
+
{spec.viewSpec.layoutTitle} {!verboseDescription && spec.viewSpec.layoutDescription ? ( - + ({ ) : null}
-
-
+
+
.#{$ns}view-transparent { margin-bottom: 6px; diff --git a/src/lib/kit/components/ViewLayouts/ViewRow/ViewRow.tsx b/src/lib/kit/components/ViewLayouts/ViewRow/ViewRow.tsx index bc878d85..844772e4 100644 --- a/src/lib/kit/components/ViewLayouts/ViewRow/ViewRow.tsx +++ b/src/lib/kit/components/ViewLayouts/ViewRow/ViewRow.tsx @@ -15,7 +15,10 @@ export const ViewRow = ({ value, spec, children, -}: ViewLayoutProps) => { + direction = 'vertical', +}: ViewLayoutProps & { + direction?: 'vertical' | 'horizontal'; +}) => { const {showLayoutDescription} = useDynamicFormsCtx(); if (!isNotEmptyValue(value, spec)) { @@ -23,8 +26,8 @@ export const ViewRow = ({ } return ( -
-
+
+
{spec.viewSpec.layoutTitle} @@ -35,9 +38,9 @@ export const ViewRow = ({ placement={['bottom', 'top']} /> ) : null} -
+ {direction === 'horizontal' &&
}
-
{children}
+
{children}
);