-
Notifications
You must be signed in to change notification settings - Fork 200
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
feat: new value and constraints API for Calendar and DateTimePicker #4726
Draft
mizgaionutalexandru
wants to merge
35
commits into
feature/date-time-picker
Choose a base branch
from
imizga/DTP-value-api
base: feature/date-time-picker
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
feat: new value and constraints API for Calendar and DateTimePicker #4726
mizgaionutalexandru
wants to merge
35
commits into
feature/date-time-picker
from
imizga/DTP-value-api
Conversation
This file contains 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
mizgaionutalexandru
changed the base branch from
main
to
feature/date-time-picker
September 5, 2024 12:55
Lighthouse scores
What is this?Lighthouse scores comparing the documentation site built from the PR ("Branch") to that of the production documentation site ("Latest") and the build currently on Transfer Size
Request Count
|
Tachometer resultsChromeaccordion permalinkbasic-test
action-bar permalinkbasic-test
action-button permalinkbasic-test
action-group permalinkbasic-test
action-menu permalinktest-basic
test-directive permalink
test-lazy permalink
test-open-close-directive permalink
test-open-close permalink
alert-banner permalinkbasic-test
alert-dialog permalinkbasic-test
asset permalinkbasic-test
avatar permalinktest-basic
badge permalinkbasic-test
banner permalinktest-basic
breadcrumbs permalinkbasic-test
button-group permalinkbasic-test
button permalinktest-basic
Firefoxaccordion permalinkbasic-test
action-bar permalinkbasic-test
action-button permalinkbasic-test
action-group permalinkbasic-test
action-menu permalinktest-basic
test-directive permalink
test-lazy permalink
test-open-close-directive permalink
test-open-close permalink
alert-banner permalinkbasic-test
alert-dialog permalinkbasic-test
asset permalinkbasic-test
avatar permalinktest-basic
badge permalinkbasic-test
banner permalinktest-basic
breadcrumbs permalinkbasic-test
button-group permalinkbasic-test
button permalinktest-basic
|
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.
Description
New value API
CalendarDate
using thetoCalendarDate
funtion provided by the internationalized/date library.clear
method that clears its value, being a more declarative way of sayingvalue = undefined
Min and max contraints
Note
Currently WIP for the DateTimePicker component.
For example, if
value
is of typeCalendarDate
but themin
constraint is of typeCalendarDateTime
, thevalue
will be converted toCalendarDateTime
with a time of 00.00 or 12 AM. If said date's time doesn't comply with the min constraint it should get the minimum available time from it.Removed TextField and InputSegments from the inheritance chain
Textfield
class was extended only for styling purposes. This PR removes that from the inheritance chain and the styles were be added manually from spectrum-css. This surfaced some problems with thevalid
variant and it was deleted for now since no requirement mentioned it but it was included in the RFC because it was previously available when theTextField
was extended. This can be prio'ed later on if required.InputSegments
class seems too big and handles a lot of logic that is specific for theDateTimePicker
. Currently the logic was moved to theDateTimePicker
file and will be extracted after some changes like the new value API are complete. An idea is to use something similar to aReactiveController
or simply aInputManager
class that can partially handle some logic for the segments and be instantiated in theDateTimePicker
.Tests structure for DateTimePicker
Others
getDatesInWeek
method now gets executed only when needed instead of every update, usingcurrentMonthDates
as a 2D arrayRelated issue(s)
How has this been tested?
Many changes are code refactoring, improvements and API changes. The changes should be covered by tests as well as the storybook.
Types of changes
Checklist
Best practices
This repository uses conventional commit syntax for each commit message; note that the GitHub UI does not use this by default so be cautious when accepting suggested changes. Avoid the "Update branch" button on the pull request and opt instead for rebasing your branch against
main
.