From 9e44a7eda9ada16f75556628fcb0ead9fda19154 Mon Sep 17 00:00:00 2001 From: cchaos Date: Fri, 16 Nov 2018 14:14:49 -0500 Subject: [PATCH] Some tweaks --- .../date_picker/_global_date_picker.scss | 20 +++++++++++-------- .../views/date_picker/date_picker_example.js | 4 +--- .../views/date_picker/global_date_picker.js | 19 ++++++------------ 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src-docs/src/views/date_picker/_global_date_picker.scss b/src-docs/src/views/date_picker/_global_date_picker.scss index f167cc635db..d522ce46bcb 100644 --- a/src-docs/src/views/date_picker/_global_date_picker.scss +++ b/src-docs/src/views/date_picker/_global_date_picker.scss @@ -1,5 +1,6 @@ //// GLOBAL Date picker +// sass-lint:disable no-important .euiGlobalDatePicker__quickSelectButton { // Override prepend border since button already lives inside another prepend border-right: none !important; @@ -21,6 +22,7 @@ max-width: none; width: auto; + // sass-lint:disable nesting-depth .euiPopover__anchor { display: block; } @@ -75,14 +77,6 @@ .euiGlobalDatePicker__updateButton { // Just wide enough for all 3 states min-width: $euiButtonMinWidth + ($euiSizeXS * 1.5); - - @include euiBreakpoint('xs', 's') { - min-width: 0; - - .euiGlobalDatePicker__updateButtonText { - display: none; - } - } } .euiGlobalDatePicker__popoverSection { @@ -91,3 +85,13 @@ overflow: hidden; overflow-y: auto; } + +@include euiBreakpoint('xs', 's') { + .euiGlobalDatePicker__updateButton { + min-width: 0; + + .euiGlobalDatePicker__updateButtonText { + display: none; + } + } +} diff --git a/src-docs/src/views/date_picker/date_picker_example.js b/src-docs/src/views/date_picker/date_picker_example.js index e40743e58bf..38dcff6a3f9 100644 --- a/src-docs/src/views/date_picker/date_picker_example.js +++ b/src-docs/src/views/date_picker/date_picker_example.js @@ -279,9 +279,7 @@ export const DatePickerExample = {

This documents a visual pattern for the eventual replacement of Kibana's - global date/time picker. It uses all EUI components without any custom styles. However, it - currently depends strongly on react-datepicker's calendarContainer option - which has it's own problems and limitations (like auto-focus on input stealing focus from inputs inside of popover). + global date/time picker. It uses all EUI components with some custom styles.

diff --git a/src-docs/src/views/date_picker/global_date_picker.js b/src-docs/src/views/date_picker/global_date_picker.js index cd7a4839f13..0b4b809576c 100644 --- a/src-docs/src/views/date_picker/global_date_picker.js +++ b/src-docs/src/views/date_picker/global_date_picker.js @@ -26,7 +26,6 @@ import { EuiTabbedContent, EuiForm, EuiSwitch, - EuiTextColor, EuiToolTip, EuiFieldText, EuiButtonIcon, @@ -90,7 +89,7 @@ class GlobalDatePopover extends Component { - + @@ -101,14 +100,11 @@ class GlobalDatePopover extends Component { id: 'now', name: 'Now', content: ( - - {moment().format('MMMM Do YYYY')} - - - - {moment().format('h:mm:ss a')} - - + +

+ Setting the time to "Now" means that on every refresh + this time will be set to the time of the refresh. +

), }]; @@ -242,9 +238,6 @@ export default class extends Component { ['3 hours ago', '4 minutes ago'], 'Last 6 months', ['06/11/2017 06:11 AM', '06/11/2017 06:11 PM'], - ['06/11/2017 06:11 AM', '06/11/2017 06:11 PM'], - ['06/11/2017 06:11 AM', '06/11/2017 06:11 PM'], - ['06/11/2017 06:11 AM', '06/11/2017 06:11 PM'], ], }; }