@tamagui/react-native-web-lite 1.116.2 → 1.116.4
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/dist/cjs/Batchinator/index.cjs +68 -0
- package/dist/cjs/Batchinator/index.js +57 -0
- package/dist/cjs/Batchinator/index.js.map +6 -0
- package/dist/cjs/Batchinator/index.native.js +92 -0
- package/dist/cjs/Batchinator/index.native.js.map +6 -0
- package/dist/cjs/FlatList.cjs +196 -0
- package/dist/cjs/FlatList.js +193 -0
- package/dist/cjs/FlatList.js.map +6 -0
- package/dist/cjs/FlatList.native.js +256 -0
- package/dist/cjs/FlatList.native.js.map +6 -0
- package/dist/cjs/InteractionManager/TaskQueue.cjs +88 -0
- package/dist/cjs/InteractionManager/TaskQueue.js +76 -0
- package/dist/cjs/InteractionManager/TaskQueue.js.map +6 -0
- package/dist/cjs/InteractionManager/TaskQueue.native.js +134 -0
- package/dist/cjs/InteractionManager/TaskQueue.native.js.map +6 -0
- package/dist/cjs/InteractionManager/index.cjs +114 -0
- package/dist/cjs/InteractionManager/index.js +95 -0
- package/dist/cjs/InteractionManager/index.js.map +6 -0
- package/dist/cjs/InteractionManager/index.native.js +99 -0
- package/dist/cjs/InteractionManager/index.native.js.map +6 -0
- package/dist/cjs/index.cjs +7 -7
- package/dist/cjs/index.js +6 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +6 -6
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/vendor/react-native/FillRateHelper/index.cjs +138 -0
- package/dist/cjs/vendor/react-native/FillRateHelper/index.js +124 -0
- package/dist/cjs/vendor/react-native/FillRateHelper/index.js.map +6 -0
- package/dist/cjs/vendor/react-native/FillRateHelper/index.native.js +158 -0
- package/dist/cjs/vendor/react-native/FillRateHelper/index.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/Utilities/clamp.cjs +29 -0
- package/dist/cjs/vendor/react-native/Utilities/clamp.js +24 -0
- package/dist/cjs/vendor/react-native/Utilities/clamp.js.map +6 -0
- package/dist/cjs/vendor/react-native/Utilities/clamp.native.js +25 -0
- package/dist/cjs/vendor/react-native/Utilities/clamp.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/ViewabilityHelper.cjs +133 -0
- package/dist/cjs/vendor/react-native/ViewabilityHelper.js +144 -0
- package/dist/cjs/vendor/react-native/ViewabilityHelper.js.map +6 -0
- package/dist/cjs/vendor/react-native/ViewabilityHelper.native.js +199 -0
- package/dist/cjs/vendor/react-native/ViewabilityHelper.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.cjs +106 -0
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.js +86 -0
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.native.js +95 -0
- package/dist/cjs/vendor/react-native/VirtualizeUtils/index.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.cjs +81 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.js +84 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.native.js +125 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/CellRenderMask.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.cjs +56 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.js +59 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.native.js +153 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/ChildListCollection.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.cjs +80 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.js +74 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.native.js +163 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/StateSafePureComponent.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.cjs +164 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js +149 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.native.js +245 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.cjs +84 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.js +72 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.native.js +85 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListContext.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.cjs +16 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.js +14 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.native.js +15 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/VirtualizedListProps.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/index.cjs +1003 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/index.js +1021 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/index.js.map +6 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/index.native.js +1075 -0
- package/dist/cjs/vendor/react-native/VirtualizedList/index.native.js.map +6 -0
- package/dist/cjs/vendor/react-native/deepDiffer/index.cjs +41 -0
- package/dist/cjs/vendor/react-native/deepDiffer/index.js +47 -0
- package/dist/cjs/vendor/react-native/deepDiffer/index.js.map +6 -0
- package/dist/cjs/vendor/react-native/deepDiffer/index.native.js +48 -0
- package/dist/cjs/vendor/react-native/deepDiffer/index.native.js.map +6 -0
- package/dist/esm/Batchinator/index.js +33 -0
- package/dist/esm/Batchinator/index.js.map +6 -0
- package/dist/esm/Batchinator/index.mjs +34 -0
- package/dist/esm/Batchinator/index.mjs.map +1 -0
- package/dist/esm/Batchinator/index.native.js +67 -0
- package/dist/esm/Batchinator/index.native.js.map +6 -0
- package/dist/esm/FlatList.js +176 -0
- package/dist/esm/FlatList.js.map +6 -0
- package/dist/esm/FlatList.mjs +162 -0
- package/dist/esm/FlatList.mjs.map +1 -0
- package/dist/esm/FlatList.native.js +238 -0
- package/dist/esm/FlatList.native.js.map +6 -0
- package/dist/esm/InteractionManager/TaskQueue.js +60 -0
- package/dist/esm/InteractionManager/TaskQueue.js.map +6 -0
- package/dist/esm/InteractionManager/TaskQueue.mjs +65 -0
- package/dist/esm/InteractionManager/TaskQueue.mjs.map +1 -0
- package/dist/esm/InteractionManager/TaskQueue.native.js +117 -0
- package/dist/esm/InteractionManager/TaskQueue.native.js.map +6 -0
- package/dist/esm/InteractionManager/index.js +73 -0
- package/dist/esm/InteractionManager/index.js.map +6 -0
- package/dist/esm/InteractionManager/index.mjs +80 -0
- package/dist/esm/InteractionManager/index.mjs.map +1 -0
- package/dist/esm/InteractionManager/index.native.js +77 -0
- package/dist/esm/InteractionManager/index.native.js.map +6 -0
- package/dist/esm/index.js +2 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/index.native.js +2 -2
- package/dist/esm/vendor/react-native/FillRateHelper/index.js +108 -0
- package/dist/esm/vendor/react-native/FillRateHelper/index.js.map +6 -0
- package/dist/esm/vendor/react-native/FillRateHelper/index.mjs +115 -0
- package/dist/esm/vendor/react-native/FillRateHelper/index.mjs.map +1 -0
- package/dist/esm/vendor/react-native/FillRateHelper/index.native.js +141 -0
- package/dist/esm/vendor/react-native/FillRateHelper/index.native.js.map +6 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.js +8 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.js.map +6 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.mjs +6 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.mjs.map +1 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.native.js +8 -0
- package/dist/esm/vendor/react-native/Utilities/clamp.native.js.map +6 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.js +128 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.js.map +6 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.mjs +110 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.mjs.map +1 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.native.js +182 -0
- package/dist/esm/vendor/react-native/ViewabilityHelper.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.js +70 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.mjs +80 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.native.js +71 -0
- package/dist/esm/vendor/react-native/VirtualizeUtils/index.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.js +68 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.mjs +58 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.native.js +104 -0
- package/dist/esm/vendor/react-native/VirtualizedList/CellRenderMask.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.js +43 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.mjs +33 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.native.js +136 -0
- package/dist/esm/vendor/react-native/VirtualizedList/ChildListCollection.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.js +51 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.mjs +46 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.native.js +139 -0
- package/dist/esm/vendor/react-native/VirtualizedList/StateSafePureComponent.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js +132 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.mjs +130 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.native.js +224 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.js +50 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.mjs +47 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.native.js +56 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListContext.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.js +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.mjs +2 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.native.js +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/VirtualizedListProps.native.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.js +1016 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.js.map +6 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.mjs +969 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.mjs.map +1 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.native.js +1065 -0
- package/dist/esm/vendor/react-native/VirtualizedList/index.native.js.map +6 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.js +31 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.js.map +6 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.mjs +18 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.mjs.map +1 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.native.js +31 -0
- package/dist/esm/vendor/react-native/deepDiffer/index.native.js.map +6 -0
- package/package.json +6 -6
- package/src/Batchinator/index.tsx +78 -0
- package/src/FlatList.tsx +330 -0
- package/src/InteractionManager/TaskQueue.tsx +114 -0
- package/src/InteractionManager/index.tsx +139 -0
- package/src/index.tsx +2 -2
- package/src/vendor/react-native/FillRateHelper/index.tsx +218 -0
- package/src/vendor/react-native/Utilities/clamp.ts +21 -0
- package/src/vendor/react-native/ViewabilityHelper.ts +291 -0
- package/src/vendor/react-native/VirtualizeUtils/index.tsx +212 -0
- package/src/vendor/react-native/VirtualizedList/CellRenderMask.ts +147 -0
- package/src/vendor/react-native/VirtualizedList/ChildListCollection.tsx +73 -0
- package/src/vendor/react-native/VirtualizedList/StateSafePureComponent.tsx +79 -0
- package/src/vendor/react-native/VirtualizedList/VirtualizedListCellRenderer.tsx +210 -0
- package/src/vendor/react-native/VirtualizedList/VirtualizedListContext.tsx +116 -0
- package/src/vendor/react-native/VirtualizedList/VirtualizedListProps.ts +130 -0
- package/src/vendor/react-native/VirtualizedList/index.tsx +1797 -0
- package/src/vendor/react-native/deepDiffer/index.tsx +56 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
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", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var Batchinator_exports = {};
|
|
33
|
+
__export(Batchinator_exports, {
|
|
34
|
+
default: () => Batchinator_default
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(Batchinator_exports);
|
|
37
|
+
var import_InteractionManager = __toESM(require("../InteractionManager/index.cjs"));
|
|
38
|
+
class Batchinator {
|
|
39
|
+
_callback;
|
|
40
|
+
_delay;
|
|
41
|
+
_taskHandle = null;
|
|
42
|
+
constructor(callback, delayMS) {
|
|
43
|
+
this._delay = delayMS, this._callback = callback;
|
|
44
|
+
}
|
|
45
|
+
/*
|
|
46
|
+
* Cleanup any pending tasks.
|
|
47
|
+
*
|
|
48
|
+
* By default, if there is a pending task the callback is run immediately. Set the option abort to
|
|
49
|
+
* true to not call the callback if it was pending.
|
|
50
|
+
*/
|
|
51
|
+
dispose(options = {
|
|
52
|
+
abort: !1
|
|
53
|
+
}) {
|
|
54
|
+
this._taskHandle && (this._taskHandle.cancel(), options.abort || this._callback(), this._taskHandle = null);
|
|
55
|
+
}
|
|
56
|
+
schedule() {
|
|
57
|
+
if (this._taskHandle) return;
|
|
58
|
+
const timeoutHandle = setTimeout(() => {
|
|
59
|
+
this._taskHandle = import_InteractionManager.default.runAfterInteractions(() => {
|
|
60
|
+
this._taskHandle = null, this._callback();
|
|
61
|
+
});
|
|
62
|
+
}, this._delay);
|
|
63
|
+
this._taskHandle = {
|
|
64
|
+
cancel: () => clearTimeout(timeoutHandle)
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
var Batchinator_default = Batchinator;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
+
mod
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
+
var Batchinator_exports = {};
|
|
24
|
+
__export(Batchinator_exports, {
|
|
25
|
+
default: () => Batchinator_default
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(Batchinator_exports);
|
|
28
|
+
var import_InteractionManager = __toESM(require("../InteractionManager"));
|
|
29
|
+
class Batchinator {
|
|
30
|
+
_callback;
|
|
31
|
+
_delay;
|
|
32
|
+
_taskHandle = null;
|
|
33
|
+
constructor(callback, delayMS) {
|
|
34
|
+
this._delay = delayMS, this._callback = callback;
|
|
35
|
+
}
|
|
36
|
+
/*
|
|
37
|
+
* Cleanup any pending tasks.
|
|
38
|
+
*
|
|
39
|
+
* By default, if there is a pending task the callback is run immediately. Set the option abort to
|
|
40
|
+
* true to not call the callback if it was pending.
|
|
41
|
+
*/
|
|
42
|
+
dispose(options = { abort: !1 }) {
|
|
43
|
+
this._taskHandle && (this._taskHandle.cancel(), options.abort || this._callback(), this._taskHandle = null);
|
|
44
|
+
}
|
|
45
|
+
schedule() {
|
|
46
|
+
if (this._taskHandle)
|
|
47
|
+
return;
|
|
48
|
+
const timeoutHandle = setTimeout(() => {
|
|
49
|
+
this._taskHandle = import_InteractionManager.default.runAfterInteractions(() => {
|
|
50
|
+
this._taskHandle = null, this._callback();
|
|
51
|
+
});
|
|
52
|
+
}, this._delay);
|
|
53
|
+
this._taskHandle = { cancel: () => clearTimeout(timeoutHandle) };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
var Batchinator_default = Batchinator;
|
|
57
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/Batchinator/index.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,gCAA+B;AAwB/B,MAAM,YAAY;AAAA,EACR;AAAA,EACA;AAAA,EACA,cAA2C;AAAA,EAEnD,YAAY,UAAsB,SAAiB;AACjD,SAAK,SAAS,SACd,KAAK,YAAY;AAAA,EACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,QAAQ,UAA8B,EAAE,OAAO,GAAM,GAAG;AACtD,IAAI,KAAK,gBACP,KAAK,YAAY,OAAO,GACnB,QAAQ,SACX,KAAK,UAAU,GAEjB,KAAK,cAAc;AAAA,EAEvB;AAAA,EAEA,WAAW;AACT,QAAI,KAAK;AACP;AAGF,UAAM,gBAAgB,WAAW,MAAM;AACrC,WAAK,cAAc,0BAAAA,QAAmB,qBAAqB,MAAM;AAG/D,aAAK,cAAc,MACnB,KAAK,UAAU;AAAA,MACjB,CAAC;AAAA,IACH,GAAG,KAAK,MAAM;AAEd,SAAK,cAAc,EAAE,QAAQ,MAAM,aAAa,aAAa,EAAE;AAAA,EACjE;AACF;AAEA,IAAO,sBAAQ;",
|
|
5
|
+
"names": ["InteractionManager"]
|
|
6
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
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, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
10
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
return to;
|
|
15
|
+
};
|
|
16
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
17
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
18
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
19
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
20
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
21
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
22
|
+
mod
|
|
23
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
24
|
+
var Batchinator_exports = {};
|
|
25
|
+
__export(Batchinator_exports, {
|
|
26
|
+
default: () => Batchinator_default
|
|
27
|
+
});
|
|
28
|
+
module.exports = __toCommonJS(Batchinator_exports);
|
|
29
|
+
var import_InteractionManager = __toESM(require("../InteractionManager"));
|
|
30
|
+
function _class_call_check(instance, Constructor) {
|
|
31
|
+
if (!(instance instanceof Constructor))
|
|
32
|
+
throw new TypeError("Cannot call a class as a function");
|
|
33
|
+
}
|
|
34
|
+
function _defineProperties(target, props) {
|
|
35
|
+
for (var i = 0; i < props.length; i++) {
|
|
36
|
+
var descriptor = props[i];
|
|
37
|
+
descriptor.enumerable = descriptor.enumerable || !1, descriptor.configurable = !0, "value" in descriptor && (descriptor.writable = !0), Object.defineProperty(target, descriptor.key, descriptor);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function _create_class(Constructor, protoProps, staticProps) {
|
|
41
|
+
return protoProps && _defineProperties(Constructor.prototype, protoProps), staticProps && _defineProperties(Constructor, staticProps), Constructor;
|
|
42
|
+
}
|
|
43
|
+
function _define_property(obj, key, value) {
|
|
44
|
+
return key in obj ? Object.defineProperty(obj, key, {
|
|
45
|
+
value,
|
|
46
|
+
enumerable: !0,
|
|
47
|
+
configurable: !0,
|
|
48
|
+
writable: !0
|
|
49
|
+
}) : obj[key] = value, obj;
|
|
50
|
+
}
|
|
51
|
+
var Batchinator = /* @__PURE__ */ function() {
|
|
52
|
+
"use strict";
|
|
53
|
+
function Batchinator2(callback, delayMS) {
|
|
54
|
+
_class_call_check(this, Batchinator2), _define_property(this, "_callback", void 0), _define_property(this, "_delay", void 0), _define_property(this, "_taskHandle", null), this._delay = delayMS, this._callback = callback;
|
|
55
|
+
}
|
|
56
|
+
return _create_class(Batchinator2, [
|
|
57
|
+
{
|
|
58
|
+
/*
|
|
59
|
+
* Cleanup any pending tasks.
|
|
60
|
+
*
|
|
61
|
+
* By default, if there is a pending task the callback is run immediately. Set the option abort to
|
|
62
|
+
* true to not call the callback if it was pending.
|
|
63
|
+
*/
|
|
64
|
+
key: "dispose",
|
|
65
|
+
value: function() {
|
|
66
|
+
var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {
|
|
67
|
+
abort: !1
|
|
68
|
+
};
|
|
69
|
+
this._taskHandle && (this._taskHandle.cancel(), options.abort || this._callback(), this._taskHandle = null);
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
key: "schedule",
|
|
74
|
+
value: function() {
|
|
75
|
+
var _this = this;
|
|
76
|
+
if (!this._taskHandle) {
|
|
77
|
+
var timeoutHandle = setTimeout(function() {
|
|
78
|
+
_this._taskHandle = import_InteractionManager.default.runAfterInteractions(function() {
|
|
79
|
+
_this._taskHandle = null, _this._callback();
|
|
80
|
+
});
|
|
81
|
+
}, this._delay);
|
|
82
|
+
this._taskHandle = {
|
|
83
|
+
cancel: function() {
|
|
84
|
+
return clearTimeout(timeoutHandle);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
]), Batchinator2;
|
|
91
|
+
}(), Batchinator_default = Batchinator;
|
|
92
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/Batchinator/Users/n8/tamagui/code/packages/react-native-web-lite/src/Batchinator/index.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AASA,gCAA+B;AAF9B,SAAA,kBAAA,UAAA,aAAA;;;;;;;;;;;;;;;;;;;;;AA0BD,IAAMA,cAAN,2BAAA;;WAAMA,aAKQC,UAAsBC,SAAe;4BAL7CF,YAAAA,GACJ,iBAAA,MAAQG,aAAR,MAAA,GACA,iBAAA,MAAQC,UAAR,MAAA,GACA,iBAAA,MAAQC,eAA2C,IAAA,GAGjD,KAAKD,SAASF,SACd,KAAKC,YAAYF;;uBAPfD,cAAAA;;;;;;;;MAgBJM,KAAAA;aAAAA,WAAAA;YAAQC,UAAAA,UAAAA,SAAAA,KAAAA,UAAAA,CAAAA,MAAAA,SAAAA,UAAAA,CAAAA,IAA8B;UAAEC,OAAO;QAAM;AACnD,QAAI,KAAKH,gBACP,KAAKA,YAAYI,OAAM,GAClBF,QAAQC,SACX,KAAKL,UAAS,GAEhB,KAAKE,cAAc;MAEvB;;;MAEAK,KAAAA;aAAAA,WAAAA;;AACE,YAAI,MAAKL,aAIT;cAAMM,gBAAgBC,WAAW,WAAA;AAC/B,kBAAKP,cAAcQ,0BAAAA,QAAmBC,qBAAqB,WAAA;AAGzD,oBAAKT,cAAc,MACnB,MAAKF,UAAS;YAChB,CAAA;UACF,GAAG,KAAKC,MAAM;AAEd,eAAKC,cAAc;YAAEI,QAAQ,WAAA;qBAAMM,aAAaJ,aAAAA;;UAAe;;MACjE;;MAzCIX;KA4CN,sBAAeA;",
|
|
5
|
+
"names": ["Batchinator", "callback", "delayMS", "_callback", "_delay", "_taskHandle", "dispose", "options", "abort", "cancel", "schedule", "timeoutHandle", "setTimeout", "InteractionManager", "runAfterInteractions", "clearTimeout"]
|
|
6
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf,
|
|
6
|
+
__hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all) __defProp(target, name, {
|
|
9
|
+
get: all[name],
|
|
10
|
+
enumerable: !0
|
|
11
|
+
});
|
|
12
|
+
},
|
|
13
|
+
__copyProps = (to, from, except, desc) => {
|
|
14
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
15
|
+
get: () => from[key],
|
|
16
|
+
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", {
|
|
26
|
+
value: mod,
|
|
27
|
+
enumerable: !0
|
|
28
|
+
}) : target, mod)),
|
|
29
|
+
__toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
30
|
+
value: !0
|
|
31
|
+
}), mod);
|
|
32
|
+
var FlatList_exports = {};
|
|
33
|
+
__export(FlatList_exports, {
|
|
34
|
+
default: () => FlatList_default
|
|
35
|
+
});
|
|
36
|
+
module.exports = __toCommonJS(FlatList_exports);
|
|
37
|
+
var import_react_native_web_internals = require("@tamagui/react-native-web-internals"),
|
|
38
|
+
import_memoize_one = __toESM(require("memoize-one")),
|
|
39
|
+
import_react = __toESM(require("react")),
|
|
40
|
+
import_deepDiffer = __toESM(require("./vendor/react-native/deepDiffer/index.cjs")),
|
|
41
|
+
import_VirtualizedList = __toESM(require("./vendor/react-native/VirtualizedList/index.cjs")),
|
|
42
|
+
import_VirtualizeUtils = require("./vendor/react-native/VirtualizeUtils/index.cjs"),
|
|
43
|
+
import_View = __toESM(require("./View/index.cjs")),
|
|
44
|
+
import_jsx_runtime = require("react/jsx-runtime");
|
|
45
|
+
function removeClippedSubviewsOrDefault(removeClippedSubviews) {
|
|
46
|
+
return removeClippedSubviews ?? import_react_native_web_internals.Platform.OS === "android";
|
|
47
|
+
}
|
|
48
|
+
function numColumnsOrDefault(numColumns) {
|
|
49
|
+
return numColumns ?? 1;
|
|
50
|
+
}
|
|
51
|
+
function isArrayLike(data) {
|
|
52
|
+
return typeof Object(data).length == "number";
|
|
53
|
+
}
|
|
54
|
+
class FlatList extends import_react.default.PureComponent {
|
|
55
|
+
props;
|
|
56
|
+
_listRef = null;
|
|
57
|
+
_virtualizedListPairs = [];
|
|
58
|
+
constructor(props) {
|
|
59
|
+
super(props), this.props = props, this._checkProps(this.props), this.props.viewabilityConfigCallbackPairs ? this._virtualizedListPairs = this.props.viewabilityConfigCallbackPairs.map(pair => ({
|
|
60
|
+
viewabilityConfig: pair.viewabilityConfig,
|
|
61
|
+
onViewableItemsChanged: this._createOnViewableItemsChanged(pair.onViewableItemsChanged)
|
|
62
|
+
})) : this.props.onViewableItemsChanged && this._virtualizedListPairs.push({
|
|
63
|
+
viewabilityConfig: this.props.viewabilityConfig,
|
|
64
|
+
onViewableItemsChanged: this._createOnViewableItemsChanged(this.props.onViewableItemsChanged)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
componentDidUpdate(prevProps) {
|
|
68
|
+
(0, import_react_native_web_internals.invariant)(prevProps.numColumns === this.props.numColumns, "Changing numColumns on the fly is not supported. Change the key prop on FlatList when changing the number of columns to force a fresh render of the component."), (0, import_react_native_web_internals.invariant)(prevProps.onViewableItemsChanged === this.props.onViewableItemsChanged, "Changing onViewableItemsChanged on the fly is not supported"), (0, import_react_native_web_internals.invariant)(!(0, import_deepDiffer.default)(prevProps.viewabilityConfig, this.props.viewabilityConfig), "Changing viewabilityConfig on the fly is not supported"), (0, import_react_native_web_internals.invariant)(prevProps.viewabilityConfigCallbackPairs === this.props.viewabilityConfigCallbackPairs, "Changing viewabilityConfigCallbackPairs on the fly is not supported"), this._checkProps(this.props);
|
|
69
|
+
}
|
|
70
|
+
_captureRef = ref => {
|
|
71
|
+
this._listRef = ref;
|
|
72
|
+
};
|
|
73
|
+
_checkProps(props) {
|
|
74
|
+
const {
|
|
75
|
+
getItem,
|
|
76
|
+
getItemCount,
|
|
77
|
+
horizontal,
|
|
78
|
+
columnWrapperStyle,
|
|
79
|
+
onViewableItemsChanged,
|
|
80
|
+
viewabilityConfigCallbackPairs
|
|
81
|
+
} = props,
|
|
82
|
+
numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
83
|
+
(0, import_react_native_web_internals.invariant)(!getItem && !getItemCount, "FlatList does not support custom data formats."), numColumns > 1 ? (0, import_react_native_web_internals.invariant)(!horizontal, "numColumns does not support horizontal.") : (0, import_react_native_web_internals.invariant)(!columnWrapperStyle, "columnWrapperStyle not supported for single column lists"), (0, import_react_native_web_internals.invariant)(!(onViewableItemsChanged && viewabilityConfigCallbackPairs), "FlatList does not support setting both onViewableItemsChanged and viewabilityConfigCallbackPairs.");
|
|
84
|
+
}
|
|
85
|
+
_getItem = (data, index) => {
|
|
86
|
+
const numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
87
|
+
if (numColumns > 1) {
|
|
88
|
+
const ret = [];
|
|
89
|
+
for (let kk = 0; kk < numColumns; kk++) {
|
|
90
|
+
const itemIndex = index * numColumns + kk;
|
|
91
|
+
if (itemIndex < data.length) {
|
|
92
|
+
const item = data[itemIndex];
|
|
93
|
+
ret.push(item);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return ret;
|
|
97
|
+
} else return data[index];
|
|
98
|
+
};
|
|
99
|
+
_getItemCount = data => {
|
|
100
|
+
if (data != null && isArrayLike(data)) {
|
|
101
|
+
const numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
102
|
+
return numColumns > 1 ? Math.ceil(data.length / numColumns) : data.length;
|
|
103
|
+
} else return 0;
|
|
104
|
+
};
|
|
105
|
+
_keyExtractor = (items, index) => {
|
|
106
|
+
const numColumns = numColumnsOrDefault(this.props.numColumns),
|
|
107
|
+
keyExtractor = this.props.keyExtractor ?? import_VirtualizeUtils.keyExtractor;
|
|
108
|
+
return numColumns > 1 ? ((0, import_react_native_web_internals.invariant)(Array.isArray(items), "FlatList: Expected each item to be an array with multiple columns."), items.map((item, kk) => keyExtractor(item, index * numColumns + kk)).join(":")) : keyExtractor(items, index);
|
|
109
|
+
};
|
|
110
|
+
_pushMultiColumnViewable(arr, v) {
|
|
111
|
+
const numColumns = numColumnsOrDefault(this.props.numColumns),
|
|
112
|
+
keyExtractor = this.props.keyExtractor ?? import_VirtualizeUtils.keyExtractor;
|
|
113
|
+
v.item.forEach((item, ii) => {
|
|
114
|
+
(0, import_react_native_web_internals.invariant)(v.index != null, "Missing index!");
|
|
115
|
+
const index = v.index * numColumns + ii;
|
|
116
|
+
arr.push({
|
|
117
|
+
...v,
|
|
118
|
+
item,
|
|
119
|
+
key: keyExtractor(item, index),
|
|
120
|
+
index
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
_createOnViewableItemsChanged(onViewableItemsChanged) {
|
|
125
|
+
return info => {
|
|
126
|
+
const numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
127
|
+
if (onViewableItemsChanged) if (numColumns > 1) {
|
|
128
|
+
const changed = [],
|
|
129
|
+
viewableItems = [];
|
|
130
|
+
info.viewableItems.forEach(v => this._pushMultiColumnViewable(viewableItems, v)), info.changed.forEach(v => this._pushMultiColumnViewable(changed, v)), onViewableItemsChanged({
|
|
131
|
+
viewableItems,
|
|
132
|
+
changed
|
|
133
|
+
});
|
|
134
|
+
} else onViewableItemsChanged(info);
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
_renderer = (ListItemComponent, renderItem, columnWrapperStyle, numColumns, extraData) => {
|
|
138
|
+
const cols = numColumnsOrDefault(numColumns),
|
|
139
|
+
render = props => ListItemComponent ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(ListItemComponent, {
|
|
140
|
+
...props
|
|
141
|
+
}) : renderItem ? renderItem(props) : null,
|
|
142
|
+
renderProp = info => {
|
|
143
|
+
if (cols > 1) {
|
|
144
|
+
const {
|
|
145
|
+
item,
|
|
146
|
+
index
|
|
147
|
+
} = info;
|
|
148
|
+
return (0, import_react_native_web_internals.invariant)(Array.isArray(item), "Expected array of items with numColumns > 1"), /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_View.default, {
|
|
149
|
+
style: [styles.row, columnWrapperStyle],
|
|
150
|
+
children: item.map((it, kk) => {
|
|
151
|
+
const element = render({
|
|
152
|
+
item: it,
|
|
153
|
+
index: index * cols + kk,
|
|
154
|
+
separators: info.separators
|
|
155
|
+
});
|
|
156
|
+
return element != null ? /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react.default.Fragment, {
|
|
157
|
+
children: element
|
|
158
|
+
}, kk) : null;
|
|
159
|
+
})
|
|
160
|
+
});
|
|
161
|
+
} else return render(info);
|
|
162
|
+
};
|
|
163
|
+
return ListItemComponent ? {
|
|
164
|
+
ListItemComponent: renderProp
|
|
165
|
+
} : {
|
|
166
|
+
renderItem: renderProp
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
_memoizedRenderer = (0, import_memoize_one.default)(this._renderer);
|
|
170
|
+
render() {
|
|
171
|
+
const {
|
|
172
|
+
numColumns,
|
|
173
|
+
columnWrapperStyle,
|
|
174
|
+
removeClippedSubviews: _removeClippedSubviews,
|
|
175
|
+
strictMode = !1,
|
|
176
|
+
...restProps
|
|
177
|
+
} = this.props,
|
|
178
|
+
renderer = strictMode ? this._memoizedRenderer : this._renderer;
|
|
179
|
+
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_VirtualizedList.default, {
|
|
180
|
+
...restProps,
|
|
181
|
+
getItem: this._getItem,
|
|
182
|
+
getItemCount: this._getItemCount,
|
|
183
|
+
keyExtractor: this._keyExtractor,
|
|
184
|
+
ref: this._captureRef,
|
|
185
|
+
viewabilityConfigCallbackPairs: this._virtualizedListPairs,
|
|
186
|
+
removeClippedSubviews: removeClippedSubviewsOrDefault(_removeClippedSubviews),
|
|
187
|
+
...renderer(this.props.ListItemComponent, this.props.renderItem, columnWrapperStyle, numColumns, this.props.extraData)
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const styles = {
|
|
192
|
+
row: {
|
|
193
|
+
flexDirection: "row"
|
|
194
|
+
}
|
|
195
|
+
};
|
|
196
|
+
var FlatList_default = FlatList;
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
+
return to;
|
|
14
|
+
};
|
|
15
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
16
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
17
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
18
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
19
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
20
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target,
|
|
21
|
+
mod
|
|
22
|
+
)), __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
23
|
+
var FlatList_exports = {};
|
|
24
|
+
__export(FlatList_exports, {
|
|
25
|
+
default: () => FlatList_default
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(FlatList_exports);
|
|
28
|
+
var import_react_native_web_internals = require("@tamagui/react-native-web-internals"), import_memoize_one = __toESM(require("memoize-one")), import_react = __toESM(require("react")), import_deepDiffer = __toESM(require("./vendor/react-native/deepDiffer")), import_VirtualizedList = __toESM(require("./vendor/react-native/VirtualizedList")), import_VirtualizeUtils = require("./vendor/react-native/VirtualizeUtils"), import_View = __toESM(require("./View")), import_jsx_runtime = require("react/jsx-runtime");
|
|
29
|
+
function removeClippedSubviewsOrDefault(removeClippedSubviews) {
|
|
30
|
+
return removeClippedSubviews ?? import_react_native_web_internals.Platform.OS === "android";
|
|
31
|
+
}
|
|
32
|
+
function numColumnsOrDefault(numColumns) {
|
|
33
|
+
return numColumns ?? 1;
|
|
34
|
+
}
|
|
35
|
+
function isArrayLike(data) {
|
|
36
|
+
return typeof Object(data).length == "number";
|
|
37
|
+
}
|
|
38
|
+
class FlatList extends import_react.default.PureComponent {
|
|
39
|
+
props;
|
|
40
|
+
_listRef = null;
|
|
41
|
+
_virtualizedListPairs = [];
|
|
42
|
+
constructor(props) {
|
|
43
|
+
super(props), this.props = props, this._checkProps(this.props), this.props.viewabilityConfigCallbackPairs ? this._virtualizedListPairs = this.props.viewabilityConfigCallbackPairs.map(
|
|
44
|
+
(pair) => ({
|
|
45
|
+
viewabilityConfig: pair.viewabilityConfig,
|
|
46
|
+
onViewableItemsChanged: this._createOnViewableItemsChanged(
|
|
47
|
+
pair.onViewableItemsChanged
|
|
48
|
+
)
|
|
49
|
+
})
|
|
50
|
+
) : this.props.onViewableItemsChanged && this._virtualizedListPairs.push({
|
|
51
|
+
viewabilityConfig: this.props.viewabilityConfig,
|
|
52
|
+
onViewableItemsChanged: this._createOnViewableItemsChanged(
|
|
53
|
+
this.props.onViewableItemsChanged
|
|
54
|
+
)
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
componentDidUpdate(prevProps) {
|
|
58
|
+
(0, import_react_native_web_internals.invariant)(
|
|
59
|
+
prevProps.numColumns === this.props.numColumns,
|
|
60
|
+
"Changing numColumns on the fly is not supported. Change the key prop on FlatList when changing the number of columns to force a fresh render of the component."
|
|
61
|
+
), (0, import_react_native_web_internals.invariant)(
|
|
62
|
+
prevProps.onViewableItemsChanged === this.props.onViewableItemsChanged,
|
|
63
|
+
"Changing onViewableItemsChanged on the fly is not supported"
|
|
64
|
+
), (0, import_react_native_web_internals.invariant)(
|
|
65
|
+
!(0, import_deepDiffer.default)(prevProps.viewabilityConfig, this.props.viewabilityConfig),
|
|
66
|
+
"Changing viewabilityConfig on the fly is not supported"
|
|
67
|
+
), (0, import_react_native_web_internals.invariant)(
|
|
68
|
+
prevProps.viewabilityConfigCallbackPairs === this.props.viewabilityConfigCallbackPairs,
|
|
69
|
+
"Changing viewabilityConfigCallbackPairs on the fly is not supported"
|
|
70
|
+
), this._checkProps(this.props);
|
|
71
|
+
}
|
|
72
|
+
_captureRef = (ref) => {
|
|
73
|
+
this._listRef = ref;
|
|
74
|
+
};
|
|
75
|
+
_checkProps(props) {
|
|
76
|
+
const {
|
|
77
|
+
getItem,
|
|
78
|
+
getItemCount,
|
|
79
|
+
horizontal,
|
|
80
|
+
columnWrapperStyle,
|
|
81
|
+
onViewableItemsChanged,
|
|
82
|
+
viewabilityConfigCallbackPairs
|
|
83
|
+
} = props, numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
84
|
+
(0, import_react_native_web_internals.invariant)(!getItem && !getItemCount, "FlatList does not support custom data formats."), numColumns > 1 ? (0, import_react_native_web_internals.invariant)(!horizontal, "numColumns does not support horizontal.") : (0, import_react_native_web_internals.invariant)(
|
|
85
|
+
!columnWrapperStyle,
|
|
86
|
+
"columnWrapperStyle not supported for single column lists"
|
|
87
|
+
), (0, import_react_native_web_internals.invariant)(
|
|
88
|
+
!(onViewableItemsChanged && viewabilityConfigCallbackPairs),
|
|
89
|
+
"FlatList does not support setting both onViewableItemsChanged and viewabilityConfigCallbackPairs."
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
_getItem = (data, index) => {
|
|
93
|
+
const numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
94
|
+
if (numColumns > 1) {
|
|
95
|
+
const ret = [];
|
|
96
|
+
for (let kk = 0; kk < numColumns; kk++) {
|
|
97
|
+
const itemIndex = index * numColumns + kk;
|
|
98
|
+
if (itemIndex < data.length) {
|
|
99
|
+
const item = data[itemIndex];
|
|
100
|
+
ret.push(item);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return ret;
|
|
104
|
+
} else
|
|
105
|
+
return data[index];
|
|
106
|
+
};
|
|
107
|
+
_getItemCount = (data) => {
|
|
108
|
+
if (data != null && isArrayLike(data)) {
|
|
109
|
+
const numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
110
|
+
return numColumns > 1 ? Math.ceil(data.length / numColumns) : data.length;
|
|
111
|
+
} else
|
|
112
|
+
return 0;
|
|
113
|
+
};
|
|
114
|
+
_keyExtractor = (items, index) => {
|
|
115
|
+
const numColumns = numColumnsOrDefault(this.props.numColumns), keyExtractor = this.props.keyExtractor ?? import_VirtualizeUtils.keyExtractor;
|
|
116
|
+
return numColumns > 1 ? ((0, import_react_native_web_internals.invariant)(
|
|
117
|
+
Array.isArray(items),
|
|
118
|
+
"FlatList: Expected each item to be an array with multiple columns."
|
|
119
|
+
), items.map((item, kk) => keyExtractor(item, index * numColumns + kk)).join(":")) : keyExtractor(items, index);
|
|
120
|
+
};
|
|
121
|
+
_pushMultiColumnViewable(arr, v) {
|
|
122
|
+
const numColumns = numColumnsOrDefault(this.props.numColumns), keyExtractor = this.props.keyExtractor ?? import_VirtualizeUtils.keyExtractor;
|
|
123
|
+
v.item.forEach((item, ii) => {
|
|
124
|
+
(0, import_react_native_web_internals.invariant)(v.index != null, "Missing index!");
|
|
125
|
+
const index = v.index * numColumns + ii;
|
|
126
|
+
arr.push({ ...v, item, key: keyExtractor(item, index), index });
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
_createOnViewableItemsChanged(onViewableItemsChanged) {
|
|
130
|
+
return (info) => {
|
|
131
|
+
const numColumns = numColumnsOrDefault(this.props.numColumns);
|
|
132
|
+
if (onViewableItemsChanged)
|
|
133
|
+
if (numColumns > 1) {
|
|
134
|
+
const changed = [], viewableItems = [];
|
|
135
|
+
info.viewableItems.forEach(
|
|
136
|
+
(v) => this._pushMultiColumnViewable(viewableItems, v)
|
|
137
|
+
), info.changed.forEach((v) => this._pushMultiColumnViewable(changed, v)), onViewableItemsChanged({ viewableItems, changed });
|
|
138
|
+
} else
|
|
139
|
+
onViewableItemsChanged(info);
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
_renderer = (ListItemComponent, renderItem, columnWrapperStyle, numColumns, extraData) => {
|
|
143
|
+
const cols = numColumnsOrDefault(numColumns), render = (props) => ListItemComponent ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ListItemComponent, { ...props }) : renderItem ? renderItem(props) : null, renderProp = (info) => {
|
|
144
|
+
if (cols > 1) {
|
|
145
|
+
const { item, index } = info;
|
|
146
|
+
return (0, import_react_native_web_internals.invariant)(Array.isArray(item), "Expected array of items with numColumns > 1"), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_View.default, { style: [styles.row, columnWrapperStyle], children: item.map((it, kk) => {
|
|
147
|
+
const element = render({
|
|
148
|
+
item: it,
|
|
149
|
+
index: index * cols + kk,
|
|
150
|
+
separators: info.separators
|
|
151
|
+
});
|
|
152
|
+
return element != null ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react.default.Fragment, { children: element }, kk) : null;
|
|
153
|
+
}) });
|
|
154
|
+
} else
|
|
155
|
+
return render(info);
|
|
156
|
+
};
|
|
157
|
+
return ListItemComponent ? { ListItemComponent: renderProp } : { renderItem: renderProp };
|
|
158
|
+
};
|
|
159
|
+
_memoizedRenderer = (0, import_memoize_one.default)(this._renderer);
|
|
160
|
+
render() {
|
|
161
|
+
const {
|
|
162
|
+
numColumns,
|
|
163
|
+
columnWrapperStyle,
|
|
164
|
+
removeClippedSubviews: _removeClippedSubviews,
|
|
165
|
+
strictMode = !1,
|
|
166
|
+
...restProps
|
|
167
|
+
} = this.props, renderer = strictMode ? this._memoizedRenderer : this._renderer;
|
|
168
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
169
|
+
import_VirtualizedList.default,
|
|
170
|
+
{
|
|
171
|
+
...restProps,
|
|
172
|
+
getItem: this._getItem,
|
|
173
|
+
getItemCount: this._getItemCount,
|
|
174
|
+
keyExtractor: this._keyExtractor,
|
|
175
|
+
ref: this._captureRef,
|
|
176
|
+
viewabilityConfigCallbackPairs: this._virtualizedListPairs,
|
|
177
|
+
removeClippedSubviews: removeClippedSubviewsOrDefault(_removeClippedSubviews),
|
|
178
|
+
...renderer(
|
|
179
|
+
this.props.ListItemComponent,
|
|
180
|
+
this.props.renderItem,
|
|
181
|
+
columnWrapperStyle,
|
|
182
|
+
numColumns,
|
|
183
|
+
this.props.extraData
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const styles = {
|
|
190
|
+
row: { flexDirection: "row" }
|
|
191
|
+
};
|
|
192
|
+
var FlatList_default = FlatList;
|
|
193
|
+
//# sourceMappingURL=FlatList.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/FlatList.tsx"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,wCAAoC,gDACpC,qBAAuB,iCACvB,eAAkB,2BAClB,oBAAuB,sDAGvB,yBAA4B,2DAE5B,yBAAoD,kDACpD,cAAiB,4BA8OF;AAhMf,SAAS,+BAA+B,uBAAwC;AAC9E,SAAO,yBAAyB,2CAAS,OAAO;AAClD;AAEA,SAAS,oBAAoB,YAA4B;AACvD,SAAO,cAAc;AACvB;AAEA,SAAS,YAAY,MA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