@usefragments/ui 1.0.1 → 1.0.2
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/components/DataTable/DataTable.virtual.cjs +7 -7
- package/dist/components/DataTable/DataTable.virtual.js +1 -1
- package/package.json +1 -1
- package/dist/node_modules/.pnpm/@tanstack_react-virtual@3.13.18_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@tanstack/react-virtual/dist/esm/index.cjs +0 -68
- package/dist/node_modules/.pnpm/@tanstack_react-virtual@3.13.18_react-dom@19.2.4_react@19.2.4__react@19.2.4/node_modules/@tanstack/react-virtual/dist/esm/index.js +0 -52
- package/dist/node_modules/.pnpm/@tanstack_virtual-core@3.13.18/node_modules/@tanstack/virtual-core/dist/esm/index.cjs +0 -822
- package/dist/node_modules/.pnpm/@tanstack_virtual-core@3.13.18/node_modules/@tanstack/virtual-core/dist/esm/index.js +0 -822
- package/dist/node_modules/.pnpm/@tanstack_virtual-core@3.13.18/node_modules/@tanstack/virtual-core/dist/esm/utils.cjs +0 -72
- package/dist/node_modules/.pnpm/@tanstack_virtual-core@3.13.18/node_modules/@tanstack/virtual-core/dist/esm/utils.js +0 -72
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const React = require("react");
|
|
5
|
-
const
|
|
5
|
+
const reactVirtual = require("@tanstack/react-virtual");
|
|
6
6
|
const table = require("../../table.cjs");
|
|
7
7
|
function _interopNamespaceDefault(e) {
|
|
8
8
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -58,19 +58,19 @@ function useTableVirtualizer({
|
|
|
58
58
|
}) {
|
|
59
59
|
const itemsRef = React__namespace.useRef(items);
|
|
60
60
|
itemsRef.current = items;
|
|
61
|
-
const virtualizer =
|
|
61
|
+
const virtualizer = reactVirtual.useVirtualizer({
|
|
62
62
|
count: enabled ? items.length : 0,
|
|
63
63
|
getScrollElement,
|
|
64
|
-
estimateSize: (
|
|
64
|
+
estimateSize: (index) => estimateSize(itemsRef.current[index], index),
|
|
65
65
|
overscan,
|
|
66
|
-
getItemKey: getItemKey ? (
|
|
66
|
+
getItemKey: getItemKey ? (index) => getItemKey(itemsRef.current[index], index) : void 0
|
|
67
67
|
});
|
|
68
68
|
if (!enabled) {
|
|
69
69
|
return {
|
|
70
|
-
virtualRows: items.map((item,
|
|
71
|
-
index
|
|
70
|
+
virtualRows: items.map((item, index) => ({
|
|
71
|
+
index,
|
|
72
72
|
item,
|
|
73
|
-
key: (getItemKey == null ? void 0 : getItemKey(item,
|
|
73
|
+
key: (getItemKey == null ? void 0 : getItemKey(item, index)) ?? index
|
|
74
74
|
})),
|
|
75
75
|
paddingTop: 0,
|
|
76
76
|
paddingBottom: 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
|
-
import { useVirtualizer } from "
|
|
3
|
+
import { useVirtualizer } from "@tanstack/react-virtual";
|
|
4
4
|
import { Table } from "../../table.js";
|
|
5
5
|
function DataTableVirtualRoot({
|
|
6
6
|
caption,
|
package/package.json
CHANGED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const React = require("react");
|
|
4
|
-
const reactDom = require("react-dom");
|
|
5
|
-
const index = require("../../../../../../@tanstack_virtual-core@3.13.18/node_modules/@tanstack/virtual-core/dist/esm/index.cjs");
|
|
6
|
-
function _interopNamespaceDefault(e) {
|
|
7
|
-
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
8
|
-
if (e) {
|
|
9
|
-
for (const k in e) {
|
|
10
|
-
if (k !== "default") {
|
|
11
|
-
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: () => e[k]
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
n.default = e;
|
|
20
|
-
return Object.freeze(n);
|
|
21
|
-
}
|
|
22
|
-
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
|
|
23
|
-
const useIsomorphicLayoutEffect = typeof document !== "undefined" ? React__namespace.useLayoutEffect : React__namespace.useEffect;
|
|
24
|
-
function useVirtualizerBase({
|
|
25
|
-
useFlushSync = true,
|
|
26
|
-
...options
|
|
27
|
-
}) {
|
|
28
|
-
const rerender = React__namespace.useReducer(() => ({}), {})[1];
|
|
29
|
-
const resolvedOptions = {
|
|
30
|
-
...options,
|
|
31
|
-
onChange: (instance2, sync) => {
|
|
32
|
-
var _a;
|
|
33
|
-
if (useFlushSync && sync) {
|
|
34
|
-
reactDom.flushSync(rerender);
|
|
35
|
-
} else {
|
|
36
|
-
rerender();
|
|
37
|
-
}
|
|
38
|
-
(_a = options.onChange) == null ? void 0 : _a.call(options, instance2, sync);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
const [instance] = React__namespace.useState(
|
|
42
|
-
() => new index.Virtualizer(resolvedOptions)
|
|
43
|
-
);
|
|
44
|
-
instance.setOptions(resolvedOptions);
|
|
45
|
-
useIsomorphicLayoutEffect(() => {
|
|
46
|
-
return instance._didMount();
|
|
47
|
-
}, []);
|
|
48
|
-
useIsomorphicLayoutEffect(() => {
|
|
49
|
-
return instance._willUpdate();
|
|
50
|
-
});
|
|
51
|
-
return instance;
|
|
52
|
-
}
|
|
53
|
-
function useVirtualizer(options) {
|
|
54
|
-
return useVirtualizerBase({
|
|
55
|
-
observeElementRect: index.observeElementRect,
|
|
56
|
-
observeElementOffset: index.observeElementOffset,
|
|
57
|
-
scrollToFn: index.elementScroll,
|
|
58
|
-
...options
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
exports.Virtualizer = index.Virtualizer;
|
|
62
|
-
exports.defaultKeyExtractor = index.defaultKeyExtractor;
|
|
63
|
-
exports.defaultRangeExtractor = index.defaultRangeExtractor;
|
|
64
|
-
exports.elementScroll = index.elementScroll;
|
|
65
|
-
exports.measureElement = index.measureElement;
|
|
66
|
-
exports.observeElementOffset = index.observeElementOffset;
|
|
67
|
-
exports.observeElementRect = index.observeElementRect;
|
|
68
|
-
exports.useVirtualizer = useVirtualizer;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { flushSync } from "react-dom";
|
|
3
|
-
import { Virtualizer, elementScroll, observeElementOffset, observeElementRect } from "../../../../../../@tanstack_virtual-core@3.13.18/node_modules/@tanstack/virtual-core/dist/esm/index.js";
|
|
4
|
-
import { defaultKeyExtractor, defaultRangeExtractor, measureElement } from "../../../../../../@tanstack_virtual-core@3.13.18/node_modules/@tanstack/virtual-core/dist/esm/index.js";
|
|
5
|
-
const useIsomorphicLayoutEffect = typeof document !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
6
|
-
function useVirtualizerBase({
|
|
7
|
-
useFlushSync = true,
|
|
8
|
-
...options
|
|
9
|
-
}) {
|
|
10
|
-
const rerender = React.useReducer(() => ({}), {})[1];
|
|
11
|
-
const resolvedOptions = {
|
|
12
|
-
...options,
|
|
13
|
-
onChange: (instance2, sync) => {
|
|
14
|
-
var _a;
|
|
15
|
-
if (useFlushSync && sync) {
|
|
16
|
-
flushSync(rerender);
|
|
17
|
-
} else {
|
|
18
|
-
rerender();
|
|
19
|
-
}
|
|
20
|
-
(_a = options.onChange) == null ? void 0 : _a.call(options, instance2, sync);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const [instance] = React.useState(
|
|
24
|
-
() => new Virtualizer(resolvedOptions)
|
|
25
|
-
);
|
|
26
|
-
instance.setOptions(resolvedOptions);
|
|
27
|
-
useIsomorphicLayoutEffect(() => {
|
|
28
|
-
return instance._didMount();
|
|
29
|
-
}, []);
|
|
30
|
-
useIsomorphicLayoutEffect(() => {
|
|
31
|
-
return instance._willUpdate();
|
|
32
|
-
});
|
|
33
|
-
return instance;
|
|
34
|
-
}
|
|
35
|
-
function useVirtualizer(options) {
|
|
36
|
-
return useVirtualizerBase({
|
|
37
|
-
observeElementRect,
|
|
38
|
-
observeElementOffset,
|
|
39
|
-
scrollToFn: elementScroll,
|
|
40
|
-
...options
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
export {
|
|
44
|
-
Virtualizer,
|
|
45
|
-
defaultKeyExtractor,
|
|
46
|
-
defaultRangeExtractor,
|
|
47
|
-
elementScroll,
|
|
48
|
-
measureElement,
|
|
49
|
-
observeElementOffset,
|
|
50
|
-
observeElementRect,
|
|
51
|
-
useVirtualizer
|
|
52
|
-
};
|