@react-fabric/data 1.0.0-beta.49 → 1.0.0-beta.51
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.
|
@@ -66,8 +66,9 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
66
66
|
if (scrollerRef.current) {
|
|
67
67
|
var el = scrollerRef.current;
|
|
68
68
|
var handler = function handler() {
|
|
69
|
-
var _el$offsetWidth;
|
|
70
|
-
|
|
69
|
+
var _getComputedStyle$pad, _el$firstElementChild, _el$offsetWidth;
|
|
70
|
+
var pad = parseInt((_getComputedStyle$pad = getComputedStyle((_el$firstElementChild = el.firstElementChild) === null || _el$firstElementChild === void 0 ? void 0 : _el$firstElementChild.firstElementChild).padding) !== null && _getComputedStyle$pad !== void 0 ? _getComputedStyle$pad : 8);
|
|
71
|
+
setColumnCount(columns !== null && columns !== void 0 ? columns : Math.max(1, Math.floor((((_el$offsetWidth = el === null || el === void 0 ? void 0 : el.offsetWidth) !== null && _el$offsetWidth !== void 0 ? _el$offsetWidth : 800) - 32 - (isNaN(pad) ? 8 : pad) * 2) / width)));
|
|
71
72
|
};
|
|
72
73
|
var ob = new ResizeObserver(handler);
|
|
73
74
|
handler();
|
|
@@ -199,7 +200,7 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
199
200
|
var key = _ref3.key,
|
|
200
201
|
index = _ref3.index;
|
|
201
202
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
202
|
-
className: "flex justify-
|
|
203
|
+
className: "flex justify-center",
|
|
203
204
|
"data-index": index,
|
|
204
205
|
ref: virtualizer.measureElement,
|
|
205
206
|
children: columnMap.map(function (col) {
|
|
@@ -66,8 +66,9 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
66
66
|
if (scrollerRef.current) {
|
|
67
67
|
var el = scrollerRef.current;
|
|
68
68
|
var handler = function handler() {
|
|
69
|
-
var _el$offsetWidth;
|
|
70
|
-
|
|
69
|
+
var _getComputedStyle$pad, _el$firstElementChild, _el$offsetWidth;
|
|
70
|
+
var pad = parseInt((_getComputedStyle$pad = getComputedStyle((_el$firstElementChild = el.firstElementChild) === null || _el$firstElementChild === void 0 ? void 0 : _el$firstElementChild.firstElementChild).padding) !== null && _getComputedStyle$pad !== void 0 ? _getComputedStyle$pad : 8);
|
|
71
|
+
setColumnCount(columns !== null && columns !== void 0 ? columns : Math.max(1, Math.floor((((_el$offsetWidth = el === null || el === void 0 ? void 0 : el.offsetWidth) !== null && _el$offsetWidth !== void 0 ? _el$offsetWidth : 800) - 32 - (isNaN(pad) ? 8 : pad) * 2) / width)));
|
|
71
72
|
};
|
|
72
73
|
var ob = new ResizeObserver(handler);
|
|
73
74
|
handler();
|
|
@@ -199,7 +200,7 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
199
200
|
var key = _ref3.key,
|
|
200
201
|
index = _ref3.index;
|
|
201
202
|
return /*#__PURE__*/jsx("div", {
|
|
202
|
-
className: "flex justify-
|
|
203
|
+
className: "flex justify-center",
|
|
203
204
|
"data-index": index,
|
|
204
205
|
ref: virtualizer.measureElement,
|
|
205
206
|
children: columnMap.map(function (col) {
|
|
@@ -14,7 +14,7 @@ export declare const useVirtualTable: <T extends KeyValue<any> = KeyValue<any>>(
|
|
|
14
14
|
groupProperty?: keyof T;
|
|
15
15
|
onCheckChanged?: (checked: AnyObject[]) => void;
|
|
16
16
|
}) => {
|
|
17
|
-
scrollerRef: import("react").RefObject<HTMLDivElement>;
|
|
17
|
+
scrollerRef: import("react").RefObject<HTMLDivElement | null>;
|
|
18
18
|
items: import("@tanstack/virtual-core").VirtualItem[];
|
|
19
19
|
checkState: DataState<T>;
|
|
20
20
|
getData: (index: number) => T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-fabric/data",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.51",
|
|
4
4
|
"description": "RUF: Data package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -35,24 +35,24 @@
|
|
|
35
35
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
39
|
-
"@react-fabric/date": "^1.0.0-beta.
|
|
40
|
-
"@react-fabric/form": "^1.0.0-beta.
|
|
41
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
38
|
+
"@react-fabric/core": "^1.0.0-beta.51",
|
|
39
|
+
"@react-fabric/date": "^1.0.0-beta.51",
|
|
40
|
+
"@react-fabric/form": "^1.0.0-beta.51",
|
|
41
|
+
"@react-fabric/utilities": "^1.0.0-beta.50",
|
|
42
42
|
"@tanstack/react-virtual": "^3.13.9",
|
|
43
43
|
"classnames": "^2.5.1",
|
|
44
44
|
"color": "^4.2.3",
|
|
45
45
|
"memoize-one": "^6.0.0"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"i18next": "^
|
|
48
|
+
"i18next": "^25.2.1",
|
|
49
49
|
"react": "^19.0.0",
|
|
50
50
|
"react-dom": "^19.0.0",
|
|
51
|
-
"react-i18next": "^15.
|
|
51
|
+
"react-i18next": "^15.5.2"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=18.12.0",
|
|
55
55
|
"npm": ">=8.19.0"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "a1b04de4663045f82992bff2aef8db26608eac74"
|
|
58
58
|
}
|
package/src/virtual/Gallery.tsx
CHANGED
|
@@ -150,9 +150,19 @@ const _VirtualGallery = <T extends AnyObject>({
|
|
|
150
150
|
if (scrollerRef.current) {
|
|
151
151
|
const el = scrollerRef.current;
|
|
152
152
|
const handler = () => {
|
|
153
|
+
const pad = parseInt(
|
|
154
|
+
getComputedStyle(el.firstElementChild?.firstElementChild as any)
|
|
155
|
+
.padding ?? 8,
|
|
156
|
+
);
|
|
153
157
|
setColumnCount(
|
|
154
158
|
columns ??
|
|
155
|
-
Math.max(
|
|
159
|
+
Math.max(
|
|
160
|
+
1,
|
|
161
|
+
Math.floor(
|
|
162
|
+
((el?.offsetWidth ?? 800) - 32 - (isNaN(pad) ? 8 : pad) * 2) /
|
|
163
|
+
width,
|
|
164
|
+
),
|
|
165
|
+
),
|
|
156
166
|
);
|
|
157
167
|
};
|
|
158
168
|
const ob = new ResizeObserver(handler);
|
|
@@ -308,7 +318,7 @@ const _VirtualGallery = <T extends AnyObject>({
|
|
|
308
318
|
<div style={{ height: virtualItems[0]?.start }} />
|
|
309
319
|
{virtualItems.map(({ key, index }) => (
|
|
310
320
|
<div
|
|
311
|
-
className="flex justify-
|
|
321
|
+
className="flex justify-center"
|
|
312
322
|
key={key}
|
|
313
323
|
data-index={index}
|
|
314
324
|
ref={virtualizer.measureElement}
|