From c53c078633f20a312f464757a6a4c092ef3c598f Mon Sep 17 00:00:00 2001 From: Jason Rhodes Date: Fri, 15 Feb 2019 18:29:17 -0500 Subject: [PATCH 1/7] Updates docs so datepicker becomes date picker --- .../src/views/date_picker/custom_input.js | 2 +- .../views/date_picker/date_picker_example.js | 544 ++++++++++-------- 2 files changed, 308 insertions(+), 238 deletions(-) diff --git a/src-docs/src/views/date_picker/custom_input.js b/src-docs/src/views/date_picker/custom_input.js index 702fa600f5a..deab042bee2 100644 --- a/src-docs/src/views/date_picker/custom_input.js +++ b/src-docs/src/views/date_picker/custom_input.js @@ -11,7 +11,7 @@ import { EuiButton, } from '../../../../src/components'; -// Should be a component because the datepicker does some ref stuff behind the scenes +// Should be a component because the date picker does some ref stuff behind the scenes // eslint-disable-next-line react/prefer-stateless-function class ExampleCustomInput extends React.Component { 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 1f2c69f95c2..74f8af06c10 100644 --- a/src-docs/src/views/date_picker/date_picker_example.js +++ b/src-docs/src/views/date_picker/date_picker_example.js @@ -2,9 +2,7 @@ import React from 'react'; import { renderToHtml } from '../../services'; -import { - GuideSectionTypes, -} from '../../components'; +import { GuideSectionTypes } from '../../components'; import { EuiCode, @@ -64,248 +62,320 @@ const superDatePickerSource = require('!!raw-loader!./super_date_picker'); const superDatePickerHtml = renderToHtml(SuperDatePicker); export const DatePickerExample = { - title: 'DatePicker', - sections: [{ - source: [{ - type: GuideSectionTypes.JS, - code: datePickerSource, - }, { - type: GuideSectionTypes.HTML, - code: datePickerHtml, - }], - text: ( -

- At its most bare the EuiDatePicker only requires - props for selected and onChange. - It depends on moment for - all of its formatting. -

- ), - components: { EuiDatePicker }, - demo: , - props: { EuiDatePicker }, - }, { - title: 'Datepicker states', - source: [{ - type: GuideSectionTypes.JS, - code: statesSource, - }, { - type: GuideSectionTypes.HTML, - code: statesHtml, - }], - text: ( -

- Examples of how the input can appear within a form. This should match our - other form styles. -

- ), - demo: , - }, { - title: 'Time selection', - source: [{ - type: GuideSectionTypes.JS, - code: timeSource, - }, { - type: GuideSectionTypes.HTML, - code: timeHtml, - }], - text: ( -

- Two props control time selction. showTimeSelect will make - time selection appear next to the calendar - and showTimeSelectOnly will exclude the calendar and - make the time selection the only thing you see. Make sure to adjust - your dateFormat and timeFormat values - to match. -

- ), - demo: