DocSpace-buildtools/web/ASC.Web.Components/example/stories/input/date/index.stories.js

28 lines
787 B
JavaScript
Raw Normal View History

2019-06-27 14:36:42 +00:00
import React from 'react';
import { storiesOf } from '@storybook/react';
import { action } from '@storybook/addon-actions';
2019-06-28 12:40:40 +00:00
import { DateValue } from 'react-values'
2019-06-27 14:36:42 +00:00
import withReadme from 'storybook-readme/with-readme';
import Readme from './README.md';
import { DateInput } from 'asc-web-components';
import Section from '../../../.storybook/decorators/section';
storiesOf('Components|Input', module)
.addDecorator(withReadme(Readme))
.add('date', () => (
<Section>
2019-06-28 12:40:40 +00:00
<DateValue>
{({ value, set }) => (
2019-06-27 14:36:42 +00:00
<DateInput
2019-06-28 12:40:40 +00:00
selected={value}
dateFormat="dd.MM.yyyy"
onChange={date => {
action('onChange')(date);
set(date);
2019-06-27 14:36:42 +00:00
}}
/>
)}
2019-06-28 12:40:40 +00:00
</DateValue>
2019-06-27 14:36:42 +00:00
</Section>
));