Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions src/lib/kit/components/Layouts/Column/Column.scss
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@
min-height: var(--df-column-first-row-min-height, 28px);
display: flex;
margin-bottom: auto;
flex-direction: column;
flex-direction: row;
flex-shrink: 0;

&-inner {
display: inline;
flex-grow: 1;
margin-top: auto;
margin-bottom: auto;
}

&::after {
content: '';
width: 100%;
flex-shrink: 1;
&-action {
padding-left: var(--g-spacing-2);
margin-top: auto;
margin-bottom: auto;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this pseudo after was added for the textarea fix
https://github.com/gravity-ui/dynamic-forms/pull/22/files
it doesn't seem to be relevant for the vertical layout (Column)

}
}

Expand Down
6 changes: 5 additions & 1 deletion src/lib/kit/components/Layouts/Column/Column.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,17 @@ import './Column.scss';

const b = block('column');

interface ColumnProps {}
interface ColumnProps {
action?: React.ReactNode;
}

const ColumnBase = <T extends FieldValue, S extends Spec>({
name,
spec,
input,
meta,
children,
action,
}: LayoutProps<T, undefined, undefined, S> & ColumnProps) => {
const arrayItem = React.useMemo(() => isArrayItem(name), [name]);
const generateButton = React.useMemo(() => withGenerateButton(spec), [spec]);
Expand All @@ -47,6 +50,7 @@ const ColumnBase = <T extends FieldValue, S extends Spec>({
</span>
) : null}
</div>
{Boolean(action) && <div className={b('first-row-action')}>{action}</div>}
</div>
<div className={b('second-row')}>
<div className={b('second-row-inner')}>
Expand Down
4 changes: 4 additions & 0 deletions src/lib/kit/components/Layouts/Row/Row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
margin-bottom: auto;
}

&-action {
padding-left: var(--g-spacing-2);
}

&::after {
content: '';
width: 100%;
Expand Down
3 changes: 3 additions & 0 deletions src/lib/kit/components/Layouts/Row/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const b = block('row');

interface RowProps {
verboseDescription?: boolean;
action?: React.ReactNode;
}

const RowBase = <T extends FieldValue, S extends Spec>({
Expand All @@ -24,6 +25,7 @@ const RowBase = <T extends FieldValue, S extends Spec>({
input,
meta,
verboseDescription,
action,
children,
}: LayoutProps<T, undefined, undefined, S> & RowProps) => {
const arrayItem = React.useMemo(() => isArrayItem(name), [name]);
Expand All @@ -49,6 +51,7 @@ const RowBase = <T extends FieldValue, S extends Spec>({
</Text>
</span>
) : null}
{Boolean(action) && <span className={b('left-action')}>{action}</span>}
</div>
</div>
<div className={b('right')}>
Expand Down