@gem-sdk/components 2.0.0-dev.346 → 2.0.0-dev.348
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/carousel/components/plugins/AutoPlayPlugin.js +58 -17
- package/dist/cjs/countdown-timer/components/Countdown.js +103 -307
- package/dist/cjs/countdown-timer/components/Countdown.liquid.js +92 -56
- package/dist/cjs/countdown-timer/components/common/getAttr.js +15 -0
- package/dist/cjs/countdown-timer/components/common/getClasses.js +69 -0
- package/dist/cjs/countdown-timer/components/common/getStyle.js +66 -0
- package/dist/cjs/countdown-timer/components/hooks/useCountDownTimer.js +67 -0
- package/dist/cjs/countdown-timer/{hooks → components/hooks}/useTimeLeft.js +1 -1
- package/dist/cjs/countdown-timer/index.js +1 -1
- package/dist/cjs/countdown-timer/setting/Countdown.js +1 -1
- package/dist/cjs/countdown-timer/setting/configs/settings.js +1 -1
- package/dist/cjs/product/components/ProductProperties/ProductPropertyInput/ProductPropertyInput.liquid.js +1 -1
- package/dist/cjs/product/setting/product-properties/configs/settingsV2.js +43 -14
- package/dist/cjs/product/setting/product-properties/configs/uiV2.js +5 -2
- package/dist/cjs/third-party/components/AliReviews.liquid.js +1 -1
- package/dist/cjs/third-party/components/FeraReviews/FeraReviewsSampleContent.js +3 -3
- package/dist/cjs/third-party/components/FeraReviews/LiquidTemplateByWidget.js +2 -2
- package/dist/cjs/third-party/components/FeraReviews.js +0 -5
- package/dist/cjs/third-party/components/GoogleReviewsByReputon.liquid.js +2 -2
- package/dist/cjs/third-party/components/JudgemeReviews.liquid.js +5 -5
- package/dist/cjs/third-party/components/KachingBundles.liquid.js +1 -1
- package/dist/cjs/third-party/components/KingProductOptions.liquid.js +1 -1
- package/dist/cjs/third-party/components/LaiProductReviews/LiquidTemplateByWiget.js +3 -3
- package/dist/cjs/third-party/components/LooxReviews.liquid.js +1 -1
- package/dist/cjs/third-party/components/Ryviu.liquid.js +1 -1
- package/dist/cjs/third-party/components/Vitals.liquid.js +2 -2
- package/dist/cjs/third-party/setting/TrustshopProductReviews.js +3 -3
- package/dist/cjs/third-party/setting/WhatmoreShoppableVideosreel.js +36 -36
- package/dist/cjs/third-party/types/index.js +5 -0
- package/dist/esm/carousel/components/plugins/AutoPlayPlugin.js +58 -17
- package/dist/esm/countdown-timer/components/Countdown.js +104 -308
- package/dist/esm/countdown-timer/components/Countdown.liquid.js +93 -57
- package/dist/esm/countdown-timer/components/common/getAttr.js +12 -0
- package/dist/esm/countdown-timer/components/common/getClasses.js +61 -0
- package/dist/esm/countdown-timer/components/common/getStyle.js +60 -0
- package/dist/esm/countdown-timer/components/hooks/useCountDownTimer.js +63 -0
- package/dist/esm/countdown-timer/{hooks → components/hooks}/useTimeLeft.js +1 -1
- package/dist/esm/countdown-timer/index.js +1 -1
- package/dist/esm/countdown-timer/setting/Countdown.js +1 -1
- package/dist/esm/countdown-timer/setting/configs/settings.js +1 -1
- package/dist/esm/product/components/ProductProperties/ProductPropertyInput/ProductPropertyInput.liquid.js +1 -1
- package/dist/esm/product/setting/product-properties/configs/settingsV2.js +43 -14
- package/dist/esm/product/setting/product-properties/configs/uiV2.js +5 -2
- package/dist/esm/third-party/components/AliReviews.liquid.js +1 -1
- package/dist/esm/third-party/components/FeraReviews/FeraReviewsSampleContent.js +1 -1
- package/dist/esm/third-party/components/FeraReviews/LiquidTemplateByWidget.js +1 -1
- package/dist/esm/third-party/components/FeraReviews.js +1 -5
- package/dist/esm/third-party/components/GoogleReviewsByReputon.liquid.js +2 -2
- package/dist/esm/third-party/components/JudgemeReviews.liquid.js +5 -5
- package/dist/esm/third-party/components/KachingBundles.liquid.js +1 -1
- package/dist/esm/third-party/components/KingProductOptions.liquid.js +1 -1
- package/dist/esm/third-party/components/LaiProductReviews/LiquidTemplateByWiget.js +3 -3
- package/dist/esm/third-party/components/LooxReviews.liquid.js +1 -1
- package/dist/esm/third-party/components/Ryviu.liquid.js +1 -1
- package/dist/esm/third-party/components/Vitals.liquid.js +2 -2
- package/dist/esm/third-party/setting/TrustshopProductReviews.js +3 -3
- package/dist/esm/third-party/setting/WhatmoreShoppableVideosreel.js +36 -36
- package/dist/esm/third-party/types/index.js +5 -1
- package/dist/types/index.d.ts +1541 -1531
- package/package.json +1 -1
|
@@ -4,15 +4,41 @@ const AutoPlayPlugin = (slider)=>{
|
|
|
4
4
|
let autoplay = slider.options.autoplay ?? {};
|
|
5
5
|
let timeout;
|
|
6
6
|
let mouseOver = false;
|
|
7
|
+
let inViewport = false;
|
|
8
|
+
let observer = null;
|
|
9
|
+
// Thêm sự kiện cho dot nếu có
|
|
10
|
+
const $dots = slider?.container?.closest('[data-component-type="component"]')?.querySelector('.carousel-dots');
|
|
11
|
+
// Callback của IntersectionObserver
|
|
12
|
+
function handleIntersection(entries) {
|
|
13
|
+
entries.forEach((entry)=>{
|
|
14
|
+
// Với threshold 0, chỉ cần một phần bất kỳ hiển thị sẽ đánh dấu isIntersecting
|
|
15
|
+
inViewport = entry.isIntersecting;
|
|
16
|
+
if (inViewport) {
|
|
17
|
+
nextTimeout();
|
|
18
|
+
} else {
|
|
19
|
+
clearNextTimeout();
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
function initIntersectionObserver() {
|
|
24
|
+
// Nếu đã có observer hoặc không có container thì không khởi tạo lại
|
|
25
|
+
if (observer || !slider.container) return;
|
|
26
|
+
observer = new IntersectionObserver(handleIntersection, {
|
|
27
|
+
root: null,
|
|
28
|
+
threshold: 0
|
|
29
|
+
});
|
|
30
|
+
observer.observe(slider.container);
|
|
31
|
+
}
|
|
7
32
|
function clearNextTimeout() {
|
|
8
33
|
clearTimeout(timeout);
|
|
9
34
|
}
|
|
10
35
|
function nextTimeout() {
|
|
11
|
-
|
|
36
|
+
clearNextTimeout();
|
|
12
37
|
timeout = setTimeout(()=>{
|
|
13
|
-
|
|
38
|
+
// Nếu đang hover, autoplay bị tắt hoặc slider không trong viewport thì không chuyển slide
|
|
39
|
+
if (mouseOver || !autoplay.enable || !inViewport) return;
|
|
14
40
|
slider.next();
|
|
15
|
-
}, autoplay
|
|
41
|
+
}, autoplay.delay ?? 2000);
|
|
16
42
|
}
|
|
17
43
|
function onMouseOver() {
|
|
18
44
|
mouseOver = true;
|
|
@@ -23,11 +49,15 @@ const AutoPlayPlugin = (slider)=>{
|
|
|
23
49
|
nextTimeout();
|
|
24
50
|
}
|
|
25
51
|
slider.on('created', ()=>{
|
|
26
|
-
|
|
52
|
+
$dots?.addEventListener('mouseover', onMouseOver);
|
|
53
|
+
$dots?.addEventListener('mouseout', onMouseOut);
|
|
54
|
+
// Nếu tùy chọn pauseOnHover bật thì thêm sự kiện hover cho container slider
|
|
55
|
+
if (autoplay.pauseOnHover && slider.container) {
|
|
27
56
|
slider.container.addEventListener('mouseover', onMouseOver);
|
|
28
57
|
slider.container.addEventListener('mouseout', onMouseOut);
|
|
29
58
|
}
|
|
30
|
-
if (
|
|
59
|
+
if (autoplay.enable) {
|
|
60
|
+
initIntersectionObserver();
|
|
31
61
|
nextTimeout();
|
|
32
62
|
}
|
|
33
63
|
});
|
|
@@ -35,29 +65,40 @@ const AutoPlayPlugin = (slider)=>{
|
|
|
35
65
|
slider.on('animationEnded', nextTimeout);
|
|
36
66
|
slider.on('updated', (newOptions)=>{
|
|
37
67
|
autoplay = newOptions.options?.autoplay ?? {};
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
slider.container.removeEventListener('mouseout', onMouseOut);
|
|
68
|
+
if (autoplay.enable) {
|
|
69
|
+
initIntersectionObserver();
|
|
70
|
+
nextTimeout();
|
|
71
|
+
}
|
|
43
72
|
});
|
|
44
73
|
slider.on('optionsChanged', (newOptions)=>{
|
|
45
|
-
|
|
46
|
-
$dots?.addEventListener('mouseover', onMouseOver);
|
|
47
|
-
$dots?.addEventListener('mouseout', onMouseOut);
|
|
48
|
-
if (newOptions.options.autoplay?.pauseOnHover !== autoplay.pauseOnHover) {
|
|
74
|
+
if (newOptions.options.autoplay?.pauseOnHover !== autoplay.pauseOnHover && slider.container) {
|
|
49
75
|
if (newOptions.options.autoplay?.pauseOnHover) {
|
|
50
76
|
slider.container.addEventListener('mouseover', onMouseOver);
|
|
51
77
|
slider.container.addEventListener('mouseout', onMouseOut);
|
|
52
|
-
}
|
|
53
|
-
if (!newOptions.options.autoplay?.pauseOnHover) {
|
|
78
|
+
} else {
|
|
54
79
|
slider.container.removeEventListener('mouseover', onMouseOver);
|
|
55
80
|
slider.container.removeEventListener('mouseout', onMouseOut);
|
|
56
81
|
mouseOver = false;
|
|
57
82
|
}
|
|
58
83
|
}
|
|
59
|
-
nextTimeout();
|
|
60
84
|
autoplay = newOptions.options.autoplay ?? {};
|
|
85
|
+
if (autoplay.enable) {
|
|
86
|
+
initIntersectionObserver();
|
|
87
|
+
nextTimeout();
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
slider.on('destroyed', ()=>{
|
|
91
|
+
if (slider.container) {
|
|
92
|
+
slider.container.removeEventListener('mouseover', onMouseOver);
|
|
93
|
+
slider.container.removeEventListener('mouseout', onMouseOut);
|
|
94
|
+
}
|
|
95
|
+
$dots?.removeEventListener('mouseover', onMouseOver);
|
|
96
|
+
$dots?.removeEventListener('mouseout', onMouseOut);
|
|
97
|
+
clearNextTimeout();
|
|
98
|
+
if (observer) {
|
|
99
|
+
observer.disconnect();
|
|
100
|
+
observer = null;
|
|
101
|
+
}
|
|
61
102
|
});
|
|
62
103
|
};
|
|
63
104
|
|
|
@@ -5,335 +5,131 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var helpers = require('../helpers.js');
|
|
8
|
-
var useTimeLeft = require('../hooks/useTimeLeft.js');
|
|
9
|
-
var core = require('@gem-sdk/core');
|
|
10
|
-
var React = require('react');
|
|
11
8
|
var Text = require('../../text/components/Text.js');
|
|
12
|
-
var
|
|
9
|
+
var core = require('@gem-sdk/core');
|
|
10
|
+
var useCountDownTimer = require('./hooks/useCountDownTimer.js');
|
|
11
|
+
var system = require('@gem-sdk/system');
|
|
12
|
+
var getAttr = require('./common/getAttr.js');
|
|
13
|
+
var getClasses = require('./common/getClasses.js');
|
|
14
|
+
var getStyle = require('./common/getStyle.js');
|
|
13
15
|
|
|
14
|
-
const Countdown = (
|
|
15
|
-
const {
|
|
16
|
+
const Countdown = (props)=>{
|
|
17
|
+
const { setting, styles, builderProps, advanced } = props;
|
|
18
|
+
const { labelTypo, numTypo, labelTypography, numTypography } = styles ?? {};
|
|
19
|
+
const { weekLabel, dayLabel, hourLabel, minuteLabel, secondLabel, enableWeek, enableDay, enableHour, enableMinute, enableSecond, redirectUrl } = setting ?? {};
|
|
16
20
|
const mode = core.useEditorMode();
|
|
17
|
-
const ref =
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
timerEverygreen: setting?.timerEverygreen,
|
|
22
|
-
dateStandard: setting?.dateStandard,
|
|
23
|
-
behaviour: setting?.behaviour,
|
|
24
|
-
loopAfterFinish: setting?.loopAfterFinish,
|
|
25
|
-
redirectUrl: setting?.redirectUrl,
|
|
26
|
-
timeZone: setting?.timeZone
|
|
27
|
-
});
|
|
28
|
-
const { week, day, hour, minute, second } = helpers.convertTime(timeLeft, {
|
|
29
|
-
enableWeek: setting?.enableWeek,
|
|
30
|
-
enableDay: setting?.enableDay,
|
|
31
|
-
enableHour: setting?.enableHour,
|
|
32
|
-
enableMinute: setting?.enableMinute,
|
|
33
|
-
enableSecond: setting?.enableSecond
|
|
21
|
+
const { week, day, hour, minute, second, timeLeft, ref } = useCountDownTimer.default(setting, builderProps);
|
|
22
|
+
const hasLinkCover = !!redirectUrl?.link && mode !== 'edit';
|
|
23
|
+
const textExpireClasses = system.createClass({
|
|
24
|
+
...getClasses.getTextExpireClasses()
|
|
34
25
|
});
|
|
35
|
-
common.useTransition((preTimeLeft)=>{
|
|
36
|
-
if (preTimeLeft !== timeLeft) {
|
|
37
|
-
dispatchInteractionCountdownTimer(timeLeft);
|
|
38
|
-
}
|
|
39
|
-
}, [
|
|
40
|
-
timeLeft
|
|
41
|
-
]);
|
|
42
|
-
const dispatchInteractionCountdownTimer = (timeLeft)=>{
|
|
43
|
-
const element = ref.current;
|
|
44
|
-
const gpInteractionCounter = new Map(Object.entries(JSON.parse(element?.getAttribute('gp-interaction-counter') ?? '{}')));
|
|
45
|
-
if (gpInteractionCounter.size <= 0) return;
|
|
46
|
-
gpInteractionCounter.forEach((_, key)=>{
|
|
47
|
-
if (timeLeft !== Number(key)) return;
|
|
48
|
-
trigger({
|
|
49
|
-
event: 'gp:countdown-timer',
|
|
50
|
-
selector: `[data-id="${builderProps?.uid}"]`,
|
|
51
|
-
element,
|
|
52
|
-
data: Number(key)
|
|
53
|
-
});
|
|
54
|
-
if (!setting?.loopAfterFinish) {
|
|
55
|
-
gpInteractionCounter.delete(key);
|
|
56
|
-
element.setAttribute('gp-interaction-counter', JSON.stringify(Object.fromEntries(gpInteractionCounter)));
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
const renderClassWithCondition = (condition, className)=>condition ? className : '';
|
|
61
26
|
if (setting?.autoHideWhenTimeout && timeLeft <= 0) {
|
|
62
27
|
if (mode !== 'edit') {
|
|
63
28
|
return null;
|
|
64
29
|
}
|
|
65
30
|
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
66
|
-
className:
|
|
31
|
+
className: textExpireClasses,
|
|
67
32
|
children: /*#__PURE__*/ jsxRuntime.jsx("span", {
|
|
68
33
|
children: "Countdown is run out of time (this only visible in the editor)"
|
|
69
34
|
})
|
|
70
35
|
});
|
|
71
36
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
37
|
+
const attrs = system.createAttr({
|
|
38
|
+
...getAttr.getAttr({
|
|
39
|
+
uid: builderProps?.uid || ''
|
|
40
|
+
})
|
|
41
|
+
});
|
|
42
|
+
const wrapperStyle = system.createStyle({
|
|
43
|
+
...getStyle.getWrapperStyle(styles)
|
|
44
|
+
});
|
|
45
|
+
const wrapperClasses = system.createClass({
|
|
46
|
+
...getClasses.getWrapperClasses(advanced?.cssClass)
|
|
47
|
+
});
|
|
48
|
+
const containClasses = system.createClass({
|
|
49
|
+
...getClasses.getContentClasses()
|
|
50
|
+
});
|
|
51
|
+
const containStyle = system.createStyle({
|
|
52
|
+
...getStyle.getContainStyle(styles)
|
|
53
|
+
});
|
|
54
|
+
const dateStyle = system.createStyle({
|
|
55
|
+
...getStyle.getDateStyle(styles)
|
|
56
|
+
});
|
|
57
|
+
const dateClasses = (dateLabel)=>system.createClass({
|
|
58
|
+
...getClasses.getDateClasses(styles, dateLabel)
|
|
59
|
+
});
|
|
60
|
+
const textFrontClasses = system.createClass({
|
|
61
|
+
...getClasses.getTextFrontClasses(styles)
|
|
62
|
+
});
|
|
63
|
+
const textFrontStyle = system.createStyle({
|
|
64
|
+
...getStyle.getTextFrontStyle(styles)
|
|
65
|
+
});
|
|
66
|
+
const textBackStyle = system.createStyle({
|
|
67
|
+
...getStyle.getTextBackStyle(styles)
|
|
68
|
+
});
|
|
69
|
+
const textBackClasses = (textLabel)=>system.createClass({
|
|
70
|
+
...getClasses.getTextBackClasses(styles, textLabel)
|
|
71
|
+
});
|
|
72
|
+
const linkClasses = system.createClass({
|
|
73
|
+
...getClasses.getLinkClasses()
|
|
74
|
+
});
|
|
75
|
+
const timeTemplate = (time, textLabel)=>{
|
|
76
|
+
const textFrontLabel = helpers.formatTime(time);
|
|
77
|
+
return /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
78
|
+
style: dateStyle,
|
|
79
|
+
className: dateClasses(textLabel),
|
|
85
80
|
children: [
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
...core.handleConvertBorderWidth(styles?.borderState),
|
|
91
|
-
...core.handleConvertBorderColor(styles?.borderState),
|
|
92
|
-
...core.composeRadius(styles?.roundedState),
|
|
93
|
-
...core.makeStyle({
|
|
94
|
-
bg: core.getGlobalColorCSSProp(styles?.backgroundItemColor)
|
|
95
|
-
})
|
|
96
|
-
},
|
|
97
|
-
className: core.cls(core.getGlobalColorClass('bg', styles?.backgroundItemColor), 'gp-min-w-max !gp-max-w-max gp-flex-1 gp-text-center ', styles?.itemPadding?.type ? core.genSizeClass(styles?.itemPadding?.type) : '', renderClassWithCondition(!setting?.weekLabel, 'gp-content-center')),
|
|
98
|
-
children: [
|
|
99
|
-
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
100
|
-
className: core.cls(core.getGlobalColorClass('text', colorNumber)),
|
|
101
|
-
styles: {
|
|
102
|
-
typography: styles?.numTypography,
|
|
103
|
-
typo: styles?.numTypo
|
|
104
|
-
},
|
|
105
|
-
style: {
|
|
106
|
-
...core.makeStyle({
|
|
107
|
-
mb: styles?.verticalGap,
|
|
108
|
-
c: core.getGlobalColorCSSProp(colorNumber)
|
|
109
|
-
})
|
|
110
|
-
},
|
|
111
|
-
setting: {
|
|
112
|
-
text: helpers.formatTime(week),
|
|
113
|
-
htmlTag: 'div',
|
|
114
|
-
excludeFlex: true
|
|
115
|
-
}
|
|
116
|
-
}),
|
|
117
|
-
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
118
|
-
className: core.cls(core.getGlobalColorClass('text', colorLabel), renderClassWithCondition(!setting?.weekLabel, 'gp-hidden')),
|
|
119
|
-
styles: {
|
|
120
|
-
typography: styles?.labelTypography,
|
|
121
|
-
typo: styles?.labelTypo
|
|
122
|
-
},
|
|
123
|
-
style: {
|
|
124
|
-
...core.makeStyle({
|
|
125
|
-
c: core.getGlobalColorCSSProp(colorLabel)
|
|
126
|
-
})
|
|
127
|
-
},
|
|
128
|
-
setting: {
|
|
129
|
-
text: setting?.weekLabel,
|
|
130
|
-
htmlTag: 'p',
|
|
131
|
-
excludeFlex: true
|
|
132
|
-
}
|
|
133
|
-
})
|
|
134
|
-
]
|
|
135
|
-
}),
|
|
136
|
-
setting?.enableDay && /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
137
|
-
style: {
|
|
138
|
-
...!styles?.itemPadding?.type ? core.composeSize(styles?.itemPadding?.custom) : {},
|
|
139
|
-
...core.handleConvertBorderStyle(styles?.borderState),
|
|
140
|
-
...core.handleConvertBorderWidth(styles?.borderState),
|
|
141
|
-
...core.handleConvertBorderColor(styles?.borderState),
|
|
142
|
-
...core.composeRadius(styles?.roundedState),
|
|
143
|
-
...core.makeStyle({
|
|
144
|
-
bg: core.getGlobalColorCSSProp(styles?.backgroundItemColor)
|
|
145
|
-
})
|
|
81
|
+
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
82
|
+
styles: {
|
|
83
|
+
typography: numTypography,
|
|
84
|
+
typo: numTypo
|
|
146
85
|
},
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
styles: {
|
|
152
|
-
typography: styles?.numTypography,
|
|
153
|
-
typo: styles?.numTypo
|
|
154
|
-
},
|
|
155
|
-
style: {
|
|
156
|
-
...core.makeStyle({
|
|
157
|
-
mb: styles?.verticalGap,
|
|
158
|
-
c: core.getGlobalColorCSSProp(colorNumber)
|
|
159
|
-
})
|
|
160
|
-
},
|
|
161
|
-
setting: {
|
|
162
|
-
text: helpers.formatTime(day),
|
|
163
|
-
htmlTag: 'div',
|
|
164
|
-
excludeFlex: true
|
|
165
|
-
}
|
|
166
|
-
}),
|
|
167
|
-
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
168
|
-
className: `${core.cls(core.getGlobalColorClass('text', colorLabel), renderClassWithCondition(!setting?.dayLabel, 'gp-hidden'))} , `,
|
|
169
|
-
styles: {
|
|
170
|
-
typography: styles?.labelTypography,
|
|
171
|
-
typo: styles?.labelTypo
|
|
172
|
-
},
|
|
173
|
-
style: {
|
|
174
|
-
...core.makeStyle({
|
|
175
|
-
c: core.getGlobalColorCSSProp(colorLabel)
|
|
176
|
-
})
|
|
177
|
-
},
|
|
178
|
-
setting: {
|
|
179
|
-
text: setting?.dayLabel,
|
|
180
|
-
htmlTag: 'p',
|
|
181
|
-
excludeFlex: true
|
|
182
|
-
}
|
|
183
|
-
})
|
|
184
|
-
]
|
|
185
|
-
}),
|
|
186
|
-
setting?.enableHour && /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
187
|
-
className: core.cls(core.getGlobalColorClass('bg', styles?.backgroundItemColor), 'gp-min-w-max !gp-max-w-max gp-flex-1 gp-text-center', styles?.itemPadding?.type ? core.genSizeClass(styles?.itemPadding?.type) : '', renderClassWithCondition(!setting?.hourLabel, 'gp-content-center')),
|
|
188
|
-
style: {
|
|
189
|
-
...!styles?.itemPadding?.type ? core.composeSize(styles?.itemPadding?.custom) : {},
|
|
190
|
-
...core.handleConvertBorderStyle(styles?.borderState),
|
|
191
|
-
...core.handleConvertBorderWidth(styles?.borderState),
|
|
192
|
-
...core.handleConvertBorderColor(styles?.borderState),
|
|
193
|
-
...core.composeRadius(styles?.roundedState),
|
|
194
|
-
...core.makeStyle({
|
|
195
|
-
bg: core.getGlobalColorCSSProp(styles?.backgroundItemColor)
|
|
196
|
-
})
|
|
86
|
+
setting: {
|
|
87
|
+
htmlTag: 'div',
|
|
88
|
+
text: textFrontLabel,
|
|
89
|
+
excludeFlex: true
|
|
197
90
|
},
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
className: core.cls(core.getGlobalColorClass('text', colorNumber)),
|
|
201
|
-
styles: {
|
|
202
|
-
typography: styles?.numTypography,
|
|
203
|
-
typo: styles?.numTypo
|
|
204
|
-
},
|
|
205
|
-
style: {
|
|
206
|
-
...core.makeStyle({
|
|
207
|
-
mb: styles?.verticalGap,
|
|
208
|
-
c: core.getGlobalColorCSSProp(colorNumber)
|
|
209
|
-
})
|
|
210
|
-
},
|
|
211
|
-
setting: {
|
|
212
|
-
text: helpers.formatTime(hour),
|
|
213
|
-
htmlTag: 'div',
|
|
214
|
-
excludeFlex: true
|
|
215
|
-
}
|
|
216
|
-
}),
|
|
217
|
-
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
218
|
-
className: core.cls(core.getGlobalColorClass('text', colorLabel), renderClassWithCondition(!setting?.hourLabel, 'gp-hidden')),
|
|
219
|
-
styles: {
|
|
220
|
-
typography: styles?.labelTypography,
|
|
221
|
-
typo: styles?.labelTypo
|
|
222
|
-
},
|
|
223
|
-
style: {
|
|
224
|
-
...core.makeStyle({
|
|
225
|
-
c: core.getGlobalColorCSSProp(colorLabel)
|
|
226
|
-
})
|
|
227
|
-
},
|
|
228
|
-
setting: {
|
|
229
|
-
text: setting?.hourLabel,
|
|
230
|
-
htmlTag: 'p',
|
|
231
|
-
excludeFlex: true
|
|
232
|
-
}
|
|
233
|
-
})
|
|
234
|
-
]
|
|
91
|
+
className: textFrontClasses,
|
|
92
|
+
style: textFrontStyle
|
|
235
93
|
}),
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
...core.handleConvertBorderStyle(styles?.borderState),
|
|
241
|
-
...core.handleConvertBorderWidth(styles?.borderState),
|
|
242
|
-
...core.handleConvertBorderColor(styles?.borderState),
|
|
243
|
-
...core.composeRadius(styles?.roundedState),
|
|
244
|
-
...core.makeStyle({
|
|
245
|
-
bg: core.getGlobalColorCSSProp(styles?.backgroundItemColor)
|
|
246
|
-
})
|
|
94
|
+
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
95
|
+
styles: {
|
|
96
|
+
typography: labelTypography,
|
|
97
|
+
typo: labelTypo
|
|
247
98
|
},
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
typography: styles?.numTypography,
|
|
253
|
-
typo: styles?.numTypo
|
|
254
|
-
},
|
|
255
|
-
style: {
|
|
256
|
-
...core.makeStyle({
|
|
257
|
-
mb: styles?.verticalGap,
|
|
258
|
-
c: core.getGlobalColorCSSProp(colorNumber)
|
|
259
|
-
})
|
|
260
|
-
},
|
|
261
|
-
setting: {
|
|
262
|
-
text: helpers.formatTime(minute),
|
|
263
|
-
htmlTag: 'div',
|
|
264
|
-
excludeFlex: true
|
|
265
|
-
}
|
|
266
|
-
}),
|
|
267
|
-
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
268
|
-
className: core.cls(core.getGlobalColorClass('text', colorLabel), renderClassWithCondition(!setting?.minuteLabel, 'gp-hidden')),
|
|
269
|
-
styles: {
|
|
270
|
-
typography: styles?.labelTypography,
|
|
271
|
-
typo: styles?.labelTypo
|
|
272
|
-
},
|
|
273
|
-
style: {
|
|
274
|
-
...core.makeStyle({
|
|
275
|
-
c: core.getGlobalColorCSSProp(colorLabel)
|
|
276
|
-
})
|
|
277
|
-
},
|
|
278
|
-
setting: {
|
|
279
|
-
text: setting?.minuteLabel,
|
|
280
|
-
htmlTag: 'p',
|
|
281
|
-
excludeFlex: true
|
|
282
|
-
}
|
|
283
|
-
})
|
|
284
|
-
]
|
|
285
|
-
}),
|
|
286
|
-
setting?.enableSecond && /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
287
|
-
className: core.cls(core.getGlobalColorClass('bg', styles?.backgroundItemColor), 'gp-min-w-max !gp-max-w-max gp-flex-1 gp-text-center', styles?.itemPadding?.type ? core.genSizeClass(styles?.itemPadding?.type) : '', renderClassWithCondition(!setting?.secondLabel, 'gp-content-center')),
|
|
288
|
-
style: {
|
|
289
|
-
...!styles?.itemPadding?.type ? core.composeSize(styles?.itemPadding?.custom) : {},
|
|
290
|
-
...core.handleConvertBorderStyle(styles?.borderState),
|
|
291
|
-
...core.handleConvertBorderWidth(styles?.borderState),
|
|
292
|
-
...core.handleConvertBorderColor(styles?.borderState),
|
|
293
|
-
...core.composeRadius(styles?.roundedState),
|
|
294
|
-
...core.makeStyle({
|
|
295
|
-
bg: core.getGlobalColorCSSProp(styles?.backgroundItemColor)
|
|
296
|
-
})
|
|
99
|
+
setting: {
|
|
100
|
+
text: textLabel,
|
|
101
|
+
htmlTag: 'p',
|
|
102
|
+
excludeFlex: true
|
|
297
103
|
},
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
className: core.cls(core.getGlobalColorClass('text', colorNumber)),
|
|
301
|
-
styles: {
|
|
302
|
-
typography: styles?.numTypography,
|
|
303
|
-
typo: styles?.numTypo
|
|
304
|
-
},
|
|
305
|
-
style: {
|
|
306
|
-
...core.makeStyle({
|
|
307
|
-
mb: styles?.verticalGap,
|
|
308
|
-
c: core.getGlobalColorCSSProp(colorNumber)
|
|
309
|
-
})
|
|
310
|
-
},
|
|
311
|
-
setting: {
|
|
312
|
-
text: helpers.formatTime(second),
|
|
313
|
-
htmlTag: 'div',
|
|
314
|
-
excludeFlex: true
|
|
315
|
-
}
|
|
316
|
-
}),
|
|
317
|
-
/*#__PURE__*/ jsxRuntime.jsx(Text.default, {
|
|
318
|
-
className: core.cls(core.getGlobalColorClass('text', colorLabel), renderClassWithCondition(!setting?.secondLabel, 'gp-hidden')),
|
|
319
|
-
styles: {
|
|
320
|
-
typography: styles?.labelTypography,
|
|
321
|
-
typo: styles?.labelTypo
|
|
322
|
-
},
|
|
323
|
-
style: {
|
|
324
|
-
...core.makeStyle({
|
|
325
|
-
c: core.getGlobalColorCSSProp(colorLabel)
|
|
326
|
-
})
|
|
327
|
-
},
|
|
328
|
-
setting: {
|
|
329
|
-
text: setting?.secondLabel,
|
|
330
|
-
htmlTag: 'p',
|
|
331
|
-
excludeFlex: true
|
|
332
|
-
}
|
|
333
|
-
})
|
|
334
|
-
]
|
|
104
|
+
style: textBackStyle,
|
|
105
|
+
className: textBackClasses(textLabel)
|
|
335
106
|
})
|
|
336
107
|
]
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
return /*#__PURE__*/ jsxRuntime.jsx("div", {
|
|
111
|
+
ref: ref,
|
|
112
|
+
...attrs,
|
|
113
|
+
className: wrapperClasses,
|
|
114
|
+
style: wrapperStyle,
|
|
115
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs("div", {
|
|
116
|
+
className: containClasses,
|
|
117
|
+
style: containStyle,
|
|
118
|
+
children: [
|
|
119
|
+
system.If(hasLinkCover, /*#__PURE__*/ jsxRuntime.jsx("a", {
|
|
120
|
+
href: redirectUrl?.link,
|
|
121
|
+
target: redirectUrl?.target,
|
|
122
|
+
"aria-label": "Countdown link",
|
|
123
|
+
className: linkClasses,
|
|
124
|
+
children: ' '
|
|
125
|
+
})),
|
|
126
|
+
system.If(enableWeek, timeTemplate(week, weekLabel)),
|
|
127
|
+
system.If(enableWeek, timeTemplate(week, weekLabel)),
|
|
128
|
+
system.If(enableDay, timeTemplate(day, dayLabel)),
|
|
129
|
+
system.If(enableHour, timeTemplate(hour, hourLabel)),
|
|
130
|
+
system.If(enableMinute, timeTemplate(minute, minuteLabel)),
|
|
131
|
+
system.If(enableSecond, timeTemplate(second, secondLabel))
|
|
132
|
+
]
|
|
337
133
|
})
|
|
338
134
|
});
|
|
339
135
|
};
|