@shopgate/pwa-common 7.31.0-alpha.5 → 7.31.0-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/Swiper/index.js +15 -4
- package/package.json +3 -3
|
@@ -15,7 +15,15 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
15
15
|
const useStyles = makeStyles()(() => ({
|
|
16
16
|
container: {
|
|
17
17
|
position: 'relative',
|
|
18
|
-
maxHeight: '100%'
|
|
18
|
+
maxHeight: '100%',
|
|
19
|
+
'&.pagination-below': {
|
|
20
|
+
'& .swiper-pagination.swiper-pagination-bullets': {
|
|
21
|
+
'--swiper-pagination-bottom': 0,
|
|
22
|
+
position: 'relative',
|
|
23
|
+
height: 32,
|
|
24
|
+
lineHeight: '40px'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
19
27
|
},
|
|
20
28
|
innerContainer: {
|
|
21
29
|
overflow: 'hidden',
|
|
@@ -135,6 +143,7 @@ const Swiper = ({
|
|
|
135
143
|
classes,
|
|
136
144
|
cx
|
|
137
145
|
} = useStyles();
|
|
146
|
+
const isBulletsBelow = paginationTypeProp === 'bulletsBelow';
|
|
138
147
|
const useFraction = maxIndicators && maxIndicators < children.length;
|
|
139
148
|
const paginationType = useFraction ? 'fraction' : 'bullets';
|
|
140
149
|
const showPagination = indicators && children.length > 1;
|
|
@@ -179,7 +188,7 @@ const Swiper = ({
|
|
|
179
188
|
...(showPagination && {
|
|
180
189
|
pagination: {
|
|
181
190
|
el: undefined,
|
|
182
|
-
type: paginationTypeProp || paginationType,
|
|
191
|
+
type: isBulletsBelow ? 'bullets' : paginationTypeProp || paginationType,
|
|
183
192
|
bulletClass: classNames.bulletClass || 'swiper-pagination-bullet',
|
|
184
193
|
bulletActiveClass: classNames.bulletActiveClass || 'swiper-pagination-bullet-active',
|
|
185
194
|
dynamicBullets: true,
|
|
@@ -190,7 +199,7 @@ const Swiper = ({
|
|
|
190
199
|
allowSlidePrev: !disabled,
|
|
191
200
|
allowSlideNext: !disabled,
|
|
192
201
|
onSlideChange: handleSlideChange
|
|
193
|
-
}), [additionalModules, classNames.container, classNames.bulletClass, classNames.bulletActiveClass, classes.innerContainer, classes.zoomFix, swiperProps, autoPlay, interval, navigation, showPagination, paginationTypeProp, paginationType, indicators, children.length, disabled, handleSlideChange, cx]);
|
|
202
|
+
}), [additionalModules, classNames.container, classNames.bulletClass, classNames.bulletActiveClass, classes.innerContainer, classes.zoomFix, swiperProps, autoPlay, interval, navigation, showPagination, paginationTypeProp, paginationType, indicators, children.length, disabled, handleSlideChange, isBulletsBelow, cx]);
|
|
194
203
|
useEffect(() => {
|
|
195
204
|
if (!internalProps.autoplay && !swiperProps.autoplay) {
|
|
196
205
|
if (swiperRef.current?.swiper?.autoplay) {
|
|
@@ -255,7 +264,9 @@ const Swiper = ({
|
|
|
255
264
|
}
|
|
256
265
|
}, [delay, loopProp, onBreakpoint]);
|
|
257
266
|
return /*#__PURE__*/_jsx("div", {
|
|
258
|
-
className: cx(classes.container, className, 'common__swiper'
|
|
267
|
+
className: cx(classes.container, className, 'common__swiper', {
|
|
268
|
+
'pagination-below': isBulletsBelow
|
|
269
|
+
}),
|
|
259
270
|
"aria-hidden": ariaHidden,
|
|
260
271
|
children: /*#__PURE__*/_jsxs(OriginalSwiper, {
|
|
261
272
|
"aria-live": "off",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopgate/pwa-common",
|
|
3
|
-
"version": "7.31.0-alpha.
|
|
3
|
+
"version": "7.31.0-alpha.7",
|
|
4
4
|
"description": "Common library for the Shopgate Connect PWA.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Shopgate <support@shopgate.com>",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@redux-devtools/extension": "^3.3.0",
|
|
19
19
|
"@sentry/browser": "6.0.1",
|
|
20
|
-
"@shopgate/pwa-benchmark": "7.31.0-alpha.
|
|
20
|
+
"@shopgate/pwa-benchmark": "7.31.0-alpha.7",
|
|
21
21
|
"@virtuous/conductor": "~2.5.0",
|
|
22
22
|
"@virtuous/react-conductor": "~2.5.0",
|
|
23
23
|
"@virtuous/redux-persister": "1.1.0-beta.7",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"swiper": "12.1.0"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@shopgate/pwa-core": "7.31.0-alpha.
|
|
43
|
+
"@shopgate/pwa-core": "7.31.0-alpha.7",
|
|
44
44
|
"@types/lodash": "^4.17.24",
|
|
45
45
|
"@types/react-portal": "^3.0.9",
|
|
46
46
|
"lodash": "^4.17.23",
|