@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/view/index.cjs
CHANGED
|
@@ -1,58 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var
|
|
3
|
-
var
|
|
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);
|
|
29
|
-
|
|
30
|
-
// src/components/view/index.ts
|
|
31
|
-
var view_exports = {};
|
|
32
|
-
__export(view_exports, {
|
|
33
|
-
AspectRatio: () => AspectRatio,
|
|
34
|
-
BlurView: () => BlurView,
|
|
35
|
-
Column: () => Column,
|
|
36
|
-
ConditionalView: () => ConditionalView,
|
|
37
|
-
Grid: () => Grid,
|
|
38
|
-
GridBuilder: () => GridBuilder,
|
|
39
|
-
GridItem: () => GridItem,
|
|
40
|
-
Margin: () => Margin,
|
|
41
|
-
MasonryGrid: () => MasonryGrid,
|
|
42
|
-
MasonryGridBuilder: () => MasonryGridBuilder,
|
|
43
|
-
MasonryGridItem: () => MasonryGridItem,
|
|
44
|
-
Padding: () => Padding,
|
|
45
|
-
PositionedView: () => PositionedView,
|
|
46
|
-
RoundedView: () => RoundedView,
|
|
47
|
-
Row: () => Row,
|
|
48
|
-
SizedBox: () => SizedBox,
|
|
49
|
-
Spacer: () => Spacer
|
|
50
|
-
});
|
|
51
|
-
module.exports = __toCommonJS(view_exports);
|
|
52
|
-
|
|
53
|
-
// src/components/view/column/column.tsx
|
|
54
|
-
var import_react = __toESM(require("react"), 1);
|
|
55
|
-
var import_react_native = require("react-native");
|
|
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; }// src/components/view/column/column.tsx
|
|
2
|
+
var _react = require('react'); var _react2 = _interopRequireDefault(_react);
|
|
3
|
+
var _reactnative = require('react-native');
|
|
56
4
|
|
|
57
5
|
// src/components/view/layout-utils.ts
|
|
58
6
|
var MAIN_AXIS_JUSTIFY_MAP = {
|
|
@@ -71,10 +19,10 @@ var CROSS_AXIS_ALIGN_MAP = {
|
|
|
71
19
|
baseline: "baseline"
|
|
72
20
|
};
|
|
73
21
|
var resolveMainAxisAlignment = (alignment) => {
|
|
74
|
-
return MAIN_AXIS_JUSTIFY_MAP[alignment
|
|
22
|
+
return MAIN_AXIS_JUSTIFY_MAP[_nullishCoalesce(alignment, () => ( "start"))];
|
|
75
23
|
};
|
|
76
24
|
var resolveCrossAxisAlignment = (alignment) => {
|
|
77
|
-
return CROSS_AXIS_ALIGN_MAP[alignment
|
|
25
|
+
return CROSS_AXIS_ALIGN_MAP[_nullishCoalesce(alignment, () => ( "center"))];
|
|
78
26
|
};
|
|
79
27
|
|
|
80
28
|
// src/components/view/column/column.tsx
|
|
@@ -89,8 +37,8 @@ var Column = ({
|
|
|
89
37
|
}) => {
|
|
90
38
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
91
39
|
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
|
|
92
|
-
return /* @__PURE__ */
|
|
93
|
-
|
|
40
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
41
|
+
_reactnative.View,
|
|
94
42
|
{
|
|
95
43
|
style: [
|
|
96
44
|
{
|
|
@@ -108,8 +56,8 @@ var Column = ({
|
|
|
108
56
|
};
|
|
109
57
|
|
|
110
58
|
// src/components/view/row/row.tsx
|
|
111
|
-
|
|
112
|
-
|
|
59
|
+
|
|
60
|
+
|
|
113
61
|
var Row = ({
|
|
114
62
|
children,
|
|
115
63
|
mainAxisAlignment,
|
|
@@ -121,8 +69,8 @@ var Row = ({
|
|
|
121
69
|
}) => {
|
|
122
70
|
const gapStyle = spacing === void 0 ? void 0 : { gap: spacing };
|
|
123
71
|
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
|
|
72
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
73
|
+
_reactnative.View,
|
|
126
74
|
{
|
|
127
75
|
style: [
|
|
128
76
|
{
|
|
@@ -140,11 +88,11 @@ var Row = ({
|
|
|
140
88
|
};
|
|
141
89
|
|
|
142
90
|
// src/components/view/spacer/spacer.tsx
|
|
143
|
-
|
|
144
|
-
|
|
91
|
+
|
|
92
|
+
|
|
145
93
|
var Spacer = ({ flex = 1, style }) => {
|
|
146
|
-
return /* @__PURE__ */
|
|
147
|
-
|
|
94
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
95
|
+
_reactnative.View,
|
|
148
96
|
{
|
|
149
97
|
style: [
|
|
150
98
|
{
|
|
@@ -160,8 +108,8 @@ var Spacer = ({ flex = 1, style }) => {
|
|
|
160
108
|
Spacer.displayName = "Spacer";
|
|
161
109
|
|
|
162
110
|
// src/components/view/padding/padding.tsx
|
|
163
|
-
|
|
164
|
-
|
|
111
|
+
|
|
112
|
+
|
|
165
113
|
var Padding = ({
|
|
166
114
|
children,
|
|
167
115
|
all,
|
|
@@ -175,8 +123,8 @@ var Padding = ({
|
|
|
175
123
|
style
|
|
176
124
|
}) => {
|
|
177
125
|
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
|
|
178
|
-
return /* @__PURE__ */
|
|
179
|
-
|
|
126
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
127
|
+
_reactnative.View,
|
|
180
128
|
{
|
|
181
129
|
style: [
|
|
182
130
|
{
|
|
@@ -198,8 +146,8 @@ var Padding = ({
|
|
|
198
146
|
Padding.displayName = "Padding";
|
|
199
147
|
|
|
200
148
|
// src/components/view/margin/margin.tsx
|
|
201
|
-
|
|
202
|
-
|
|
149
|
+
|
|
150
|
+
|
|
203
151
|
var Margin = ({
|
|
204
152
|
children,
|
|
205
153
|
all,
|
|
@@ -213,8 +161,8 @@ var Margin = ({
|
|
|
213
161
|
style
|
|
214
162
|
}) => {
|
|
215
163
|
const fullWidthStyle = fullWidth ? { flexShrink: 1, flexBasis: "auto", width: "100%" } : void 0;
|
|
216
|
-
return /* @__PURE__ */
|
|
217
|
-
|
|
164
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
165
|
+
_reactnative.View,
|
|
218
166
|
{
|
|
219
167
|
style: [
|
|
220
168
|
{
|
|
@@ -236,16 +184,16 @@ var Margin = ({
|
|
|
236
184
|
Margin.displayName = "Margin";
|
|
237
185
|
|
|
238
186
|
// src/components/view/sized-box/sized-box.tsx
|
|
239
|
-
|
|
240
|
-
|
|
187
|
+
|
|
188
|
+
|
|
241
189
|
var SizedBox = ({
|
|
242
190
|
children,
|
|
243
191
|
width,
|
|
244
192
|
height,
|
|
245
193
|
style
|
|
246
194
|
}) => {
|
|
247
|
-
return /* @__PURE__ */
|
|
248
|
-
|
|
195
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
196
|
+
_reactnative.View,
|
|
249
197
|
{
|
|
250
198
|
style: [
|
|
251
199
|
{
|
|
@@ -261,8 +209,8 @@ var SizedBox = ({
|
|
|
261
209
|
SizedBox.displayName = "SizedBox";
|
|
262
210
|
|
|
263
211
|
// src/components/view/positioned-view/positioned-view.tsx
|
|
264
|
-
|
|
265
|
-
|
|
212
|
+
|
|
213
|
+
|
|
266
214
|
var PositionedView = ({
|
|
267
215
|
children,
|
|
268
216
|
top,
|
|
@@ -272,8 +220,8 @@ var PositionedView = ({
|
|
|
272
220
|
zIndex,
|
|
273
221
|
style
|
|
274
222
|
}) => {
|
|
275
|
-
return /* @__PURE__ */
|
|
276
|
-
|
|
223
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
224
|
+
_reactnative.View,
|
|
277
225
|
{
|
|
278
226
|
style: [
|
|
279
227
|
{
|
|
@@ -293,14 +241,14 @@ var PositionedView = ({
|
|
|
293
241
|
PositionedView.displayName = "PositionedView";
|
|
294
242
|
|
|
295
243
|
// src/components/view/blur-view/blur-view.tsx
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
var styles =
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
var styles = _reactnative.StyleSheet.create({
|
|
299
247
|
container: {
|
|
300
248
|
position: "relative"
|
|
301
249
|
},
|
|
302
250
|
overlay: {
|
|
303
|
-
...
|
|
251
|
+
..._reactnative.StyleSheet.absoluteFillObject
|
|
304
252
|
}
|
|
305
253
|
});
|
|
306
254
|
var BlurView = ({
|
|
@@ -311,19 +259,19 @@ var BlurView = ({
|
|
|
311
259
|
style
|
|
312
260
|
}) => {
|
|
313
261
|
const overlayOpacity = Math.min(1, Math.max(0, intensity));
|
|
314
|
-
const overlayAnim = (0,
|
|
315
|
-
new
|
|
262
|
+
const overlayAnim = _react.useRef.call(void 0,
|
|
263
|
+
new _reactnative.Animated.Value(unlockable ? 0 : overlayOpacity)
|
|
316
264
|
).current;
|
|
317
|
-
const scaleAnim = (0,
|
|
318
|
-
(0,
|
|
265
|
+
const scaleAnim = _react.useRef.call(void 0, new _reactnative.Animated.Value(unlockable ? 1 : 0.98)).current;
|
|
266
|
+
_react.useEffect.call(void 0, () => {
|
|
319
267
|
if (unlockable) {
|
|
320
|
-
|
|
321
|
-
|
|
268
|
+
_reactnative.Animated.parallel([
|
|
269
|
+
_reactnative.Animated.timing(overlayAnim, {
|
|
322
270
|
toValue: 0,
|
|
323
271
|
duration: 220,
|
|
324
272
|
useNativeDriver: true
|
|
325
273
|
}),
|
|
326
|
-
|
|
274
|
+
_reactnative.Animated.timing(scaleAnim, {
|
|
327
275
|
toValue: 1,
|
|
328
276
|
duration: 220,
|
|
329
277
|
useNativeDriver: true
|
|
@@ -334,23 +282,23 @@ var BlurView = ({
|
|
|
334
282
|
overlayAnim.setValue(overlayOpacity);
|
|
335
283
|
scaleAnim.setValue(0.98);
|
|
336
284
|
}, [overlayAnim, overlayOpacity, scaleAnim, unlockable]);
|
|
337
|
-
return /* @__PURE__ */
|
|
338
|
-
|
|
285
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.container, style] }, /* @__PURE__ */ _react2.default.createElement(_reactnative.Animated.View, { style: { transform: [{ scale: scaleAnim }] } }, children), /* @__PURE__ */ _react2.default.createElement(
|
|
286
|
+
_reactnative.Animated.View,
|
|
339
287
|
{
|
|
340
288
|
pointerEvents: unlockable ? "none" : "auto",
|
|
341
289
|
style: [styles.overlay, { opacity: overlayAnim }]
|
|
342
290
|
},
|
|
343
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [styles.overlay, { backgroundColor: overlayColor }] })
|
|
344
292
|
));
|
|
345
293
|
};
|
|
346
294
|
BlurView.displayName = "BlurView";
|
|
347
295
|
|
|
348
296
|
// src/components/view/rounded-view/rounded-view.tsx
|
|
349
|
-
|
|
350
|
-
|
|
297
|
+
|
|
298
|
+
|
|
351
299
|
|
|
352
300
|
// src/components/view/rounded-view/rounded-view.hook.ts
|
|
353
|
-
|
|
301
|
+
|
|
354
302
|
var useRoundedViewStyle = (props) => {
|
|
355
303
|
const {
|
|
356
304
|
all = 0,
|
|
@@ -363,12 +311,12 @@ var useRoundedViewStyle = (props) => {
|
|
|
363
311
|
bottomLeft,
|
|
364
312
|
bottomRight
|
|
365
313
|
} = props;
|
|
366
|
-
return (0,
|
|
314
|
+
return _react.useMemo.call(void 0, () => {
|
|
367
315
|
return {
|
|
368
|
-
borderTopLeftRadius: topLeft
|
|
369
|
-
borderTopRightRadius: topRight
|
|
370
|
-
borderBottomLeftRadius: bottomLeft
|
|
371
|
-
borderBottomRightRadius: bottomRight
|
|
316
|
+
borderTopLeftRadius: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(topLeft, () => ( top)), () => ( left)), () => ( all)),
|
|
317
|
+
borderTopRightRadius: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(topRight, () => ( top)), () => ( right)), () => ( all)),
|
|
318
|
+
borderBottomLeftRadius: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(bottomLeft, () => ( bottom)), () => ( left)), () => ( all)),
|
|
319
|
+
borderBottomRightRadius: _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(bottomRight, () => ( bottom)), () => ( right)), () => ( all))
|
|
372
320
|
};
|
|
373
321
|
}, [all, top, bottom, left, right, topLeft, topRight, bottomLeft, bottomRight]);
|
|
374
322
|
};
|
|
@@ -400,8 +348,8 @@ var RoundedView = ({
|
|
|
400
348
|
bottomLeft,
|
|
401
349
|
bottomRight
|
|
402
350
|
});
|
|
403
|
-
return /* @__PURE__ */
|
|
404
|
-
|
|
351
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
352
|
+
_reactnative.View,
|
|
405
353
|
{
|
|
406
354
|
style: [
|
|
407
355
|
borderRadiusStyle,
|
|
@@ -413,32 +361,34 @@ var RoundedView = ({
|
|
|
413
361
|
children
|
|
414
362
|
);
|
|
415
363
|
};
|
|
416
|
-
var styles2 =
|
|
364
|
+
var styles2 = _reactnative.StyleSheet.create({
|
|
417
365
|
fullWidth: {
|
|
418
366
|
width: "100%"
|
|
419
367
|
}
|
|
420
368
|
});
|
|
421
369
|
|
|
422
370
|
// src/components/view/aspect-ratio/aspect-ratio.tsx
|
|
423
|
-
|
|
424
|
-
|
|
371
|
+
|
|
372
|
+
|
|
425
373
|
var AspectRatio = ({
|
|
426
374
|
children,
|
|
427
375
|
ratio,
|
|
428
376
|
style
|
|
429
377
|
}) => {
|
|
430
|
-
return /* @__PURE__ */
|
|
378
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: [{ aspectRatio: ratio }, style] }, children);
|
|
431
379
|
};
|
|
432
380
|
|
|
433
381
|
// src/components/view/grid/grid.tsx
|
|
434
|
-
|
|
435
|
-
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
|
|
436
386
|
|
|
437
387
|
// src/components/view/grid/grid-item.tsx
|
|
438
|
-
|
|
439
|
-
|
|
388
|
+
|
|
389
|
+
|
|
440
390
|
var GridItem = ({ children, style }) => {
|
|
441
|
-
return /* @__PURE__ */
|
|
391
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style }, children);
|
|
442
392
|
};
|
|
443
393
|
GridItem.displayName = "GridItem";
|
|
444
394
|
|
|
@@ -452,7 +402,7 @@ var getSafeSpan = (span, columns) => {
|
|
|
452
402
|
return Math.min(Math.floor(span), columns);
|
|
453
403
|
};
|
|
454
404
|
var isGridItemElement = (child) => {
|
|
455
|
-
if (!
|
|
405
|
+
if (!_react2.default.isValidElement(child)) return false;
|
|
456
406
|
if (child.type === GridItem) return true;
|
|
457
407
|
const displayName = child.type.displayName;
|
|
458
408
|
return displayName === "GridItem";
|
|
@@ -466,20 +416,20 @@ var Grid = ({
|
|
|
466
416
|
style,
|
|
467
417
|
itemStyle
|
|
468
418
|
}) => {
|
|
469
|
-
const [containerWidth, setContainerWidth] = (0,
|
|
419
|
+
const [containerWidth, setContainerWidth] = _react.useState.call(void 0, );
|
|
470
420
|
const safeColumns = getSafeColumns(columns);
|
|
471
|
-
const resolvedRowSpacing = rowSpacing
|
|
472
|
-
const resolvedColumnSpacing = columnSpacing
|
|
421
|
+
const resolvedRowSpacing = _nullishCoalesce(_nullishCoalesce(rowSpacing, () => ( spacing)), () => ( 0));
|
|
422
|
+
const resolvedColumnSpacing = _nullishCoalesce(_nullishCoalesce(columnSpacing, () => ( spacing)), () => ( 0));
|
|
473
423
|
const itemWidth = `${100 / safeColumns}%`;
|
|
474
|
-
const items =
|
|
424
|
+
const items = _react2.default.Children.toArray(children);
|
|
475
425
|
const totalColumnGap = resolvedColumnSpacing * (safeColumns - 1);
|
|
476
|
-
const baseItemWidth = (0,
|
|
426
|
+
const baseItemWidth = _react.useMemo.call(void 0, () => {
|
|
477
427
|
if (!containerWidth) return void 0;
|
|
478
428
|
return (containerWidth - totalColumnGap) / safeColumns;
|
|
479
429
|
}, [containerWidth, safeColumns, totalColumnGap]);
|
|
480
430
|
let currentColumn = 0;
|
|
481
|
-
return /* @__PURE__ */
|
|
482
|
-
|
|
431
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
432
|
+
_reactnative.View,
|
|
483
433
|
{
|
|
484
434
|
style: [
|
|
485
435
|
{
|
|
@@ -496,7 +446,7 @@ var Grid = ({
|
|
|
496
446
|
}
|
|
497
447
|
},
|
|
498
448
|
items.map((child, index) => {
|
|
499
|
-
const key =
|
|
449
|
+
const key = _react2.default.isValidElement(child) && child.key ? child.key : `grid-${index}`;
|
|
500
450
|
const span = isGridItemElement(child) ? getSafeSpan(child.props.span, safeColumns) : 1;
|
|
501
451
|
const spanWidth = baseItemWidth === void 0 ? `${100 / safeColumns * span}%` : baseItemWidth * span + resolvedColumnSpacing * (span - 1);
|
|
502
452
|
if (currentColumn + span > safeColumns) {
|
|
@@ -516,7 +466,7 @@ var Grid = ({
|
|
|
516
466
|
itemStyle,
|
|
517
467
|
child.props.style
|
|
518
468
|
];
|
|
519
|
-
const element2 =
|
|
469
|
+
const element2 = _react2.default.cloneElement(child, {
|
|
520
470
|
key,
|
|
521
471
|
style: mergedStyle
|
|
522
472
|
});
|
|
@@ -524,8 +474,8 @@ var Grid = ({
|
|
|
524
474
|
return element2;
|
|
525
475
|
}
|
|
526
476
|
const defaultItemWidth = baseItemWidth === void 0 ? itemWidth : baseItemWidth;
|
|
527
|
-
const element = /* @__PURE__ */
|
|
528
|
-
|
|
477
|
+
const element = /* @__PURE__ */ _react2.default.createElement(
|
|
478
|
+
_reactnative.View,
|
|
529
479
|
{
|
|
530
480
|
key,
|
|
531
481
|
style: [
|
|
@@ -548,8 +498,12 @@ var Grid = ({
|
|
|
548
498
|
};
|
|
549
499
|
|
|
550
500
|
// src/components/view/grid/grid-builder.tsx
|
|
551
|
-
|
|
552
|
-
|
|
501
|
+
|
|
502
|
+
|
|
503
|
+
|
|
504
|
+
|
|
505
|
+
|
|
506
|
+
|
|
553
507
|
var getSafeColumns2 = (columns) => {
|
|
554
508
|
if (!columns || columns <= 0) return 1;
|
|
555
509
|
return Math.floor(columns);
|
|
@@ -579,13 +533,13 @@ var GridBuilder = ({
|
|
|
579
533
|
footer
|
|
580
534
|
}) => {
|
|
581
535
|
const safeColumns = getSafeColumns2(columns);
|
|
582
|
-
const resolvedRowSpacing = rowSpacing
|
|
583
|
-
const resolvedColumnSpacing = columnSpacing
|
|
584
|
-
const resolvedData = (0,
|
|
536
|
+
const resolvedRowSpacing = _nullishCoalesce(_nullishCoalesce(rowSpacing, () => ( spacing)), () => ( 0));
|
|
537
|
+
const resolvedColumnSpacing = _nullishCoalesce(_nullishCoalesce(columnSpacing, () => ( spacing)), () => ( 0));
|
|
538
|
+
const resolvedData = _react.useMemo.call(void 0,
|
|
585
539
|
() => resolveGridData(data, itemCount),
|
|
586
540
|
[data, itemCount]
|
|
587
541
|
);
|
|
588
|
-
const paddedData = (0,
|
|
542
|
+
const paddedData = _react.useMemo.call(void 0, () => {
|
|
589
543
|
const remainder = resolvedData.length % safeColumns;
|
|
590
544
|
const placeholders = remainder === 0 ? 0 : safeColumns - remainder;
|
|
591
545
|
if (placeholders === 0)
|
|
@@ -606,12 +560,12 @@ var GridBuilder = ({
|
|
|
606
560
|
}))
|
|
607
561
|
];
|
|
608
562
|
}, [resolvedData, safeColumns]);
|
|
609
|
-
const resolvedKeyExtractor = (0,
|
|
563
|
+
const resolvedKeyExtractor = _react.useMemo.call(void 0, () => {
|
|
610
564
|
if (keyExtractor)
|
|
611
|
-
return (item, index) => item.type === "data" ? keyExtractor(item.item, item.index) : item.key
|
|
612
|
-
return (item, index) => item.type === "data" ? `grid-${item.index}` : item.key
|
|
565
|
+
return (item, index) => item.type === "data" ? keyExtractor(item.item, item.index) : _nullishCoalesce(item.key, () => ( `placeholder-${index}`));
|
|
566
|
+
return (item, index) => item.type === "data" ? `grid-${item.index}` : _nullishCoalesce(item.key, () => ( `placeholder-${index}`));
|
|
613
567
|
}, [keyExtractor]);
|
|
614
|
-
const resolvedRenderer = (0,
|
|
568
|
+
const resolvedRenderer = _react.useMemo.call(void 0, () => {
|
|
615
569
|
if (renderItem) return renderItem;
|
|
616
570
|
if (itemBuilder)
|
|
617
571
|
return ({ item, index }) => itemBuilder({ item, index });
|
|
@@ -635,7 +589,7 @@ var GridBuilder = ({
|
|
|
635
589
|
},
|
|
636
590
|
itemStyle
|
|
637
591
|
];
|
|
638
|
-
return /* @__PURE__ */
|
|
592
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: placeholderStyle, pointerEvents: "none" });
|
|
639
593
|
}
|
|
640
594
|
const element = resolvedRenderer({ item: item.item, index: item.index });
|
|
641
595
|
if (element === null) return null;
|
|
@@ -651,9 +605,9 @@ var GridBuilder = ({
|
|
|
651
605
|
},
|
|
652
606
|
itemStyle
|
|
653
607
|
];
|
|
654
|
-
return /* @__PURE__ */
|
|
608
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style: wrapperStyle }, element);
|
|
655
609
|
};
|
|
656
|
-
const flattenedStyle =
|
|
610
|
+
const flattenedStyle = _nullishCoalesce(_reactnative.StyleSheet.flatten(style), () => ( {}));
|
|
657
611
|
const {
|
|
658
612
|
alignItems,
|
|
659
613
|
justifyContent,
|
|
@@ -672,8 +626,8 @@ var GridBuilder = ({
|
|
|
672
626
|
...columnGap !== void 0 ? { columnGap } : {}
|
|
673
627
|
};
|
|
674
628
|
const hasLayoutStyle = Object.keys(layoutStyle).length > 0;
|
|
675
|
-
return /* @__PURE__ */
|
|
676
|
-
|
|
629
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
630
|
+
_reactnative.FlatList,
|
|
677
631
|
{
|
|
678
632
|
data: paddedData,
|
|
679
633
|
renderItem: renderGridItem,
|
|
@@ -692,8 +646,8 @@ var GridBuilder = ({
|
|
|
692
646
|
GridBuilder.displayName = "GridBuilder";
|
|
693
647
|
|
|
694
648
|
// src/components/view/conditional/conditional-view.tsx
|
|
695
|
-
|
|
696
|
-
|
|
649
|
+
|
|
650
|
+
|
|
697
651
|
|
|
698
652
|
// src/components/view/conditional/conditional-view.utils.ts
|
|
699
653
|
var FINAL_VALUES = {
|
|
@@ -722,7 +676,7 @@ var getExitValues = (animation) => {
|
|
|
722
676
|
};
|
|
723
677
|
|
|
724
678
|
// src/components/view/conditional/conditional-view.animation.ts
|
|
725
|
-
|
|
679
|
+
|
|
726
680
|
var runConditionalViewAnimation = ({
|
|
727
681
|
opacity,
|
|
728
682
|
scale,
|
|
@@ -731,27 +685,27 @@ var runConditionalViewAnimation = ({
|
|
|
731
685
|
toValues,
|
|
732
686
|
onComplete
|
|
733
687
|
}) => {
|
|
734
|
-
const easing =
|
|
735
|
-
const animation =
|
|
736
|
-
|
|
688
|
+
const easing = _reactnative.Easing.out(_reactnative.Easing.cubic);
|
|
689
|
+
const animation = _reactnative.Animated.parallel([
|
|
690
|
+
_reactnative.Animated.timing(opacity, {
|
|
737
691
|
toValue: toValues.opacity,
|
|
738
692
|
duration: 800,
|
|
739
693
|
easing,
|
|
740
694
|
useNativeDriver: true
|
|
741
695
|
}),
|
|
742
|
-
|
|
696
|
+
_reactnative.Animated.timing(scale, {
|
|
743
697
|
toValue: toValues.scale,
|
|
744
698
|
duration: 800,
|
|
745
699
|
easing,
|
|
746
700
|
useNativeDriver: true
|
|
747
701
|
}),
|
|
748
|
-
|
|
702
|
+
_reactnative.Animated.timing(translateX, {
|
|
749
703
|
toValue: toValues.translateX,
|
|
750
704
|
duration: 800,
|
|
751
705
|
easing,
|
|
752
706
|
useNativeDriver: true
|
|
753
707
|
}),
|
|
754
|
-
|
|
708
|
+
_reactnative.Animated.timing(translateY, {
|
|
755
709
|
toValue: toValues.translateY,
|
|
756
710
|
duration: 800,
|
|
757
711
|
easing,
|
|
@@ -760,7 +714,7 @@ var runConditionalViewAnimation = ({
|
|
|
760
714
|
]);
|
|
761
715
|
animation.start(({ finished }) => {
|
|
762
716
|
if (finished) {
|
|
763
|
-
onComplete
|
|
717
|
+
_optionalChain([onComplete, 'optionalCall', _2 => _2()]);
|
|
764
718
|
}
|
|
765
719
|
});
|
|
766
720
|
return animation;
|
|
@@ -773,34 +727,34 @@ var ConditionalView = ({
|
|
|
773
727
|
animation = "fade",
|
|
774
728
|
disableAnimation = false
|
|
775
729
|
}) => {
|
|
776
|
-
const [shouldRender, setShouldRender] = (0,
|
|
777
|
-
const animationRef = (0,
|
|
778
|
-
const initialValues = (0,
|
|
779
|
-
const exitValues = (0,
|
|
780
|
-
const opacity = (0,
|
|
781
|
-
new
|
|
730
|
+
const [shouldRender, setShouldRender] = _react.useState.call(void 0, isVisible);
|
|
731
|
+
const animationRef = _react.useRef.call(void 0, null);
|
|
732
|
+
const initialValues = _react.useMemo.call(void 0, () => getInitialValues(animation), [animation]);
|
|
733
|
+
const exitValues = _react.useMemo.call(void 0, () => getExitValues(animation), [animation]);
|
|
734
|
+
const opacity = _react.useRef.call(void 0,
|
|
735
|
+
new _reactnative.Animated.Value(
|
|
782
736
|
disableAnimation ? FINAL_VALUES.opacity : initialValues.opacity
|
|
783
737
|
)
|
|
784
738
|
).current;
|
|
785
|
-
const scale = (0,
|
|
786
|
-
new
|
|
739
|
+
const scale = _react.useRef.call(void 0,
|
|
740
|
+
new _reactnative.Animated.Value(disableAnimation ? FINAL_VALUES.scale : initialValues.scale)
|
|
787
741
|
).current;
|
|
788
|
-
const translateX = (0,
|
|
789
|
-
new
|
|
742
|
+
const translateX = _react.useRef.call(void 0,
|
|
743
|
+
new _reactnative.Animated.Value(
|
|
790
744
|
disableAnimation ? FINAL_VALUES.translateX : initialValues.translateX
|
|
791
745
|
)
|
|
792
746
|
).current;
|
|
793
|
-
const translateY = (0,
|
|
794
|
-
new
|
|
747
|
+
const translateY = _react.useRef.call(void 0,
|
|
748
|
+
new _reactnative.Animated.Value(
|
|
795
749
|
disableAnimation ? FINAL_VALUES.translateY : initialValues.translateY
|
|
796
750
|
)
|
|
797
751
|
).current;
|
|
798
|
-
(0,
|
|
752
|
+
_react.useEffect.call(void 0, () => {
|
|
799
753
|
if (isVisible) {
|
|
800
754
|
setShouldRender(true);
|
|
801
755
|
}
|
|
802
756
|
}, [isVisible]);
|
|
803
|
-
(0,
|
|
757
|
+
_react.useEffect.call(void 0, () => {
|
|
804
758
|
if (!shouldRender) return;
|
|
805
759
|
const startValues = isVisible ? disableAnimation ? FINAL_VALUES : initialValues : FINAL_VALUES;
|
|
806
760
|
const targetValues = isVisible ? FINAL_VALUES : exitValues;
|
|
@@ -814,7 +768,7 @@ var ConditionalView = ({
|
|
|
814
768
|
}
|
|
815
769
|
return;
|
|
816
770
|
}
|
|
817
|
-
animationRef.current
|
|
771
|
+
_optionalChain([animationRef, 'access', _3 => _3.current, 'optionalAccess', _4 => _4.stop, 'call', _5 => _5()]);
|
|
818
772
|
animationRef.current = runConditionalViewAnimation({
|
|
819
773
|
opacity,
|
|
820
774
|
scale,
|
|
@@ -834,7 +788,7 @@ var ConditionalView = ({
|
|
|
834
788
|
translateX,
|
|
835
789
|
translateY
|
|
836
790
|
]);
|
|
837
|
-
const animatedStyle = (0,
|
|
791
|
+
const animatedStyle = _react.useMemo.call(void 0,
|
|
838
792
|
() => ({
|
|
839
793
|
opacity,
|
|
840
794
|
transform: [{ translateX }, { translateY }, { scale }]
|
|
@@ -844,18 +798,18 @@ var ConditionalView = ({
|
|
|
844
798
|
if (!shouldRender) {
|
|
845
799
|
return null;
|
|
846
800
|
}
|
|
847
|
-
return /* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.Animated.View, { style: animatedStyle }, children);
|
|
848
802
|
};
|
|
849
803
|
|
|
850
804
|
// src/components/view/masonry-grid/masonry-grid.tsx
|
|
851
|
-
|
|
852
|
-
|
|
805
|
+
|
|
806
|
+
|
|
853
807
|
var getSafeColumns3 = (columns) => {
|
|
854
808
|
if (!columns || columns <= 0) return 1;
|
|
855
809
|
return Math.floor(columns);
|
|
856
810
|
};
|
|
857
811
|
var getItemKey = (child, index) => {
|
|
858
|
-
return
|
|
812
|
+
return _react2.default.isValidElement(child) && child.key ? String(child.key) : `masonry-${index}`;
|
|
859
813
|
};
|
|
860
814
|
var MasonryGrid = ({
|
|
861
815
|
children,
|
|
@@ -866,37 +820,37 @@ var MasonryGrid = ({
|
|
|
866
820
|
style,
|
|
867
821
|
columnStyle
|
|
868
822
|
}) => {
|
|
869
|
-
const [containerWidth, setContainerWidth] = (0,
|
|
870
|
-
const heightMapRef = (0,
|
|
871
|
-
const [layoutVersion, setLayoutVersion] = (0,
|
|
823
|
+
const [containerWidth, setContainerWidth] = _react.useState.call(void 0, );
|
|
824
|
+
const heightMapRef = _react.useRef.call(void 0, {});
|
|
825
|
+
const [layoutVersion, setLayoutVersion] = _react.useState.call(void 0, 0);
|
|
872
826
|
const safeColumns = getSafeColumns3(columns);
|
|
873
|
-
const resolvedRowSpacing = rowSpacing
|
|
874
|
-
const resolvedColumnSpacing = columnSpacing
|
|
827
|
+
const resolvedRowSpacing = _nullishCoalesce(_nullishCoalesce(rowSpacing, () => ( spacing)), () => ( 0));
|
|
828
|
+
const resolvedColumnSpacing = _nullishCoalesce(_nullishCoalesce(columnSpacing, () => ( spacing)), () => ( 0));
|
|
875
829
|
const totalColumnGap = resolvedColumnSpacing * (safeColumns - 1);
|
|
876
|
-
const columnWidth = (0,
|
|
830
|
+
const columnWidth = _react.useMemo.call(void 0, () => {
|
|
877
831
|
if (!containerWidth) return void 0;
|
|
878
832
|
return (containerWidth - totalColumnGap) / safeColumns;
|
|
879
833
|
}, [containerWidth, safeColumns, totalColumnGap]);
|
|
880
|
-
const items = (0,
|
|
881
|
-
() =>
|
|
834
|
+
const items = _react.useMemo.call(void 0,
|
|
835
|
+
() => _react2.default.Children.toArray(children).map((child, index) => ({
|
|
882
836
|
key: getItemKey(child, index),
|
|
883
837
|
element: child
|
|
884
838
|
})),
|
|
885
839
|
[children]
|
|
886
840
|
);
|
|
887
|
-
const columnsItems = (0,
|
|
841
|
+
const columnsItems = _react.useMemo.call(void 0, () => {
|
|
888
842
|
const buckets = Array.from({ length: safeColumns }, () => []);
|
|
889
843
|
const heights = new Array(safeColumns).fill(0);
|
|
890
844
|
items.forEach((item) => {
|
|
891
845
|
const height = heightMapRef.current[item.key];
|
|
892
846
|
const targetIndex = heights.indexOf(Math.min(...heights));
|
|
893
847
|
buckets[targetIndex].push(item);
|
|
894
|
-
heights[targetIndex] += (height
|
|
848
|
+
heights[targetIndex] += (_nullishCoalesce(height, () => ( 0))) + resolvedRowSpacing;
|
|
895
849
|
});
|
|
896
850
|
return buckets;
|
|
897
851
|
}, [items, layoutVersion, resolvedRowSpacing, safeColumns]);
|
|
898
|
-
return /* @__PURE__ */
|
|
899
|
-
|
|
852
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
853
|
+
_reactnative.View,
|
|
900
854
|
{
|
|
901
855
|
style: [
|
|
902
856
|
{
|
|
@@ -919,10 +873,10 @@ var MasonryGrid = ({
|
|
|
919
873
|
},
|
|
920
874
|
columnStyle
|
|
921
875
|
];
|
|
922
|
-
return /* @__PURE__ */
|
|
876
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { key: `masonry-col-${columnIndex}`, style: columnStyles }, column.map((item, index) => {
|
|
923
877
|
const isLastRow = index === column.length - 1;
|
|
924
|
-
return /* @__PURE__ */
|
|
925
|
-
|
|
878
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
879
|
+
_reactnative.View,
|
|
926
880
|
{
|
|
927
881
|
key: item.key,
|
|
928
882
|
style: { marginBottom: isLastRow ? 0 : resolvedRowSpacing },
|
|
@@ -941,19 +895,21 @@ var MasonryGrid = ({
|
|
|
941
895
|
};
|
|
942
896
|
|
|
943
897
|
// src/components/view/masonry-grid/masonry-grid-item.tsx
|
|
944
|
-
|
|
945
|
-
|
|
898
|
+
|
|
899
|
+
|
|
946
900
|
var MasonryGridItem = ({
|
|
947
901
|
children,
|
|
948
902
|
style
|
|
949
903
|
}) => {
|
|
950
|
-
return /* @__PURE__ */
|
|
904
|
+
return /* @__PURE__ */ _react2.default.createElement(_reactnative.View, { style }, children);
|
|
951
905
|
};
|
|
952
906
|
MasonryGridItem.displayName = "MasonryGridItem";
|
|
953
907
|
|
|
954
908
|
// src/components/view/masonry-grid/masonry-grid-builder.tsx
|
|
955
|
-
|
|
956
|
-
|
|
909
|
+
|
|
910
|
+
|
|
911
|
+
|
|
912
|
+
|
|
957
913
|
var resolveMasonryData = (data, itemCount) => {
|
|
958
914
|
if (data) return data;
|
|
959
915
|
if (!itemCount || itemCount <= 0) return [];
|
|
@@ -982,27 +938,27 @@ var MasonryGridBuilder = ({
|
|
|
982
938
|
bounces,
|
|
983
939
|
onScroll
|
|
984
940
|
}) => {
|
|
985
|
-
const resolvedData = (0,
|
|
941
|
+
const resolvedData = _react.useMemo.call(void 0,
|
|
986
942
|
() => resolveMasonryData(data, itemCount),
|
|
987
943
|
[data, itemCount]
|
|
988
944
|
);
|
|
989
|
-
const resolvedKeyExtractor = (0,
|
|
945
|
+
const resolvedKeyExtractor = _react.useMemo.call(void 0, () => {
|
|
990
946
|
if (keyExtractor) return keyExtractor;
|
|
991
947
|
return (_, index) => `masonry-${index}`;
|
|
992
948
|
}, [keyExtractor]);
|
|
993
|
-
const resolvedRenderer = (0,
|
|
949
|
+
const resolvedRenderer = _react.useMemo.call(void 0, () => {
|
|
994
950
|
if (renderItem) return renderItem;
|
|
995
951
|
if (itemBuilder)
|
|
996
952
|
return ({ item, index }) => itemBuilder({ item, index });
|
|
997
953
|
return void 0;
|
|
998
954
|
}, [renderItem, itemBuilder]);
|
|
999
|
-
const lastEndReachedHeight = (0,
|
|
955
|
+
const lastEndReachedHeight = _react.useRef.call(void 0, 0);
|
|
1000
956
|
if (!resolvedRenderer) return null;
|
|
1001
957
|
const handleScroll = (event) => {
|
|
1002
|
-
onScroll
|
|
958
|
+
_optionalChain([onScroll, 'optionalCall', _6 => _6(event)]);
|
|
1003
959
|
if (!onEndReached) return;
|
|
1004
960
|
const { layoutMeasurement, contentOffset, contentSize } = event.nativeEvent;
|
|
1005
|
-
if (!layoutMeasurement
|
|
961
|
+
if (!_optionalChain([layoutMeasurement, 'optionalAccess', _7 => _7.height])) return;
|
|
1006
962
|
const distanceFromEnd = contentSize.height - (layoutMeasurement.height + contentOffset.y);
|
|
1007
963
|
const threshold = onEndReachedThreshold * layoutMeasurement.height;
|
|
1008
964
|
if (distanceFromEnd <= threshold && contentSize.height !== lastEndReachedHeight.current) {
|
|
@@ -1010,8 +966,8 @@ var MasonryGridBuilder = ({
|
|
|
1010
966
|
onEndReached();
|
|
1011
967
|
}
|
|
1012
968
|
};
|
|
1013
|
-
return /* @__PURE__ */
|
|
1014
|
-
|
|
969
|
+
return /* @__PURE__ */ _react2.default.createElement(
|
|
970
|
+
_reactnative.ScrollView,
|
|
1015
971
|
{
|
|
1016
972
|
scrollEventThrottle: 16,
|
|
1017
973
|
scrollEnabled,
|
|
@@ -1022,7 +978,7 @@ var MasonryGridBuilder = ({
|
|
|
1022
978
|
onScroll: handleScroll
|
|
1023
979
|
},
|
|
1024
980
|
header,
|
|
1025
|
-
/* @__PURE__ */
|
|
981
|
+
/* @__PURE__ */ _react2.default.createElement(
|
|
1026
982
|
MasonryGrid,
|
|
1027
983
|
{
|
|
1028
984
|
columns,
|
|
@@ -1032,29 +988,28 @@ var MasonryGridBuilder = ({
|
|
|
1032
988
|
style: [{ width: "100%" }, style],
|
|
1033
989
|
columnStyle
|
|
1034
990
|
},
|
|
1035
|
-
resolvedData.map((item, index) => /* @__PURE__ */
|
|
991
|
+
resolvedData.map((item, index) => /* @__PURE__ */ _react2.default.createElement(MasonryGridItem, { key: resolvedKeyExtractor(item, index) }, resolvedRenderer({ item, index })))
|
|
1036
992
|
),
|
|
1037
993
|
footer
|
|
1038
994
|
);
|
|
1039
995
|
};
|
|
1040
996
|
MasonryGridBuilder.displayName = "MasonryGridBuilder";
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
});
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
|
|
1002
|
+
|
|
1003
|
+
|
|
1004
|
+
|
|
1005
|
+
|
|
1006
|
+
|
|
1007
|
+
|
|
1008
|
+
|
|
1009
|
+
|
|
1010
|
+
|
|
1011
|
+
|
|
1012
|
+
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
exports.AspectRatio = AspectRatio; exports.BlurView = BlurView; exports.Column = Column; exports.ConditionalView = ConditionalView; exports.Grid = Grid; exports.GridBuilder = GridBuilder; exports.GridItem = GridItem; exports.Margin = Margin; exports.MasonryGrid = MasonryGrid; exports.MasonryGridBuilder = MasonryGridBuilder; exports.MasonryGridItem = MasonryGridItem; exports.Padding = Padding; exports.PositionedView = PositionedView; exports.RoundedView = RoundedView; exports.Row = Row; exports.SizedBox = SizedBox; exports.Spacer = Spacer;
|