From b592661f616320887609ab37eb84f3e6313be6eb Mon Sep 17 00:00:00 2001 From: "pei.fan" Date: Sun, 4 Dec 2022 13:42:07 +0900 Subject: [PATCH 1/3] feat: Add wrapperClass prop to swiper/react --- src/react/swiper-react.d.ts | 7 +++++++ src/react/swiper.js | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/react/swiper-react.d.ts b/src/react/swiper-react.d.ts index c64404a3d..628f33679 100644 --- a/src/react/swiper-react.d.ts +++ b/src/react/swiper-react.d.ts @@ -17,6 +17,13 @@ interface SwiperProps extends SwiperOptions { */ wrapperTag?: string; + /** + * CSS class name of slides' wrapper + * + * @default 'swiper-wrapper' + */ + wrapperClass?: string; + /** * Get Swiper instance */ diff --git a/src/react/swiper.js b/src/react/swiper.js index d84f5ea6d..455bc5abd 100644 --- a/src/react/swiper.js +++ b/src/react/swiper.js @@ -24,6 +24,7 @@ const Swiper = forwardRef( className, tag: Tag = 'div', wrapperTag: WrapperTag = 'div', + wrapperClass = 'swiper-wrapper', children, onSwiper, ...rest @@ -205,7 +206,7 @@ const Swiper = forwardRef( > {slots['container-start']} - + {slots['wrapper-start']} {renderSlides()} {slots['wrapper-end']} From bb01b295208655556f3c91a6b684ce025d45d1e6 Mon Sep 17 00:00:00 2001 From: "pei.fan" Date: Sun, 4 Dec 2022 13:42:19 +0900 Subject: [PATCH 2/3] feat: Add wrapperClass prop to swiper/solid --- src/solid/swiper-solid.d.ts | 7 +++++++ src/solid/swiper.jsx | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/solid/swiper-solid.d.ts b/src/solid/swiper-solid.d.ts index f7584f5af..f9692fade 100644 --- a/src/solid/swiper-solid.d.ts +++ b/src/solid/swiper-solid.d.ts @@ -16,6 +16,13 @@ interface SwiperProps extends SwiperOptions { */ wrapperTag?: string; + /** + * CSS class name of slides' wrapper + * + * @default 'swiper-wrapper' + */ + wrapperClass?: string; + /** * Get Swiper instance */ diff --git a/src/solid/swiper.jsx b/src/solid/swiper.jsx index 6a2338a6c..a5e8b8a63 100644 --- a/src/solid/swiper.jsx +++ b/src/solid/swiper.jsx @@ -51,6 +51,7 @@ const Swiper = (props) => { 'ref', 'tag', 'wrapperTag', + 'wrapperClass', ]); const params = createMemo(() => getParams(rest)); @@ -221,7 +222,7 @@ const Swiper = (props) => { {slidesSlots().slots['container-start']} -
+
{slidesSlots().slots['wrapper-start']} {renderSlides()} {slidesSlots().slots['wrapper-end']} From 51c19b9ab80fe030b771081c2fd755911cc579ff Mon Sep 17 00:00:00 2001 From: "pei.fan" Date: Sun, 4 Dec 2022 13:42:46 +0900 Subject: [PATCH 3/3] feat: Add wrapperClass prop to swiper/svelte --- src/svelte/swiper.svelte | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/svelte/swiper.svelte b/src/svelte/swiper.svelte index 1b6cd2c52..afd6d6153 100644 --- a/src/svelte/swiper.svelte +++ b/src/svelte/swiper.svelte @@ -20,6 +20,7 @@ export let tag = 'div'; export let wrapperTag = 'div'; + export let wrapperClass = 'swiper-wrapper'; let containerClasses = 'swiper'; let breakpointChanged = false; @@ -158,7 +159,7 @@ {...restProps} > - +