-
Notifications
You must be signed in to change notification settings - Fork 45
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
refactor(calendar): range logic #1190
base: master
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: b5ecd39 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Bundle size report
|
Pull Request Test Coverage Report for Build 9080530986Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
Собрана новая демка. |
Собрана новая демка. |
Предлагаемые изменения в Calendar
Т.к. основной запрос был на предоставление более удобного апи для выбора периода в компоненте Calendar, то предлагаю следующие изменения:
mode?: 'single' | 'range';
rangeBehavior
и избавить пользователя от необходимости самому настраивать хуки usePeriod и usePeriodWithReset.value
наvalue?: number | { dateFrom?: number; dateTo?: number };
onChange
на(date: number, dateTo?: number) => void
Кажется, что данных изменений будет достаточно, чтобы решить основные проблемы с текущим компонентом, а также не сломать обратную совместимость и не заставлять пользователей переезжать на новый компонент.