Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update row note position #20

Merged
merged 1 commit into from
Mar 30, 2023
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
40 changes: 21 additions & 19 deletions src/lib/kit/components/Layouts/Row/Row.scss
Original file line number Diff line number Diff line change
Expand Up @@ -17,37 +17,40 @@

&__left {
width: 180px;
min-height: 28px;
display: flex;
flex-direction: column;
flex-shrink: 0;
align-items: center;

&-inner {
min-height: 28px;
display: flex;
}

&::after {
content: '';
width: 100%;
flex-shrink: 1;
display: inline;
}
}

&__title {
align-self: center;
word-break: break-word;
margin-right: 3px;

&_required {
&::after {
content: '*';
color: var(--yc-color-text-danger);
}
}
}

&__note {
height: 28px;
display: flex;
align-items: center;
margin-left: 5px;
padding-right: 16px;

.yc-help-popover {
display: flex;
&-inner {
position: absolute;
margin-top: 1px;

& > span {
.yc-help-popover {
display: flex;

& > span {
display: flex;
}
}
}
}
Expand All @@ -74,7 +77,6 @@
}

&__required-mark {
margin-left: 2px;
color: var(--yc-color-text-danger);
}
}
19 changes: 10 additions & 9 deletions src/lib/kit/components/Layouts/Row/Row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,18 @@ const RowBase = <T extends FieldValue, S extends Spec>({
<div className={b({'extra-width': isArraySpec(spec) || arrayItem})}>
<div className={b('left')}>
<div className={b('left-inner')}>
<div className={b('title')}>
<span className={b('title', {required: spec.required})}>
{spec.viewSpec.layoutTitle}
{spec.required && <span className={b('required-mark')}>*</span>}
</div>
</span>
{!verboseDescription && spec.viewSpec.layoutDescription ? (
<div className={b('note')}>
<HelpPopover
htmlContent={spec.viewSpec.layoutDescription}
placement={['bottom', 'top']}
/>
</div>
<span className={b('note')}>
<span className={b('note-inner')}>
<HelpPopover
htmlContent={spec.viewSpec.layoutDescription}
placement={['bottom', 'top']}
/>
</span>
</span>
) : null}
</div>
</div>
Expand Down