cozy-ui 127.2.0 → 127.3.0

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/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ # [127.3.0](https://github.com/cozy/cozy-ui/compare/v127.2.0...v127.3.0) (2025-07-21)
2
+
3
+
4
+ ### Features
5
+
6
+ * implement virtualized grid :sparkles: ([9a6a475](https://github.com/cozy/cozy-ui/commit/9a6a475))
7
+
1
8
  # [127.2.0](https://github.com/cozy/cozy-ui/compare/v127.1.0...v127.2.0) (2025-07-01)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cozy-ui",
3
- "version": "127.2.0",
3
+ "version": "127.3.0",
4
4
  "description": "Cozy apps UI SDK",
5
5
  "main": "./index.js",
6
6
  "bin": {
@@ -0,0 +1,21 @@
1
+ import React, { forwardRef } from 'react'
2
+ import { VirtuosoGrid } from 'react-virtuoso'
3
+
4
+ const VirtualizedGridList = forwardRef(
5
+ ({ items = [], itemRenderer, components, ...props }, ref) => {
6
+ return (
7
+ <VirtuosoGrid
8
+ ref={ref}
9
+ components={components}
10
+ style={{ height: '100%' }}
11
+ totalCount={items.length}
12
+ itemContent={index => itemRenderer(items[index])}
13
+ {...props}
14
+ />
15
+ )
16
+ }
17
+ )
18
+
19
+ VirtualizedGridList.displayName = 'VirtualizedGridList'
20
+
21
+ export default VirtualizedGridList
@@ -0,0 +1,3 @@
1
+ export default VirtualizedGridList;
2
+ declare const VirtualizedGridList: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
+ import React from "react";
@@ -0,0 +1,26 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ var _excluded = ["items", "itemRenderer", "components"];
4
+ import React, { forwardRef } from 'react';
5
+ import { VirtuosoGrid } from 'react-virtuoso';
6
+ var VirtualizedGridList = /*#__PURE__*/forwardRef(function (_ref, ref) {
7
+ var _ref$items = _ref.items,
8
+ items = _ref$items === void 0 ? [] : _ref$items,
9
+ itemRenderer = _ref.itemRenderer,
10
+ components = _ref.components,
11
+ props = _objectWithoutProperties(_ref, _excluded);
12
+
13
+ return /*#__PURE__*/React.createElement(VirtuosoGrid, _extends({
14
+ ref: ref,
15
+ components: components,
16
+ style: {
17
+ height: '100%'
18
+ },
19
+ totalCount: items.length,
20
+ itemContent: function itemContent(index) {
21
+ return itemRenderer(items[index]);
22
+ }
23
+ }, props));
24
+ });
25
+ VirtualizedGridList.displayName = 'VirtualizedGridList';
26
+ export default VirtualizedGridList;