feat(pkg.gridvirtualizer): add gridvirtualizer#88
Open
avea-maria wants to merge 2 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| import type { Meta, StoryObj } from '@storybook/react'; | ||
| import { GridVirtualizer } from '@xipkg/gridvirtualizer'; | ||
|
|
||
| type TMaterialItem = { |
Contributor
There was a problem hiding this comment.
Для интерфейсов используется IName, а для типов NameT, то есть тут должен быть суффикс. Не то чтобы это совсем важно, но так больше принято
| }; | ||
|
|
||
| const generateItems = (count: number): TMaterialItem[] => { | ||
| const colors = [ |
Contributor
There was a problem hiding this comment.
Можно вынести вне функции, чтобы массив не создавался каждый раз
| style={{ | ||
| height: `${rowVirtualizer.getTotalSize()}px`, | ||
| width: '100%', | ||
| position: 'relative', |
Contributor
There was a problem hiding this comment.
Я бы добавил возможность сюда прокинуть стили на всякий случай
| gap, | ||
| paddingBottom: gap, | ||
| gridTemplateColumns: `repeat(${colCount}, minmax(${minItemWidth}px, 1fr)`, | ||
| transform: `translateY(${virtualItem.start}px)`, |
Contributor
There was a problem hiding this comment.
Тут тоже бы пропсы добавить
| }} | ||
| > | ||
| {rowItems.map((item) => ( | ||
| <div key={item.id}>{renderItem(item)}</div> |
Contributor
There was a problem hiding this comment.
И тут бы пропсы прокидывать при необходимости
| @@ -0,0 +1,50 @@ | |||
| { | |||
| "name": "@xipkg/gridvirtualizer", | |||
| "version": "0.1.1", | |||
Contributor
There was a problem hiding this comment.
Будто лучше начать либо с 0.0.0, либо 1.0.0. Кажется второе даже предпочтительнее
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix 154 Добавлен инструмент GridVirtualizer для виртуализации больших списков элементов.