@gem-sdk/components 2.0.0-dev.349 → 2.0.0-dev.350
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/dist/cjs/marquee/common/index.js +2 -1
- package/dist/cjs/marquee/common/styles.js +10 -10
- package/dist/cjs/marquee/components/Marquee.liquid.js +9 -1
- package/dist/cjs/marquee/components/MarqueeBase.liquid.js +15 -21
- package/dist/esm/marquee/common/index.js +2 -1
- package/dist/esm/marquee/common/styles.js +10 -10
- package/dist/esm/marquee/components/Marquee.liquid.js +9 -1
- package/dist/esm/marquee/components/MarqueeBase.liquid.js +15 -21
- package/package.json +1 -1
|
@@ -172,17 +172,17 @@ const getWidthValue = (currentDevice, isFullWidthResponsive)=>{
|
|
|
172
172
|
const isFullWidthByScreen = core.getResponsiveValueByScreen(isFullWidthResponsive, currentDevice);
|
|
173
173
|
return isFullWidthByScreen ? '100%' : 'auto';
|
|
174
174
|
};
|
|
175
|
-
const getWidthMarquee = ()=>{
|
|
175
|
+
const getWidthMarquee = (isFullWidthResponsive)=>{
|
|
176
176
|
return {
|
|
177
177
|
...core.makeStyleResponsive('w', {
|
|
178
|
-
desktop: getWidthValue('desktop'),
|
|
179
|
-
tablet: getWidthValue('tablet'),
|
|
180
|
-
mobile: getWidthValue('mobile')
|
|
178
|
+
desktop: getWidthValue('desktop', isFullWidthResponsive),
|
|
179
|
+
tablet: getWidthValue('tablet', isFullWidthResponsive),
|
|
180
|
+
mobile: getWidthValue('mobile', isFullWidthResponsive)
|
|
181
181
|
}),
|
|
182
182
|
...core.makeStyleResponsive('minw', {
|
|
183
|
-
desktop: getWidthValue('desktop'),
|
|
184
|
-
tablet: getWidthValue('tablet'),
|
|
185
|
-
mobile: getWidthValue('mobile')
|
|
183
|
+
desktop: getWidthValue('desktop', isFullWidthResponsive),
|
|
184
|
+
tablet: getWidthValue('tablet', isFullWidthResponsive),
|
|
185
|
+
mobile: getWidthValue('mobile', isFullWidthResponsive)
|
|
186
186
|
})
|
|
187
187
|
};
|
|
188
188
|
};
|
|
@@ -205,12 +205,12 @@ const getMarqueeBaseStyle = (props)=>{
|
|
|
205
205
|
['--delay']: `${delay}s`,
|
|
206
206
|
['--iteration-count']: loop ? `${loop}` : 'infinite',
|
|
207
207
|
['--min-width']: autoFill ? `auto` : '100%',
|
|
208
|
-
...getWidthMarquee()
|
|
208
|
+
...getWidthMarquee(props?.isFullWidthResponsive)
|
|
209
209
|
};
|
|
210
210
|
};
|
|
211
|
-
const getChildBaseStyle = (direction)=>({
|
|
211
|
+
const getChildBaseStyle = (direction, isFullWidthResponsive)=>({
|
|
212
212
|
['--transform']: direction === 'up' ? 'rotate(90deg)' : direction === 'down' ? 'rotate(-90deg)' : 'none',
|
|
213
|
-
...getWidthMarquee()
|
|
213
|
+
...getWidthMarquee(isFullWidthResponsive)
|
|
214
214
|
});
|
|
215
215
|
|
|
216
216
|
exports.getAlignStyles = getAlignStyles;
|
|
@@ -14,12 +14,19 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
|
|
|
14
14
|
const { iconSeparatorColor, backgroundColor } = styles$1 || {};
|
|
15
15
|
const { iconSeparatorSvg, isShowIconSeparator } = setting || {};
|
|
16
16
|
const itemSize = rawChildren.length;
|
|
17
|
-
const { isFullWidth } = index.useMarqueeLiquidStyles(setting, styles$1);
|
|
17
|
+
const { isFullWidth, getIsFullWidthValue } = index.useMarqueeLiquidStyles(setting, styles$1);
|
|
18
18
|
const { styleHeight, styleWidth, getWidthForWrapperItem, getHeightOfIconSeparatorSize, getWidthOfIconSeparatorSize, getIconPosition, getItemPaddingRightSpacingValue, getWidthForItem } = styles.getMarqueeStyles({
|
|
19
19
|
itemSize,
|
|
20
20
|
setting,
|
|
21
21
|
styles: styles$1
|
|
22
22
|
});
|
|
23
|
+
const isFullWidthResponsive = ()=>{
|
|
24
|
+
return {
|
|
25
|
+
desktop: getIsFullWidthValue('desktop'),
|
|
26
|
+
tablet: getIsFullWidthValue('tablet'),
|
|
27
|
+
mobile: getIsFullWidthValue('mobile')
|
|
28
|
+
};
|
|
29
|
+
};
|
|
23
30
|
const computeAlignClasses = system.createClass(classes.getAlignClasses);
|
|
24
31
|
const computeAlignStyles = system.createStyle(styles.getAlignStyles(styles$1));
|
|
25
32
|
const computedContentStyles = system.createStyle(styles.getContentStyles({
|
|
@@ -72,6 +79,7 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
|
|
|
72
79
|
direction: props.setting?.direction,
|
|
73
80
|
play: (props.setting?.speed ?? 0) > 0,
|
|
74
81
|
pauseOnHover: props.setting?.stopOnHover,
|
|
82
|
+
isFullWidthResponsive: isFullWidthResponsive(),
|
|
75
83
|
children: `
|
|
76
84
|
<div class="${computedFastMarqueeContentClasses}">
|
|
77
85
|
${rawChildren?.length ? core.WrapRenderChildren({
|
|
@@ -7,7 +7,8 @@ var styles = require('../common/styles.js');
|
|
|
7
7
|
var system = require('@gem-sdk/system');
|
|
8
8
|
|
|
9
9
|
const MarqueeBase = (props)=>{
|
|
10
|
-
const { style = {}, autoFill = false, play = true, pauseOnHover = false, pauseOnClick = false, direction = 'left', delay = 0, loop = 0, children } = props ?? {};
|
|
10
|
+
const { style = {}, autoFill = false, play = true, pauseOnHover = false, pauseOnClick = false, direction = 'left', delay = 0, loop = 0, children, isFullWidthResponsive } = props ?? {};
|
|
11
|
+
console.log('isFullWidthResponsive', isFullWidthResponsive);
|
|
11
12
|
const computedContainerBaseStyle = system.createStyle(styles.getContainerBaseStyle({
|
|
12
13
|
style,
|
|
13
14
|
play,
|
|
@@ -19,30 +20,23 @@ const MarqueeBase = (props)=>{
|
|
|
19
20
|
direction,
|
|
20
21
|
delay,
|
|
21
22
|
loop,
|
|
22
|
-
autoFill
|
|
23
|
+
autoFill,
|
|
24
|
+
isFullWidthResponsive
|
|
23
25
|
}));
|
|
24
|
-
const computedChildBaseStyle = system.createStyle(styles.getChildBaseStyle(direction));
|
|
26
|
+
const computedChildBaseStyle = system.createStyle(styles.getChildBaseStyle(direction, isFullWidthResponsive));
|
|
25
27
|
return core.template`
|
|
26
|
-
|
|
27
|
-
|
|
28
|
+
<div style="${computedContainerBaseStyle}" class="rfm-marquee-container">
|
|
29
|
+
<div class="rfm-marquee" style="${computedMarqueeBaseStyle}">
|
|
28
30
|
<div class="rfm-initial-child-container">
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
${core.template`
|
|
32
|
+
<div style="${computedChildBaseStyle}" class="${`rfm-child`}">
|
|
33
|
+
${children}
|
|
34
|
+
</div>
|
|
35
|
+
`}
|
|
34
36
|
</div>
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
${children}
|
|
39
|
-
</div>
|
|
40
|
-
`}
|
|
41
|
-
</div>
|
|
42
|
-
</div>
|
|
43
|
-
<div class="rfm-marquee placeholder-marquee" style="${computedMarqueeBaseStyle}">
|
|
44
|
-
</div>
|
|
45
|
-
</div>
|
|
37
|
+
</div>
|
|
38
|
+
<div class="rfm-marquee placeholder-marquee" style="${computedMarqueeBaseStyle}"></div>
|
|
39
|
+
</div>
|
|
46
40
|
`;
|
|
47
41
|
};
|
|
48
42
|
|
|
@@ -170,17 +170,17 @@ const getWidthValue = (currentDevice, isFullWidthResponsive)=>{
|
|
|
170
170
|
const isFullWidthByScreen = getResponsiveValueByScreen(isFullWidthResponsive, currentDevice);
|
|
171
171
|
return isFullWidthByScreen ? '100%' : 'auto';
|
|
172
172
|
};
|
|
173
|
-
const getWidthMarquee = ()=>{
|
|
173
|
+
const getWidthMarquee = (isFullWidthResponsive)=>{
|
|
174
174
|
return {
|
|
175
175
|
...makeStyleResponsive('w', {
|
|
176
|
-
desktop: getWidthValue('desktop'),
|
|
177
|
-
tablet: getWidthValue('tablet'),
|
|
178
|
-
mobile: getWidthValue('mobile')
|
|
176
|
+
desktop: getWidthValue('desktop', isFullWidthResponsive),
|
|
177
|
+
tablet: getWidthValue('tablet', isFullWidthResponsive),
|
|
178
|
+
mobile: getWidthValue('mobile', isFullWidthResponsive)
|
|
179
179
|
}),
|
|
180
180
|
...makeStyleResponsive('minw', {
|
|
181
|
-
desktop: getWidthValue('desktop'),
|
|
182
|
-
tablet: getWidthValue('tablet'),
|
|
183
|
-
mobile: getWidthValue('mobile')
|
|
181
|
+
desktop: getWidthValue('desktop', isFullWidthResponsive),
|
|
182
|
+
tablet: getWidthValue('tablet', isFullWidthResponsive),
|
|
183
|
+
mobile: getWidthValue('mobile', isFullWidthResponsive)
|
|
184
184
|
})
|
|
185
185
|
};
|
|
186
186
|
};
|
|
@@ -203,12 +203,12 @@ const getMarqueeBaseStyle = (props)=>{
|
|
|
203
203
|
['--delay']: `${delay}s`,
|
|
204
204
|
['--iteration-count']: loop ? `${loop}` : 'infinite',
|
|
205
205
|
['--min-width']: autoFill ? `auto` : '100%',
|
|
206
|
-
...getWidthMarquee()
|
|
206
|
+
...getWidthMarquee(props?.isFullWidthResponsive)
|
|
207
207
|
};
|
|
208
208
|
};
|
|
209
|
-
const getChildBaseStyle = (direction)=>({
|
|
209
|
+
const getChildBaseStyle = (direction, isFullWidthResponsive)=>({
|
|
210
210
|
['--transform']: direction === 'up' ? 'rotate(90deg)' : direction === 'down' ? 'rotate(-90deg)' : 'none',
|
|
211
|
-
...getWidthMarquee()
|
|
211
|
+
...getWidthMarquee(isFullWidthResponsive)
|
|
212
212
|
});
|
|
213
213
|
|
|
214
214
|
export { getAlignStyles, getChildBaseStyle, getContainerBaseStyle, getContentStyles, getFastMarqueeChildrenIconStyles, getItemWrapperStyles, getMarqueeBaseStyle, getMarqueeStyles, getWidthMarquee };
|
|
@@ -10,12 +10,19 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
|
|
|
10
10
|
const { iconSeparatorColor, backgroundColor } = styles || {};
|
|
11
11
|
const { iconSeparatorSvg, isShowIconSeparator } = setting || {};
|
|
12
12
|
const itemSize = rawChildren.length;
|
|
13
|
-
const { isFullWidth } = useMarqueeLiquidStyles(setting, styles);
|
|
13
|
+
const { isFullWidth, getIsFullWidthValue } = useMarqueeLiquidStyles(setting, styles);
|
|
14
14
|
const { styleHeight, styleWidth, getWidthForWrapperItem, getHeightOfIconSeparatorSize, getWidthOfIconSeparatorSize, getIconPosition, getItemPaddingRightSpacingValue, getWidthForItem } = getMarqueeStyles({
|
|
15
15
|
itemSize,
|
|
16
16
|
setting,
|
|
17
17
|
styles
|
|
18
18
|
});
|
|
19
|
+
const isFullWidthResponsive = ()=>{
|
|
20
|
+
return {
|
|
21
|
+
desktop: getIsFullWidthValue('desktop'),
|
|
22
|
+
tablet: getIsFullWidthValue('tablet'),
|
|
23
|
+
mobile: getIsFullWidthValue('mobile')
|
|
24
|
+
};
|
|
25
|
+
};
|
|
19
26
|
const computeAlignClasses = createClass(getAlignClasses);
|
|
20
27
|
const computeAlignStyles = createStyle(getAlignStyles(styles));
|
|
21
28
|
const computedContentStyles = createStyle(getContentStyles({
|
|
@@ -68,6 +75,7 @@ const Marquee = ({ children, style, builderAttrs, rawChildren, advanced, ...prop
|
|
|
68
75
|
direction: props.setting?.direction,
|
|
69
76
|
play: (props.setting?.speed ?? 0) > 0,
|
|
70
77
|
pauseOnHover: props.setting?.stopOnHover,
|
|
78
|
+
isFullWidthResponsive: isFullWidthResponsive(),
|
|
71
79
|
children: `
|
|
72
80
|
<div class="${computedFastMarqueeContentClasses}">
|
|
73
81
|
${rawChildren?.length ? WrapRenderChildren({
|
|
@@ -3,7 +3,8 @@ import { getContainerBaseStyle, getMarqueeBaseStyle, getChildBaseStyle } from '.
|
|
|
3
3
|
import { createStyle } from '@gem-sdk/system';
|
|
4
4
|
|
|
5
5
|
const MarqueeBase = (props)=>{
|
|
6
|
-
const { style = {}, autoFill = false, play = true, pauseOnHover = false, pauseOnClick = false, direction = 'left', delay = 0, loop = 0, children } = props ?? {};
|
|
6
|
+
const { style = {}, autoFill = false, play = true, pauseOnHover = false, pauseOnClick = false, direction = 'left', delay = 0, loop = 0, children, isFullWidthResponsive } = props ?? {};
|
|
7
|
+
console.log('isFullWidthResponsive', isFullWidthResponsive);
|
|
7
8
|
const computedContainerBaseStyle = createStyle(getContainerBaseStyle({
|
|
8
9
|
style,
|
|
9
10
|
play,
|
|
@@ -15,30 +16,23 @@ const MarqueeBase = (props)=>{
|
|
|
15
16
|
direction,
|
|
16
17
|
delay,
|
|
17
18
|
loop,
|
|
18
|
-
autoFill
|
|
19
|
+
autoFill,
|
|
20
|
+
isFullWidthResponsive
|
|
19
21
|
}));
|
|
20
|
-
const computedChildBaseStyle = createStyle(getChildBaseStyle(direction));
|
|
22
|
+
const computedChildBaseStyle = createStyle(getChildBaseStyle(direction, isFullWidthResponsive));
|
|
21
23
|
return template`
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
<div style="${computedContainerBaseStyle}" class="rfm-marquee-container">
|
|
25
|
+
<div class="rfm-marquee" style="${computedMarqueeBaseStyle}">
|
|
24
26
|
<div class="rfm-initial-child-container">
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
${template`
|
|
28
|
+
<div style="${computedChildBaseStyle}" class="${`rfm-child`}">
|
|
29
|
+
${children}
|
|
30
|
+
</div>
|
|
31
|
+
`}
|
|
30
32
|
</div>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
${children}
|
|
35
|
-
</div>
|
|
36
|
-
`}
|
|
37
|
-
</div>
|
|
38
|
-
</div>
|
|
39
|
-
<div class="rfm-marquee placeholder-marquee" style="${computedMarqueeBaseStyle}">
|
|
40
|
-
</div>
|
|
41
|
-
</div>
|
|
33
|
+
</div>
|
|
34
|
+
<div class="rfm-marquee placeholder-marquee" style="${computedMarqueeBaseStyle}"></div>
|
|
35
|
+
</div>
|
|
42
36
|
`;
|
|
43
37
|
};
|
|
44
38
|
|