@telefonica/mistica 12.12.0 → 12.13.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/carousel.css-mistica.js +11 -10
- package/dist/carousel.css.d.ts +1 -0
- package/dist/carousel.css.js.flow +4 -0
- package/dist/carousel.d.ts +7 -1
- package/dist/carousel.js +213 -195
- package/dist/carousel.js.flow +9 -1
- package/dist/desktop-container-type-context.js +14 -4
- package/dist/list.js +1 -1
- package/dist/package-version.js +1 -1
- package/dist/skeletons.css-mistica.js +1 -1
- package/dist/skeletons.js +48 -37
- package/dist/theme-context-provider.js +1 -1
- package/dist-es/carousel.css-mistica.js +8 -7
- package/dist-es/carousel.js +270 -252
- package/dist-es/desktop-container-type-context.js +4 -2
- package/dist-es/list.js +1 -1
- package/dist-es/package-version.js +1 -1
- package/dist-es/skeletons.css-mistica.js +1 -1
- package/dist-es/skeletons.js +64 -53
- package/dist-es/style.css +1 -1
- package/dist-es/theme-context-provider.js +1 -1
- package/package.json +1 -1
package/dist-es/carousel.js
CHANGED
|
@@ -108,409 +108,427 @@ function _unsupportedIterableToArray(o, minLen) {
|
|
|
108
108
|
if (n === "Map" || n === "Set") return Array.from(n);
|
|
109
109
|
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
110
110
|
}
|
|
111
|
-
import * as
|
|
112
|
-
import
|
|
113
|
-
import
|
|
114
|
-
import { useScreenSize as
|
|
115
|
-
import
|
|
116
|
-
import
|
|
117
|
-
import { BaseTouchable as
|
|
118
|
-
import
|
|
119
|
-
import { useIsInverseVariant as
|
|
120
|
-
import { DisableBorderRadiusProvider as
|
|
121
|
-
import { listenResize as
|
|
122
|
-
import { isAndroid as
|
|
123
|
-
import { useDocumentVisibility as
|
|
124
|
-
import { slideshowContainer as
|
|
125
|
-
import { assignInlineVars as
|
|
126
|
-
import { sprinkles as
|
|
127
|
-
import {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var
|
|
134
|
-
|
|
135
|
-
|
|
111
|
+
import * as u from "react";
|
|
112
|
+
import Z from "./generated/mistica-icons/icon-chevron-left-regular.js";
|
|
113
|
+
import ee from "./generated/mistica-icons/icon-chevron-right-regular.js";
|
|
114
|
+
import { useScreenSize as te, useTheme as oe, useIsInViewport as ge, useIsomorphicLayoutEffect as ve } from "./hooks.js";
|
|
115
|
+
import be from "./inline.js";
|
|
116
|
+
import Ie from "./stack.js";
|
|
117
|
+
import { BaseTouchable as B } from "./touchable.js";
|
|
118
|
+
import K from "classnames";
|
|
119
|
+
import { useIsInverseVariant as xe, ThemeVariant as R } from "./theme-variant-context.js";
|
|
120
|
+
import { DisableBorderRadiusProvider as Pe } from "./image.js";
|
|
121
|
+
import { listenResize as se, getPrefixedDataAttributes as we } from "./utils/dom.js";
|
|
122
|
+
import { isAndroid as re } from "./utils/platform.js";
|
|
123
|
+
import { useDocumentVisibility as Se } from "./utils/document-visibility.js";
|
|
124
|
+
import { slideshowContainer as ke, slideshowPrevArrowButton as Le, slideshow as Ne, slideshowItem as Ae, slideshowNextArrowButton as Ce, slideshowBullets as Me, bulletActiveInverse as Re, bulletInverse as Be, bulletActive as Ee, bullet as ye, carouselContainer as Te, carouselPrevArrowButton as We, carousel as De, centeredCarousel as Ve, carouselWithScroll as Oe, vars as L, carouselItem as ze, carouselNextArrowButton as je, carouselBullets as _e } from "./carousel.css-mistica.js";
|
|
125
|
+
import { assignInlineVars as Fe } from "@vanilla-extract/dynamic";
|
|
126
|
+
import { sprinkles as Ue } from "./sprinkles.css-mistica.js";
|
|
127
|
+
import { useDesktopContainerType as $e } from "./desktop-container-type-context.js";
|
|
128
|
+
import { jsx as r, jsxs as G } from "./_virtual/jsx-runtime.js";
|
|
129
|
+
var le = function(e, s) {
|
|
130
|
+
var t = Se();
|
|
131
|
+
return ge(s, !1) && t && !!e;
|
|
132
|
+
}, ne = function(param) {
|
|
133
|
+
var e = param.currentIndex, s = param.numPages, t = param.onPress;
|
|
134
|
+
var o = xe(), ref = te(), d = ref.isDesktopOrBigger, p = function(v) {
|
|
135
|
+
var n = v === e;
|
|
136
|
+
return o ? n ? Re : Be : n ? Ee : ye;
|
|
136
137
|
};
|
|
137
|
-
return /* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ r(be, {
|
|
138
139
|
space: d ? 16 : 8,
|
|
139
140
|
alignItems: "center",
|
|
140
141
|
dataAttributes: {
|
|
141
142
|
"component-name": "PageBullets"
|
|
142
143
|
},
|
|
143
144
|
children: Array.from({
|
|
144
|
-
length:
|
|
145
|
-
}, function(
|
|
146
|
-
return /* @__PURE__ */
|
|
147
|
-
className:
|
|
145
|
+
length: s
|
|
146
|
+
}, function(v, n) {
|
|
147
|
+
return /* @__PURE__ */ r(B, {
|
|
148
|
+
className: Ue({
|
|
148
149
|
display: "block",
|
|
149
150
|
padding: 0,
|
|
150
151
|
border: "none",
|
|
151
152
|
background: "transparent"
|
|
152
153
|
}),
|
|
153
154
|
maybe: !0,
|
|
154
|
-
onPress: d &&
|
|
155
|
-
return
|
|
155
|
+
onPress: d && t ? function() {
|
|
156
|
+
return t(n);
|
|
156
157
|
} : void 0,
|
|
157
|
-
children: /* @__PURE__ */
|
|
158
|
-
className:
|
|
158
|
+
children: /* @__PURE__ */ r("div", {
|
|
159
|
+
className: p(n)
|
|
159
160
|
})
|
|
160
161
|
}, n);
|
|
161
162
|
})
|
|
162
163
|
});
|
|
163
|
-
},
|
|
164
|
-
|
|
164
|
+
}, Q = function(e, s, t) {
|
|
165
|
+
return t ? typeof t == "number" ? t : t[e] || s[e] : s[e];
|
|
166
|
+
}, qe = function(e, s) {
|
|
167
|
+
var t = {
|
|
165
168
|
mobile: 1,
|
|
166
|
-
|
|
169
|
+
tablet: 2,
|
|
170
|
+
desktop: {
|
|
171
|
+
small: 1,
|
|
172
|
+
medium: 2,
|
|
173
|
+
large: 3
|
|
174
|
+
}
|
|
175
|
+
};
|
|
176
|
+
if (!s) return _objectSpreadProps(_objectSpread({}, t), {
|
|
177
|
+
desktop: Q(e, t.desktop)
|
|
178
|
+
});
|
|
179
|
+
if (typeof s == "number") return {
|
|
180
|
+
mobile: s,
|
|
181
|
+
tablet: s,
|
|
182
|
+
desktop: s
|
|
167
183
|
};
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
desktop:
|
|
171
|
-
}
|
|
172
|
-
},
|
|
184
|
+
var o = Q(e, t.desktop, s.desktop);
|
|
185
|
+
return _objectSpreadProps(_objectSpread({}, t, s), {
|
|
186
|
+
desktop: o
|
|
187
|
+
});
|
|
188
|
+
}, Ye = function(e) {
|
|
173
189
|
return typeof e == "number" || e === void 0 ? {
|
|
174
190
|
next: e,
|
|
175
191
|
prev: e
|
|
176
192
|
} : e;
|
|
177
|
-
},
|
|
193
|
+
}, X = function(e, s) {
|
|
178
194
|
if (e.length === 0) return [];
|
|
179
|
-
var
|
|
180
|
-
for(var d = 0; d < e.length; d +=
|
|
181
|
-
return
|
|
182
|
-
},
|
|
183
|
-
var
|
|
184
|
-
for(var
|
|
185
|
-
for(var
|
|
195
|
+
var t = Math.ceil(e.length / s), o = [];
|
|
196
|
+
for(var d = 0; d < e.length; d += t)o.push(e[d]);
|
|
197
|
+
return o[o.length - 1] = e[e.length - t], o;
|
|
198
|
+
}, Ge = function(e, s) {
|
|
199
|
+
var t = [];
|
|
200
|
+
for(var o = 0; o < s.length; o++)o === 0 ? t.push(s[0]) : t.push((s[o] + s[o - 1]) / 2);
|
|
201
|
+
for(var o1 = t.length - 1; o1 >= 0; o1--)if (e - t[o1] >= -1) return o1;
|
|
186
202
|
return 0;
|
|
187
|
-
},
|
|
188
|
-
var e = param.items,
|
|
189
|
-
var ref =
|
|
203
|
+
}, ce = 5e3, ie = function(param) {
|
|
204
|
+
var e = param.items, s = param.itemStyle, t = param.itemClassName, o = param.withBullets, d = param.renderBullets, p = param.initialActiveItem, v = param.itemsPerPage, n = param.itemsToScroll, E = param.mobilePageOffset, x = param.gap, _ = param.free, N = param.centered, m = param.autoplay, A = param.onPageChange, F = param.dataAttributes;
|
|
205
|
+
var ref = oe(), S = ref.texts, y = ref.platformOverrides, c = $e(), i = qe(c || "large", v), ref1 = te(), P = ref1.isDesktopOrBigger, k = ref1.isMobile, U = k ? i.mobile : i.tablet, g = Math.max(Math.floor(P ? i.desktop : U), 1), b = Ye(E), I = u.useRef(null), w = Math.ceil(e.length / g), ref2 = _slicedToArray(u.useState({
|
|
190
206
|
scrollLeft: 0,
|
|
191
207
|
scrollRight: 0
|
|
192
|
-
}), 2), ref3 = ref2[0],
|
|
193
|
-
return
|
|
208
|
+
}), 2), ref3 = ref2[0], H = ref3.scrollLeft, $ = ref3.scrollRight, ae = ref2[1], ref4 = _slicedToArray(u.useState([]), 2), q = ref4[0], ue = ref4[1], T = u.useMemo(function() {
|
|
209
|
+
return X(q, w);
|
|
194
210
|
}, [
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
]),
|
|
198
|
-
|
|
199
|
-
if (
|
|
200
|
-
var
|
|
201
|
-
var
|
|
202
|
-
|
|
211
|
+
q,
|
|
212
|
+
w
|
|
213
|
+
]), W = n ? X(q, Math.ceil(e.length / n)) : T, fe = $ !== 0, de = H !== 0;
|
|
214
|
+
ve(function() {
|
|
215
|
+
if (I.current) {
|
|
216
|
+
var l = I.current, a = function() {
|
|
217
|
+
var O = l.scrollWidth, M = l.clientWidth, z = Math.round(l.scrollLeft), j = Math.round(O - (z + M));
|
|
218
|
+
ae({
|
|
203
219
|
scrollLeft: z,
|
|
204
|
-
scrollRight:
|
|
220
|
+
scrollRight: j
|
|
205
221
|
});
|
|
206
222
|
}, f = function() {
|
|
207
|
-
var
|
|
208
|
-
|
|
209
|
-
if (z === e.length - 1) return
|
|
210
|
-
var
|
|
211
|
-
return Math.min(
|
|
223
|
+
var O = l.scrollWidth - l.clientWidth;
|
|
224
|
+
ue(Array.from(l.querySelectorAll("[data-item]")).map(function(M, z) {
|
|
225
|
+
if (z === e.length - 1) return O;
|
|
226
|
+
var j = M.offsetLeft, me = parseInt(getComputedStyle(M).scrollMargin), pe = N && !P ? j - M.clientWidth / 2 : j;
|
|
227
|
+
return Math.min(pe - me - l.offsetLeft, O);
|
|
212
228
|
}));
|
|
213
229
|
};
|
|
214
|
-
|
|
215
|
-
var
|
|
216
|
-
|
|
230
|
+
a(), f(), l.addEventListener("scroll", a);
|
|
231
|
+
var h = se(l, function() {
|
|
232
|
+
a(), f();
|
|
217
233
|
});
|
|
218
234
|
return function() {
|
|
219
|
-
|
|
235
|
+
l.removeEventListener("scroll", a), h();
|
|
220
236
|
};
|
|
221
237
|
}
|
|
222
238
|
return function() {};
|
|
223
239
|
}, [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
L,
|
|
240
|
+
i.desktop,
|
|
241
|
+
i.tablet,
|
|
242
|
+
i.mobile,
|
|
243
|
+
b.next,
|
|
244
|
+
b.prev,
|
|
245
|
+
w,
|
|
231
246
|
x,
|
|
247
|
+
N,
|
|
248
|
+
P,
|
|
232
249
|
e.length
|
|
233
250
|
]);
|
|
234
|
-
var
|
|
235
|
-
var
|
|
236
|
-
var f =
|
|
251
|
+
var D = u.useCallback(function(l) {
|
|
252
|
+
var a = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !0;
|
|
253
|
+
var f = I.current;
|
|
237
254
|
if (f) {
|
|
238
|
-
var
|
|
255
|
+
var h = T[l];
|
|
239
256
|
f.scrollTo({
|
|
240
|
-
left:
|
|
241
|
-
behavior:
|
|
257
|
+
left: h,
|
|
258
|
+
behavior: a ? "smooth" : "auto"
|
|
242
259
|
});
|
|
243
260
|
}
|
|
244
261
|
}, [
|
|
245
|
-
|
|
246
|
-
]),
|
|
247
|
-
var
|
|
248
|
-
if (
|
|
249
|
-
var
|
|
250
|
-
return
|
|
262
|
+
T
|
|
263
|
+
]), he = u.useCallback(function() {
|
|
264
|
+
var l = I.current;
|
|
265
|
+
if (l) {
|
|
266
|
+
var a = l.scrollLeft, f = _toConsumableArray(W).reverse().find(function(h) {
|
|
267
|
+
return h - a < -1;
|
|
251
268
|
});
|
|
252
|
-
|
|
269
|
+
l.scrollTo({
|
|
253
270
|
left: f,
|
|
254
271
|
behavior: "smooth"
|
|
255
272
|
});
|
|
256
273
|
}
|
|
257
274
|
}, [
|
|
258
|
-
|
|
259
|
-
]),
|
|
260
|
-
var
|
|
261
|
-
if (
|
|
262
|
-
var
|
|
263
|
-
return
|
|
275
|
+
W
|
|
276
|
+
]), Y = u.useCallback(function() {
|
|
277
|
+
var l = I.current;
|
|
278
|
+
if (l) {
|
|
279
|
+
var a = l.scrollLeft, f = W.find(function(h) {
|
|
280
|
+
return h - a > 1;
|
|
264
281
|
});
|
|
265
|
-
|
|
282
|
+
l.scrollTo({
|
|
266
283
|
left: f,
|
|
267
284
|
behavior: "smooth"
|
|
268
285
|
});
|
|
269
286
|
}
|
|
270
287
|
}, [
|
|
271
|
-
|
|
272
|
-
]),
|
|
273
|
-
|
|
274
|
-
|
|
288
|
+
W
|
|
289
|
+
]), J = le(!!m, I);
|
|
290
|
+
u.useEffect(function() {
|
|
291
|
+
p !== void 0 && D(Math.floor(p / g), !1);
|
|
275
292
|
}, [
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
]),
|
|
280
|
-
if (
|
|
281
|
-
var
|
|
282
|
-
var
|
|
283
|
-
|
|
293
|
+
p,
|
|
294
|
+
D,
|
|
295
|
+
g
|
|
296
|
+
]), u.useEffect(function() {
|
|
297
|
+
if (J && m) {
|
|
298
|
+
var l = typeof m == "boolean" ? ce : m.time, a = typeof m == "object" && m.loop, f = setInterval(function() {
|
|
299
|
+
var h;
|
|
300
|
+
$ !== 0 ? Y() : a && ((h = I.current) == null || h.scrollTo({
|
|
284
301
|
left: 0,
|
|
285
302
|
behavior: "smooth"
|
|
286
303
|
}));
|
|
287
|
-
},
|
|
304
|
+
}, l);
|
|
288
305
|
return function() {
|
|
289
306
|
return clearInterval(f);
|
|
290
307
|
};
|
|
291
308
|
}
|
|
292
309
|
}, [
|
|
293
|
-
|
|
310
|
+
m,
|
|
311
|
+
Y,
|
|
294
312
|
$,
|
|
295
|
-
|
|
296
|
-
Y
|
|
313
|
+
J
|
|
297
314
|
]);
|
|
298
|
-
var
|
|
299
|
-
|
|
300
|
-
if (
|
|
301
|
-
var
|
|
302
|
-
for(var f = 0; f <
|
|
303
|
-
var
|
|
304
|
-
|
|
315
|
+
var C = Ge(H, T);
|
|
316
|
+
u.useEffect(function() {
|
|
317
|
+
if (A) {
|
|
318
|
+
var l = Math.min((C + 1) * g - 1, e.length - 1), a = [];
|
|
319
|
+
for(var f = 0; f < g; f++){
|
|
320
|
+
var h = l - f;
|
|
321
|
+
h >= 0 && a.unshift(h);
|
|
305
322
|
}
|
|
306
|
-
|
|
307
|
-
pageIndex:
|
|
308
|
-
shownItemIndexes:
|
|
323
|
+
A({
|
|
324
|
+
pageIndex: C,
|
|
325
|
+
shownItemIndexes: a
|
|
309
326
|
});
|
|
310
327
|
}
|
|
311
328
|
}, [
|
|
312
|
-
|
|
329
|
+
C,
|
|
313
330
|
e.length,
|
|
314
|
-
|
|
315
|
-
|
|
331
|
+
g,
|
|
332
|
+
A
|
|
316
333
|
]);
|
|
317
|
-
var
|
|
334
|
+
var V = null;
|
|
318
335
|
var _obj, _obj1;
|
|
319
|
-
return d ?
|
|
320
|
-
numPages:
|
|
321
|
-
currentIndex:
|
|
322
|
-
onPress:
|
|
323
|
-
}) :
|
|
324
|
-
numPages:
|
|
325
|
-
currentIndex:
|
|
326
|
-
onPress:
|
|
327
|
-
})), /* @__PURE__ */
|
|
336
|
+
return d ? V = d({
|
|
337
|
+
numPages: w,
|
|
338
|
+
currentIndex: C,
|
|
339
|
+
onPress: D
|
|
340
|
+
}) : o && (V = w > 1 && /* @__PURE__ */ r(ne, {
|
|
341
|
+
numPages: w,
|
|
342
|
+
currentIndex: C,
|
|
343
|
+
onPress: D
|
|
344
|
+
})), /* @__PURE__ */ G(Ie, {
|
|
328
345
|
space: 24,
|
|
329
346
|
dataAttributes: _objectSpread({
|
|
330
347
|
"component-name": "Carousel"
|
|
331
|
-
},
|
|
348
|
+
}, F),
|
|
332
349
|
children: [
|
|
333
|
-
/* @__PURE__ */
|
|
334
|
-
className:
|
|
350
|
+
/* @__PURE__ */ G("div", {
|
|
351
|
+
className: Te,
|
|
335
352
|
children: [
|
|
336
|
-
/* @__PURE__ */
|
|
353
|
+
/* @__PURE__ */ r(R, {
|
|
337
354
|
isInverse: !1,
|
|
338
|
-
children: /* @__PURE__ */
|
|
339
|
-
className:
|
|
340
|
-
"aria-label":
|
|
341
|
-
onPress:
|
|
342
|
-
disabled: !
|
|
343
|
-
children: /* @__PURE__ */
|
|
355
|
+
children: /* @__PURE__ */ r(B, {
|
|
356
|
+
className: We,
|
|
357
|
+
"aria-label": S.carouselPrevButton,
|
|
358
|
+
onPress: he,
|
|
359
|
+
disabled: !de,
|
|
360
|
+
children: /* @__PURE__ */ r(Z, {})
|
|
344
361
|
})
|
|
345
362
|
}),
|
|
346
|
-
/* @__PURE__ */
|
|
347
|
-
className:
|
|
348
|
-
style: _objectSpreadProps(_objectSpread({},
|
|
349
|
-
scrollSnapType:
|
|
363
|
+
/* @__PURE__ */ r("div", {
|
|
364
|
+
className: K(De, (_obj = {}, _defineProperty(_obj, Ve, N), _defineProperty(_obj, Oe, w > 1), _obj)),
|
|
365
|
+
style: _objectSpreadProps(_objectSpread({}, Fe(_objectSpread((_obj1 = {}, _defineProperty(_obj1, L.itemsPerPageDesktop, String(i.desktop)), _defineProperty(_obj1, L.itemsPerPageTablet, String(i.tablet)), _defineProperty(_obj1, L.itemsPerPageMobile, String(i.mobile)), _defineProperty(_obj1, L.mobilePageOffsetNext, b.next ? "".concat(b.next, "px") : ""), _defineProperty(_obj1, L.mobilePageOffsetPrev, b.prev ? "".concat(b.prev, "px") : ""), _obj1), x !== void 0 ? _defineProperty({}, L.gap, String(x)) : {}))), {
|
|
366
|
+
scrollSnapType: _ ? "initial" : "x mandatory"
|
|
350
367
|
}),
|
|
351
|
-
ref:
|
|
352
|
-
children: e.map(function(
|
|
353
|
-
return /* @__PURE__ */
|
|
354
|
-
className:
|
|
355
|
-
style: _objectSpreadProps(_objectSpread({},
|
|
356
|
-
scrollSnapStop:
|
|
368
|
+
ref: I,
|
|
369
|
+
children: e.map(function(l, a) {
|
|
370
|
+
return /* @__PURE__ */ r("div", {
|
|
371
|
+
className: K(ze, t),
|
|
372
|
+
style: _objectSpreadProps(_objectSpread({}, s), {
|
|
373
|
+
scrollSnapStop: re(y) ? "always" : "normal"
|
|
357
374
|
}),
|
|
358
375
|
"data-item": !0,
|
|
359
|
-
children:
|
|
360
|
-
},
|
|
376
|
+
children: l
|
|
377
|
+
}, a);
|
|
361
378
|
})
|
|
362
379
|
}),
|
|
363
|
-
/* @__PURE__ */
|
|
380
|
+
/* @__PURE__ */ r(R, {
|
|
364
381
|
isInverse: !1,
|
|
365
|
-
children: /* @__PURE__ */
|
|
366
|
-
className:
|
|
367
|
-
"aria-label":
|
|
368
|
-
onPress:
|
|
369
|
-
disabled: !
|
|
370
|
-
children: /* @__PURE__ */
|
|
382
|
+
children: /* @__PURE__ */ r(B, {
|
|
383
|
+
className: je,
|
|
384
|
+
"aria-label": S.carouselNextButton,
|
|
385
|
+
onPress: Y,
|
|
386
|
+
disabled: !fe,
|
|
387
|
+
children: /* @__PURE__ */ r(ee, {})
|
|
371
388
|
})
|
|
372
389
|
})
|
|
373
390
|
]
|
|
374
391
|
}),
|
|
375
|
-
|
|
376
|
-
className:
|
|
377
|
-
children:
|
|
392
|
+
V && /* @__PURE__ */ r("div", {
|
|
393
|
+
className: _e,
|
|
394
|
+
children: V
|
|
378
395
|
})
|
|
379
396
|
]
|
|
380
397
|
});
|
|
381
|
-
},
|
|
382
|
-
return /* @__PURE__ */
|
|
383
|
-
},
|
|
384
|
-
var e = param.items,
|
|
385
|
-
return /* @__PURE__ */
|
|
398
|
+
}, ft = function(e) {
|
|
399
|
+
return /* @__PURE__ */ r(ie, _objectSpread({}, e));
|
|
400
|
+
}, dt = function(param) {
|
|
401
|
+
var e = param.items, s = param.itemStyle, t = param.itemClassName, o = param.withBullets, d = param.renderBullets, p = param.initialActiveItem, v = param.onPageChange, n = param.dataAttributes;
|
|
402
|
+
return /* @__PURE__ */ r(ie, {
|
|
386
403
|
items: e,
|
|
387
|
-
itemStyle:
|
|
388
|
-
itemClassName:
|
|
404
|
+
itemStyle: s,
|
|
405
|
+
itemClassName: t,
|
|
389
406
|
itemsPerPage: {
|
|
390
407
|
mobile: 1,
|
|
408
|
+
tablet: 1,
|
|
391
409
|
desktop: 3
|
|
392
410
|
},
|
|
393
411
|
centered: !0,
|
|
394
412
|
itemsToScroll: 1,
|
|
395
413
|
mobilePageOffset: 0,
|
|
396
414
|
gap: 0,
|
|
397
|
-
withBullets:
|
|
415
|
+
withBullets: o,
|
|
398
416
|
renderBullets: d,
|
|
399
|
-
initialActiveItem:
|
|
400
|
-
onPageChange:
|
|
417
|
+
initialActiveItem: p,
|
|
418
|
+
onPageChange: v,
|
|
401
419
|
dataAttributes: n
|
|
402
420
|
});
|
|
403
|
-
},
|
|
404
|
-
var e = param.items,
|
|
405
|
-
var ref =
|
|
421
|
+
}, ht = function(param) {
|
|
422
|
+
var e = param.items, s = param.withBullets, t = param.autoplay, o = param.onPageChange, d = param.dataAttributes;
|
|
423
|
+
var ref = oe(), p = ref.texts, v = ref.platformOverrides, n = u.useRef(null), ref1 = _slicedToArray(u.useState({
|
|
406
424
|
scrollLeft: 0,
|
|
407
425
|
scrollRight: 0
|
|
408
|
-
}), 2), ref2 = ref1[0],
|
|
409
|
-
var
|
|
410
|
-
|
|
411
|
-
left: -
|
|
426
|
+
}), 2), ref2 = ref1[0], E = ref2.scrollLeft, x = ref2.scrollRight, _ = ref1[1], N = u.useCallback(function() {
|
|
427
|
+
var c = n.current;
|
|
428
|
+
c && c.scrollBy({
|
|
429
|
+
left: -c.clientWidth,
|
|
412
430
|
behavior: "smooth"
|
|
413
431
|
});
|
|
414
|
-
}, []),
|
|
415
|
-
var
|
|
416
|
-
|
|
417
|
-
left:
|
|
432
|
+
}, []), m = u.useCallback(function() {
|
|
433
|
+
var c = n.current;
|
|
434
|
+
c && c.scrollBy({
|
|
435
|
+
left: c.clientWidth,
|
|
418
436
|
behavior: "smooth"
|
|
419
437
|
});
|
|
420
|
-
}, []),
|
|
421
|
-
|
|
422
|
-
var
|
|
423
|
-
if (
|
|
424
|
-
var
|
|
425
|
-
var
|
|
426
|
-
|
|
427
|
-
scrollLeft:
|
|
428
|
-
scrollRight:
|
|
438
|
+
}, []), A = x !== 0, F = E !== 0, S = n.current ? Math.floor((E + n.current.clientWidth / 2) / n.current.clientWidth) : 0;
|
|
439
|
+
u.useLayoutEffect(function() {
|
|
440
|
+
var c = n.current;
|
|
441
|
+
if (c) {
|
|
442
|
+
var i = function() {
|
|
443
|
+
var k = c.scrollWidth, U = c.clientWidth, g = Math.round(c.scrollLeft), b = Math.round(k - (g + U));
|
|
444
|
+
_({
|
|
445
|
+
scrollLeft: g,
|
|
446
|
+
scrollRight: b
|
|
429
447
|
});
|
|
430
448
|
};
|
|
431
|
-
|
|
432
|
-
var
|
|
449
|
+
i(), c.addEventListener("scroll", i);
|
|
450
|
+
var P = se(c, i);
|
|
433
451
|
return function() {
|
|
434
|
-
|
|
452
|
+
c.removeEventListener("scroll", i), P();
|
|
435
453
|
};
|
|
436
454
|
}
|
|
437
455
|
}, [
|
|
438
456
|
e.length
|
|
439
457
|
]);
|
|
440
|
-
var
|
|
441
|
-
return
|
|
442
|
-
if (
|
|
443
|
-
var
|
|
444
|
-
var
|
|
445
|
-
|
|
458
|
+
var y = le(!!t, n);
|
|
459
|
+
return u.useEffect(function() {
|
|
460
|
+
if (y && t) {
|
|
461
|
+
var c = typeof t == "boolean" ? ce : t.time, i = typeof t == "object" && t.loop, P = setInterval(function() {
|
|
462
|
+
var k;
|
|
463
|
+
x !== 0 ? m() : i && ((k = n.current) == null || k.scrollTo({
|
|
446
464
|
left: 0,
|
|
447
465
|
behavior: "smooth"
|
|
448
466
|
}));
|
|
449
|
-
},
|
|
467
|
+
}, c);
|
|
450
468
|
return function() {
|
|
451
|
-
return clearInterval(
|
|
469
|
+
return clearInterval(P);
|
|
452
470
|
};
|
|
453
471
|
}
|
|
454
472
|
}, [
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
]),
|
|
460
|
-
|
|
473
|
+
t,
|
|
474
|
+
m,
|
|
475
|
+
x,
|
|
476
|
+
y
|
|
477
|
+
]), u.useEffect(function() {
|
|
478
|
+
o && o(S);
|
|
461
479
|
}, [
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
]), /* @__PURE__ */
|
|
465
|
-
className:
|
|
466
|
-
},
|
|
480
|
+
S,
|
|
481
|
+
o
|
|
482
|
+
]), /* @__PURE__ */ G("div", _objectSpreadProps(_objectSpread({
|
|
483
|
+
className: ke
|
|
484
|
+
}, we(d, "SlideShow")), {
|
|
467
485
|
children: [
|
|
468
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ r(R, {
|
|
469
487
|
isInverse: !1,
|
|
470
|
-
children: /* @__PURE__ */
|
|
471
|
-
className:
|
|
472
|
-
"aria-label":
|
|
473
|
-
onPress:
|
|
474
|
-
disabled: !
|
|
475
|
-
children: /* @__PURE__ */
|
|
488
|
+
children: /* @__PURE__ */ r(B, {
|
|
489
|
+
className: Le,
|
|
490
|
+
"aria-label": p.carouselPrevButton,
|
|
491
|
+
onPress: N,
|
|
492
|
+
disabled: !F,
|
|
493
|
+
children: /* @__PURE__ */ r(Z, {})
|
|
476
494
|
})
|
|
477
495
|
}),
|
|
478
|
-
/* @__PURE__ */
|
|
479
|
-
children: /* @__PURE__ */
|
|
480
|
-
className:
|
|
496
|
+
/* @__PURE__ */ r(Pe, {
|
|
497
|
+
children: /* @__PURE__ */ r("div", {
|
|
498
|
+
className: Ne,
|
|
481
499
|
ref: n,
|
|
482
|
-
children: e.map(function(
|
|
483
|
-
return /* @__PURE__ */
|
|
484
|
-
className:
|
|
500
|
+
children: e.map(function(c, i) {
|
|
501
|
+
return /* @__PURE__ */ r("div", {
|
|
502
|
+
className: Ae,
|
|
485
503
|
style: {
|
|
486
|
-
scrollSnapStop:
|
|
504
|
+
scrollSnapStop: re(v) ? "always" : "normal"
|
|
487
505
|
},
|
|
488
|
-
children:
|
|
489
|
-
},
|
|
506
|
+
children: c
|
|
507
|
+
}, i);
|
|
490
508
|
})
|
|
491
509
|
})
|
|
492
510
|
}),
|
|
493
|
-
/* @__PURE__ */
|
|
511
|
+
/* @__PURE__ */ r(R, {
|
|
494
512
|
isInverse: !1,
|
|
495
|
-
children: /* @__PURE__ */
|
|
496
|
-
className:
|
|
497
|
-
"aria-label":
|
|
498
|
-
onPress:
|
|
499
|
-
disabled: !
|
|
500
|
-
children: /* @__PURE__ */
|
|
513
|
+
children: /* @__PURE__ */ r(B, {
|
|
514
|
+
className: Ce,
|
|
515
|
+
"aria-label": p.carouselNextButton,
|
|
516
|
+
onPress: m,
|
|
517
|
+
disabled: !A,
|
|
518
|
+
children: /* @__PURE__ */ r(ee, {})
|
|
501
519
|
})
|
|
502
520
|
}),
|
|
503
|
-
|
|
521
|
+
s && e.length > 1 && /* @__PURE__ */ r(R, {
|
|
504
522
|
isInverse: !0,
|
|
505
|
-
children: /* @__PURE__ */
|
|
506
|
-
className:
|
|
507
|
-
children: /* @__PURE__ */
|
|
523
|
+
children: /* @__PURE__ */ r("div", {
|
|
524
|
+
className: Me,
|
|
525
|
+
children: /* @__PURE__ */ r(ne, {
|
|
508
526
|
numPages: e.length,
|
|
509
|
-
currentIndex:
|
|
527
|
+
currentIndex: S
|
|
510
528
|
})
|
|
511
529
|
})
|
|
512
530
|
})
|
|
513
531
|
]
|
|
514
532
|
}));
|
|
515
533
|
};
|
|
516
|
-
export {
|
|
534
|
+
export { ft as Carousel, dt as CenteredCarousel, ne as PageBullets, ht as Slideshow };
|