@xaui/native 0.0.26 → 0.0.28
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/LICENSE +21 -0
- package/README.md +105 -228
- package/dist/alert/index.cjs +92 -166
- package/dist/alert/index.js +2 -1
- package/dist/app-bar/index.cjs +24 -98
- package/dist/app-bar/index.js +2 -1
- package/dist/autocomplete/index.cjs +192 -281
- package/dist/autocomplete/index.js +36 -48
- package/dist/avatar/index.cjs +59 -133
- package/dist/avatar/index.js +2 -1
- package/dist/badge/index.cjs +26 -99
- package/dist/badge/index.js +2 -1
- package/dist/bottom-sheet/index.cjs +5 -456
- package/dist/bottom-sheet/index.js +4 -363
- package/dist/bottom-tab-bar/index.cjs +93 -167
- package/dist/bottom-tab-bar/index.js +2 -2
- package/dist/button/index.cjs +73 -525
- package/dist/button/index.js +3 -2
- package/dist/card/index.cjs +76 -169
- package/dist/card/index.js +2 -2
- package/dist/carousel/index.cjs +68 -145
- package/dist/carousel/index.js +1 -1
- package/dist/chart/index.cjs +132 -173
- package/dist/checkbox/index.cjs +70 -143
- package/dist/checkbox/index.js +2 -1
- package/dist/chip/index.cjs +89 -164
- package/dist/chip/index.js +2 -1
- package/dist/chunk-BD72HIPR.cjs +75 -0
- package/dist/chunk-DHSTKO3K.cjs +19 -0
- package/dist/{chunk-CZFDZPAS.js → chunk-DXXNBF5P.js} +5 -0
- package/dist/{chunk-UI5L26KD.js → chunk-F7WH4DMG.js} +1 -1
- package/dist/chunk-GBHQCAKW.js +19 -0
- package/dist/chunk-HC2SSHNU.js +368 -0
- package/dist/chunk-HSPTLUFA.cjs +7 -0
- package/dist/chunk-JEGEPGVU.js +287 -0
- package/dist/chunk-KTLGDLCB.cjs +287 -0
- package/dist/{chunk-GHCVNQET.js → chunk-LTKYHG5V.js} +5 -12
- package/dist/{chunk-ULJSCNPE.js → chunk-LUBWRVI2.js} +1 -1
- package/dist/chunk-OQ2BLOOG.cjs +138 -0
- package/dist/chunk-QMYWIWSX.cjs +384 -0
- package/dist/chunk-XFPPR2VB.cjs +368 -0
- package/dist/core/index.cjs +22 -168
- package/dist/core/index.d.cts +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +5 -3
- package/dist/datepicker/index.cjs +239 -320
- package/dist/datepicker/index.js +2 -1
- package/dist/divider/index.cjs +5 -145
- package/dist/divider/index.js +3 -2
- package/dist/drawer/index.cjs +39 -112
- package/dist/drawer/index.js +2 -1
- package/dist/expansion-panel/index.cjs +91 -230
- package/dist/expansion-panel/index.js +3 -2
- package/dist/fab/index.cjs +6 -722
- package/dist/fab/index.js +4 -3
- package/dist/fab-menu/index.cjs +81 -814
- package/dist/fab-menu/index.js +4 -3
- package/dist/feature-discovery/index.cjs +72 -139
- package/dist/feature-discovery/index.js +2 -2
- package/dist/index.cjs +1 -18
- package/dist/indicator/index.cjs +5 -445
- package/dist/indicator/index.js +3 -2
- package/dist/input/index.cjs +214 -282
- package/dist/input/index.js +2 -2
- package/dist/list/index.cjs +71 -146
- package/dist/list/index.js +2 -1
- package/dist/menu/index.cjs +59 -127
- package/dist/menu/index.js +2 -2
- package/dist/menubox/index.cjs +60 -132
- package/dist/menubox/index.js +2 -1
- package/dist/pager/index.cjs +42 -80
- package/dist/progress/index.cjs +43 -114
- package/dist/progress/index.js +2 -1
- package/dist/radio/index.cjs +82 -154
- package/dist/radio/index.js +2 -1
- package/dist/segment-button/index.cjs +60 -147
- package/dist/segment-button/index.js +2 -2
- package/dist/select/index.cjs +149 -224
- package/dist/select/index.js +10 -22
- package/dist/skeleton/index.cjs +23 -94
- package/dist/skeleton/index.js +2 -2
- package/dist/slider/index.cjs +77 -156
- package/dist/slider/index.js +2 -1
- package/dist/snackbar/index.cjs +420 -0
- package/dist/snackbar/index.d.cts +175 -0
- package/dist/snackbar/index.d.ts +175 -0
- package/dist/snackbar/index.js +420 -0
- package/dist/stepper/index.cjs +121 -195
- package/dist/stepper/index.js +2 -1
- package/dist/switch/index.cjs +48 -121
- package/dist/switch/index.js +2 -1
- package/dist/tabs/index.cjs +67 -151
- package/dist/tabs/index.js +2 -1
- package/dist/timepicker/index.cjs +135 -593
- package/dist/timepicker/index.js +24 -383
- package/dist/toolbar/index.cjs +59 -128
- package/dist/toolbar/index.js +2 -1
- package/dist/typography/index.cjs +37 -92
- package/dist/typography/index.d.cts +1 -1
- package/dist/typography/index.d.ts +1 -1
- package/dist/typography/index.js +20 -1
- package/dist/view/index.cjs +178 -223
- package/package.json +7 -1
- package/dist/chunk-3XSXTM3G.js +0 -661
- package/dist/chunk-4KSZLONZ.js +0 -79
- package/dist/chunk-I4V5Y5GD.js +0 -76
- package/dist/chunk-URBEEDFX.js +0 -79
package/dist/carousel/index.cjs
CHANGED
|
@@ -1,47 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
29
2
|
|
|
30
|
-
|
|
31
|
-
var carousel_exports = {};
|
|
32
|
-
__export(carousel_exports, {
|
|
33
|
-
Carousel: () => Carousel
|
|
34
|
-
});
|
|
35
|
-
module.exports = __toCommonJS(carousel_exports);
|
|
3
|
+
var _chunkOQ2BLOOGcjs = require('../chunk-OQ2BLOOG.cjs');
|
|
36
4
|
|
|
37
5
|
// src/components/carousel/carousel.tsx
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
-
|
|
6
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
7
|
+
var _reactnative = require('react-native');
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
var _reactnativereanimated = require('react-native-reanimated'); var _reactnativereanimated2 = _interopRequireDefault(_reactnativereanimated);
|
|
41
13
|
|
|
42
14
|
// src/components/carousel/carousel.style.ts
|
|
43
|
-
|
|
44
|
-
var styles =
|
|
15
|
+
|
|
16
|
+
var styles = _reactnative.StyleSheet.create({
|
|
45
17
|
scrollContent: {
|
|
46
18
|
flexDirection: "row",
|
|
47
19
|
alignItems: "center"
|
|
@@ -70,7 +42,7 @@ var styles = import_react_native.StyleSheet.create({
|
|
|
70
42
|
});
|
|
71
43
|
|
|
72
44
|
// src/components/carousel/carousel.hook.ts
|
|
73
|
-
|
|
45
|
+
|
|
74
46
|
var HERO_PEEK_WIDTH = 56;
|
|
75
47
|
function computeMultiBrowseLayout(config) {
|
|
76
48
|
const { preferredItemWidth, itemSpacing } = config;
|
|
@@ -107,14 +79,14 @@ function computeFullScreenLayout(config) {
|
|
|
107
79
|
};
|
|
108
80
|
}
|
|
109
81
|
function useCarouselLayout(config) {
|
|
110
|
-
return (0,
|
|
82
|
+
return _react.useMemo.call(void 0, () => {
|
|
111
83
|
const layoutMap = {
|
|
112
84
|
"multi-browse": computeMultiBrowseLayout,
|
|
113
85
|
uncontained: computeUncontainedLayout,
|
|
114
86
|
hero: computeHeroLayout,
|
|
115
87
|
"full-screen": computeFullScreenLayout
|
|
116
88
|
};
|
|
117
|
-
const compute = layoutMap[config.layout]
|
|
89
|
+
const compute = _nullishCoalesce(layoutMap[config.layout], () => ( computeMultiBrowseLayout));
|
|
118
90
|
return compute(config);
|
|
119
91
|
}, [
|
|
120
92
|
config.layout,
|
|
@@ -126,8 +98,8 @@ function useCarouselLayout(config) {
|
|
|
126
98
|
}
|
|
127
99
|
|
|
128
100
|
// src/components/carousel/carousel-item.tsx
|
|
129
|
-
|
|
130
|
-
|
|
101
|
+
|
|
102
|
+
|
|
131
103
|
var CarouselItem = ({
|
|
132
104
|
children,
|
|
133
105
|
width,
|
|
@@ -136,8 +108,8 @@ var CarouselItem = ({
|
|
|
136
108
|
spacing,
|
|
137
109
|
isLast,
|
|
138
110
|
customStyle
|
|
139
|
-
}) => /* @__PURE__ */
|
|
140
|
-
|
|
111
|
+
}) => /* @__PURE__ */ _react2.default.createElement(
|
|
112
|
+
_reactnative.View,
|
|
141
113
|
{
|
|
142
114
|
style: [
|
|
143
115
|
styles.item,
|
|
@@ -154,8 +126,12 @@ var CarouselItem = ({
|
|
|
154
126
|
);
|
|
155
127
|
|
|
156
128
|
// src/components/carousel/animated-carousel-item.tsx
|
|
157
|
-
|
|
158
|
-
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
159
135
|
var AnimatedCarouselItem = ({
|
|
160
136
|
children,
|
|
161
137
|
index,
|
|
@@ -171,24 +147,24 @@ var AnimatedCarouselItem = ({
|
|
|
171
147
|
containerWidth,
|
|
172
148
|
contentPadding
|
|
173
149
|
}) => {
|
|
174
|
-
const animatedStyle = (0,
|
|
150
|
+
const animatedStyle = _reactnativereanimated.useAnimatedStyle.call(void 0, () => {
|
|
175
151
|
const inputRange = [
|
|
176
152
|
(index - 1) * snapInterval,
|
|
177
153
|
index * snapInterval,
|
|
178
154
|
(index + 1) * snapInterval
|
|
179
155
|
];
|
|
180
156
|
if (layout === "multi-browse") {
|
|
181
|
-
const scale = (0,
|
|
157
|
+
const scale = _reactnativereanimated.interpolate.call(void 0,
|
|
182
158
|
scrollX.value,
|
|
183
159
|
inputRange,
|
|
184
160
|
[0.85, 1, 0.85],
|
|
185
|
-
|
|
161
|
+
_reactnativereanimated.Extrapolation.CLAMP
|
|
186
162
|
);
|
|
187
|
-
const opacity = (0,
|
|
163
|
+
const opacity = _reactnativereanimated.interpolate.call(void 0,
|
|
188
164
|
scrollX.value,
|
|
189
165
|
inputRange,
|
|
190
166
|
[0.6, 1, 0.6],
|
|
191
|
-
|
|
167
|
+
_reactnativereanimated.Extrapolation.CLAMP
|
|
192
168
|
);
|
|
193
169
|
return {
|
|
194
170
|
transform: [{ scale }],
|
|
@@ -203,23 +179,23 @@ var AnimatedCarouselItem = ({
|
|
|
203
179
|
itemPosition - centerOffset,
|
|
204
180
|
itemPosition - centerOffset + snapInterval
|
|
205
181
|
];
|
|
206
|
-
const scale = (0,
|
|
182
|
+
const scale = _reactnativereanimated.interpolate.call(void 0,
|
|
207
183
|
scrollX.value,
|
|
208
184
|
inputRangeHero,
|
|
209
185
|
[0.9, 1, 0.9],
|
|
210
|
-
|
|
186
|
+
_reactnativereanimated.Extrapolation.CLAMP
|
|
211
187
|
);
|
|
212
|
-
const opacity = (0,
|
|
188
|
+
const opacity = _reactnativereanimated.interpolate.call(void 0,
|
|
213
189
|
scrollX.value,
|
|
214
190
|
inputRangeHero,
|
|
215
191
|
[0.5, 1, 0.5],
|
|
216
|
-
|
|
192
|
+
_reactnativereanimated.Extrapolation.CLAMP
|
|
217
193
|
);
|
|
218
|
-
const translateX = (0,
|
|
194
|
+
const translateX = _reactnativereanimated.interpolate.call(void 0,
|
|
219
195
|
scrollX.value,
|
|
220
196
|
inputRangeHero,
|
|
221
197
|
[-10, 0, 10],
|
|
222
|
-
|
|
198
|
+
_reactnativereanimated.Extrapolation.CLAMP
|
|
223
199
|
);
|
|
224
200
|
return {
|
|
225
201
|
transform: [{ scale }, { translateX }],
|
|
@@ -228,8 +204,8 @@ var AnimatedCarouselItem = ({
|
|
|
228
204
|
}
|
|
229
205
|
return {};
|
|
230
206
|
}, [index, snapInterval, layout, containerWidth, contentPadding, width]);
|
|
231
|
-
return /* @__PURE__ */
|
|
232
|
-
|
|
207
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
208
|
+
_reactnativereanimated2.default.View,
|
|
233
209
|
{
|
|
234
210
|
style: [
|
|
235
211
|
styles.item,
|
|
@@ -247,58 +223,6 @@ var AnimatedCarouselItem = ({
|
|
|
247
223
|
);
|
|
248
224
|
};
|
|
249
225
|
|
|
250
|
-
// src/core/theme-hooks.ts
|
|
251
|
-
var import_react8 = require("react");
|
|
252
|
-
var import_react_native5 = require("react-native");
|
|
253
|
-
|
|
254
|
-
// src/core/theme-context.tsx
|
|
255
|
-
var import_react7 = __toESM(require("react"), 1);
|
|
256
|
-
var import_react_native4 = require("react-native");
|
|
257
|
-
var import_theme = require("@xaui/core/theme");
|
|
258
|
-
var import_palette = require("@xaui/core/palette");
|
|
259
|
-
|
|
260
|
-
// src/core/portal/portal.tsx
|
|
261
|
-
var import_react5 = require("react");
|
|
262
|
-
|
|
263
|
-
// src/core/portal/portal-context.ts
|
|
264
|
-
var import_react4 = require("react");
|
|
265
|
-
var PortalContext = (0, import_react4.createContext)(null);
|
|
266
|
-
|
|
267
|
-
// src/core/portal/portal-host.tsx
|
|
268
|
-
var import_react6 = __toESM(require("react"), 1);
|
|
269
|
-
var import_react_native3 = require("react-native");
|
|
270
|
-
var hostStyles = import_react_native3.StyleSheet.create({
|
|
271
|
-
container: {
|
|
272
|
-
flex: 1
|
|
273
|
-
}
|
|
274
|
-
});
|
|
275
|
-
|
|
276
|
-
// src/core/theme-context.tsx
|
|
277
|
-
var XUIThemeContext = (0, import_react7.createContext)(null);
|
|
278
|
-
|
|
279
|
-
// src/core/theme-hooks.ts
|
|
280
|
-
function useXUITheme() {
|
|
281
|
-
const theme = (0, import_react8.useContext)(XUIThemeContext);
|
|
282
|
-
if (!theme) {
|
|
283
|
-
throw new Error("useXUITheme must be used within XUIProvider");
|
|
284
|
-
}
|
|
285
|
-
return theme;
|
|
286
|
-
}
|
|
287
|
-
function useBorderRadiusStyles(radius) {
|
|
288
|
-
const theme = useXUITheme();
|
|
289
|
-
const borderRadius = (0, import_react8.useMemo)(() => {
|
|
290
|
-
const radiusMap = {
|
|
291
|
-
none: theme.borderRadius.none,
|
|
292
|
-
sm: theme.borderRadius.sm,
|
|
293
|
-
md: theme.borderRadius.md,
|
|
294
|
-
lg: theme.borderRadius.lg,
|
|
295
|
-
full: theme.borderRadius.full
|
|
296
|
-
};
|
|
297
|
-
return { borderRadius: radiusMap[radius] };
|
|
298
|
-
}, [radius, theme]);
|
|
299
|
-
return borderRadius;
|
|
300
|
-
}
|
|
301
|
-
|
|
302
226
|
// src/components/carousel/carousel.tsx
|
|
303
227
|
var DEFAULT_ITEM_WIDTH = 196;
|
|
304
228
|
var DEFAULT_ITEM_HEIGHT = 205;
|
|
@@ -323,15 +247,15 @@ function Carousel({
|
|
|
323
247
|
onActiveItemChange,
|
|
324
248
|
customAppearance
|
|
325
249
|
}) {
|
|
326
|
-
const [containerWidth, setContainerWidth] = (0,
|
|
327
|
-
const [activeIndex, setActiveIndex] = (0,
|
|
328
|
-
const scrollRef = (0,
|
|
329
|
-
const onActiveItemChangeRef = (0,
|
|
250
|
+
const [containerWidth, setContainerWidth] = _react.useState.call(void 0, 0);
|
|
251
|
+
const [activeIndex, setActiveIndex] = _react.useState.call(void 0, initialIndex);
|
|
252
|
+
const scrollRef = _reactnativereanimated.useAnimatedRef.call(void 0, );
|
|
253
|
+
const onActiveItemChangeRef = _react.useRef.call(void 0, onActiveItemChange);
|
|
330
254
|
onActiveItemChangeRef.current = onActiveItemChange;
|
|
331
|
-
const scrollX = (0,
|
|
332
|
-
const { borderRadius } = useBorderRadiusStyles(radius);
|
|
255
|
+
const scrollX = _reactnativereanimated.useSharedValue.call(void 0, 0);
|
|
256
|
+
const { borderRadius } = _chunkOQ2BLOOGcjs.useBorderRadiusStyles.call(void 0, radius);
|
|
333
257
|
const defaultSpacing = layout === "multi-browse" ? DEFAULT_ITEM_SPACING_MULTI_BROWSE : DEFAULT_ITEM_SPACING;
|
|
334
|
-
const resolvedSpacing = itemSpacing
|
|
258
|
+
const resolvedSpacing = _nullishCoalesce(itemSpacing, () => ( defaultSpacing));
|
|
335
259
|
const isFullScreen = layout === "full-screen";
|
|
336
260
|
const effectivePadding = isFullScreen ? 0 : contentPadding;
|
|
337
261
|
const effectiveSpacing = isFullScreen ? 0 : resolvedSpacing;
|
|
@@ -342,44 +266,44 @@ function Carousel({
|
|
|
342
266
|
itemSpacing: effectiveSpacing,
|
|
343
267
|
contentPadding: effectivePadding
|
|
344
268
|
});
|
|
345
|
-
const handleLayout = (0,
|
|
269
|
+
const handleLayout = _react.useCallback.call(void 0, (event) => {
|
|
346
270
|
setContainerWidth(event.nativeEvent.layout.width);
|
|
347
271
|
}, []);
|
|
348
|
-
const scrollHandler = (0,
|
|
272
|
+
const scrollHandler = _reactnativereanimated.useAnimatedScrollHandler.call(void 0, {
|
|
349
273
|
onScroll: (event) => {
|
|
350
274
|
scrollX.value = event.contentOffset.x;
|
|
351
275
|
}
|
|
352
276
|
});
|
|
353
|
-
const handleMomentumScrollEnd = (0,
|
|
277
|
+
const handleMomentumScrollEnd = _react.useCallback.call(void 0,
|
|
354
278
|
(event) => {
|
|
355
279
|
if (snapInterval <= 0) return;
|
|
356
280
|
const offsetX = event.nativeEvent.contentOffset.x;
|
|
357
281
|
const newIndex = Math.round(offsetX / snapInterval);
|
|
358
282
|
const clampedIndex = Math.max(0, Math.min(newIndex, data.length - 1));
|
|
359
283
|
setActiveIndex(clampedIndex);
|
|
360
|
-
onActiveItemChangeRef.current
|
|
284
|
+
_optionalChain([onActiveItemChangeRef, 'access', _2 => _2.current, 'optionalCall', _3 => _3(clampedIndex)]);
|
|
361
285
|
},
|
|
362
286
|
[snapInterval, data.length]
|
|
363
287
|
);
|
|
364
|
-
(0,
|
|
288
|
+
_react.useEffect.call(void 0, () => {
|
|
365
289
|
if (!autoPlay || data.length <= 1) return;
|
|
366
290
|
if (containerWidth <= 0 || snapInterval <= 0) return;
|
|
367
291
|
const timer = setInterval(() => {
|
|
368
292
|
setActiveIndex((prev) => {
|
|
369
293
|
const nextIndex = (prev + 1) % data.length;
|
|
370
|
-
scrollRef.current
|
|
371
|
-
onActiveItemChangeRef.current
|
|
294
|
+
_optionalChain([scrollRef, 'access', _4 => _4.current, 'optionalAccess', _5 => _5.scrollTo, 'call', _6 => _6({ x: nextIndex * snapInterval, animated: true })]);
|
|
295
|
+
_optionalChain([onActiveItemChangeRef, 'access', _7 => _7.current, 'optionalCall', _8 => _8(nextIndex)]);
|
|
372
296
|
return nextIndex;
|
|
373
297
|
});
|
|
374
298
|
}, autoPlayInterval);
|
|
375
299
|
return () => clearInterval(timer);
|
|
376
300
|
}, [autoPlay, autoPlayInterval, data.length, snapInterval, containerWidth]);
|
|
377
301
|
if (containerWidth <= 0) {
|
|
378
|
-
return /* @__PURE__ */
|
|
302
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: _optionalChain([customAppearance, 'optionalAccess', _9 => _9.container]), onLayout: handleLayout });
|
|
379
303
|
}
|
|
380
304
|
const shouldAnimate = layout === "multi-browse" || layout === "hero";
|
|
381
|
-
return /* @__PURE__ */
|
|
382
|
-
|
|
305
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: _optionalChain([customAppearance, 'optionalAccess', _10 => _10.container]), onLayout: handleLayout }, /* @__PURE__ */ _react2.default.createElement(
|
|
306
|
+
_reactnativereanimated2.default.ScrollView,
|
|
383
307
|
{
|
|
384
308
|
ref: scrollRef,
|
|
385
309
|
horizontal: true,
|
|
@@ -399,7 +323,7 @@ function Carousel({
|
|
|
399
323
|
data.map((item, index) => {
|
|
400
324
|
const content = renderItem({ item, index });
|
|
401
325
|
if (shouldAnimate) {
|
|
402
|
-
return /* @__PURE__ */
|
|
326
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
403
327
|
AnimatedCarouselItem,
|
|
404
328
|
{
|
|
405
329
|
key: keyExtractor ? keyExtractor(item, index) : String(index),
|
|
@@ -410,7 +334,7 @@ function Carousel({
|
|
|
410
334
|
radius: borderRadius,
|
|
411
335
|
spacing: effectiveSpacing,
|
|
412
336
|
isLast: index === data.length - 1,
|
|
413
|
-
customStyle: customAppearance
|
|
337
|
+
customStyle: _optionalChain([customAppearance, 'optionalAccess', _11 => _11.item]),
|
|
414
338
|
layout,
|
|
415
339
|
snapInterval,
|
|
416
340
|
containerWidth,
|
|
@@ -419,7 +343,7 @@ function Carousel({
|
|
|
419
343
|
content
|
|
420
344
|
);
|
|
421
345
|
}
|
|
422
|
-
return /* @__PURE__ */
|
|
346
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
423
347
|
CarouselItem,
|
|
424
348
|
{
|
|
425
349
|
key: keyExtractor ? keyExtractor(item, index) : String(index),
|
|
@@ -428,31 +352,30 @@ function Carousel({
|
|
|
428
352
|
radius: borderRadius,
|
|
429
353
|
spacing: effectiveSpacing,
|
|
430
354
|
isLast: index === data.length - 1,
|
|
431
|
-
customStyle: customAppearance
|
|
355
|
+
customStyle: _optionalChain([customAppearance, 'optionalAccess', _12 => _12.item])
|
|
432
356
|
},
|
|
433
357
|
content
|
|
434
358
|
);
|
|
435
359
|
})
|
|
436
|
-
), showIndicator && data.length > 1 && /* @__PURE__ */
|
|
437
|
-
|
|
360
|
+
), showIndicator && data.length > 1 && /* @__PURE__ */ _react2.default.createElement(
|
|
361
|
+
_reactnative.View,
|
|
438
362
|
{
|
|
439
|
-
style: [styles.indicatorContainer, customAppearance
|
|
363
|
+
style: [styles.indicatorContainer, _optionalChain([customAppearance, 'optionalAccess', _13 => _13.indicatorContainer])]
|
|
440
364
|
},
|
|
441
|
-
data.map((_, index) => /* @__PURE__ */
|
|
442
|
-
|
|
365
|
+
data.map((_, index) => /* @__PURE__ */ _react2.default.createElement(
|
|
366
|
+
_reactnative.View,
|
|
443
367
|
{
|
|
444
368
|
key: `indicator-${String(index)}`,
|
|
445
369
|
style: [
|
|
446
370
|
styles.indicator,
|
|
447
|
-
customAppearance
|
|
371
|
+
_optionalChain([customAppearance, 'optionalAccess', _14 => _14.indicator]),
|
|
448
372
|
activeIndex === index && styles.activeIndicator,
|
|
449
|
-
activeIndex === index && customAppearance
|
|
373
|
+
activeIndex === index && _optionalChain([customAppearance, 'optionalAccess', _15 => _15.activeIndicator])
|
|
450
374
|
]
|
|
451
375
|
}
|
|
452
376
|
))
|
|
453
377
|
));
|
|
454
378
|
}
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
});
|
|
379
|
+
|
|
380
|
+
|
|
381
|
+
exports.Carousel = Carousel;
|