-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
18 changed files
with
159 additions
and
58 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -8,7 +8,6 @@ import { | |
|
||
export default () => ( | ||
<EuiDateTime> | ||
<EuiDateTimeInput /> | ||
<EuiCalendar /> | ||
</EuiDateTime> | ||
); |
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 |
---|---|---|
|
@@ -20,6 +20,7 @@ const iconTypes = [ | |
'boxesVertical', | ||
'brush', | ||
'bullseye', | ||
'calendar', | ||
'check', | ||
'clock', | ||
'console', | ||
|
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 |
---|---|---|
@@ -1,3 +1,19 @@ | ||
.euiDateTime { | ||
max-width: $euiFormMaxWidth; | ||
|
||
.euiDateTime__input { | ||
padding-right: $euiSizeXXL; | ||
padding-left:$euiSizeM; | ||
} | ||
|
||
.euiDateTime__dateColumn { | ||
padding: $euiSize; | ||
} | ||
|
||
.euiDateTime__timeColumn { | ||
background: $euiColorLightestShade; | ||
border-radius: 0 $euiBorderRadius $euiBorderRadius 0; | ||
border-left: $euiBorderThin; | ||
padding: $euiSize 0 $euiSize $euiSizeS; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@import 'date_time'; | ||
@import 'date_time_input'; | ||
@import 'calendar/index'; | ||
@import 'time_selector/index'; |
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 was deleted.
Oops, something went wrong.
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 @@ | ||
@import 'time_selector'; |
22 changes: 22 additions & 0 deletions
22
src/components/form/date_time/time_selector/_time_selector.scss
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,22 @@ | ||
.euiTimeSelector { | ||
@include euiScrollBar; | ||
max-height: 256px; | ||
overflow-y: auto; | ||
|
||
.euiTimeSelector__button { | ||
display: block; | ||
font-size: $euiFontSizeXS; | ||
color: $euiColorDarkShade; | ||
padding: $euiSizeXS / 2 $euiSizeXS; | ||
text-align: right; | ||
width: 100%; | ||
border: $euiBorderThin; | ||
border-color: transparent; | ||
|
||
&:focus { | ||
background: $euiColorEmptyShade; | ||
border-color: $euiColorPrimary; | ||
color: $euiColorPrimary; | ||
} | ||
} | ||
} |
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,3 @@ | ||
export { | ||
EuiTimeSelector, | ||
} from './time_selector'; |
61 changes: 61 additions & 0 deletions
61
src/components/form/date_time/time_selector/time_selector.js
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,61 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import classNames from 'classnames'; | ||
|
||
export const EuiTimeSelector = ({ | ||
children, | ||
className, | ||
...rest, | ||
}) => { | ||
const classes = classNames('euiTimeSelector', className); | ||
|
||
const times = [ | ||
'12:00 AM', | ||
'12:30 AM', | ||
'1:00 AM', | ||
'1:30 AM', | ||
'2:00 AM', | ||
'2:30 AM', | ||
'3:00 AM', | ||
'3:30 AM', | ||
'4:00 AM', | ||
'4:30 AM', | ||
'5:00 AM', | ||
'5:30 AM', | ||
'6:00 AM', | ||
'6:30 AM', | ||
'7:00 AM', | ||
'7:30 AM', | ||
'8:00 AM', | ||
'8:30 AM', | ||
] | ||
|
||
const timeListItems = ( | ||
times.map((time, index) => { | ||
return ( | ||
<li | ||
key={index} | ||
> | ||
<button className="euiTimeSelector__button"> | ||
{time} | ||
</button> | ||
</li> | ||
); | ||
}) | ||
); | ||
|
||
|
||
return ( | ||
<ul | ||
className={classes} | ||
{...rest} | ||
> | ||
{timeListItems} | ||
</ul> | ||
); | ||
}; | ||
|
||
EuiTimeSelector.propTypes = { | ||
children: PropTypes.node, | ||
className: PropTypes.string, | ||
}; |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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