-
Notifications
You must be signed in to change notification settings - Fork 841
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
Input groups #961
Input groups #961
Changes from 26 commits
f5f82c6
8c01c96
27f04ae
70bc54d
c1b5c24
abc855f
c2e8a73
66647f0
2eea143
d48cd3e
37899c3
88b2fdd
15d201b
a4c2760
6ea467c
9802500
75b5e13
0af05cb
7c656a0
d19c365
e0c9bfd
130d872
96c2c0c
b7af0dd
39ab710
de21e4d
a5d4106
9ba5136
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,7 @@ import moment from 'moment'; | |
|
||
import { | ||
EuiDatePicker, | ||
EuiFlexGroup, | ||
EuiFlexItem, | ||
EuiFormRow, | ||
EuiDatePickerRange, | ||
} from '../../../../src/components'; | ||
|
||
export default class extends Component { | ||
|
@@ -39,30 +37,28 @@ export default class extends Component { | |
|
||
render() { | ||
return ( | ||
<EuiFlexGroup gutterSize="none"> | ||
<EuiFlexItem grow={false}> | ||
<EuiFormRow label="Start date"> | ||
<EuiDatePicker | ||
selected={this.state.startDate} | ||
onChange={this.handleChangeStart} | ||
startDate={this.state.startDate} | ||
endDate={this.state.endDate} | ||
showTimeSelect | ||
/> | ||
</EuiFormRow> | ||
</EuiFlexItem> | ||
<EuiFlexItem grow={false}> | ||
<EuiFormRow label="End date"> | ||
<EuiDatePicker | ||
selected={this.state.endDate} | ||
onChange={this.handleChangeEnd} | ||
startDate={this.state.startDate} | ||
endDate={this.state.endDate} | ||
showTimeSelect | ||
/> | ||
</EuiFormRow> | ||
</EuiFlexItem> | ||
</EuiFlexGroup> | ||
<EuiDatePickerRange | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe add simple validation to ensure the start date is before end date? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just for the doc example? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, since validation lives outside the controls. Would be good to have a reference example. |
||
startDateControl={ | ||
<EuiDatePicker | ||
selected={this.state.startDate} | ||
onChange={this.handleChangeStart} | ||
startDate={this.state.startDate} | ||
endDate={this.state.endDate} | ||
aria-label="Start date" | ||
showTimeSelect | ||
/> | ||
} | ||
endDateControl={ | ||
<EuiDatePicker | ||
selected={this.state.endDate} | ||
onChange={this.handleChangeEnd} | ||
startDate={this.state.startDate} | ||
endDate={this.state.endDate} | ||
aria-label="End date" | ||
showTimeSelect | ||
/> | ||
} | ||
/> | ||
); | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
export { | ||
COLORS, | ||
ICON_SIDES, | ||
EuiButtonEmpty, | ||
} from './button_empty'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
export { EuiButton } from './button'; | ||
export { | ||
COLORS, | ||
EuiButton | ||
} from './button'; | ||
|
||
export { | ||
EuiButtonEmpty, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use the
color
value as thekey
, usingindex
when there is a unique value available is an anti-pattern (it has potential performance implications)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍