|
1 |
| -import { action } from '@storybook/addon-actions'; |
2 |
| -import { boolean, number, select } from '@storybook/addon-knobs'; |
| 1 | +import { createSelectArgTypes } from '@shared/stories/createSelectArgTypes'; |
3 | 2 | import { ThemingParameters } from '@ui5/webcomponents-react-base/lib/ThemingParameters';
|
4 | 3 | import { Carousel } from '@ui5/webcomponents-react/lib/Carousel';
|
5 | 4 | import { CarouselArrowsPlacement } from '@ui5/webcomponents-react/lib/CarouselArrowsPlacement';
|
6 | 5 | import React from 'react';
|
7 | 6 |
|
8 | 7 | export default {
|
9 | 8 | title: 'UI5 Web Components / Carousel',
|
10 |
| - component: Carousel |
| 9 | + component: Carousel, |
| 10 | + argTypes: { |
| 11 | + ...createSelectArgTypes({ arrowsPlacement: CarouselArrowsPlacement }) |
| 12 | + }, |
| 13 | + args: { |
| 14 | + arrowsPlacement: CarouselArrowsPlacement.Content, |
| 15 | + selectedIndex: 0 |
| 16 | + } |
11 | 17 | };
|
12 | 18 |
|
13 |
| -export const generatedDefaultStory = () => ( |
| 19 | +export const generatedDefaultStory = (props) => ( |
14 | 20 | <Carousel
|
15 |
| - arrowsPlacement={select('arrowsPlacement', CarouselArrowsPlacement, CarouselArrowsPlacement['Content'])} |
16 |
| - cyclic={boolean('cyclic', false)} |
17 |
| - hideNavigation={boolean('hideNavigation', false)} |
18 |
| - itemsPerPageL={number('itemsPerPageL', 1)} |
19 |
| - itemsPerPageM={number('itemsPerPageM', 1)} |
20 |
| - itemsPerPageS={number('itemsPerPageS', 1)} |
21 |
| - onNavigate={action('onNavigate')} |
22 |
| - selectedIndex={number('selectedIndex', 0)} |
| 21 | + arrowsPlacement={props.arrowsPlacement} |
| 22 | + cyclic={props.cyclic} |
| 23 | + hideNavigation={props.hideNavigation} |
| 24 | + itemsPerPageL={props.itemsPerPageL} |
| 25 | + itemsPerPageM={props.itemsPerPageM} |
| 26 | + itemsPerPageS={props.itemsPerPageS} |
| 27 | + onNavigate={props.onNavigate} |
| 28 | + selectedIndex={props.selectedIndex} |
23 | 29 | >
|
24 | 30 | <div style={{ height: '300px', width: '100%', backgroundColor: ThemingParameters.sapInformationBackground }}>
|
25 | 31 | Carousel Content 1
|
|
0 commit comments