-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed target reset when source is changed (#456)
* fixed * refactored * after review * fix * removed div
- Loading branch information
1 parent
43d9a08
commit b774827
Showing
9 changed files
with
367 additions
and
430 deletions.
There are no files selected for viewing
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...ts/TriggerEditForm/EditDescritionHelp.tsx → ...ditForm/Components/EditDescritionHelp.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
.form { | ||
max-width: 800px; | ||
} | ||
|
||
.label { | ||
flex-shrink: 0; | ||
width: 150px; | ||
} | ||
|
||
.label-for-group { | ||
align-self: flex-start; | ||
padding-top: 7px; | ||
} | ||
|
||
.row { | ||
display: flex; | ||
align-items: baseline; | ||
margin-bottom: 15px; | ||
|
||
textarea { | ||
vertical-align: top; | ||
} | ||
} | ||
|
||
.control { | ||
margin-left: auto; | ||
width: calc(~'100% - 150px'); | ||
} | ||
|
||
.group { | ||
display: flex; | ||
align-items: center; | ||
|
||
& > * { | ||
margin-right: 5px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import React from "react"; | ||
import classNames from "classnames/bind"; | ||
|
||
import styles from "./Form.less"; | ||
|
||
const cn = classNames.bind(styles); | ||
|
||
interface IFormProps { | ||
children: React.ReactNode; | ||
} | ||
|
||
export function Form({ children }: IFormProps): React.ReactElement { | ||
return <div className={cn("form")}>{children}</div>; | ||
} | ||
|
||
interface IFormRowProps { | ||
label?: string; | ||
useTopAlignForLabel?: boolean; | ||
singleLineControlGroup?: boolean; | ||
style?: { | ||
[key: string]: number | string; | ||
}; | ||
children: React.ReactNode; | ||
} | ||
|
||
export function FormRow({ | ||
label, | ||
useTopAlignForLabel, | ||
singleLineControlGroup, | ||
children, | ||
style, | ||
}: IFormRowProps): React.ReactElement { | ||
const labelElement = label && ( | ||
<div className={cn("label", { "label-for-group": useTopAlignForLabel })}>{label}</div> | ||
); | ||
|
||
return ( | ||
<div className={cn("row")}> | ||
{labelElement} | ||
<div style={style} className={cn("control", { group: singleLineControlGroup })}> | ||
{children} | ||
</div> | ||
</div> | ||
); | ||
} |
2 changes: 1 addition & 1 deletion
2
...ts/TriggerEditForm/MetricSourceSelect.tsx → ...ditForm/Components/MetricSourceSelect.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.