@react-fabric/data 1.0.0-beta.17 → 1.0.0-beta.18
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/virtual/Gallery.js +10 -3
- package/dist/cjs/virtual/List.js +7 -1
- package/dist/esm/virtual/Gallery.js +10 -3
- package/dist/esm/virtual/List.js +7 -1
- package/dist/types/virtual/Gallery.d.ts +7 -1
- package/dist/types/virtual/List.d.ts +3 -1
- package/package.json +6 -6
- package/src/virtual/Gallery.tsx +15 -1
- package/src/virtual/List.tsx +8 -0
|
@@ -12,7 +12,7 @@ var react = require('react');
|
|
|
12
12
|
var Scroller = require('./Scroller.js');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
|
|
15
|
-
var _excluded = ["items", "children", "columns", "padding", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "galleryRef"];
|
|
15
|
+
var _excluded = ["items", "children", "columns", "fullWidth", "maxWidth", "minWidth", "padding", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "galleryRef"];
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
18
|
var createItemList = memoizeOne(function (items) {
|
|
@@ -23,6 +23,9 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
23
23
|
var items = _ref.items,
|
|
24
24
|
children = _ref.children,
|
|
25
25
|
columns = _ref.columns,
|
|
26
|
+
fullWidth = _ref.fullWidth,
|
|
27
|
+
maxWidth = _ref.maxWidth,
|
|
28
|
+
minWidth = _ref.minWidth,
|
|
26
29
|
_ref$padding = _ref.padding,
|
|
27
30
|
padding = _ref$padding === void 0 ? "md" : _ref$padding,
|
|
28
31
|
_ref$defaultHeight = _ref.defaultHeight,
|
|
@@ -177,7 +180,11 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
177
180
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
178
181
|
className: classNames("inline-flex flex-nowrap gap-2 justify-center min-h-full min-w-full"),
|
|
179
182
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
180
|
-
className: classNames("box-content", padding === "sm" && "p-1", padding === "md" && "p-2", padding === "lg" && "p-4"),
|
|
183
|
+
className: classNames("box-content", fullWidth && "flex-1", padding === "sm" && "p-1", padding === "md" && "p-2", padding === "lg" && "p-4"),
|
|
184
|
+
style: {
|
|
185
|
+
minWidth: minWidth,
|
|
186
|
+
maxWidth: maxWidth
|
|
187
|
+
},
|
|
181
188
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
182
189
|
style: {
|
|
183
190
|
height: virtualizer.getTotalSize()
|
|
@@ -191,7 +198,7 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
191
198
|
index = _ref3.index,
|
|
192
199
|
measureElement = _ref3.measureElement;
|
|
193
200
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
194
|
-
className: "flex",
|
|
201
|
+
className: "flex justify-center",
|
|
195
202
|
"data-index": index,
|
|
196
203
|
ref: measureElement,
|
|
197
204
|
children: columnMap.map(function (col) {
|
package/dist/cjs/virtual/List.js
CHANGED
|
@@ -12,7 +12,7 @@ var react = require('react');
|
|
|
12
12
|
var Scroller = require('./Scroller.js');
|
|
13
13
|
var jsxRuntime = require('react/jsx-runtime');
|
|
14
14
|
|
|
15
|
-
var _excluded = ["items", "children", "fullWidth", "padding", "orientation", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "listRef"];
|
|
15
|
+
var _excluded = ["items", "children", "fullWidth", "maxWidth", "minWidth", "padding", "orientation", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "listRef"];
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
18
|
var createItemList = memoizeOne(function (items) {
|
|
@@ -23,6 +23,8 @@ var _VirtualList = function _VirtualList(_ref) {
|
|
|
23
23
|
var items = _ref.items,
|
|
24
24
|
children = _ref.children,
|
|
25
25
|
fullWidth = _ref.fullWidth,
|
|
26
|
+
maxWidth = _ref.maxWidth,
|
|
27
|
+
minWidth = _ref.minWidth,
|
|
26
28
|
_ref$padding = _ref.padding,
|
|
27
29
|
padding = _ref$padding === void 0 ? "md" : _ref$padding,
|
|
28
30
|
_ref$orientation = _ref.orientation,
|
|
@@ -169,6 +171,10 @@ var _VirtualList = function _VirtualList(_ref) {
|
|
|
169
171
|
className: classNames("inline-flex flex-nowrap gap-2 justify-center min-h-full min-w-full", orientation === "horizontal" && "flex-col"),
|
|
170
172
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
171
173
|
className: classNames("box-content inline-flex flex-nowrap", orientation === "vertical" && "flex-col", orientation === "horizontal" && "flex-row", fullWidth && "flex-1", padding === "sm" && "p-1", padding === "md" && "p-2", padding === "lg" && "p-4"),
|
|
174
|
+
style: {
|
|
175
|
+
minWidth: minWidth,
|
|
176
|
+
maxWidth: maxWidth
|
|
177
|
+
},
|
|
172
178
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
173
179
|
style: orientation === "vertical" ? {
|
|
174
180
|
height: virtualizer.getTotalSize()
|
|
@@ -12,7 +12,7 @@ import { useDeferredValue, useMemo, useRef, useState, useEffect, useCallback, us
|
|
|
12
12
|
import { Scroller } from './Scroller.js';
|
|
13
13
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
14
|
|
|
15
|
-
var _excluded = ["items", "children", "columns", "padding", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "galleryRef"];
|
|
15
|
+
var _excluded = ["items", "children", "columns", "fullWidth", "maxWidth", "minWidth", "padding", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "galleryRef"];
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
18
|
var createItemList = memoizeOne(function (items) {
|
|
@@ -23,6 +23,9 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
23
23
|
var items = _ref.items,
|
|
24
24
|
children = _ref.children,
|
|
25
25
|
columns = _ref.columns,
|
|
26
|
+
fullWidth = _ref.fullWidth,
|
|
27
|
+
maxWidth = _ref.maxWidth,
|
|
28
|
+
minWidth = _ref.minWidth,
|
|
26
29
|
_ref$padding = _ref.padding,
|
|
27
30
|
padding = _ref$padding === void 0 ? "md" : _ref$padding,
|
|
28
31
|
_ref$defaultHeight = _ref.defaultHeight,
|
|
@@ -177,7 +180,11 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
177
180
|
children: /*#__PURE__*/jsxs("div", {
|
|
178
181
|
className: classNames("inline-flex flex-nowrap gap-2 justify-center min-h-full min-w-full"),
|
|
179
182
|
children: [/*#__PURE__*/jsx("div", {
|
|
180
|
-
className: classNames("box-content", padding === "sm" && "p-1", padding === "md" && "p-2", padding === "lg" && "p-4"),
|
|
183
|
+
className: classNames("box-content", fullWidth && "flex-1", padding === "sm" && "p-1", padding === "md" && "p-2", padding === "lg" && "p-4"),
|
|
184
|
+
style: {
|
|
185
|
+
minWidth: minWidth,
|
|
186
|
+
maxWidth: maxWidth
|
|
187
|
+
},
|
|
181
188
|
children: /*#__PURE__*/jsxs("div", {
|
|
182
189
|
style: {
|
|
183
190
|
height: virtualizer.getTotalSize()
|
|
@@ -191,7 +198,7 @@ var _VirtualGallery = function _VirtualGallery(_ref) {
|
|
|
191
198
|
index = _ref3.index,
|
|
192
199
|
measureElement = _ref3.measureElement;
|
|
193
200
|
return /*#__PURE__*/jsx("div", {
|
|
194
|
-
className: "flex",
|
|
201
|
+
className: "flex justify-center",
|
|
195
202
|
"data-index": index,
|
|
196
203
|
ref: measureElement,
|
|
197
204
|
children: columnMap.map(function (col) {
|
package/dist/esm/virtual/List.js
CHANGED
|
@@ -12,7 +12,7 @@ import { useDeferredValue, useMemo, useRef, useEffect, useCallback, useState, us
|
|
|
12
12
|
import { Scroller } from './Scroller.js';
|
|
13
13
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
14
|
|
|
15
|
-
var _excluded = ["items", "children", "fullWidth", "padding", "orientation", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "listRef"];
|
|
15
|
+
var _excluded = ["items", "children", "fullWidth", "maxWidth", "minWidth", "padding", "orientation", "defaultHeight", "defaultWidth", "hideScroller", "initialScroll", "loading", "onLoadMore", "onScroll", "listRef"];
|
|
16
16
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
17
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
18
18
|
var createItemList = memoizeOne(function (items) {
|
|
@@ -23,6 +23,8 @@ var _VirtualList = function _VirtualList(_ref) {
|
|
|
23
23
|
var items = _ref.items,
|
|
24
24
|
children = _ref.children,
|
|
25
25
|
fullWidth = _ref.fullWidth,
|
|
26
|
+
maxWidth = _ref.maxWidth,
|
|
27
|
+
minWidth = _ref.minWidth,
|
|
26
28
|
_ref$padding = _ref.padding,
|
|
27
29
|
padding = _ref$padding === void 0 ? "md" : _ref$padding,
|
|
28
30
|
_ref$orientation = _ref.orientation,
|
|
@@ -169,6 +171,10 @@ var _VirtualList = function _VirtualList(_ref) {
|
|
|
169
171
|
className: classNames("inline-flex flex-nowrap gap-2 justify-center min-h-full min-w-full", orientation === "horizontal" && "flex-col"),
|
|
170
172
|
children: [/*#__PURE__*/jsxs("div", {
|
|
171
173
|
className: classNames("box-content inline-flex flex-nowrap", orientation === "vertical" && "flex-col", orientation === "horizontal" && "flex-row", fullWidth && "flex-1", padding === "sm" && "p-1", padding === "md" && "p-2", padding === "lg" && "p-4"),
|
|
174
|
+
style: {
|
|
175
|
+
minWidth: minWidth,
|
|
176
|
+
maxWidth: maxWidth
|
|
177
|
+
},
|
|
172
178
|
children: [/*#__PURE__*/jsxs("div", {
|
|
173
179
|
style: orientation === "vertical" ? {
|
|
174
180
|
height: virtualizer.getTotalSize()
|
|
@@ -24,6 +24,12 @@ export interface VirtualGalleryProps<T> extends TestProps {
|
|
|
24
24
|
* default item width
|
|
25
25
|
*/
|
|
26
26
|
defaultWidth?: number;
|
|
27
|
+
/**
|
|
28
|
+
* full width list
|
|
29
|
+
*/
|
|
30
|
+
fullWidth?: boolean;
|
|
31
|
+
maxWidth?: string | number;
|
|
32
|
+
minWidth?: string | number;
|
|
27
33
|
/**
|
|
28
34
|
* padding
|
|
29
35
|
*/
|
|
@@ -51,6 +57,6 @@ export interface VirtualGalleryProps<T> extends TestProps {
|
|
|
51
57
|
onScroll?: (top: number) => void;
|
|
52
58
|
}
|
|
53
59
|
export declare const VirtualGallery: {
|
|
54
|
-
<T extends KeyValue<any>>({ items, children, columns, padding, defaultHeight: height, defaultWidth: width, hideScroller, initialScroll, loading, onLoadMore, onScroll, galleryRef, ...aria }: VirtualGalleryProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
<T extends KeyValue<any>>({ items, children, columns, fullWidth, maxWidth, minWidth, padding, defaultHeight: height, defaultWidth: width, hideScroller, initialScroll, loading, onLoadMore, onScroll, galleryRef, ...aria }: VirtualGalleryProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
55
61
|
displayName: string;
|
|
56
62
|
};
|
|
@@ -24,6 +24,8 @@ export interface VirtualListProps<T> extends TestProps {
|
|
|
24
24
|
* full width list
|
|
25
25
|
*/
|
|
26
26
|
fullWidth?: boolean;
|
|
27
|
+
maxWidth?: string | number;
|
|
28
|
+
minWidth?: string | number;
|
|
27
29
|
/**
|
|
28
30
|
* padding
|
|
29
31
|
*/
|
|
@@ -55,6 +57,6 @@ export interface VirtualListProps<T> extends TestProps {
|
|
|
55
57
|
onScroll?: (top: number) => void;
|
|
56
58
|
}
|
|
57
59
|
export declare const VirtualList: {
|
|
58
|
-
<T extends KeyValue<any>>({ items, children, fullWidth, padding, orientation, defaultHeight: height, defaultWidth: width, hideScroller, initialScroll, loading, onLoadMore, onScroll, listRef, ...aria }: VirtualListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
60
|
+
<T extends KeyValue<any>>({ items, children, fullWidth, maxWidth, minWidth, padding, orientation, defaultHeight: height, defaultWidth: width, hideScroller, initialScroll, loading, onLoadMore, onScroll, listRef, ...aria }: VirtualListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
59
61
|
displayName: string;
|
|
60
62
|
};
|
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.18",
|
|
4
4
|
"description": "RUF: Data package",
|
|
5
5
|
"author": "Adarsh Pastakia <adarshpastakia@outlook.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"watch": "npm-run-all -p watch:rollup watch:dts"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@react-fabric/core": "^1.0.0-beta.
|
|
37
|
-
"@react-fabric/date": "^1.0.0-beta.
|
|
38
|
-
"@react-fabric/form": "^1.0.0-beta.
|
|
39
|
-
"@react-fabric/utilities": "^1.0.0-beta.
|
|
36
|
+
"@react-fabric/core": "^1.0.0-beta.18",
|
|
37
|
+
"@react-fabric/date": "^1.0.0-beta.18",
|
|
38
|
+
"@react-fabric/form": "^1.0.0-beta.18",
|
|
39
|
+
"@react-fabric/utilities": "^1.0.0-beta.18",
|
|
40
40
|
"@tanstack/react-virtual": "^3.8.6",
|
|
41
41
|
"classnames": "^2.5.1",
|
|
42
42
|
"color": "^4.2.3",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"node": ">=18.12.0",
|
|
53
53
|
"npm": ">=8.19.0"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "4795fee60aa3e7411934a688f7c53e42ca3297ed"
|
|
56
56
|
}
|
package/src/virtual/Gallery.tsx
CHANGED
|
@@ -67,6 +67,12 @@ export interface VirtualGalleryProps<T> extends TestProps {
|
|
|
67
67
|
* default item width
|
|
68
68
|
*/
|
|
69
69
|
defaultWidth?: number;
|
|
70
|
+
/**
|
|
71
|
+
* full width list
|
|
72
|
+
*/
|
|
73
|
+
fullWidth?: boolean;
|
|
74
|
+
maxWidth?: string | number;
|
|
75
|
+
minWidth?: string | number;
|
|
70
76
|
/**
|
|
71
77
|
* padding
|
|
72
78
|
*/
|
|
@@ -100,6 +106,9 @@ const _VirtualGallery = <T extends KeyValue>({
|
|
|
100
106
|
items,
|
|
101
107
|
children,
|
|
102
108
|
columns,
|
|
109
|
+
fullWidth,
|
|
110
|
+
maxWidth,
|
|
111
|
+
minWidth,
|
|
103
112
|
padding = "md",
|
|
104
113
|
defaultHeight: height = 48,
|
|
105
114
|
defaultWidth: width = 48,
|
|
@@ -287,10 +296,15 @@ const _VirtualGallery = <T extends KeyValue>({
|
|
|
287
296
|
<div
|
|
288
297
|
className={classNames(
|
|
289
298
|
"box-content",
|
|
299
|
+
fullWidth && "flex-1",
|
|
290
300
|
padding === "sm" && "p-1",
|
|
291
301
|
padding === "md" && "p-2",
|
|
292
302
|
padding === "lg" && "p-4",
|
|
293
303
|
)}
|
|
304
|
+
style={{
|
|
305
|
+
minWidth,
|
|
306
|
+
maxWidth,
|
|
307
|
+
}}
|
|
294
308
|
>
|
|
295
309
|
<div
|
|
296
310
|
style={{
|
|
@@ -300,7 +314,7 @@ const _VirtualGallery = <T extends KeyValue>({
|
|
|
300
314
|
<div style={{ height: virtualItems[0]?.start }} />
|
|
301
315
|
{virtualItems.map(({ key, index, measureElement }) => (
|
|
302
316
|
<div
|
|
303
|
-
className="flex"
|
|
317
|
+
className="flex justify-center"
|
|
304
318
|
key={key}
|
|
305
319
|
data-index={index}
|
|
306
320
|
ref={measureElement}
|
package/src/virtual/List.tsx
CHANGED
|
@@ -74,6 +74,8 @@ export interface VirtualListProps<T> extends TestProps {
|
|
|
74
74
|
* full width list
|
|
75
75
|
*/
|
|
76
76
|
fullWidth?: boolean;
|
|
77
|
+
maxWidth?: string | number;
|
|
78
|
+
minWidth?: string | number;
|
|
77
79
|
/**
|
|
78
80
|
* padding
|
|
79
81
|
*/
|
|
@@ -111,6 +113,8 @@ const _VirtualList = <T extends KeyValue>({
|
|
|
111
113
|
items,
|
|
112
114
|
children,
|
|
113
115
|
fullWidth,
|
|
116
|
+
maxWidth,
|
|
117
|
+
minWidth,
|
|
114
118
|
padding = "md",
|
|
115
119
|
orientation = "vertical",
|
|
116
120
|
defaultHeight: height = 48,
|
|
@@ -278,6 +282,10 @@ const _VirtualList = <T extends KeyValue>({
|
|
|
278
282
|
padding === "md" && "p-2",
|
|
279
283
|
padding === "lg" && "p-4",
|
|
280
284
|
)}
|
|
285
|
+
style={{
|
|
286
|
+
minWidth,
|
|
287
|
+
maxWidth,
|
|
288
|
+
}}
|
|
281
289
|
>
|
|
282
290
|
<div
|
|
283
291
|
style={
|