@gem-sdk/components 2.0.0-dev.729 → 2.0.0-dev.731

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.
@@ -4,7 +4,7 @@ require('react/jsx-runtime');
4
4
  require('@gem-sdk/core');
5
5
  require('react');
6
6
  require('@gem-sdk/system');
7
- require('swiper/element');
7
+ require('swiper/element/bundle');
8
8
  require('next/link');
9
9
  var Carousel = require('./setting/Carousel.js');
10
10
  var CarouselItem$1 = require('./setting/CarouselItem.js');
@@ -2,14 +2,14 @@
2
2
 
3
3
  var jsxRuntime = require('react/jsx-runtime');
4
4
  var React = require('react');
5
- var element = require('swiper/element');
5
+ var bundle = require('swiper/element/bundle');
6
6
 
7
7
  function Swiper(props) {
8
8
  const swiperRef = React.useRef(null);
9
9
  const { children, totalSlides, onSwiperReady, sliderClass, ...sliderSetting } = props;
10
10
  const pauseOnMouseEnter = typeof props.autoplay === 'object' && props.autoplay !== null ? props.autoplay.pauseOnMouseEnter : undefined;
11
11
  React.useEffect(()=>{
12
- element.register();
12
+ bundle.register();
13
13
  Object.assign(swiperRef.current, sliderSetting);
14
14
  swiperRef.current.initialize();
15
15
  const instance = swiperRef.current.swiper;
@@ -11,7 +11,7 @@ require('../notification/components/Notice.js');
11
11
  require('./components/ProductButton/common/types.js');
12
12
  require('./components/ProductVariants/components/variants/index.js');
13
13
  require('next/image');
14
- require('swiper/element');
14
+ require('swiper/element/bundle');
15
15
  require('react-dom');
16
16
  require('../modal/components/confirm.js');
17
17
  require('../video/components/Video.js');
@@ -5,11 +5,14 @@ require('react/jsx-runtime');
5
5
  require('react');
6
6
  var _const = require('../../../common/const.js');
7
7
 
8
+ const getCSSPosition = (position)=>{
9
+ return position == 'top' ? 'sticky' : 'fixed';
10
+ };
8
11
  const getDisplayStyle = (device, display, position)=>{
9
12
  const style = {
10
13
  [`--top${device}`]: 'auto',
11
14
  [`--${position + device}`]: '0',
12
- [`--pos${device}`]: 'fixed'
15
+ [`--pos${device}`]: getCSSPosition(position)
13
16
  };
14
17
  if (display === 'after-first-cart-button') style[`--d${device}`] = 'none';
15
18
  return style;
@@ -65,13 +65,16 @@ const useSticky = (setting)=>{
65
65
  position?.mobile,
66
66
  position?.tablet
67
67
  ]);
68
- const positionStyle = React.useMemo(()=>{
68
+ const getCSSPosition = (position)=>{
69
+ return position == 'top' ? 'sticky' : 'fixed';
70
+ };
71
+ const positionStyle = ()=>{
69
72
  return {
70
- [`--pos`]: 'fixed',
71
- [`--pos-tablet`]: 'fixed',
72
- [`--pos-mobile`]: 'fixed'
73
+ [`--pos`]: getCSSPosition(position?.desktop),
74
+ [`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop),
75
+ [`--pos-mobile`]: getCSSPosition(position?.mobile ?? position?.desktop)
73
76
  };
74
- }, []);
77
+ };
75
78
  return {
76
79
  w,
77
80
  displayStyle,
@@ -2,7 +2,7 @@ import 'react/jsx-runtime';
2
2
  import '@gem-sdk/core';
3
3
  import 'react';
4
4
  import '@gem-sdk/system';
5
- import 'swiper/element';
5
+ import 'swiper/element/bundle';
6
6
  import 'next/link';
7
7
  import config from './setting/Carousel.js';
8
8
  import config$1 from './setting/CarouselItem.js';
@@ -1,6 +1,6 @@
1
1
  import { jsx } from 'react/jsx-runtime';
2
2
  import { useRef, useEffect } from 'react';
3
- import { register } from 'swiper/element';
3
+ import { register } from 'swiper/element/bundle';
4
4
 
5
5
  function Swiper(props) {
6
6
  const swiperRef = useRef(null);
@@ -9,7 +9,7 @@ import '../notification/components/Notice.js';
9
9
  import './components/ProductButton/common/types.js';
10
10
  import './components/ProductVariants/components/variants/index.js';
11
11
  import 'next/image';
12
- import 'swiper/element';
12
+ import 'swiper/element/bundle';
13
13
  import 'react-dom';
14
14
  import '../modal/components/confirm.js';
15
15
  import '../video/components/Video.js';
@@ -3,11 +3,14 @@ import 'react/jsx-runtime';
3
3
  import 'react';
4
4
  import { ELEMENT_Z_INDEX } from '../../../common/const.js';
5
5
 
6
+ const getCSSPosition = (position)=>{
7
+ return position == 'top' ? 'sticky' : 'fixed';
8
+ };
6
9
  const getDisplayStyle = (device, display, position)=>{
7
10
  const style = {
8
11
  [`--top${device}`]: 'auto',
9
12
  [`--${position + device}`]: '0',
10
- [`--pos${device}`]: 'fixed'
13
+ [`--pos${device}`]: getCSSPosition(position)
11
14
  };
12
15
  if (display === 'after-first-cart-button') style[`--d${device}`] = 'none';
13
16
  return style;
@@ -61,13 +61,16 @@ const useSticky = (setting)=>{
61
61
  position?.mobile,
62
62
  position?.tablet
63
63
  ]);
64
- const positionStyle = useMemo(()=>{
64
+ const getCSSPosition = (position)=>{
65
+ return position == 'top' ? 'sticky' : 'fixed';
66
+ };
67
+ const positionStyle = ()=>{
65
68
  return {
66
- [`--pos`]: 'fixed',
67
- [`--pos-tablet`]: 'fixed',
68
- [`--pos-mobile`]: 'fixed'
69
+ [`--pos`]: getCSSPosition(position?.desktop),
70
+ [`--pos-tablet`]: getCSSPosition(position?.tablet ?? position?.desktop),
71
+ [`--pos-mobile`]: getCSSPosition(position?.mobile ?? position?.desktop)
69
72
  };
70
- }, []);
73
+ };
71
74
  return {
72
75
  w,
73
76
  displayStyle,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gem-sdk/components",
3
- "version": "2.0.0-dev.729",
3
+ "version": "2.0.0-dev.731",
4
4
  "license": "MIT",
5
5
  "sideEffects": false,
6
6
  "main": "dist/cjs/index.js",