@telefonica/mistica 14.42.1 → 14.44.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.d.ts +0 -2
- package/dist/carousel.d.ts +5 -5
- package/dist/carousel.js +169 -153
- package/dist/cvv-field.js +85 -40
- package/dist/feedback.js +36 -36
- package/dist/index.d.ts +7 -3
- package/dist/index.js +17 -1
- package/dist/logo.d.ts +1 -0
- package/dist/logo.js +110 -68
- package/dist/package-version.js +1 -1
- package/dist/popover.css-mistica.js +4 -43
- package/dist/popover.css.d.ts +1 -12
- package/dist/popover.d.ts +6 -2
- package/dist/popover.js +71 -226
- package/dist/select.js +176 -172
- package/dist/skins/constants.d.ts +1 -0
- package/dist/skins/constants.js +4 -1
- package/dist/skins/tu.d.ts +47 -0
- package/dist/skins/tu.js +362 -0
- package/dist/skins/types/index.d.ts +1 -1
- package/dist/skins/utils.js +7 -4
- package/dist/theme.d.ts +2 -1
- package/dist/theme.js +17 -13
- package/dist/tooltip.css-mistica.js +15 -6
- package/dist/tooltip.css.d.ts +3 -0
- package/dist/tooltip.d.ts +15 -1
- package/dist/tooltip.js +213 -140
- package/dist-es/carousel.js +193 -176
- package/dist-es/cvv-field.js +73 -69
- package/dist-es/feedback.js +58 -58
- package/dist-es/index.js +1744 -1743
- package/dist-es/logo.js +128 -89
- package/dist-es/package-version.js +1 -1
- package/dist-es/popover.css-mistica.js +2 -3
- package/dist-es/popover.js +75 -191
- package/dist-es/select.js +182 -178
- package/dist-es/skins/constants.js +2 -2
- package/dist-es/skins/tu.js +345 -0
- package/dist-es/skins/utils.js +21 -18
- package/dist-es/style.css +1 -1
- package/dist-es/theme.js +16 -12
- package/dist-es/tooltip.css-mistica.js +2 -2
- package/dist-es/tooltip.js +234 -169
- package/package.json +4 -4
package/dist/carousel.js
CHANGED
|
@@ -11,31 +11,31 @@ function _export(target, all) {
|
|
|
11
11
|
}
|
|
12
12
|
_export(exports, {
|
|
13
13
|
Carousel: function() {
|
|
14
|
-
return
|
|
14
|
+
return _t;
|
|
15
15
|
},
|
|
16
|
-
|
|
17
|
-
return
|
|
16
|
+
CarouselContextConsumer: function() {
|
|
17
|
+
return zt;
|
|
18
18
|
},
|
|
19
19
|
CarouselContextProvider: function() {
|
|
20
|
-
return
|
|
20
|
+
return Ot;
|
|
21
21
|
},
|
|
22
22
|
CenteredCarousel: function() {
|
|
23
|
-
return
|
|
23
|
+
return jt;
|
|
24
24
|
},
|
|
25
25
|
IsInsideSlideshowProvider: function() {
|
|
26
|
-
return
|
|
26
|
+
return Ct;
|
|
27
27
|
},
|
|
28
28
|
PageBullets: function() {
|
|
29
29
|
return xe;
|
|
30
30
|
},
|
|
31
31
|
Slideshow: function() {
|
|
32
|
-
return
|
|
32
|
+
return Kt;
|
|
33
33
|
},
|
|
34
34
|
useCarouselContext: function() {
|
|
35
|
-
return
|
|
35
|
+
return Vt;
|
|
36
36
|
},
|
|
37
37
|
useIsInsideSlideshowContext: function() {
|
|
38
|
-
return
|
|
38
|
+
return Ft;
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
41
|
const _jsxruntime = require("react/jsx-runtime");
|
|
@@ -159,10 +159,10 @@ const ve = (e, t)=>{
|
|
|
159
159
|
}, xe = (param)=>{
|
|
160
160
|
let { currentIndex: e, numPages: t, onPress: s } = param;
|
|
161
161
|
var _t_tablet;
|
|
162
|
-
const r = (0, _themevariantcontext.useIsInverseVariant)(), { isDesktopOrBigger:
|
|
163
|
-
const
|
|
164
|
-
return r ?
|
|
165
|
-
},
|
|
162
|
+
const r = (0, _themevariantcontext.useIsInverseVariant)(), { isDesktopOrBigger: d } = (0, _hooks.useScreenSize)(), h = (i)=>{
|
|
163
|
+
const u = i === e;
|
|
164
|
+
return r ? u ? _carouselcssmistica.bulletActiveInverse : _carouselcssmistica.bulletInverse : u ? _carouselcssmistica.bulletActive : _carouselcssmistica.bullet;
|
|
165
|
+
}, w = typeof t == "number" ? t : Math.max(t.mobile, (_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile, t.desktop);
|
|
166
166
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)(_inline.default, {
|
|
167
167
|
space: 0,
|
|
168
168
|
alignItems: "center",
|
|
@@ -170,62 +170,62 @@ const ve = (e, t)=>{
|
|
|
170
170
|
"component-name": "PageBullets"
|
|
171
171
|
},
|
|
172
172
|
children: Array.from({
|
|
173
|
-
length:
|
|
174
|
-
}, (i,
|
|
173
|
+
length: w
|
|
174
|
+
}, (i, u)=>/* @__PURE__ */ {
|
|
175
175
|
var _t_tablet;
|
|
176
176
|
return (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
177
177
|
className: (0, _classnames.default)(typeof t == "number" ? _carouselcssmistica.bulletButton : {
|
|
178
|
-
[_carouselcssmistica.bulletButtonMobile]:
|
|
179
|
-
[_carouselcssmistica.bulletButtonTablet]:
|
|
180
|
-
[_carouselcssmistica.bulletButtonDesktop]:
|
|
178
|
+
[_carouselcssmistica.bulletButtonMobile]: u < t.mobile,
|
|
179
|
+
[_carouselcssmistica.bulletButtonTablet]: u < ((_t_tablet = t.tablet) !== null && _t_tablet !== void 0 ? _t_tablet : t.mobile),
|
|
180
|
+
[_carouselcssmistica.bulletButtonDesktop]: u < t.desktop
|
|
181
181
|
}),
|
|
182
|
-
style:
|
|
182
|
+
style: u === 0 ? {
|
|
183
183
|
paddingLeft: 0
|
|
184
184
|
} : {},
|
|
185
185
|
maybe: !0,
|
|
186
|
-
onPress:
|
|
186
|
+
onPress: d && s ? ()=>s(u) : void 0,
|
|
187
187
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
188
|
-
className: h(
|
|
188
|
+
className: h(u)
|
|
189
189
|
})
|
|
190
|
-
},
|
|
190
|
+
}, u);
|
|
191
191
|
})
|
|
192
192
|
});
|
|
193
193
|
}, oe = ()=>{
|
|
194
194
|
throw new Error("You must wrap your component with a CarouselContextProvider to use CarouselContext");
|
|
195
|
-
}, Ce = oe, Pe = oe,
|
|
195
|
+
}, Ce = oe, Pe = oe, we = oe, Ie = {
|
|
196
196
|
currentIndex: 0,
|
|
197
197
|
numPages: 0
|
|
198
198
|
}, se = /*#__PURE__*/ _react.createContext({
|
|
199
199
|
goPrev: Ce,
|
|
200
200
|
goNext: Pe,
|
|
201
|
-
goToPage:
|
|
202
|
-
bulletsProps:
|
|
203
|
-
}), re = /*#__PURE__*/ _react.createContext(null),
|
|
201
|
+
goToPage: we,
|
|
202
|
+
bulletsProps: Ie
|
|
203
|
+
}), re = /*#__PURE__*/ _react.createContext(null), Ot = (param)=>{
|
|
204
204
|
let { children: e } = param;
|
|
205
|
-
const [t, s] = _react.useState(
|
|
205
|
+
const [t, s] = _react.useState(Ie), r = _react.useRef(Ce), d = _react.useRef(Pe), h = _react.useRef(we), w = _react.useMemo(()=>({
|
|
206
206
|
goPrev: ()=>{
|
|
207
207
|
r.current();
|
|
208
208
|
},
|
|
209
209
|
goNext: ()=>{
|
|
210
|
-
|
|
210
|
+
d.current();
|
|
211
211
|
},
|
|
212
212
|
goToPage: function(i) {
|
|
213
|
-
let
|
|
214
|
-
h.current(i,
|
|
213
|
+
let u = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
|
|
214
|
+
h.current(i, u);
|
|
215
215
|
},
|
|
216
216
|
bulletsProps: t
|
|
217
217
|
}), [
|
|
218
218
|
t
|
|
219
219
|
]);
|
|
220
220
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)(se.Provider, {
|
|
221
|
-
value:
|
|
221
|
+
value: w,
|
|
222
222
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(re.Provider, {
|
|
223
223
|
value: {
|
|
224
224
|
setGoPrev: (i)=>{
|
|
225
225
|
r.current = i;
|
|
226
226
|
},
|
|
227
227
|
setGoNext: (i)=>{
|
|
228
|
-
|
|
228
|
+
d.current = i;
|
|
229
229
|
},
|
|
230
230
|
setGoToPage: (i)=>{
|
|
231
231
|
h.current = i;
|
|
@@ -235,7 +235,7 @@ const ve = (e, t)=>{
|
|
|
235
235
|
children: e
|
|
236
236
|
})
|
|
237
237
|
});
|
|
238
|
-
},
|
|
238
|
+
}, Vt = ()=>_react.useContext(se), zt = se.Consumer, ae = (e, t, s)=>s ? typeof s == "number" ? s : s[e] || t[e] : t[e], vt = (e, t)=>{
|
|
239
239
|
const s = {
|
|
240
240
|
mobile: 1,
|
|
241
241
|
tablet: 2,
|
|
@@ -260,44 +260,44 @@ const ve = (e, t)=>{
|
|
|
260
260
|
}, ie = (e, t)=>{
|
|
261
261
|
if (e.length === 0) return [];
|
|
262
262
|
const s = Math.ceil(e.length / t), r = [];
|
|
263
|
-
for(let
|
|
263
|
+
for(let d = 0; d < e.length; d += s)r.push(e[d]);
|
|
264
264
|
return r[r.length - 1] = e[e.length - s], r;
|
|
265
|
-
},
|
|
265
|
+
}, xt = (e, t)=>{
|
|
266
266
|
const s = [];
|
|
267
267
|
for(let r = 0; r < t.length; r++)r === 0 ? s.push(t[0]) : s.push((t[r] + t[r - 1]) / 2);
|
|
268
268
|
for(let r = s.length - 1; r >= 0; r--)if (e - s[r] >= -1) return r;
|
|
269
269
|
return 0;
|
|
270
|
-
},
|
|
271
|
-
let { items: e, itemStyle: t, itemClassName: s, withBullets: r, renderBullets:
|
|
272
|
-
const { texts:
|
|
270
|
+
}, Me = 5e3, Se = (param)=>{
|
|
271
|
+
let { items: e, itemStyle: t, itemClassName: s, withBullets: r, renderBullets: d, initialActiveItem: h, itemsPerPage: w, itemsToScroll: i, mobilePageOffset: u, gap: C, free: b, centered: k, autoplay: x, onPageChange: y, dataAttributes: W } = param;
|
|
272
|
+
const { texts: I, platformOverrides: N, skinName: H } = (0, _hooks.useTheme)(), J = (0, _desktopcontainertypecontext.useDesktopContainerType)(), a = vt(J || "large", w), { isDesktopOrBigger: E, isTablet: A } = (0, _hooks.useScreenSize)(), j = A ? a.tablet : a.mobile, P = Math.max(Math.floor(E ? a.desktop : j), 1), l = _react.useRef(null), m = Math.ceil(e.length / Math.max(Math.floor(a.mobile), 1)), v = Math.ceil(e.length / Math.max(Math.floor(a.tablet), 1)), M = Math.ceil(e.length / Math.max(Math.floor(a.desktop), 1)), R = Math.ceil(e.length / P), [{ scrollLeft: D, scrollRight: G }, Ee] = _react.useState({
|
|
273
273
|
scrollLeft: 0,
|
|
274
274
|
scrollRight: 0
|
|
275
|
-
}), [
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
]),
|
|
275
|
+
}), [Q, Re] = _react.useState([]), F = _react.useMemo(()=>ie(Q, R), [
|
|
276
|
+
Q,
|
|
277
|
+
R
|
|
278
|
+
]), K = i ? ie(Q, Math.ceil(e.length / i)) : F, Be = G !== 0, Te = D !== 0;
|
|
279
279
|
_react.useEffect(()=>{
|
|
280
280
|
if (l.current) {
|
|
281
|
-
const c = l.current,
|
|
282
|
-
const { scrollWidth:
|
|
283
|
-
|
|
284
|
-
scrollLeft:
|
|
285
|
-
scrollRight:
|
|
281
|
+
const c = l.current, f = ()=>{
|
|
282
|
+
const { scrollWidth: Y, clientWidth: V } = c, q = Math.round(c.scrollLeft), Z = Math.round(Y - (q + V));
|
|
283
|
+
Ee({
|
|
284
|
+
scrollLeft: q,
|
|
285
|
+
scrollRight: Z
|
|
286
286
|
});
|
|
287
287
|
}, p = ()=>{
|
|
288
|
-
const
|
|
289
|
-
Re(Array.from(c.querySelectorAll("[data-item]")).map((V,
|
|
290
|
-
if (
|
|
291
|
-
const
|
|
292
|
-
return Math.min(
|
|
288
|
+
const Y = c.scrollWidth - c.clientWidth;
|
|
289
|
+
Re(Array.from(c.querySelectorAll("[data-item]")).map((V, q)=>{
|
|
290
|
+
if (q === e.length - 1) return Y;
|
|
291
|
+
const Z = V.offsetLeft, We = parseInt(getComputedStyle(V).scrollMargin), Ae = k && !E ? Z - V.clientWidth / 2 : Z;
|
|
292
|
+
return Math.min(Ae - We - c.offsetLeft, Y);
|
|
293
293
|
}));
|
|
294
294
|
};
|
|
295
|
-
|
|
295
|
+
f(), p(), c.addEventListener("scroll", f);
|
|
296
296
|
const g = (0, _dom.listenResize)(c, ()=>{
|
|
297
|
-
|
|
297
|
+
f(), p();
|
|
298
298
|
});
|
|
299
299
|
return ()=>{
|
|
300
|
-
c.removeEventListener("scroll",
|
|
300
|
+
c.removeEventListener("scroll", f), g();
|
|
301
301
|
};
|
|
302
302
|
}
|
|
303
303
|
return ()=>{};
|
|
@@ -305,60 +305,60 @@ const ve = (e, t)=>{
|
|
|
305
305
|
a.desktop,
|
|
306
306
|
a.tablet,
|
|
307
307
|
a.mobile,
|
|
308
|
-
B,
|
|
309
|
-
C,
|
|
310
|
-
S,
|
|
311
308
|
R,
|
|
309
|
+
C,
|
|
310
|
+
k,
|
|
311
|
+
E,
|
|
312
312
|
e.length
|
|
313
313
|
]);
|
|
314
|
-
const
|
|
315
|
-
let
|
|
314
|
+
const B = _react.useCallback(function(c) {
|
|
315
|
+
let f = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
|
|
316
316
|
const p = l.current;
|
|
317
317
|
if (p) {
|
|
318
318
|
const g = F[c];
|
|
319
319
|
p.scrollTo({
|
|
320
320
|
left: g,
|
|
321
|
-
behavior:
|
|
321
|
+
behavior: f ? "smooth" : "auto"
|
|
322
322
|
});
|
|
323
323
|
}
|
|
324
324
|
}, [
|
|
325
325
|
F
|
|
326
|
-
]),
|
|
326
|
+
]), X = _react.useCallback(()=>{
|
|
327
327
|
const c = l.current;
|
|
328
328
|
if (c) {
|
|
329
|
-
const { scrollLeft:
|
|
330
|
-
...
|
|
331
|
-
].reverse().find((g)=>g -
|
|
329
|
+
const { scrollLeft: f } = c, p = [
|
|
330
|
+
...K
|
|
331
|
+
].reverse().find((g)=>g - f < -1);
|
|
332
332
|
c.scrollTo({
|
|
333
333
|
left: p,
|
|
334
334
|
behavior: "smooth"
|
|
335
335
|
});
|
|
336
336
|
}
|
|
337
337
|
}, [
|
|
338
|
-
|
|
338
|
+
K
|
|
339
339
|
]), O = _react.useCallback(()=>{
|
|
340
340
|
const c = l.current;
|
|
341
341
|
if (c) {
|
|
342
|
-
const { scrollLeft:
|
|
342
|
+
const { scrollLeft: f } = c, p = K.find((g)=>g - f > 1);
|
|
343
343
|
c.scrollTo({
|
|
344
344
|
left: p,
|
|
345
345
|
behavior: "smooth"
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
348
|
}, [
|
|
349
|
-
|
|
349
|
+
K
|
|
350
350
|
]), le = ve(!!x, l);
|
|
351
351
|
_react.useEffect(()=>{
|
|
352
|
-
h !== void 0 &&
|
|
352
|
+
h !== void 0 && B(Math.floor(h / P), !1);
|
|
353
353
|
}, [
|
|
354
354
|
h,
|
|
355
|
-
|
|
355
|
+
B,
|
|
356
356
|
P
|
|
357
357
|
]), _react.useEffect(()=>{
|
|
358
358
|
if (le && x) {
|
|
359
|
-
const c = typeof x == "boolean" ?
|
|
359
|
+
const c = typeof x == "boolean" ? Me : x.time, f = typeof x == "object" && x.loop, p = setInterval(()=>{
|
|
360
360
|
var g;
|
|
361
|
-
G !== 0 ? O() :
|
|
361
|
+
G !== 0 ? O() : f && ((g = l.current) == null || g.scrollTo({
|
|
362
362
|
left: 0,
|
|
363
363
|
behavior: "smooth"
|
|
364
364
|
}));
|
|
@@ -371,60 +371,60 @@ const ve = (e, t)=>{
|
|
|
371
371
|
G,
|
|
372
372
|
le
|
|
373
373
|
]);
|
|
374
|
-
const
|
|
374
|
+
const S = xt(D, F), ne = _react.useRef(!h), ce = _react.useRef(0);
|
|
375
375
|
_react.useEffect(()=>{
|
|
376
|
-
if (
|
|
377
|
-
const c = Math.min((
|
|
376
|
+
if (y) {
|
|
377
|
+
const c = Math.min((S + 1) * P - 1, e.length - 1), f = [];
|
|
378
378
|
for(let p = 0; p < P; p++){
|
|
379
379
|
const g = c - p;
|
|
380
|
-
g >= 0 &&
|
|
380
|
+
g >= 0 && f.unshift(g);
|
|
381
381
|
}
|
|
382
|
-
ne.current ? ce.current !==
|
|
383
|
-
pageIndex:
|
|
384
|
-
shownItemIndexes:
|
|
385
|
-
}) : ne.current =
|
|
382
|
+
ne.current ? ce.current !== S && y({
|
|
383
|
+
pageIndex: S,
|
|
384
|
+
shownItemIndexes: f
|
|
385
|
+
}) : ne.current = f.includes(h || 0), ce.current = S;
|
|
386
386
|
}
|
|
387
387
|
}, [
|
|
388
|
-
|
|
388
|
+
S,
|
|
389
389
|
e.length,
|
|
390
390
|
P,
|
|
391
391
|
h,
|
|
392
|
-
|
|
392
|
+
y
|
|
393
393
|
]);
|
|
394
|
-
const
|
|
395
|
-
currentIndex:
|
|
394
|
+
const T = _react.useContext(re), ee = _react.useMemo(()=>({
|
|
395
|
+
currentIndex: S,
|
|
396
396
|
numPages: {
|
|
397
397
|
mobile: m,
|
|
398
398
|
tablet: v,
|
|
399
|
-
desktop:
|
|
399
|
+
desktop: M
|
|
400
400
|
}
|
|
401
401
|
}), [
|
|
402
|
-
|
|
403
|
-
|
|
402
|
+
S,
|
|
403
|
+
M,
|
|
404
404
|
m,
|
|
405
405
|
v
|
|
406
406
|
]);
|
|
407
407
|
_react.useEffect(()=>{
|
|
408
|
-
|
|
408
|
+
T && (T.setGoPrev(X), T.setGoNext(O), T.setGoToPage(B), T.setBulletsProps(ee));
|
|
409
409
|
}, [
|
|
410
|
-
|
|
410
|
+
T,
|
|
411
411
|
O,
|
|
412
|
-
|
|
412
|
+
X,
|
|
413
413
|
ee,
|
|
414
|
-
|
|
414
|
+
B
|
|
415
415
|
]);
|
|
416
|
-
let
|
|
417
|
-
|
|
418
|
-
numPages:
|
|
419
|
-
currentIndex:
|
|
420
|
-
onPress:
|
|
421
|
-
}) : r && (
|
|
422
|
-
onPress:
|
|
416
|
+
let U = null;
|
|
417
|
+
d ? U = d({
|
|
418
|
+
numPages: R,
|
|
419
|
+
currentIndex: S,
|
|
420
|
+
onPress: B
|
|
421
|
+
}) : r && (U = /* @__PURE__ */ (0, _jsxruntime.jsx)(xe, _object_spread_props(_object_spread({}, ee), {
|
|
422
|
+
onPress: B
|
|
423
423
|
})));
|
|
424
|
-
const
|
|
424
|
+
const Le = "64px", ye = "36px";
|
|
425
425
|
return /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({}, (0, _dom.getPrefixedDataAttributes)(_object_spread({
|
|
426
426
|
"component-name": "Carousel"
|
|
427
|
-
},
|
|
427
|
+
}, W))), {
|
|
428
428
|
children: [
|
|
429
429
|
/* @__PURE__ */ (0, _jsxruntime.jsxs)("div", {
|
|
430
430
|
className: _carouselcssmistica.carouselContainer,
|
|
@@ -433,15 +433,15 @@ const ve = (e, t)=>{
|
|
|
433
433
|
isInverse: !1,
|
|
434
434
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
435
435
|
className: _carouselcssmistica.carouselPrevArrowButton,
|
|
436
|
-
"aria-label":
|
|
437
|
-
onPress:
|
|
436
|
+
"aria-label": I.carouselPrevButton,
|
|
437
|
+
onPress: X,
|
|
438
438
|
disabled: !Te,
|
|
439
439
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronleftregular.default, {})
|
|
440
440
|
})
|
|
441
441
|
}),
|
|
442
442
|
/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
443
443
|
className: (0, _classnames.default)(_carouselcssmistica.carousel, {
|
|
444
|
-
[_carouselcssmistica.centeredCarousel]:
|
|
444
|
+
[_carouselcssmistica.centeredCarousel]: k,
|
|
445
445
|
[_carouselcssmistica.carouselWithScrollMobile]: m > 1,
|
|
446
446
|
[_carouselcssmistica.carouselWithScrollTablet]: v > 1
|
|
447
447
|
}),
|
|
@@ -449,10 +449,10 @@ const ve = (e, t)=>{
|
|
|
449
449
|
[_carouselcssmistica.vars.itemsPerPageDesktop]: String(a.desktop),
|
|
450
450
|
[_carouselcssmistica.vars.itemsPerPageTablet]: String(a.tablet),
|
|
451
451
|
[_carouselcssmistica.vars.itemsPerPageMobile]: String(a.mobile)
|
|
452
|
-
},
|
|
453
|
-
[_carouselcssmistica.vars.mobilePageOffset]: Ee
|
|
454
|
-
} : J === _constants.VIVO_NEW_SKIN ? {
|
|
452
|
+
}, u === "large" ? {
|
|
455
453
|
[_carouselcssmistica.vars.mobilePageOffset]: Le
|
|
454
|
+
} : H === _constants.VIVO_NEW_SKIN ? {
|
|
455
|
+
[_carouselcssmistica.vars.mobilePageOffset]: ye
|
|
456
456
|
} : {}, C !== void 0 ? {
|
|
457
457
|
[_carouselcssmistica.vars.gap]: String(C)
|
|
458
458
|
} : {}))), {
|
|
@@ -462,23 +462,23 @@ const ve = (e, t)=>{
|
|
|
462
462
|
// the bottom of the scrollable area in retina displays when it has a height with
|
|
463
463
|
// decimals. This extra padding avoids that line to partially cover the carousel
|
|
464
464
|
// slides border:
|
|
465
|
-
paddingBottom: (0, _platform.isIos)(
|
|
465
|
+
paddingBottom: (0, _platform.isIos)(N) && !(0, _platform.isRunningAcceptanceTest)(N) ? 0.5 : void 0
|
|
466
466
|
}),
|
|
467
467
|
ref: l,
|
|
468
|
-
children: e.map((c,
|
|
468
|
+
children: e.map((c, f)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
469
469
|
className: (0, _classnames.default)(_carouselcssmistica.carouselItem, s),
|
|
470
470
|
style: _object_spread_props(_object_spread({}, t), {
|
|
471
|
-
scrollSnapStop: (0, _platform.isAndroid)(
|
|
471
|
+
scrollSnapStop: (0, _platform.isAndroid)(N) ? "always" : "normal"
|
|
472
472
|
}),
|
|
473
473
|
"data-item": !0,
|
|
474
474
|
children: c
|
|
475
|
-
},
|
|
475
|
+
}, f))
|
|
476
476
|
}),
|
|
477
477
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
|
|
478
478
|
isInverse: !1,
|
|
479
479
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
480
480
|
className: _carouselcssmistica.carouselNextArrowButton,
|
|
481
|
-
"aria-label":
|
|
481
|
+
"aria-label": I.carouselNextButton,
|
|
482
482
|
onPress: O,
|
|
483
483
|
disabled: !Be,
|
|
484
484
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronrightregular.default, {})
|
|
@@ -486,19 +486,35 @@ const ve = (e, t)=>{
|
|
|
486
486
|
})
|
|
487
487
|
]
|
|
488
488
|
}),
|
|
489
|
-
|
|
489
|
+
U && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
490
490
|
className: (0, _classnames.default)(_carouselcssmistica.carouselBullets, {
|
|
491
|
-
[_carouselcssmistica.noCarouselBulletsDesktop]:
|
|
491
|
+
[_carouselcssmistica.noCarouselBulletsDesktop]: M <= 1,
|
|
492
492
|
[_carouselcssmistica.noCarouselBulletsTablet]: v <= 1,
|
|
493
493
|
[_carouselcssmistica.noCarouselBulletsMobile]: m <= 1
|
|
494
494
|
}),
|
|
495
|
-
children:
|
|
495
|
+
children: U
|
|
496
496
|
})
|
|
497
497
|
]
|
|
498
498
|
}));
|
|
499
|
-
},
|
|
500
|
-
|
|
501
|
-
return
|
|
499
|
+
}, ke = ()=>{
|
|
500
|
+
const [e, t] = _react.useState(1);
|
|
501
|
+
return _react.useEffect(()=>{
|
|
502
|
+
const s = ()=>{
|
|
503
|
+
window.innerWidth !== 0 && (t((r)=>r + 1), window.removeEventListener("resize", s));
|
|
504
|
+
};
|
|
505
|
+
return window.innerWidth === 0 && window.addEventListener("resize", s), ()=>{
|
|
506
|
+
window.removeEventListener("resize", s);
|
|
507
|
+
};
|
|
508
|
+
}, []), e;
|
|
509
|
+
}, _t = (e)=>{
|
|
510
|
+
const t = ke();
|
|
511
|
+
return /* @__PURE__ */ /*#__PURE__*/ (0, _react.createElement)(Se, _object_spread_props(_object_spread({}, e), {
|
|
512
|
+
key: t
|
|
513
|
+
}));
|
|
514
|
+
}, jt = (param)=>{
|
|
515
|
+
let { items: e, itemStyle: t, itemClassName: s, withBullets: r, renderBullets: d, initialActiveItem: h, onPageChange: w, dataAttributes: i } = param;
|
|
516
|
+
const u = ke();
|
|
517
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(Se, {
|
|
502
518
|
items: e,
|
|
503
519
|
itemStyle: t,
|
|
504
520
|
itemClassName: s,
|
|
@@ -511,35 +527,35 @@ const ve = (e, t)=>{
|
|
|
511
527
|
itemsToScroll: 1,
|
|
512
528
|
gap: 0,
|
|
513
529
|
withBullets: r,
|
|
514
|
-
renderBullets:
|
|
530
|
+
renderBullets: d,
|
|
515
531
|
initialActiveItem: h,
|
|
516
|
-
onPageChange:
|
|
532
|
+
onPageChange: w,
|
|
517
533
|
dataAttributes: i
|
|
518
|
-
});
|
|
519
|
-
},
|
|
534
|
+
}, u);
|
|
535
|
+
}, Ne = /*#__PURE__*/ _react.createContext(!1), Ft = ()=>_react.useContext(Ne), Ct = (param)=>{
|
|
520
536
|
let { children: e } = param;
|
|
521
|
-
return /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
537
|
+
return /* @__PURE__ */ (0, _jsxruntime.jsx)(Ne.Provider, {
|
|
522
538
|
value: !0,
|
|
523
539
|
children: e
|
|
524
540
|
});
|
|
525
|
-
},
|
|
526
|
-
let { items: e, withBullets: t, autoplay: s, initialPageIndex: r = 0, onPageChange:
|
|
527
|
-
const { texts: i, platformOverrides:
|
|
541
|
+
}, Kt = (param)=>{
|
|
542
|
+
let { items: e, withBullets: t, autoplay: s, initialPageIndex: r = 0, onPageChange: d, dataAttributes: h, inverseBullets: w = !0 } = param;
|
|
543
|
+
const { texts: i, platformOverrides: u } = (0, _hooks.useTheme)(), C = _react.useContext(re), b = _react.useRef(null), [{ scrollLeft: k, scrollRight: x }, y] = _react.useState({
|
|
528
544
|
scrollLeft: 0,
|
|
529
545
|
scrollRight: 0
|
|
530
|
-
}),
|
|
546
|
+
}), W = _react.useCallback(()=>{
|
|
531
547
|
const l = b.current;
|
|
532
548
|
l && l.scrollBy({
|
|
533
549
|
left: -l.clientWidth,
|
|
534
550
|
behavior: "smooth"
|
|
535
551
|
});
|
|
536
|
-
}, []),
|
|
552
|
+
}, []), I = _react.useCallback(()=>{
|
|
537
553
|
const l = b.current;
|
|
538
554
|
l && l.scrollBy({
|
|
539
555
|
left: l.clientWidth,
|
|
540
556
|
behavior: "smooth"
|
|
541
557
|
});
|
|
542
|
-
}, []),
|
|
558
|
+
}, []), N = _react.useCallback(function(l) {
|
|
543
559
|
let m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
|
|
544
560
|
const v = b.current;
|
|
545
561
|
v && v.scrollTo({
|
|
@@ -548,13 +564,13 @@ const ve = (e, t)=>{
|
|
|
548
564
|
});
|
|
549
565
|
}, [
|
|
550
566
|
b
|
|
551
|
-
]),
|
|
567
|
+
]), H = x !== 0, J = k !== 0, a = b.current ? Math.floor((k + b.current.clientWidth / 2) / b.current.clientWidth) : 0;
|
|
552
568
|
_react.useLayoutEffect(()=>{
|
|
553
569
|
const l = b.current;
|
|
554
570
|
if (l) {
|
|
555
571
|
const m = ()=>{
|
|
556
|
-
const { scrollWidth:
|
|
557
|
-
|
|
572
|
+
const { scrollWidth: M, clientWidth: R } = l, D = Math.round(l.scrollLeft), G = Math.round(M - (D + R));
|
|
573
|
+
y({
|
|
558
574
|
scrollLeft: D,
|
|
559
575
|
scrollRight: G
|
|
560
576
|
});
|
|
@@ -568,12 +584,12 @@ const ve = (e, t)=>{
|
|
|
568
584
|
}, [
|
|
569
585
|
e.length
|
|
570
586
|
]);
|
|
571
|
-
const
|
|
587
|
+
const E = ve(!!s, b);
|
|
572
588
|
_react.useEffect(()=>{
|
|
573
|
-
if (
|
|
574
|
-
const l = typeof s == "boolean" ?
|
|
575
|
-
var
|
|
576
|
-
x !== 0 ?
|
|
589
|
+
if (E && s) {
|
|
590
|
+
const l = typeof s == "boolean" ? Me : s.time, m = typeof s == "object" && s.loop, v = setInterval(()=>{
|
|
591
|
+
var M;
|
|
592
|
+
x !== 0 ? I() : m && ((M = b.current) == null || M.scrollTo({
|
|
577
593
|
left: 0,
|
|
578
594
|
behavior: "smooth"
|
|
579
595
|
}));
|
|
@@ -582,20 +598,20 @@ const ve = (e, t)=>{
|
|
|
582
598
|
}
|
|
583
599
|
}, [
|
|
584
600
|
s,
|
|
585
|
-
|
|
601
|
+
I,
|
|
586
602
|
x,
|
|
587
|
-
|
|
603
|
+
E
|
|
588
604
|
]);
|
|
589
|
-
const
|
|
605
|
+
const A = _react.useRef(!1), j = _react.useRef(0);
|
|
590
606
|
_react.useEffect(()=>{
|
|
591
|
-
|
|
607
|
+
d && (A.current ? j.current !== a && d(a) : A.current = r === a), j.current = a;
|
|
592
608
|
}, [
|
|
593
609
|
a,
|
|
594
610
|
r,
|
|
595
|
-
|
|
611
|
+
d
|
|
596
612
|
]), _react.useEffect(()=>{
|
|
597
613
|
const l = b.current;
|
|
598
|
-
r !== void 0 && l && !
|
|
614
|
+
r !== void 0 && l && !A.current && l.scrollTo({
|
|
599
615
|
left: l.clientWidth * r
|
|
600
616
|
});
|
|
601
617
|
}, [
|
|
@@ -609,14 +625,14 @@ const ve = (e, t)=>{
|
|
|
609
625
|
e.length
|
|
610
626
|
]);
|
|
611
627
|
return _react.useEffect(()=>{
|
|
612
|
-
C && (C.setGoPrev(
|
|
628
|
+
C && (C.setGoPrev(W), C.setGoNext(I), C.setGoToPage(N), C.setBulletsProps(P));
|
|
613
629
|
}, [
|
|
614
630
|
C,
|
|
615
|
-
|
|
616
|
-
|
|
631
|
+
I,
|
|
632
|
+
W,
|
|
617
633
|
P,
|
|
618
|
-
|
|
619
|
-
]), /* @__PURE__ */ (0, _jsxruntime.jsx)(
|
|
634
|
+
N
|
|
635
|
+
]), /* @__PURE__ */ (0, _jsxruntime.jsx)(Ct, {
|
|
620
636
|
children: /* @__PURE__ */ (0, _jsxruntime.jsxs)("div", _object_spread_props(_object_spread({
|
|
621
637
|
className: _carouselcssmistica.slideshowContainer
|
|
622
638
|
}, (0, _dom.getPrefixedDataAttributes)(h, "SlideShow")), {
|
|
@@ -626,8 +642,8 @@ const ve = (e, t)=>{
|
|
|
626
642
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
627
643
|
className: _carouselcssmistica.slideshowPrevArrowButton,
|
|
628
644
|
"aria-label": i.carouselPrevButton,
|
|
629
|
-
onPress:
|
|
630
|
-
disabled: !
|
|
645
|
+
onPress: W,
|
|
646
|
+
disabled: !J,
|
|
631
647
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronleftregular.default, {})
|
|
632
648
|
})
|
|
633
649
|
}),
|
|
@@ -641,7 +657,7 @@ const ve = (e, t)=>{
|
|
|
641
657
|
children: e.map((l, m)=>/* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
642
658
|
className: _carouselcssmistica.slideshowItem,
|
|
643
659
|
style: {
|
|
644
|
-
scrollSnapStop: (0, _platform.isAndroid)(
|
|
660
|
+
scrollSnapStop: (0, _platform.isAndroid)(u) ? "always" : "normal"
|
|
645
661
|
},
|
|
646
662
|
children: l
|
|
647
663
|
}, m))
|
|
@@ -652,13 +668,13 @@ const ve = (e, t)=>{
|
|
|
652
668
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_touchable.BaseTouchable, {
|
|
653
669
|
className: _carouselcssmistica.slideshowNextArrowButton,
|
|
654
670
|
"aria-label": i.carouselNextButton,
|
|
655
|
-
onPress:
|
|
656
|
-
disabled: !
|
|
671
|
+
onPress: I,
|
|
672
|
+
disabled: !H,
|
|
657
673
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(_iconchevronrightregular.default, {})
|
|
658
674
|
})
|
|
659
675
|
}),
|
|
660
676
|
t && e.length > 1 && /* @__PURE__ */ (0, _jsxruntime.jsx)(_themevariantcontext.ThemeVariant, {
|
|
661
|
-
isInverse:
|
|
677
|
+
isInverse: w,
|
|
662
678
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
663
679
|
className: _carouselcssmistica.slideshowBullets,
|
|
664
680
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)(xe, _object_spread({}, P))
|