-
Notifications
You must be signed in to change notification settings - Fork 184
feat(Calendar): add prop overrideDayProps
#8471
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat(Calendar): add prop overrideDayProps
#8471
Conversation
size-limit report 📦
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
e2e tests
|
👀 Docs deployed
📦 Package ✅yarn add @vkontakte/vkui@https://vkui-screenshot.hb.bizmrg.com/pull/8471/db4423f1171e7baee9e93231c391f27d8fac1575/pkg/@vkontakte/vkui/_pkg.tgz Commit db4423f |
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.
Классная задумка 💯
Конфликты появились |
# Conflicts: # packages/vkui/src/components/Calendar/Calendar.test.tsx # packages/vkui/src/components/CalendarDays/CalendarDays.tsx
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8471 +/- ##
=======================================
Coverage 95.60% 95.60%
=======================================
Files 414 414
Lines 11824 11830 +6
Branches 3917 3920 +3
=======================================
+ Hits 11304 11310 +6
Misses 520 520
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
🥇
* }) | ||
* ``` | ||
*/ | ||
overrideDayProps?: (value: Date) => Partial<Omit<CalendarDayProps, 'day' | 'renderDayContent'>>; |
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.
Может расширим dayProps
, чтобы можно было функцию передать? Новый проп звучит излишне
В любом случае, пока не совсем понял практического смысла в issue #7690 🤔 Если брать пример из jsdoc, то disabled
конкретного дня можно достичь через shouldDisableDate
, onChange
у <Calendar />
и так будет вызван с нужным днём, а className
для кастомизации не одобряем
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.
В любом случае, пока не совсем понял практического смысла в issue #7690
Вообще у CalendarDay есть много свойств, которые нельзя переопределить снаружи. НО возможно эти свойства и не нужно переопределять снаружи. Сложно придумать кейс, как это применить. Возможно стоит пока отложить это issue до еще запросов
Описание
Добавил свойство
overrideDayProps
, которое позволяет переопределять свойства ячейки календаря. Это можно использовать для более гибкой кастомизации и для добавления различных обработчиковRelease notes
Улучшения
overrideDayProps
для переопределения свойств ячейки календаряoverrideDayProps
для переопределения свойств ячейки календаряoverrideDayProps
для переопределения свойств ячейки календаряoverrideDayProps
для переопределения свойств ячейки календаря