-
Notifications
You must be signed in to change notification settings - Fork 20
feat(plasma-ui): VirtualCarousel #1131
base: master
Are you sure you want to change the base?
Conversation
Demo canvas app deployed! |
Codecov Report
@@ Coverage Diff @@
## master #1131 +/- ##
==========================================
- Coverage 88.93% 87.27% -1.67%
==========================================
Files 349 316 -33
Lines 4611 4125 -486
Branches 1368 1225 -143
==========================================
- Hits 4101 3600 -501
- Misses 509 524 +15
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
Documentation preview deployed! website: http://plasma.sberdevices.ru/pr-1131/ |
[min, max], | ||
); | ||
|
||
useRemoteListener((key, ev) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
то же самое есть внутри виртуализации (useVirtual) - надо оставить только в одном месте
* Хранилище элементов карусели. | ||
*/ | ||
export class VirtualCarouselItemRefs { | ||
public items: MutableRefObject<HTMLElement | null>[] = []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а для чего это надо? сори, не осознала
* Подсчет: от 0 до 1, какое количество ширины/высоты | ||
* каждого элемента находится по центру скролла. | ||
*/ | ||
const detectActiveItem = useCallback( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useVirtual возвращает currentIndex, надо определиться где оно будет и только в одном месте детектить ActiveItem/currentIndex
Этот PR все еще в работе, но я хочу чуть раньше, чем доделаю его до конца отдать в ревью и попробовать внедрять
Что еще в работе:
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via:
npm install @sberdevices/demo-canvas-app@0.62.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-b2c@1.44.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-core@1.52.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-icons@1.70.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-temple@1.34.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-ui@1.85.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-web@1.79.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-cy-utils@0.8.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-sb-utils@0.51.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/showcase@0.100.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-ui-docs@0.46.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-web-docs@0.36.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 npm install @sberdevices/plasma-website@0.34.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 # or yarn add @sberdevices/demo-canvas-app@0.62.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-b2c@1.44.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-core@1.52.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-icons@1.70.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-temple@1.34.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-ui@1.85.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-web@1.79.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-cy-utils@0.8.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-sb-utils@0.51.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/showcase@0.100.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-ui-docs@0.46.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-web-docs@0.36.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0 yarn add @sberdevices/plasma-website@0.34.0-canary.1131.518ed3e5f260979be6bef7e94c9db7abaf7edddf.0