Skip to content

feat(pkg.gridvirtualizer): add gridvirtualizer#88

Open
avea-maria wants to merge 2 commits into
mainfrom
154
Open

feat(pkg.gridvirtualizer): add gridvirtualizer#88
avea-maria wants to merge 2 commits into
mainfrom
154

Conversation

@avea-maria

@avea-maria avea-maria commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

fix 154 Добавлен инструмент GridVirtualizer для виртуализации больших списков элементов.

@vercel

vercel Bot commented Jul 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
xi-storybook Ready Ready Preview, Comment Jul 7, 2026 11:35pm

import type { Meta, StoryObj } from '@storybook/react';
import { GridVirtualizer } from '@xipkg/gridvirtualizer';

type TMaterialItem = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Для интерфейсов используется IName, а для типов NameT, то есть тут должен быть суффикс. Не то чтобы это совсем важно, но так больше принято

};

const generateItems = (count: number): TMaterialItem[] => {
const colors = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно вынести вне функции, чтобы массив не создавался каждый раз

style={{
height: `${rowVirtualizer.getTotalSize()}px`,
width: '100%',
position: 'relative',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Я бы добавил возможность сюда прокинуть стили на всякий случай

gap,
paddingBottom: gap,
gridTemplateColumns: `repeat(${colCount}, minmax(${minItemWidth}px, 1fr)`,
transform: `translateY(${virtualItem.start}px)`,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Тут тоже бы пропсы добавить

}}
>
{rowItems.map((item) => (
<div key={item.id}>{renderItem(item)}</div>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

И тут бы пропсы прокидывать при необходимости

@@ -0,0 +1,50 @@
{
"name": "@xipkg/gridvirtualizer",
"version": "0.1.1",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Будто лучше начать либо с 0.0.0, либо 1.0.0. Кажется второе даже предпочтительнее

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants