@telefonica/mistica 14.39.0 → 14.40.0
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/css/mistica.css +1 -1
- package/dist/accordion.js +47 -49
- package/dist/button.js +10 -10
- package/dist/card.js +10 -10
- package/dist/carousel.css-mistica.js +48 -24
- package/dist/carousel.css.d.ts +9 -1
- package/dist/carousel.d.ts +2 -2
- package/dist/carousel.js +227 -219
- package/dist/community/advanced-data-card.css-mistica.js +6 -6
- package/dist/community/blocks.js +12 -12
- package/dist/desktop-container-type-context.js +2 -2
- package/dist/fade-in.js +2 -2
- package/dist/feedback.js +6 -6
- package/dist/focus-trap.js +2 -2
- package/dist/header.js +4 -4
- package/dist/hero.js +4 -4
- package/dist/horizontal-scroll.js +2 -2
- package/dist/icons/icon-amex.js +2 -2
- package/dist/icons/icon-chevron.js +2 -2
- package/dist/icons/icon-cvv-amex.js +2 -2
- package/dist/icons/icon-cvv-visa-mc.js +2 -2
- package/dist/icons/icon-info.js +4 -4
- package/dist/icons/icon-mastercard.js +2 -2
- package/dist/icons/icon-visa.js +2 -2
- package/dist/image.js +2 -2
- package/dist/list.js +16 -16
- package/dist/loading-bar.js +2 -2
- package/dist/logo.js +10 -10
- package/dist/menu.js +2 -2
- package/dist/mosaic.js +2 -2
- package/dist/navigation-bar.js +8 -8
- package/dist/navigation-breadcrumbs.js +2 -2
- package/dist/negative-box.js +2 -2
- package/dist/nestable-context.js +2 -2
- package/dist/package-version.js +1 -1
- package/dist/placeholder.js +2 -2
- package/dist/responsive-layout.js +2 -2
- package/dist/select.js +4 -4
- package/dist/sheet.js +71 -67
- package/dist/skeletons.js +12 -12
- package/dist/stack.js +2 -2
- package/dist/text-field-base.js +2 -2
- package/dist/text-field-components.js +2 -2
- package/dist/text.js +18 -17
- package/dist/theme-variant-context.js +2 -2
- package/dist/theme.js +8 -8
- package/dist/title.js +2 -2
- package/dist/tooltip.js +64 -60
- package/dist/utils/animation.js +2 -2
- package/dist/utils/css.js +1 -1
- package/dist/video.js +2 -2
- package/dist/vivinho-loading-animation/pulse-lottie.json.js +3 -5
- package/dist-es/accordion.js +65 -67
- package/dist-es/button.js +10 -10
- package/dist-es/card.js +10 -10
- package/dist-es/carousel.css-mistica.js +7 -7
- package/dist-es/carousel.js +278 -270
- package/dist-es/community/advanced-data-card.css-mistica.js +3 -3
- package/dist-es/community/blocks.js +12 -12
- package/dist-es/desktop-container-type-context.js +2 -2
- package/dist-es/fade-in.js +2 -2
- package/dist-es/feedback.js +6 -6
- package/dist-es/focus-trap.js +2 -2
- package/dist-es/header.js +4 -4
- package/dist-es/hero.js +4 -4
- package/dist-es/horizontal-scroll.js +2 -2
- package/dist-es/icons/icon-amex.js +2 -2
- package/dist-es/icons/icon-chevron.js +2 -2
- package/dist-es/icons/icon-cvv-amex.js +2 -2
- package/dist-es/icons/icon-cvv-visa-mc.js +2 -2
- package/dist-es/icons/icon-info.js +4 -4
- package/dist-es/icons/icon-mastercard.js +2 -2
- package/dist-es/icons/icon-visa.js +2 -2
- package/dist-es/image.js +2 -2
- package/dist-es/list.js +16 -16
- package/dist-es/loading-bar.js +2 -2
- package/dist-es/logo.js +10 -10
- package/dist-es/menu.js +2 -2
- package/dist-es/mosaic.js +2 -2
- package/dist-es/navigation-bar.js +8 -8
- package/dist-es/navigation-breadcrumbs.js +2 -2
- package/dist-es/negative-box.js +2 -2
- package/dist-es/nestable-context.js +2 -2
- package/dist-es/package-version.js +1 -1
- package/dist-es/placeholder.js +2 -2
- package/dist-es/responsive-layout.js +2 -2
- package/dist-es/select.js +4 -4
- package/dist-es/sheet.js +79 -75
- package/dist-es/skeletons.js +12 -12
- package/dist-es/stack.js +2 -2
- package/dist-es/style.css +1 -1
- package/dist-es/text-field-base.js +2 -2
- package/dist-es/text-field-components.js +4 -4
- package/dist-es/text.js +21 -20
- package/dist-es/theme-variant-context.js +2 -2
- package/dist-es/theme.js +8 -8
- package/dist-es/title.js +2 -2
- package/dist-es/tooltip.js +80 -76
- package/dist-es/utils/animation.js +2 -2
- package/dist-es/utils/css.js +1 -1
- package/dist-es/video.js +2 -2
- package/dist-es/vivinho-loading-animation/pulse-lottie.json.js +3 -5
- package/package.json +16 -17
package/dist-es/carousel.js
CHANGED
|
@@ -51,61 +51,62 @@ function _object_spread_props(target, source) {
|
|
|
51
51
|
}
|
|
52
52
|
return target;
|
|
53
53
|
}
|
|
54
|
-
import { jsx as s, jsxs as
|
|
55
|
-
import * as
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import { useScreenSize as
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
import
|
|
63
|
-
import {
|
|
64
|
-
import {
|
|
65
|
-
import {
|
|
66
|
-
import {
|
|
67
|
-
import {
|
|
68
|
-
import {
|
|
69
|
-
import {
|
|
70
|
-
import {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
space: {
|
|
84
|
-
mobile: 8,
|
|
85
|
-
desktop: 16
|
|
86
|
-
},
|
|
54
|
+
import { jsx as s, jsxs as J } from "react/jsx-runtime";
|
|
55
|
+
import * as c from "react";
|
|
56
|
+
import le from "./generated/mistica-icons/icon-chevron-left-regular.js";
|
|
57
|
+
import re from "./generated/mistica-icons/icon-chevron-right-regular.js";
|
|
58
|
+
import { useScreenSize as ne, useTheme as ce, useIsInViewport as Pe } from "./hooks.js";
|
|
59
|
+
import Ne from "./inline.js";
|
|
60
|
+
import { BaseTouchable as T } from "./touchable.js";
|
|
61
|
+
import F from "classnames";
|
|
62
|
+
import { useIsInverseVariant as Be, ThemeVariant as R } from "./theme-variant-context.js";
|
|
63
|
+
import { listenResize as ie, getPrefixedDataAttributes as ae } from "./utils/dom.js";
|
|
64
|
+
import { isAndroid as ue, isIos as Le, isRunningAcceptanceTest as Re } from "./utils/platform.js";
|
|
65
|
+
import { useDocumentVisibility as Te } from "./utils/document-visibility.js";
|
|
66
|
+
import { bulletButton as Ae, bulletButtonMobile as Ee, bulletButtonTablet as ye, bulletButtonDesktop as We, slideshowContainer as De, slideshowPrevArrowButton as Oe, slideshow as Ve, slideshowItem as ze, slideshowNextArrowButton as _e, slideshowBullets as je, bulletActiveInverse as Fe, bulletInverse as Ue, bulletActive as qe, bullet as Ke, carouselContainer as Ye, carouselPrevArrowButton as $e, carousel as Ge, centeredCarousel as He, carouselWithScrollMobile as Je, carouselWithScrollTablet as Qe, vars as P, carouselItem as Xe, carouselNextArrowButton as Ze, carouselBullets as et, noCarouselBulletsDesktop as tt, noCarouselBulletsTablet as ot, noCarouselBulletsMobile as st } from "./carousel.css-mistica.js";
|
|
67
|
+
import { vars as lt } from "./image.css-mistica.js";
|
|
68
|
+
import { useDesktopContainerType as rt } from "./desktop-container-type-context.js";
|
|
69
|
+
import { VIVO_NEW_SKIN as nt } from "./skins/constants.js";
|
|
70
|
+
import { applyCssVars as fe } from "./utils/css.js";
|
|
71
|
+
const de = (e, t)=>{
|
|
72
|
+
const o = Te();
|
|
73
|
+
return Pe(t, !1) && o && !!e;
|
|
74
|
+
}, he = (param)=>{
|
|
75
|
+
let { currentIndex: e, numPages: t, onPress: o } = param;
|
|
76
|
+
var _t_tablet;
|
|
77
|
+
const l = Be(), { isDesktopOrBigger: h } = ne(), m = (p)=>{
|
|
78
|
+
const n = p === e;
|
|
79
|
+
return l ? n ? Fe : Ue : n ? qe : Ke;
|
|
80
|
+
}, I = typeof t == "number" ? t : Math.max(t.mobile, (_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile, t.desktop);
|
|
81
|
+
return /* @__PURE__ */ s(Ne, {
|
|
82
|
+
space: 0,
|
|
87
83
|
alignItems: "center",
|
|
88
84
|
dataAttributes: {
|
|
89
85
|
"component-name": "PageBullets"
|
|
90
86
|
},
|
|
91
87
|
children: Array.from({
|
|
92
|
-
length:
|
|
93
|
-
}, (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
88
|
+
length: I
|
|
89
|
+
}, (p, n)=>/* @__PURE__ */ {
|
|
90
|
+
var _t_tablet;
|
|
91
|
+
return s(T, {
|
|
92
|
+
className: F(typeof t == "number" ? Ae : {
|
|
93
|
+
[Ee]: n < t.mobile,
|
|
94
|
+
[ye]: n < ((_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile),
|
|
95
|
+
[We]: n < t.desktop
|
|
99
96
|
}),
|
|
97
|
+
style: n === 0 ? {
|
|
98
|
+
paddingLeft: 0
|
|
99
|
+
} : {},
|
|
100
100
|
maybe: !0,
|
|
101
|
-
onPress: h &&
|
|
101
|
+
onPress: h && o ? ()=>o(n) : void 0,
|
|
102
102
|
children: /* @__PURE__ */ s("div", {
|
|
103
|
-
className: m(
|
|
103
|
+
className: m(n)
|
|
104
104
|
})
|
|
105
|
-
},
|
|
105
|
+
}, n);
|
|
106
|
+
})
|
|
106
107
|
});
|
|
107
|
-
},
|
|
108
|
-
const
|
|
108
|
+
}, oe = (e, t, o)=>o ? typeof o == "number" ? o : o[e] || t[e] : t[e], ct = (e, t)=>{
|
|
109
|
+
const o = {
|
|
109
110
|
mobile: 1,
|
|
110
111
|
tablet: 2,
|
|
111
112
|
desktop: {
|
|
@@ -114,59 +115,59 @@ const ie = (e, r)=>{
|
|
|
114
115
|
large: 3
|
|
115
116
|
}
|
|
116
117
|
};
|
|
117
|
-
if (!
|
|
118
|
-
desktop:
|
|
118
|
+
if (!t) return _object_spread_props(_object_spread({}, o), {
|
|
119
|
+
desktop: oe(e, o.desktop)
|
|
119
120
|
});
|
|
120
|
-
if (typeof
|
|
121
|
-
mobile:
|
|
122
|
-
tablet:
|
|
123
|
-
desktop:
|
|
121
|
+
if (typeof t == "number") return {
|
|
122
|
+
mobile: t,
|
|
123
|
+
tablet: t,
|
|
124
|
+
desktop: t
|
|
124
125
|
};
|
|
125
|
-
const
|
|
126
|
-
return _object_spread_props(_object_spread({},
|
|
127
|
-
desktop:
|
|
126
|
+
const l = oe(e, o.desktop, t.desktop);
|
|
127
|
+
return _object_spread_props(_object_spread({}, o, t), {
|
|
128
|
+
desktop: l
|
|
128
129
|
});
|
|
129
|
-
},
|
|
130
|
+
}, se = (e, t)=>{
|
|
130
131
|
if (e.length === 0) return [];
|
|
131
|
-
const
|
|
132
|
-
for(let h = 0; h < e.length; h +=
|
|
133
|
-
return
|
|
134
|
-
},
|
|
135
|
-
const
|
|
136
|
-
for(let
|
|
137
|
-
for(let
|
|
132
|
+
const o = Math.ceil(e.length / t), l = [];
|
|
133
|
+
for(let h = 0; h < e.length; h += o)l.push(e[h]);
|
|
134
|
+
return l[l.length - 1] = e[e.length - o], l;
|
|
135
|
+
}, it = (e, t)=>{
|
|
136
|
+
const o = [];
|
|
137
|
+
for(let l = 0; l < t.length; l++)l === 0 ? o.push(t[0]) : o.push((t[l] + t[l - 1]) / 2);
|
|
138
|
+
for(let l = o.length - 1; l >= 0; l--)if (e - o[l] >= -1) return l;
|
|
138
139
|
return 0;
|
|
139
|
-
},
|
|
140
|
-
let { items: e, itemStyle:
|
|
141
|
-
const { texts:
|
|
140
|
+
}, me = 5e3, be = (param)=>{
|
|
141
|
+
let { items: e, itemStyle: t, itemClassName: o, withBullets: l, renderBullets: h, initialActiveItem: m, itemsPerPage: I, itemsToScroll: p, mobilePageOffset: n, gap: S, free: N, centered: B, autoplay: g, onPageChange: x, dataAttributes: U } = param;
|
|
142
|
+
const { texts: A, platformOverrides: M, skinName: E } = ce(), a = rt(), i = ct(a || "large", I), { isDesktopOrBigger: C, isTablet: k } = ne(), q = k ? i.tablet : i.mobile, v = Math.max(Math.floor(C ? i.desktop : q), 1), b = c.useRef(null), K = Math.ceil(e.length / Math.max(Math.floor(i.mobile), 1)), Y = Math.ceil(e.length / Math.max(Math.floor(i.tablet), 1)), Q = Math.ceil(e.length / Math.max(Math.floor(i.desktop), 1)), y = Math.ceil(e.length / v), [{ scrollLeft: X, scrollRight: $ }, ge] = c.useState({
|
|
142
143
|
scrollLeft: 0,
|
|
143
144
|
scrollRight: 0
|
|
144
|
-
}), [
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
]),
|
|
148
|
-
|
|
149
|
-
if (
|
|
150
|
-
const
|
|
151
|
-
const { scrollWidth: z, clientWidth:
|
|
152
|
-
|
|
145
|
+
}), [G, ve] = c.useState([]), W = c.useMemo(()=>se(G, y), [
|
|
146
|
+
G,
|
|
147
|
+
y
|
|
148
|
+
]), D = p ? se(G, Math.ceil(e.length / p)) : W, Ie = $ !== 0, xe = X !== 0;
|
|
149
|
+
c.useEffect(()=>{
|
|
150
|
+
if (b.current) {
|
|
151
|
+
const r = b.current, u = ()=>{
|
|
152
|
+
const { scrollWidth: z, clientWidth: L } = r, _ = Math.round(r.scrollLeft), j = Math.round(z - (_ + L));
|
|
153
|
+
ge({
|
|
153
154
|
scrollLeft: _,
|
|
154
155
|
scrollRight: j
|
|
155
156
|
});
|
|
156
|
-
},
|
|
157
|
-
const z =
|
|
158
|
-
|
|
157
|
+
}, f = ()=>{
|
|
158
|
+
const z = r.scrollWidth - r.clientWidth;
|
|
159
|
+
ve(Array.from(r.querySelectorAll("[data-item]")).map((L, _)=>{
|
|
159
160
|
if (_ === e.length - 1) return z;
|
|
160
|
-
const j =
|
|
161
|
-
return Math.min(
|
|
161
|
+
const j = L.offsetLeft, Se = parseInt(getComputedStyle(L).scrollMargin), ke = B && !C ? j - L.clientWidth / 2 : j;
|
|
162
|
+
return Math.min(ke - Se - r.offsetLeft, z);
|
|
162
163
|
}));
|
|
163
164
|
};
|
|
164
|
-
|
|
165
|
-
const d =
|
|
166
|
-
|
|
165
|
+
u(), f(), r.addEventListener("scroll", u);
|
|
166
|
+
const d = ie(r, ()=>{
|
|
167
|
+
u(), f();
|
|
167
168
|
});
|
|
168
169
|
return ()=>{
|
|
169
|
-
|
|
170
|
+
r.removeEventListener("scroll", u), d();
|
|
170
171
|
};
|
|
171
172
|
}
|
|
172
173
|
return ()=>{};
|
|
@@ -174,180 +175,187 @@ const ie = (e, r)=>{
|
|
|
174
175
|
i.desktop,
|
|
175
176
|
i.tablet,
|
|
176
177
|
i.mobile,
|
|
178
|
+
y,
|
|
177
179
|
S,
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
w,
|
|
180
|
+
B,
|
|
181
|
+
C,
|
|
181
182
|
e.length
|
|
182
183
|
]);
|
|
183
|
-
const
|
|
184
|
-
let
|
|
185
|
-
const
|
|
186
|
-
if (
|
|
187
|
-
const d = W[
|
|
188
|
-
|
|
184
|
+
const O = c.useCallback(function(r) {
|
|
185
|
+
let u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
|
|
186
|
+
const f = b.current;
|
|
187
|
+
if (f) {
|
|
188
|
+
const d = W[r];
|
|
189
|
+
f.scrollTo({
|
|
189
190
|
left: d,
|
|
190
|
-
behavior:
|
|
191
|
+
behavior: u ? "smooth" : "auto"
|
|
191
192
|
});
|
|
192
193
|
}
|
|
193
194
|
}, [
|
|
194
195
|
W
|
|
195
|
-
]),
|
|
196
|
-
const
|
|
197
|
-
if (
|
|
198
|
-
const { scrollLeft:
|
|
199
|
-
...
|
|
200
|
-
].reverse().find((d)=>d -
|
|
201
|
-
|
|
202
|
-
left:
|
|
196
|
+
]), Me = c.useCallback(()=>{
|
|
197
|
+
const r = b.current;
|
|
198
|
+
if (r) {
|
|
199
|
+
const { scrollLeft: u } = r, f = [
|
|
200
|
+
...D
|
|
201
|
+
].reverse().find((d)=>d - u < -1);
|
|
202
|
+
r.scrollTo({
|
|
203
|
+
left: f,
|
|
203
204
|
behavior: "smooth"
|
|
204
205
|
});
|
|
205
206
|
}
|
|
206
207
|
}, [
|
|
207
|
-
|
|
208
|
-
]),
|
|
209
|
-
const
|
|
210
|
-
if (
|
|
211
|
-
const { scrollLeft:
|
|
212
|
-
|
|
213
|
-
left:
|
|
208
|
+
D
|
|
209
|
+
]), H = c.useCallback(()=>{
|
|
210
|
+
const r = b.current;
|
|
211
|
+
if (r) {
|
|
212
|
+
const { scrollLeft: u } = r, f = D.find((d)=>d - u > 1);
|
|
213
|
+
r.scrollTo({
|
|
214
|
+
left: f,
|
|
214
215
|
behavior: "smooth"
|
|
215
216
|
});
|
|
216
217
|
}
|
|
217
218
|
}, [
|
|
218
|
-
|
|
219
|
-
]),
|
|
220
|
-
|
|
221
|
-
m !== void 0 &&
|
|
219
|
+
D
|
|
220
|
+
]), Z = de(!!g, b);
|
|
221
|
+
c.useEffect(()=>{
|
|
222
|
+
m !== void 0 && O(Math.floor(m / v), !1);
|
|
222
223
|
}, [
|
|
223
224
|
m,
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
]),
|
|
227
|
-
if (
|
|
228
|
-
const
|
|
225
|
+
O,
|
|
226
|
+
v
|
|
227
|
+
]), c.useEffect(()=>{
|
|
228
|
+
if (Z && g) {
|
|
229
|
+
const r = typeof g == "boolean" ? me : g.time, u = typeof g == "object" && g.loop, f = setInterval(()=>{
|
|
229
230
|
var d;
|
|
230
|
-
|
|
231
|
+
$ !== 0 ? H() : u && ((d = b.current) == null || d.scrollTo({
|
|
231
232
|
left: 0,
|
|
232
233
|
behavior: "smooth"
|
|
233
234
|
}));
|
|
234
|
-
},
|
|
235
|
-
return ()=>clearInterval(
|
|
235
|
+
}, r);
|
|
236
|
+
return ()=>clearInterval(f);
|
|
236
237
|
}
|
|
237
238
|
}, [
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
239
|
+
g,
|
|
240
|
+
H,
|
|
241
|
+
$,
|
|
242
|
+
Z
|
|
242
243
|
]);
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
if (
|
|
246
|
-
const
|
|
247
|
-
for(let
|
|
248
|
-
const d =
|
|
249
|
-
d >= 0 &&
|
|
244
|
+
const w = it(X, W), ee = c.useRef(!m), te = c.useRef(0);
|
|
245
|
+
c.useEffect(()=>{
|
|
246
|
+
if (x) {
|
|
247
|
+
const r = Math.min((w + 1) * v - 1, e.length - 1), u = [];
|
|
248
|
+
for(let f = 0; f < v; f++){
|
|
249
|
+
const d = r - f;
|
|
250
|
+
d >= 0 && u.unshift(d);
|
|
250
251
|
}
|
|
251
|
-
|
|
252
|
-
pageIndex:
|
|
253
|
-
shownItemIndexes:
|
|
254
|
-
}) :
|
|
252
|
+
ee.current ? te.current !== w && x({
|
|
253
|
+
pageIndex: w,
|
|
254
|
+
shownItemIndexes: u
|
|
255
|
+
}) : ee.current = u.includes(m || 0), te.current = w;
|
|
255
256
|
}
|
|
256
257
|
}, [
|
|
257
|
-
|
|
258
|
+
w,
|
|
258
259
|
e.length,
|
|
259
|
-
|
|
260
|
+
v,
|
|
260
261
|
m,
|
|
261
|
-
|
|
262
|
+
x
|
|
262
263
|
]);
|
|
263
264
|
let V = null;
|
|
264
265
|
h ? V = h({
|
|
265
|
-
numPages:
|
|
266
|
-
currentIndex:
|
|
267
|
-
onPress:
|
|
268
|
-
}) :
|
|
269
|
-
numPages:
|
|
270
|
-
|
|
271
|
-
|
|
266
|
+
numPages: y,
|
|
267
|
+
currentIndex: w,
|
|
268
|
+
onPress: O
|
|
269
|
+
}) : l && (V = /* @__PURE__ */ s(he, {
|
|
270
|
+
numPages: {
|
|
271
|
+
mobile: K,
|
|
272
|
+
tablet: Y,
|
|
273
|
+
desktop: Q
|
|
274
|
+
},
|
|
275
|
+
currentIndex: w,
|
|
276
|
+
onPress: O
|
|
272
277
|
}));
|
|
273
|
-
const
|
|
274
|
-
return /* @__PURE__ */
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
"component-name": "Carousel"
|
|
278
|
-
}, F),
|
|
278
|
+
const Ce = "64px", we = "36px";
|
|
279
|
+
return /* @__PURE__ */ J("div", _object_spread_props(_object_spread({}, ae(_object_spread({
|
|
280
|
+
"component-name": "Carousel"
|
|
281
|
+
}, U))), {
|
|
279
282
|
children: [
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
className:
|
|
283
|
+
/* @__PURE__ */ J("div", {
|
|
284
|
+
className: Ye,
|
|
282
285
|
children: [
|
|
283
|
-
/* @__PURE__ */ s(
|
|
286
|
+
/* @__PURE__ */ s(R, {
|
|
284
287
|
isInverse: !1,
|
|
285
|
-
children: /* @__PURE__ */ s(
|
|
286
|
-
className:
|
|
287
|
-
"aria-label":
|
|
288
|
-
onPress:
|
|
289
|
-
disabled: !
|
|
290
|
-
children: /* @__PURE__ */ s(
|
|
288
|
+
children: /* @__PURE__ */ s(T, {
|
|
289
|
+
className: $e,
|
|
290
|
+
"aria-label": A.carouselPrevButton,
|
|
291
|
+
onPress: Me,
|
|
292
|
+
disabled: !xe,
|
|
293
|
+
children: /* @__PURE__ */ s(le, {})
|
|
291
294
|
})
|
|
292
295
|
}),
|
|
293
296
|
/* @__PURE__ */ s("div", {
|
|
294
|
-
className:
|
|
295
|
-
[
|
|
296
|
-
[
|
|
297
|
+
className: F(Ge, {
|
|
298
|
+
[He]: B,
|
|
299
|
+
[Je]: K > 1,
|
|
300
|
+
[Qe]: Y > 1
|
|
297
301
|
}),
|
|
298
|
-
style: _object_spread_props(_object_spread({},
|
|
299
|
-
[
|
|
300
|
-
[
|
|
301
|
-
[
|
|
302
|
-
},
|
|
303
|
-
[
|
|
304
|
-
} :
|
|
305
|
-
[
|
|
306
|
-
} : {},
|
|
307
|
-
[
|
|
302
|
+
style: _object_spread_props(_object_spread({}, fe(_object_spread({
|
|
303
|
+
[P.itemsPerPageDesktop]: String(i.desktop),
|
|
304
|
+
[P.itemsPerPageTablet]: String(i.tablet),
|
|
305
|
+
[P.itemsPerPageMobile]: String(i.mobile)
|
|
306
|
+
}, n === "large" ? {
|
|
307
|
+
[P.mobilePageOffset]: Ce
|
|
308
|
+
} : E === nt ? {
|
|
309
|
+
[P.mobilePageOffset]: we
|
|
310
|
+
} : {}, S !== void 0 ? {
|
|
311
|
+
[P.gap]: String(S)
|
|
308
312
|
} : {}))), {
|
|
309
|
-
scrollSnapType:
|
|
313
|
+
scrollSnapType: N ? "initial" : "x mandatory",
|
|
310
314
|
// Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
|
|
311
315
|
// there is a webkit rendering bug that causes a half pixel white line to appear at
|
|
312
316
|
// the bottom of the scrollable area in retina displays when it has a height with
|
|
313
317
|
// decimals. This extra padding avoids that line to partially cover the carousel
|
|
314
318
|
// slides border:
|
|
315
|
-
paddingBottom: Le(
|
|
319
|
+
paddingBottom: Le(M) && !Re(M) ? 0.5 : void 0
|
|
316
320
|
}),
|
|
317
|
-
ref:
|
|
318
|
-
children: e.map((
|
|
319
|
-
className:
|
|
320
|
-
style: _object_spread_props(_object_spread({},
|
|
321
|
-
scrollSnapStop:
|
|
321
|
+
ref: b,
|
|
322
|
+
children: e.map((r, u)=>/* @__PURE__ */ s("div", {
|
|
323
|
+
className: F(Xe, o),
|
|
324
|
+
style: _object_spread_props(_object_spread({}, t), {
|
|
325
|
+
scrollSnapStop: ue(M) ? "always" : "normal"
|
|
322
326
|
}),
|
|
323
327
|
"data-item": !0,
|
|
324
|
-
children:
|
|
325
|
-
},
|
|
328
|
+
children: r
|
|
329
|
+
}, u))
|
|
326
330
|
}),
|
|
327
|
-
/* @__PURE__ */ s(
|
|
331
|
+
/* @__PURE__ */ s(R, {
|
|
328
332
|
isInverse: !1,
|
|
329
|
-
children: /* @__PURE__ */ s(
|
|
330
|
-
className:
|
|
331
|
-
"aria-label":
|
|
332
|
-
onPress:
|
|
333
|
-
disabled: !
|
|
334
|
-
children: /* @__PURE__ */ s(
|
|
333
|
+
children: /* @__PURE__ */ s(T, {
|
|
334
|
+
className: Ze,
|
|
335
|
+
"aria-label": A.carouselNextButton,
|
|
336
|
+
onPress: H,
|
|
337
|
+
disabled: !Ie,
|
|
338
|
+
children: /* @__PURE__ */ s(re, {})
|
|
335
339
|
})
|
|
336
340
|
})
|
|
337
341
|
]
|
|
338
342
|
}),
|
|
339
343
|
V && /* @__PURE__ */ s("div", {
|
|
340
|
-
className:
|
|
344
|
+
className: F(et, {
|
|
345
|
+
[tt]: Q <= 1,
|
|
346
|
+
[ot]: Y <= 1,
|
|
347
|
+
[st]: K <= 1
|
|
348
|
+
}),
|
|
341
349
|
children: V
|
|
342
350
|
})
|
|
343
351
|
]
|
|
344
|
-
});
|
|
345
|
-
},
|
|
346
|
-
let { items: e, itemStyle:
|
|
347
|
-
return s(
|
|
352
|
+
}));
|
|
353
|
+
}, Pt = (e)=>/* @__PURE__ */ s(be, _object_spread({}, e)), Nt = (param)=>{
|
|
354
|
+
let { items: e, itemStyle: t, itemClassName: o, withBullets: l, renderBullets: h, initialActiveItem: m, onPageChange: I, dataAttributes: p } = param;
|
|
355
|
+
return /* @__PURE__ */ s(be, {
|
|
348
356
|
items: e,
|
|
349
|
-
itemStyle:
|
|
350
|
-
itemClassName:
|
|
357
|
+
itemStyle: t,
|
|
358
|
+
itemClassName: o,
|
|
351
359
|
itemsPerPage: {
|
|
352
360
|
mobile: 1,
|
|
353
361
|
tablet: 1,
|
|
@@ -356,125 +364,125 @@ const ie = (e, r)=>{
|
|
|
356
364
|
centered: !0,
|
|
357
365
|
itemsToScroll: 1,
|
|
358
366
|
gap: 0,
|
|
359
|
-
withBullets:
|
|
367
|
+
withBullets: l,
|
|
360
368
|
renderBullets: h,
|
|
361
369
|
initialActiveItem: m,
|
|
362
|
-
onPageChange:
|
|
363
|
-
dataAttributes:
|
|
370
|
+
onPageChange: I,
|
|
371
|
+
dataAttributes: p
|
|
364
372
|
});
|
|
365
|
-
},
|
|
373
|
+
}, pe = /*#__PURE__*/ c.createContext(!1), Bt = ()=>c.useContext(pe), at = (param)=>{
|
|
366
374
|
let { children: e } = param;
|
|
367
|
-
return s(
|
|
375
|
+
return /* @__PURE__ */ s(pe.Provider, {
|
|
368
376
|
value: !0,
|
|
369
377
|
children: e
|
|
370
378
|
});
|
|
371
|
-
},
|
|
372
|
-
let { items: e, withBullets:
|
|
373
|
-
const { texts:
|
|
379
|
+
}, Lt = (param)=>{
|
|
380
|
+
let { items: e, withBullets: t, autoplay: o, onPageChange: l, dataAttributes: h, inverseBullets: m = !0 } = param;
|
|
381
|
+
const { texts: I, platformOverrides: p } = ce(), n = c.useRef(null), [{ scrollLeft: S, scrollRight: N }, B] = c.useState({
|
|
374
382
|
scrollLeft: 0,
|
|
375
383
|
scrollRight: 0
|
|
376
|
-
}),
|
|
377
|
-
const
|
|
378
|
-
|
|
379
|
-
left: -
|
|
384
|
+
}), g = c.useCallback(()=>{
|
|
385
|
+
const a = n.current;
|
|
386
|
+
a && a.scrollBy({
|
|
387
|
+
left: -a.clientWidth,
|
|
380
388
|
behavior: "smooth"
|
|
381
389
|
});
|
|
382
|
-
}, []),
|
|
383
|
-
const
|
|
384
|
-
|
|
385
|
-
left:
|
|
390
|
+
}, []), x = c.useCallback(()=>{
|
|
391
|
+
const a = n.current;
|
|
392
|
+
a && a.scrollBy({
|
|
393
|
+
left: a.clientWidth,
|
|
386
394
|
behavior: "smooth"
|
|
387
395
|
});
|
|
388
|
-
}, []),
|
|
389
|
-
|
|
390
|
-
const
|
|
391
|
-
if (
|
|
396
|
+
}, []), U = N !== 0, A = S !== 0, M = n.current ? Math.floor((S + n.current.clientWidth / 2) / n.current.clientWidth) : 0;
|
|
397
|
+
c.useLayoutEffect(()=>{
|
|
398
|
+
const a = n.current;
|
|
399
|
+
if (a) {
|
|
392
400
|
const i = ()=>{
|
|
393
|
-
const { scrollWidth:
|
|
394
|
-
|
|
395
|
-
scrollLeft:
|
|
396
|
-
scrollRight:
|
|
401
|
+
const { scrollWidth: k, clientWidth: q } = a, v = Math.round(a.scrollLeft), b = Math.round(k - (v + q));
|
|
402
|
+
B({
|
|
403
|
+
scrollLeft: v,
|
|
404
|
+
scrollRight: b
|
|
397
405
|
});
|
|
398
406
|
};
|
|
399
|
-
i(),
|
|
400
|
-
const
|
|
407
|
+
i(), a.addEventListener("scroll", i);
|
|
408
|
+
const C = ie(a, i);
|
|
401
409
|
return ()=>{
|
|
402
|
-
|
|
410
|
+
a.removeEventListener("scroll", i), C();
|
|
403
411
|
};
|
|
404
412
|
}
|
|
405
413
|
}, [
|
|
406
414
|
e.length
|
|
407
415
|
]);
|
|
408
|
-
const
|
|
409
|
-
return
|
|
410
|
-
if (
|
|
411
|
-
const
|
|
412
|
-
var
|
|
413
|
-
|
|
416
|
+
const E = de(!!o, n);
|
|
417
|
+
return c.useEffect(()=>{
|
|
418
|
+
if (E && o) {
|
|
419
|
+
const a = typeof o == "boolean" ? me : o.time, i = typeof o == "object" && o.loop, C = setInterval(()=>{
|
|
420
|
+
var k;
|
|
421
|
+
N !== 0 ? x() : i && ((k = n.current) == null || k.scrollTo({
|
|
414
422
|
left: 0,
|
|
415
423
|
behavior: "smooth"
|
|
416
424
|
}));
|
|
417
|
-
},
|
|
418
|
-
return ()=>clearInterval(
|
|
425
|
+
}, a);
|
|
426
|
+
return ()=>clearInterval(C);
|
|
419
427
|
}
|
|
420
428
|
}, [
|
|
421
|
-
|
|
422
|
-
P,
|
|
423
|
-
R,
|
|
424
|
-
y
|
|
425
|
-
]), n.useEffect(()=>{
|
|
426
|
-
o && o(x);
|
|
427
|
-
}, [
|
|
429
|
+
o,
|
|
428
430
|
x,
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
431
|
+
N,
|
|
432
|
+
E
|
|
433
|
+
]), c.useEffect(()=>{
|
|
434
|
+
l && l(M);
|
|
435
|
+
}, [
|
|
436
|
+
M,
|
|
437
|
+
l
|
|
438
|
+
]), /* @__PURE__ */ s(at, {
|
|
439
|
+
children: /* @__PURE__ */ J("div", _object_spread_props(_object_spread({
|
|
440
|
+
className: De
|
|
441
|
+
}, ae(h, "SlideShow")), {
|
|
434
442
|
children: [
|
|
435
|
-
/* @__PURE__ */ s(
|
|
443
|
+
/* @__PURE__ */ s(R, {
|
|
436
444
|
isInverse: !1,
|
|
437
|
-
children: /* @__PURE__ */ s(
|
|
438
|
-
className:
|
|
439
|
-
"aria-label":
|
|
440
|
-
onPress:
|
|
441
|
-
disabled: !
|
|
442
|
-
children: /* @__PURE__ */ s(
|
|
445
|
+
children: /* @__PURE__ */ s(T, {
|
|
446
|
+
className: Oe,
|
|
447
|
+
"aria-label": I.carouselPrevButton,
|
|
448
|
+
onPress: g,
|
|
449
|
+
disabled: !A,
|
|
450
|
+
children: /* @__PURE__ */ s(le, {})
|
|
443
451
|
})
|
|
444
452
|
}),
|
|
445
453
|
/* @__PURE__ */ s("div", {
|
|
446
|
-
style:
|
|
447
|
-
[
|
|
454
|
+
style: fe({
|
|
455
|
+
[lt.mediaBorderRadius]: "0px"
|
|
448
456
|
}),
|
|
449
457
|
children: /* @__PURE__ */ s("div", {
|
|
450
|
-
className:
|
|
451
|
-
ref:
|
|
452
|
-
children: e.map((
|
|
453
|
-
className:
|
|
458
|
+
className: Ve,
|
|
459
|
+
ref: n,
|
|
460
|
+
children: e.map((a, i)=>/* @__PURE__ */ s("div", {
|
|
461
|
+
className: ze,
|
|
454
462
|
style: {
|
|
455
|
-
scrollSnapStop:
|
|
463
|
+
scrollSnapStop: ue(p) ? "always" : "normal"
|
|
456
464
|
},
|
|
457
|
-
children:
|
|
465
|
+
children: a
|
|
458
466
|
}, i))
|
|
459
467
|
})
|
|
460
468
|
}),
|
|
461
|
-
/* @__PURE__ */ s(
|
|
469
|
+
/* @__PURE__ */ s(R, {
|
|
462
470
|
isInverse: !1,
|
|
463
|
-
children: /* @__PURE__ */ s(
|
|
464
|
-
className:
|
|
465
|
-
"aria-label":
|
|
466
|
-
onPress:
|
|
467
|
-
disabled: !
|
|
468
|
-
children: /* @__PURE__ */ s(
|
|
471
|
+
children: /* @__PURE__ */ s(T, {
|
|
472
|
+
className: _e,
|
|
473
|
+
"aria-label": I.carouselNextButton,
|
|
474
|
+
onPress: x,
|
|
475
|
+
disabled: !U,
|
|
476
|
+
children: /* @__PURE__ */ s(re, {})
|
|
469
477
|
})
|
|
470
478
|
}),
|
|
471
|
-
|
|
479
|
+
t && e.length > 1 && /* @__PURE__ */ s(R, {
|
|
472
480
|
isInverse: m,
|
|
473
481
|
children: /* @__PURE__ */ s("div", {
|
|
474
|
-
className:
|
|
475
|
-
children: /* @__PURE__ */ s(
|
|
482
|
+
className: je,
|
|
483
|
+
children: /* @__PURE__ */ s(he, {
|
|
476
484
|
numPages: e.length,
|
|
477
|
-
currentIndex:
|
|
485
|
+
currentIndex: M
|
|
478
486
|
})
|
|
479
487
|
})
|
|
480
488
|
})
|
|
@@ -482,4 +490,4 @@ const ie = (e, r)=>{
|
|
|
482
490
|
}))
|
|
483
491
|
});
|
|
484
492
|
};
|
|
485
|
-
export {
|
|
493
|
+
export { Pt as Carousel, Nt as CenteredCarousel, at as IsInsideSlideshowProvider, he as PageBullets, Lt as Slideshow, Bt as useIsInsideSlideshowContext };
|