@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/carousel.js
CHANGED
|
@@ -11,22 +11,22 @@ function _export(target, all) {
|
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
13
|
Carousel: function() {
|
|
14
|
-
return
|
|
14
|
+
return Pt;
|
|
15
15
|
},
|
|
16
16
|
CenteredCarousel: function() {
|
|
17
|
-
return
|
|
17
|
+
return Nt;
|
|
18
18
|
},
|
|
19
19
|
IsInsideSlideshowProvider: function() {
|
|
20
|
-
return
|
|
20
|
+
return at;
|
|
21
21
|
},
|
|
22
22
|
PageBullets: function() {
|
|
23
|
-
return
|
|
23
|
+
return he;
|
|
24
24
|
},
|
|
25
25
|
Slideshow: function() {
|
|
26
|
-
return
|
|
26
|
+
return Lt;
|
|
27
27
|
},
|
|
28
28
|
useIsInsideSlideshowContext: function() {
|
|
29
|
-
return
|
|
29
|
+
return Bt;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -35,7 +35,6 @@ const _iconchevronleftregular = /*#__PURE__*/ _interop_require_default(require("
|
|
|
35
35
|
const _iconchevronrightregular = /*#__PURE__*/ _interop_require_default(require("./generated/mistica-icons/icon-chevron-right-regular.js"));
|
|
36
36
|
const _hooks = require("./hooks.js");
|
|
37
37
|
const _inline = /*#__PURE__*/ _interop_require_default(require("./inline.js"));
|
|
38
|
-
const _stack = /*#__PURE__*/ _interop_require_default(require("./stack.js"));
|
|
39
38
|
const _touchable = require("./touchable.js");
|
|
40
39
|
const _classnames = /*#__PURE__*/ _interop_require_default(require("classnames"));
|
|
41
40
|
const _themevariantcontext = require("./theme-variant-context.js");
|
|
@@ -44,7 +43,6 @@ const _platform = require("./utils/platform.js");
|
|
|
44
43
|
const _documentvisibility = require("./utils/document-visibility.js");
|
|
45
44
|
const _carouselcssmistica = require("./carousel.css-mistica.js");
|
|
46
45
|
const _imagecssmistica = require("./image.css-mistica.js");
|
|
47
|
-
const _sprinklescssmistica = require("./sprinkles.css-mistica.js");
|
|
48
46
|
const _desktopcontainertypecontext = require("./desktop-container-type-context.js");
|
|
49
47
|
const _constants = require("./skins/constants.js");
|
|
50
48
|
const _css = require("./utils/css.js");
|
|
@@ -146,42 +144,45 @@ function _object_spread_props(target, source) {
|
|
|
146
144
|
}
|
|
147
145
|
return target;
|
|
148
146
|
}
|
|
149
|
-
const
|
|
150
|
-
const
|
|
151
|
-
return (0, _hooks.useIsInViewport)(
|
|
152
|
-
},
|
|
153
|
-
let { currentIndex: e, numPages:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
147
|
+
const de = (e, t)=>{
|
|
148
|
+
const o = (0, _documentvisibility.useDocumentVisibility)();
|
|
149
|
+
return (0, _hooks.useIsInViewport)(t, !1) && o && !!e;
|
|
150
|
+
}, he = (param)=>{
|
|
151
|
+
let { currentIndex: e, numPages: t, onPress: o } = param;
|
|
152
|
+
var _t_tablet;
|
|
153
|
+
const l = (0, _themevariantcontext.useIsInverseVariant)(), { isDesktopOrBigger: h } = (0, _hooks.useScreenSize)(), m = (p)=>{
|
|
154
|
+
const n = p === e;
|
|
155
|
+
return l ? n ? _carouselcssmistica.bulletActiveInverse : _carouselcssmistica.bulletInverse : n ? _carouselcssmistica.bulletActive : _carouselcssmistica.bullet;
|
|
156
|
+
}, I = typeof t == "number" ? t : Math.max(t.mobile, (_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile, t.desktop);
|
|
158
157
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
|
|
159
|
-
space:
|
|
160
|
-
mobile: 8,
|
|
161
|
-
desktop: 16
|
|
162
|
-
},
|
|
158
|
+
space: 0,
|
|
163
159
|
alignItems: "center",
|
|
164
160
|
dataAttributes: {
|
|
165
161
|
"component-name": "PageBullets"
|
|
166
162
|
},
|
|
167
163
|
children: Array.from({
|
|
168
|
-
length:
|
|
169
|
-
}, (
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
164
|
+
length: I
|
|
165
|
+
}, (p, n)=>/* @__PURE__ */ {
|
|
166
|
+
var _t_tablet;
|
|
167
|
+
return (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
168
|
+
className: (0, _classnames.default)(typeof t == "number" ? _carouselcssmistica.bulletButton : {
|
|
169
|
+
[_carouselcssmistica.bulletButtonMobile]: n < t.mobile,
|
|
170
|
+
[_carouselcssmistica.bulletButtonTablet]: n < ((_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile),
|
|
171
|
+
[_carouselcssmistica.bulletButtonDesktop]: n < t.desktop
|
|
175
172
|
}),
|
|
173
|
+
style: n === 0 ? {
|
|
174
|
+
paddingLeft: 0
|
|
175
|
+
} : {},
|
|
176
176
|
maybe: !0,
|
|
177
|
-
onPress: h &&
|
|
177
|
+
onPress: h && o ? ()=>o(n) : void 0,
|
|
178
178
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
179
|
-
className: m(
|
|
179
|
+
className: m(n)
|
|
180
180
|
})
|
|
181
|
-
},
|
|
181
|
+
}, n);
|
|
182
|
+
})
|
|
182
183
|
});
|
|
183
|
-
},
|
|
184
|
-
const
|
|
184
|
+
}, oe = (e, t, o)=>o ? typeof o == "number" ? o : o[e] || t[e] : t[e], ct = (e, t)=>{
|
|
185
|
+
const o = {
|
|
185
186
|
mobile: 1,
|
|
186
187
|
tablet: 2,
|
|
187
188
|
desktop: {
|
|
@@ -190,59 +191,59 @@ const ie = (e, r)=>{
|
|
|
190
191
|
large: 3
|
|
191
192
|
}
|
|
192
193
|
};
|
|
193
|
-
if (!
|
|
194
|
-
desktop:
|
|
194
|
+
if (!t) return _object_spread_props(_object_spread({}, o), {
|
|
195
|
+
desktop: oe(e, o.desktop)
|
|
195
196
|
});
|
|
196
|
-
if (typeof
|
|
197
|
-
mobile:
|
|
198
|
-
tablet:
|
|
199
|
-
desktop:
|
|
197
|
+
if (typeof t == "number") return {
|
|
198
|
+
mobile: t,
|
|
199
|
+
tablet: t,
|
|
200
|
+
desktop: t
|
|
200
201
|
};
|
|
201
|
-
const
|
|
202
|
-
return _object_spread_props(_object_spread({},
|
|
203
|
-
desktop:
|
|
202
|
+
const l = oe(e, o.desktop, t.desktop);
|
|
203
|
+
return _object_spread_props(_object_spread({}, o, t), {
|
|
204
|
+
desktop: l
|
|
204
205
|
});
|
|
205
|
-
},
|
|
206
|
+
}, se = (e, t)=>{
|
|
206
207
|
if (e.length === 0) return [];
|
|
207
|
-
const
|
|
208
|
-
for(let h = 0; h < e.length; h +=
|
|
209
|
-
return
|
|
210
|
-
},
|
|
211
|
-
const
|
|
212
|
-
for(let
|
|
213
|
-
for(let
|
|
208
|
+
const o = Math.ceil(e.length / t), l = [];
|
|
209
|
+
for(let h = 0; h < e.length; h += o)l.push(e[h]);
|
|
210
|
+
return l[l.length - 1] = e[e.length - o], l;
|
|
211
|
+
}, it = (e, t)=>{
|
|
212
|
+
const o = [];
|
|
213
|
+
for(let l = 0; l < t.length; l++)l === 0 ? o.push(t[0]) : o.push((t[l] + t[l - 1]) / 2);
|
|
214
|
+
for(let l = o.length - 1; l >= 0; l--)if (e - o[l] >= -1) return l;
|
|
214
215
|
return 0;
|
|
215
|
-
},
|
|
216
|
-
let { items: e, itemStyle:
|
|
217
|
-
const { texts:
|
|
216
|
+
}, me = 5e3, be = (param)=>{
|
|
217
|
+
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;
|
|
218
|
+
const { texts: A, platformOverrides: M, skinName: E } = (0, _hooks.useTheme)(), a = (0, _desktopcontainertypecontext.useDesktopContainerType)(), i = ct(a || "large", I), { isDesktopOrBigger: C, isTablet: k } = (0, _hooks.useScreenSize)(), q = k ? i.tablet : i.mobile, v = Math.max(Math.floor(C ? i.desktop : q), 1), b = _react.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] = _react.useState({
|
|
218
219
|
scrollLeft: 0,
|
|
219
220
|
scrollRight: 0
|
|
220
|
-
}), [
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
]),
|
|
221
|
+
}), [G, ve] = _react.useState([]), W = _react.useMemo(()=>se(G, y), [
|
|
222
|
+
G,
|
|
223
|
+
y
|
|
224
|
+
]), D = p ? se(G, Math.ceil(e.length / p)) : W, Ie = $ !== 0, xe = X !== 0;
|
|
224
225
|
_react.useEffect(()=>{
|
|
225
|
-
if (
|
|
226
|
-
const
|
|
227
|
-
const { scrollWidth: z, clientWidth:
|
|
228
|
-
|
|
226
|
+
if (b.current) {
|
|
227
|
+
const r = b.current, u = ()=>{
|
|
228
|
+
const { scrollWidth: z, clientWidth: L } = r, _ = Math.round(r.scrollLeft), j = Math.round(z - (_ + L));
|
|
229
|
+
ge({
|
|
229
230
|
scrollLeft: _,
|
|
230
231
|
scrollRight: j
|
|
231
232
|
});
|
|
232
|
-
},
|
|
233
|
-
const z =
|
|
234
|
-
|
|
233
|
+
}, f = ()=>{
|
|
234
|
+
const z = r.scrollWidth - r.clientWidth;
|
|
235
|
+
ve(Array.from(r.querySelectorAll("[data-item]")).map((L, _)=>{
|
|
235
236
|
if (_ === e.length - 1) return z;
|
|
236
|
-
const j =
|
|
237
|
-
return Math.min(
|
|
237
|
+
const j = L.offsetLeft, Se = parseInt(getComputedStyle(L).scrollMargin), ke = B && !C ? j - L.clientWidth / 2 : j;
|
|
238
|
+
return Math.min(ke - Se - r.offsetLeft, z);
|
|
238
239
|
}));
|
|
239
240
|
};
|
|
240
|
-
|
|
241
|
-
const d = (0, _dom.listenResize)(
|
|
242
|
-
|
|
241
|
+
u(), f(), r.addEventListener("scroll", u);
|
|
242
|
+
const d = (0, _dom.listenResize)(r, ()=>{
|
|
243
|
+
u(), f();
|
|
243
244
|
});
|
|
244
245
|
return ()=>{
|
|
245
|
-
|
|
246
|
+
r.removeEventListener("scroll", u), d();
|
|
246
247
|
};
|
|
247
248
|
}
|
|
248
249
|
return ()=>{};
|
|
@@ -250,108 +251,110 @@ const ie = (e, r)=>{
|
|
|
250
251
|
i.desktop,
|
|
251
252
|
i.tablet,
|
|
252
253
|
i.mobile,
|
|
254
|
+
y,
|
|
253
255
|
S,
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
w,
|
|
256
|
+
B,
|
|
257
|
+
C,
|
|
257
258
|
e.length
|
|
258
259
|
]);
|
|
259
|
-
const
|
|
260
|
-
let
|
|
261
|
-
const
|
|
262
|
-
if (
|
|
263
|
-
const d = W[
|
|
264
|
-
|
|
260
|
+
const O = _react.useCallback(function(r) {
|
|
261
|
+
let u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
|
|
262
|
+
const f = b.current;
|
|
263
|
+
if (f) {
|
|
264
|
+
const d = W[r];
|
|
265
|
+
f.scrollTo({
|
|
265
266
|
left: d,
|
|
266
|
-
behavior:
|
|
267
|
+
behavior: u ? "smooth" : "auto"
|
|
267
268
|
});
|
|
268
269
|
}
|
|
269
270
|
}, [
|
|
270
271
|
W
|
|
271
|
-
]),
|
|
272
|
-
const
|
|
273
|
-
if (
|
|
274
|
-
const { scrollLeft:
|
|
275
|
-
...
|
|
276
|
-
].reverse().find((d)=>d -
|
|
277
|
-
|
|
278
|
-
left:
|
|
272
|
+
]), Me = _react.useCallback(()=>{
|
|
273
|
+
const r = b.current;
|
|
274
|
+
if (r) {
|
|
275
|
+
const { scrollLeft: u } = r, f = [
|
|
276
|
+
...D
|
|
277
|
+
].reverse().find((d)=>d - u < -1);
|
|
278
|
+
r.scrollTo({
|
|
279
|
+
left: f,
|
|
279
280
|
behavior: "smooth"
|
|
280
281
|
});
|
|
281
282
|
}
|
|
282
283
|
}, [
|
|
283
|
-
|
|
284
|
-
]),
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
287
|
-
const { scrollLeft:
|
|
288
|
-
|
|
289
|
-
left:
|
|
284
|
+
D
|
|
285
|
+
]), H = _react.useCallback(()=>{
|
|
286
|
+
const r = b.current;
|
|
287
|
+
if (r) {
|
|
288
|
+
const { scrollLeft: u } = r, f = D.find((d)=>d - u > 1);
|
|
289
|
+
r.scrollTo({
|
|
290
|
+
left: f,
|
|
290
291
|
behavior: "smooth"
|
|
291
292
|
});
|
|
292
293
|
}
|
|
293
294
|
}, [
|
|
294
|
-
|
|
295
|
-
]),
|
|
295
|
+
D
|
|
296
|
+
]), Z = de(!!g, b);
|
|
296
297
|
_react.useEffect(()=>{
|
|
297
|
-
m !== void 0 &&
|
|
298
|
+
m !== void 0 && O(Math.floor(m / v), !1);
|
|
298
299
|
}, [
|
|
299
300
|
m,
|
|
300
|
-
|
|
301
|
-
|
|
301
|
+
O,
|
|
302
|
+
v
|
|
302
303
|
]), _react.useEffect(()=>{
|
|
303
|
-
if (
|
|
304
|
-
const
|
|
304
|
+
if (Z && g) {
|
|
305
|
+
const r = typeof g == "boolean" ? me : g.time, u = typeof g == "object" && g.loop, f = setInterval(()=>{
|
|
305
306
|
var d;
|
|
306
|
-
|
|
307
|
+
$ !== 0 ? H() : u && ((d = b.current) == null || d.scrollTo({
|
|
307
308
|
left: 0,
|
|
308
309
|
behavior: "smooth"
|
|
309
310
|
}));
|
|
310
|
-
},
|
|
311
|
-
return ()=>clearInterval(
|
|
311
|
+
}, r);
|
|
312
|
+
return ()=>clearInterval(f);
|
|
312
313
|
}
|
|
313
314
|
}, [
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
315
|
+
g,
|
|
316
|
+
H,
|
|
317
|
+
$,
|
|
318
|
+
Z
|
|
318
319
|
]);
|
|
319
|
-
const
|
|
320
|
+
const w = it(X, W), ee = _react.useRef(!m), te = _react.useRef(0);
|
|
320
321
|
_react.useEffect(()=>{
|
|
321
|
-
if (
|
|
322
|
-
const
|
|
323
|
-
for(let
|
|
324
|
-
const d =
|
|
325
|
-
d >= 0 &&
|
|
322
|
+
if (x) {
|
|
323
|
+
const r = Math.min((w + 1) * v - 1, e.length - 1), u = [];
|
|
324
|
+
for(let f = 0; f < v; f++){
|
|
325
|
+
const d = r - f;
|
|
326
|
+
d >= 0 && u.unshift(d);
|
|
326
327
|
}
|
|
327
|
-
|
|
328
|
-
pageIndex:
|
|
329
|
-
shownItemIndexes:
|
|
330
|
-
}) :
|
|
328
|
+
ee.current ? te.current !== w && x({
|
|
329
|
+
pageIndex: w,
|
|
330
|
+
shownItemIndexes: u
|
|
331
|
+
}) : ee.current = u.includes(m || 0), te.current = w;
|
|
331
332
|
}
|
|
332
333
|
}, [
|
|
333
|
-
|
|
334
|
+
w,
|
|
334
335
|
e.length,
|
|
335
|
-
|
|
336
|
+
v,
|
|
336
337
|
m,
|
|
337
|
-
|
|
338
|
+
x
|
|
338
339
|
]);
|
|
339
340
|
let V = null;
|
|
340
341
|
h ? V = h({
|
|
341
|
-
numPages:
|
|
342
|
-
currentIndex:
|
|
343
|
-
onPress:
|
|
344
|
-
}) :
|
|
345
|
-
numPages:
|
|
346
|
-
|
|
347
|
-
|
|
342
|
+
numPages: y,
|
|
343
|
+
currentIndex: w,
|
|
344
|
+
onPress: O
|
|
345
|
+
}) : l && (V = /* @__PURE__ */ (0, _jsxruntime.jsx)(he, {
|
|
346
|
+
numPages: {
|
|
347
|
+
mobile: K,
|
|
348
|
+
tablet: Y,
|
|
349
|
+
desktop: Q
|
|
350
|
+
},
|
|
351
|
+
currentIndex: w,
|
|
352
|
+
onPress: O
|
|
348
353
|
}));
|
|
349
|
-
const
|
|
350
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsxs)(
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
"component-name": "Carousel"
|
|
354
|
-
}, F),
|
|
354
|
+
const Ce = "64px", we = "36px";
|
|
355
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(_object_spread({
|
|
356
|
+
"component-name": "Carousel"
|
|
357
|
+
}, U))), {
|
|
355
358
|
children: [
|
|
356
359
|
/* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
|
|
357
360
|
className: _carouselcssmistica.carouselContainer,
|
|
@@ -360,70 +363,75 @@ const ie = (e, r)=>{
|
|
|
360
363
|
isInverse: !1,
|
|
361
364
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
362
365
|
className: _carouselcssmistica.carouselPrevArrowButton,
|
|
363
|
-
"aria-label":
|
|
364
|
-
onPress:
|
|
365
|
-
disabled: !
|
|
366
|
+
"aria-label": A.carouselPrevButton,
|
|
367
|
+
onPress: Me,
|
|
368
|
+
disabled: !xe,
|
|
366
369
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronleftregular.default, {})
|
|
367
370
|
})
|
|
368
371
|
}),
|
|
369
372
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
370
373
|
className: (0, _classnames.default)(_carouselcssmistica.carousel, {
|
|
371
|
-
[_carouselcssmistica.centeredCarousel]:
|
|
372
|
-
[_carouselcssmistica.
|
|
374
|
+
[_carouselcssmistica.centeredCarousel]: B,
|
|
375
|
+
[_carouselcssmistica.carouselWithScrollMobile]: K > 1,
|
|
376
|
+
[_carouselcssmistica.carouselWithScrollTablet]: Y > 1
|
|
373
377
|
}),
|
|
374
378
|
style: _object_spread_props(_object_spread({}, (0, _css.applyCssVars)(_object_spread({
|
|
375
379
|
[_carouselcssmistica.vars.itemsPerPageDesktop]: String(i.desktop),
|
|
376
380
|
[_carouselcssmistica.vars.itemsPerPageTablet]: String(i.tablet),
|
|
377
381
|
[_carouselcssmistica.vars.itemsPerPageMobile]: String(i.mobile)
|
|
378
|
-
},
|
|
379
|
-
[_carouselcssmistica.vars.mobilePageOffset]:
|
|
380
|
-
} :
|
|
381
|
-
[_carouselcssmistica.vars.mobilePageOffset]:
|
|
382
|
-
} : {},
|
|
383
|
-
[_carouselcssmistica.vars.gap]: String(
|
|
382
|
+
}, n === "large" ? {
|
|
383
|
+
[_carouselcssmistica.vars.mobilePageOffset]: Ce
|
|
384
|
+
} : E === _constants.VIVO_NEW_SKIN ? {
|
|
385
|
+
[_carouselcssmistica.vars.mobilePageOffset]: we
|
|
386
|
+
} : {}, S !== void 0 ? {
|
|
387
|
+
[_carouselcssmistica.vars.gap]: String(S)
|
|
384
388
|
} : {}))), {
|
|
385
|
-
scrollSnapType:
|
|
389
|
+
scrollSnapType: N ? "initial" : "x mandatory",
|
|
386
390
|
// Hack to fix https://jira.tid.es/browse/NOVUMCC-8988
|
|
387
391
|
// there is a webkit rendering bug that causes a half pixel white line to appear at
|
|
388
392
|
// the bottom of the scrollable area in retina displays when it has a height with
|
|
389
393
|
// decimals. This extra padding avoids that line to partially cover the carousel
|
|
390
394
|
// slides border:
|
|
391
|
-
paddingBottom: (0, _platform.isIos)(
|
|
395
|
+
paddingBottom: (0, _platform.isIos)(M) && !(0, _platform.isRunningAcceptanceTest)(M) ? 0.5 : void 0
|
|
392
396
|
}),
|
|
393
|
-
ref:
|
|
394
|
-
children: e.map((
|
|
395
|
-
className: (0, _classnames.default)(_carouselcssmistica.carouselItem,
|
|
396
|
-
style: _object_spread_props(_object_spread({},
|
|
397
|
-
scrollSnapStop: (0, _platform.isAndroid)(
|
|
397
|
+
ref: b,
|
|
398
|
+
children: e.map((r, u)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
399
|
+
className: (0, _classnames.default)(_carouselcssmistica.carouselItem, o),
|
|
400
|
+
style: _object_spread_props(_object_spread({}, t), {
|
|
401
|
+
scrollSnapStop: (0, _platform.isAndroid)(M) ? "always" : "normal"
|
|
398
402
|
}),
|
|
399
403
|
"data-item": !0,
|
|
400
|
-
children:
|
|
401
|
-
},
|
|
404
|
+
children: r
|
|
405
|
+
}, u))
|
|
402
406
|
}),
|
|
403
407
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
|
|
404
408
|
isInverse: !1,
|
|
405
409
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
406
410
|
className: _carouselcssmistica.carouselNextArrowButton,
|
|
407
|
-
"aria-label":
|
|
408
|
-
onPress:
|
|
409
|
-
disabled: !
|
|
411
|
+
"aria-label": A.carouselNextButton,
|
|
412
|
+
onPress: H,
|
|
413
|
+
disabled: !Ie,
|
|
410
414
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronrightregular.default, {})
|
|
411
415
|
})
|
|
412
416
|
})
|
|
413
417
|
]
|
|
414
418
|
}),
|
|
415
419
|
V && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
416
|
-
className: _carouselcssmistica.carouselBullets,
|
|
420
|
+
className: (0, _classnames.default)(_carouselcssmistica.carouselBullets, {
|
|
421
|
+
[_carouselcssmistica.noCarouselBulletsDesktop]: Q <= 1,
|
|
422
|
+
[_carouselcssmistica.noCarouselBulletsTablet]: Y <= 1,
|
|
423
|
+
[_carouselcssmistica.noCarouselBulletsMobile]: K <= 1
|
|
424
|
+
}),
|
|
417
425
|
children: V
|
|
418
426
|
})
|
|
419
427
|
]
|
|
420
|
-
});
|
|
421
|
-
},
|
|
422
|
-
let { items: e, itemStyle:
|
|
423
|
-
return (0, _jsxruntime.jsx)(
|
|
428
|
+
}));
|
|
429
|
+
}, Pt = (e)=>/* @__PURE__ */ (0, _jsxruntime.jsx)(be, _object_spread({}, e)), Nt = (param)=>{
|
|
430
|
+
let { items: e, itemStyle: t, itemClassName: o, withBullets: l, renderBullets: h, initialActiveItem: m, onPageChange: I, dataAttributes: p } = param;
|
|
431
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(be, {
|
|
424
432
|
items: e,
|
|
425
|
-
itemStyle:
|
|
426
|
-
itemClassName:
|
|
433
|
+
itemStyle: t,
|
|
434
|
+
itemClassName: o,
|
|
427
435
|
itemsPerPage: {
|
|
428
436
|
mobile: 1,
|
|
429
437
|
tablet: 1,
|
|
@@ -432,78 +440,78 @@ const ie = (e, r)=>{
|
|
|
432
440
|
centered: !0,
|
|
433
441
|
itemsToScroll: 1,
|
|
434
442
|
gap: 0,
|
|
435
|
-
withBullets:
|
|
443
|
+
withBullets: l,
|
|
436
444
|
renderBullets: h,
|
|
437
445
|
initialActiveItem: m,
|
|
438
|
-
onPageChange:
|
|
439
|
-
dataAttributes:
|
|
446
|
+
onPageChange: I,
|
|
447
|
+
dataAttributes: p
|
|
440
448
|
});
|
|
441
|
-
},
|
|
449
|
+
}, pe = /*#__PURE__*/ _react.createContext(!1), Bt = ()=>_react.useContext(pe), at = (param)=>{
|
|
442
450
|
let { children: e } = param;
|
|
443
|
-
return (0, _jsxruntime.jsx)(
|
|
451
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(pe.Provider, {
|
|
444
452
|
value: !0,
|
|
445
453
|
children: e
|
|
446
454
|
});
|
|
447
|
-
},
|
|
448
|
-
let { items: e, withBullets:
|
|
449
|
-
const { texts:
|
|
455
|
+
}, Lt = (param)=>{
|
|
456
|
+
let { items: e, withBullets: t, autoplay: o, onPageChange: l, dataAttributes: h, inverseBullets: m = !0 } = param;
|
|
457
|
+
const { texts: I, platformOverrides: p } = (0, _hooks.useTheme)(), n = _react.useRef(null), [{ scrollLeft: S, scrollRight: N }, B] = _react.useState({
|
|
450
458
|
scrollLeft: 0,
|
|
451
459
|
scrollRight: 0
|
|
452
|
-
}),
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
left: -
|
|
460
|
+
}), g = _react.useCallback(()=>{
|
|
461
|
+
const a = n.current;
|
|
462
|
+
a && a.scrollBy({
|
|
463
|
+
left: -a.clientWidth,
|
|
456
464
|
behavior: "smooth"
|
|
457
465
|
});
|
|
458
|
-
}, []),
|
|
459
|
-
const
|
|
460
|
-
|
|
461
|
-
left:
|
|
466
|
+
}, []), x = _react.useCallback(()=>{
|
|
467
|
+
const a = n.current;
|
|
468
|
+
a && a.scrollBy({
|
|
469
|
+
left: a.clientWidth,
|
|
462
470
|
behavior: "smooth"
|
|
463
471
|
});
|
|
464
|
-
}, []),
|
|
472
|
+
}, []), U = N !== 0, A = S !== 0, M = n.current ? Math.floor((S + n.current.clientWidth / 2) / n.current.clientWidth) : 0;
|
|
465
473
|
_react.useLayoutEffect(()=>{
|
|
466
|
-
const
|
|
467
|
-
if (
|
|
474
|
+
const a = n.current;
|
|
475
|
+
if (a) {
|
|
468
476
|
const i = ()=>{
|
|
469
|
-
const { scrollWidth:
|
|
470
|
-
|
|
471
|
-
scrollLeft:
|
|
472
|
-
scrollRight:
|
|
477
|
+
const { scrollWidth: k, clientWidth: q } = a, v = Math.round(a.scrollLeft), b = Math.round(k - (v + q));
|
|
478
|
+
B({
|
|
479
|
+
scrollLeft: v,
|
|
480
|
+
scrollRight: b
|
|
473
481
|
});
|
|
474
482
|
};
|
|
475
|
-
i(),
|
|
476
|
-
const
|
|
483
|
+
i(), a.addEventListener("scroll", i);
|
|
484
|
+
const C = (0, _dom.listenResize)(a, i);
|
|
477
485
|
return ()=>{
|
|
478
|
-
|
|
486
|
+
a.removeEventListener("scroll", i), C();
|
|
479
487
|
};
|
|
480
488
|
}
|
|
481
489
|
}, [
|
|
482
490
|
e.length
|
|
483
491
|
]);
|
|
484
|
-
const
|
|
492
|
+
const E = de(!!o, n);
|
|
485
493
|
return _react.useEffect(()=>{
|
|
486
|
-
if (
|
|
487
|
-
const
|
|
488
|
-
var
|
|
489
|
-
|
|
494
|
+
if (E && o) {
|
|
495
|
+
const a = typeof o == "boolean" ? me : o.time, i = typeof o == "object" && o.loop, C = setInterval(()=>{
|
|
496
|
+
var k;
|
|
497
|
+
N !== 0 ? x() : i && ((k = n.current) == null || k.scrollTo({
|
|
490
498
|
left: 0,
|
|
491
499
|
behavior: "smooth"
|
|
492
500
|
}));
|
|
493
|
-
},
|
|
494
|
-
return ()=>clearInterval(
|
|
501
|
+
}, a);
|
|
502
|
+
return ()=>clearInterval(C);
|
|
495
503
|
}
|
|
496
504
|
}, [
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
505
|
+
o,
|
|
506
|
+
x,
|
|
507
|
+
N,
|
|
508
|
+
E
|
|
501
509
|
]), _react.useEffect(()=>{
|
|
502
|
-
|
|
510
|
+
l && l(M);
|
|
503
511
|
}, [
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
]), /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
512
|
+
M,
|
|
513
|
+
l
|
|
514
|
+
]), /* @__PURE__ */ (0, _jsxruntime.jsx)(at, {
|
|
507
515
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
508
516
|
className: _carouselcssmistica.slideshowContainer
|
|
509
517
|
}, (0, _dom.getPrefixedDataAttributes)(h, "SlideShow")), {
|
|
@@ -512,9 +520,9 @@ const ie = (e, r)=>{
|
|
|
512
520
|
isInverse: !1,
|
|
513
521
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
514
522
|
className: _carouselcssmistica.slideshowPrevArrowButton,
|
|
515
|
-
"aria-label":
|
|
516
|
-
onPress:
|
|
517
|
-
disabled: !
|
|
523
|
+
"aria-label": I.carouselPrevButton,
|
|
524
|
+
onPress: g,
|
|
525
|
+
disabled: !A,
|
|
518
526
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronleftregular.default, {})
|
|
519
527
|
})
|
|
520
528
|
}),
|
|
@@ -524,13 +532,13 @@ const ie = (e, r)=>{
|
|
|
524
532
|
}),
|
|
525
533
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
526
534
|
className: _carouselcssmistica.slideshow,
|
|
527
|
-
ref:
|
|
528
|
-
children: e.map((
|
|
535
|
+
ref: n,
|
|
536
|
+
children: e.map((a, i)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
529
537
|
className: _carouselcssmistica.slideshowItem,
|
|
530
538
|
style: {
|
|
531
|
-
scrollSnapStop: (0, _platform.isAndroid)(
|
|
539
|
+
scrollSnapStop: (0, _platform.isAndroid)(p) ? "always" : "normal"
|
|
532
540
|
},
|
|
533
|
-
children:
|
|
541
|
+
children: a
|
|
534
542
|
}, i))
|
|
535
543
|
})
|
|
536
544
|
}),
|
|
@@ -538,19 +546,19 @@ const ie = (e, r)=>{
|
|
|
538
546
|
isInverse: !1,
|
|
539
547
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
540
548
|
className: _carouselcssmistica.slideshowNextArrowButton,
|
|
541
|
-
"aria-label":
|
|
542
|
-
onPress:
|
|
543
|
-
disabled: !
|
|
549
|
+
"aria-label": I.carouselNextButton,
|
|
550
|
+
onPress: x,
|
|
551
|
+
disabled: !U,
|
|
544
552
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronrightregular.default, {})
|
|
545
553
|
})
|
|
546
554
|
}),
|
|
547
|
-
|
|
555
|
+
t && e.length > 1 && /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
|
|
548
556
|
isInverse: m,
|
|
549
557
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
550
558
|
className: _carouselcssmistica.slideshowBullets,
|
|
551
|
-
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
559
|
+
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(he, {
|
|
552
560
|
numPages: e.length,
|
|
553
|
-
currentIndex:
|
|
561
|
+
currentIndex: M
|
|
554
562
|
})
|
|
555
563
|
})
|
|
556
564
|
})
|