Skip to content

Commit 4618d95

Browse files
committed
feat: try add layoutAction
1 parent df08011 commit 4618d95

File tree

5 files changed

+21
-6
lines changed

5 files changed

+21
-6
lines changed

src/lib/core/types/specs.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export interface ArraySpec<
2525
layout?: string;
2626
layoutTitle?: string;
2727
layoutDescription?: string;
28+
layoutAction?: string;
2829
layoutOpen?: boolean;
2930
itemLabel?: string;
3031
itemPrefix?: string;
@@ -66,6 +67,7 @@ export interface BooleanSpec<
6667
layout?: string;
6768
layoutTitle?: string;
6869
layoutDescription?: string;
70+
layoutAction?: string;
6971
layoutOpen?: boolean;
7072
link?: LinkType;
7173
hidden?: boolean;
@@ -92,6 +94,7 @@ export interface NumberSpec<
9294
layout?: string;
9395
layoutTitle?: string;
9496
layoutDescription?: string;
97+
layoutAction?: string;
9598
layoutOpen?: boolean;
9699
link?: LinkType;
97100
placeholder?: string;
@@ -119,6 +122,7 @@ export interface ObjectSpec<
119122
layout?: string;
120123
layoutTitle?: string;
121124
layoutDescription?: string;
125+
layoutAction?: string;
122126
layoutOpen?: boolean;
123127
order?: string[];
124128
link?: LinkType;
@@ -155,6 +159,7 @@ export interface StringSpec<
155159
layout?: string;
156160
layoutTitle?: string;
157161
layoutDescription?: string;
162+
layoutAction?: string;
158163
layoutOpen?: boolean;
159164
link?: LinkType;
160165
sizeParams?: {

src/lib/kit/components/Layouts/Column/Column.scss

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
min-height: var(--df-column-first-row-min-height, 28px);
1212
display: flex;
1313
margin-bottom: auto;
14-
flex-direction: column;
14+
flex-direction: row;
1515
flex-shrink: 0;
1616

1717
&-inner {
18-
display: inline;
18+
flex-grow: 1;
1919
margin-top: auto;
2020
margin-bottom: auto;
2121
}
2222

23-
&::after {
24-
content: '';
25-
width: 100%;
26-
flex-shrink: 1;
23+
&-action {
24+
padding-left: var(--g-spacing-2);
25+
margin-top: auto;
26+
margin-bottom: auto;
2727
}
2828
}
2929

src/lib/kit/components/Layouts/Column/Column.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ const ColumnBase = <T extends FieldValue, S extends Spec>({
4747
</span>
4848
) : null}
4949
</div>
50+
{Boolean(spec.viewSpec.layoutAction) && (
51+
<div className={b('first-row-action')}>{spec.viewSpec.layoutAction}</div>
52+
)}
5053
</div>
5154
<div className={b('second-row')}>
5255
<div className={b('second-row-inner')}>

src/lib/kit/components/Layouts/Row/Row.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
margin-bottom: auto;
2525
}
2626

27+
&-action {
28+
padding-left: var(--g-spacing-2);
29+
}
30+
2731
&::after {
2832
content: '';
2933
width: 100%;

src/lib/kit/components/Layouts/Row/Row.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ const RowBase = <T extends FieldValue, S extends Spec>({
4949
</Text>
5050
</span>
5151
) : null}
52+
{Boolean(spec.viewSpec.layoutAction) && (
53+
<span className={b('left-action')}>{spec.viewSpec.layoutAction}</span>
54+
)}
5255
</div>
5356
</div>
5457
<div className={b('right')}>

0 commit comments

Comments
 (0)