-
-
Notifications
You must be signed in to change notification settings - Fork 921
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DatePicker): supports date selection by using keyboard (#3515)
* fix(DateInput): fix AMPM not changing with the hour * fix: fix not being able to assign controlled null * feat(DatePicker): improve the interactive experience of DatePicker * test(Calendar): fix failing tests due to styling * fix: fix no focus issue * refactor: use useEventCallback instead of useCallback * refactor: use usePickerRef instead of usePublicMethods * fix: fix style issues caused by loading state * feat: add support for `label` on DatePicker * fix: improve accessibility * fix(DateInput): fix selection range error when deleting full month * fix(DateInput): fix unable to update selected field value * fix(DateInput): fix date format not working under controlled * feat(DatePicker): add a highlighting style for invalid dates * docs: fix document-nav incomplete display * fix: adjust the style of invalid dates * docs(DatePicker): update docs
- Loading branch information
Showing
55 changed files
with
1,790 additions
and
1,450 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,7 +20,7 @@ | |
} | ||
|
||
.document-nav { | ||
overflow: hidden; | ||
overflow: auto; | ||
z-index: 5; | ||
|
||
.nav-item { | ||
|
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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<!--start-code--> | ||
|
||
```js | ||
import { DatePicker, Stack } from 'rsuite'; | ||
|
||
const App = () => { | ||
const [value, setValue] = React.useState(new Date()); | ||
|
||
const handleChange = (value, event) => { | ||
setValue(value); | ||
console.log('Controlled Change', value); | ||
}; | ||
|
||
return ( | ||
<Stack spacing={10} direction="column" alignItems="flex-start"> | ||
<label>Controlled Value:</label> | ||
<DatePicker value={value} onChange={handleChange} /> | ||
|
||
<label>Uncontrolled Value:</label> | ||
<DatePicker defaultValue={new Date()} /> | ||
</Stack> | ||
); | ||
}; | ||
|
||
ReactDOM.render(<App />, document.getElementById('root')); | ||
``` | ||
|
||
<!--end-code--> |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!--start-code--> | ||
|
||
```js | ||
import { DatePicker, Stack } from 'rsuite'; | ||
|
||
const App = () => ( | ||
<Stack direction="column" spacing={8} alignItems="flex-start"> | ||
<DatePicker size="lg" loading placeholder="Large" /> | ||
<DatePicker size="md" loading placeholder="Medium" /> | ||
<DatePicker size="sm" loading placeholder="Small" /> | ||
<DatePicker size="xs" loading placeholder="Xsmall" /> | ||
</Stack> | ||
); | ||
ReactDOM.render(<App />, document.getElementById('root')); | ||
``` | ||
|
||
<!--end-code--> |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!--start-code--> | ||
|
||
```js | ||
import { DatePicker } from 'rsuite'; | ||
|
||
const App = () => ( | ||
<> | ||
<DatePicker label="Birthday:" /> | ||
</> | ||
); | ||
ReactDOM.render(<App />, document.getElementById('root')); | ||
``` | ||
|
||
<!--end-code--> |
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
Oops, something went wrong.
bc56cb3
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.
Successfully deployed to the following URLs:
rsuite-nextjs – ./docs
rsuite.vercel.app
rsuite-nextjs-git-main-rsuite.vercel.app
rsuite-nextjs-rsuite.vercel.app
rsuitejs.com