@tapcart/mobile-components 0.8.36 → 0.8.37
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
interface GridType {
|
|
4
|
-
className: any;
|
|
5
4
|
children: React.ReactNode;
|
|
6
5
|
isLoadingMore: boolean;
|
|
7
6
|
isReachingEnd: boolean;
|
|
@@ -19,6 +18,6 @@ declare const virtualGridVariants: (props?: ({
|
|
|
19
18
|
} & import("class-variance-authority/dist/types").ClassProp) | undefined) => string;
|
|
20
19
|
export interface VirtualGridProps extends GridType, VariantProps<typeof virtualGridVariants> {
|
|
21
20
|
}
|
|
22
|
-
declare function VirtualGrid({
|
|
21
|
+
declare function VirtualGrid({ columns, children, overscan, estimatedHeight, isReachingEnd, LoaderItem, spacing, style, }: VirtualGridProps): import("react/jsx-runtime").JSX.Element;
|
|
23
22
|
export { VirtualGrid, virtualGridVariants };
|
|
24
23
|
//# sourceMappingURL=virtual-grid.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"virtual-grid.d.ts","sourceRoot":"","sources":["../../../components/ui/virtual-grid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAMjE,UAAU,QAAQ;IAChB,
|
|
1
|
+
{"version":3,"file":"virtual-grid.d.ts","sourceRoot":"","sources":["../../../components/ui/virtual-grid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAMjE,UAAU,QAAQ;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,aAAa,EAAE,OAAO,CAAA;IACtB,aAAa,EAAE,OAAO,CAAA;IACtB,UAAU,EAAE,KAAK,CAAC,iBAAiB,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,OAAO,CAAC,EAAE;QACR,aAAa,EAAE,MAAM,CAAA;QACrB,WAAW,EAAE,MAAM,CAAA;KACpB,CAAA;IACD,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAA;CAC5B;AAED,QAAA,MAAM,mBAAmB;;mFAYvB,CAAA;AAEF,MAAM,WAAW,gBACf,SAAQ,QAAQ,EACd,YAAY,CAAC,OAAO,mBAAmB,CAAC;CAAG;AAE/C,iBAAS,WAAW,CAAC,EACnB,OAAO,EACP,QAAQ,EACR,QAAY,EACZ,eAAqB,EACrB,aAAa,EACb,UAAU,EACV,OAGC,EACD,KAAK,GACN,EAAE,gBAAgB,2CAoElB;AAED,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,CAAA"}
|
|
@@ -18,11 +18,10 @@ const virtualGridVariants = cva("grid", {
|
|
|
18
18
|
columns: 2,
|
|
19
19
|
},
|
|
20
20
|
});
|
|
21
|
-
function VirtualGrid({
|
|
21
|
+
function VirtualGrid({ columns, children, overscan = 4, estimatedHeight = 375, isReachingEnd, LoaderItem, spacing = {
|
|
22
22
|
horizontalGap: 7,
|
|
23
23
|
verticalGap: 16,
|
|
24
24
|
}, style, }) {
|
|
25
|
-
const NUM_LOADER_ITEMS = columns || 2;
|
|
26
25
|
const col = columns || 2;
|
|
27
26
|
const parentRef = React.useRef(document.getElementById("tc-vgsl"));
|
|
28
27
|
const childrenArray = React.Children.toArray(children);
|
|
@@ -41,7 +40,7 @@ function VirtualGrid({ className, columns, children, overscan = 4, estimatedHeig
|
|
|
41
40
|
position: "relative",
|
|
42
41
|
} }, { children: rowVirtualizer.getVirtualItems().map((virtualRow) => {
|
|
43
42
|
const rowStartIndex = virtualRow.index * col;
|
|
44
|
-
return (_jsx("div", Object.assign({ className: cn(virtualGridVariants({ columns })), style: {
|
|
43
|
+
return (_jsx("div", Object.assign({ ref: rowVirtualizer.measureElement, "data-index": virtualRow.index, className: cn(virtualGridVariants({ columns })), style: {
|
|
45
44
|
position: "absolute",
|
|
46
45
|
top: 0,
|
|
47
46
|
left: 0,
|