diff --git a/.storybook/preview.js b/.storybook/preview.js index 5d00c02..2518fd6 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -1,3 +1,4 @@ +import './styles.css' export const parameters = { actions: { argTypesRegex: "^on[A-Z].*" }, diff --git a/.storybook/styles.css b/.storybook/styles.css new file mode 100644 index 0000000..8d4b763 --- /dev/null +++ b/.storybook/styles.css @@ -0,0 +1,47 @@ +.sb-container { + padding: 10px; + border-radius: 5px; + background-color: #d2d2d2; +} + +span.sb-title { + color: #3e3e3e; + display: block; + margin: 5px; + font-size: 16px; + font-family: Arial, Helvetica, sans-serif; +} + +.sb-divider { + max-width: 100%; + border-bottom: solid 3px #ffffff; + margin: 5px; + box-sizing: border-box; +} + +.sb-button { + width: 150px; + height: 35px; + margin: 5px; + padding: 0px 10px; + border-radius: 5px; + background-color: #009800; + border: none; + color: white; + text-decoration: none; + font-size: 14px; + cursor: pointer; +} + +.sb-input[type=text], +.sb-input[type=number] { + width: 150px; + height: 35px; + margin: 5px; + padding: 0px 10px; + border-radius: 5px; + display: inline-block; + border: 1px solid #9f9f9f; + outline: none; + box-sizing: border-box; +} diff --git a/src/components/Carousel/stories/CarouselViewMethods.svelte b/src/components/Carousel/stories/CarouselViewMethods.svelte index 6a445ac..43c5803 100644 --- a/src/components/Carousel/stories/CarouselViewMethods.svelte +++ b/src/components/Carousel/stories/CarouselViewMethods.svelte @@ -17,13 +17,24 @@ let carousel; + // goTo let pageIndex function handlePageChange(e) { - pageIndex = e.target.value + pageIndex = Number(e.target.value) } - function handlePageChangeClick() { + function handleGoToClick() { carousel.goTo(pageIndex) } + + // goToPrev + function handleGoToPrevClick() { + carousel.goToPrev() + } + + // goToNext + function handleGoToNextClick() { + carousel.goToNext() + }
@@ -39,8 +50,21 @@
{/each} - - + +
+ carousel.goTo + + +
+ + carousel.goToPrev + +
+ + carousel.goToNext + +
+
\ No newline at end of file