Skip to content
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: Calendar onSelect support info.source param #42432

Merged
merged 4 commits into from
May 17, 2023
Merged

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented May 17, 2023

[中文版模板 / Chinese template]

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • TypeScript definition update
  • Bundle size optimization
  • Performance optimization
  • Enhancement feature
  • Internationalization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Workflow
  • Other (about what?)

🔗 Related issue link

💡 Background and solution

resolve #39801
resolve #40407
close #41553
close #42412

📝 Changelog

Language Changelog
🇺🇸 English Calendar onSelect support info.source param to help get select source.
🇨🇳 Chinese Calendar onSelect 支持 info.source 参数以获取选择来源。

☑️ Self-Check before Merge

⚠️ Please check all items below before requesting a reviewing. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

🚀 Summary

🤖 Generated by Copilot at 80c155a

Added a new feature to the Calendar component that allows users to access the source of the date selection, such as 'date', 'keyboard', or 'customize'. Enhanced the onSelect and onValueChange props with a second parameter info of type SelectInfo to pass the source information. Updated the tests and the documentation accordingly.

🔍 Walkthrough

🤖 Generated by Copilot at 80c155a

  • Add a second parameter to the onSelect prop of the Calendar component to indicate the source of the date selection (link, link, link, link, link, link, link, link, link, link, link)
  • Update the test cases for the Calendar component to pass the second parameter to the onSelect prop (link, link, link, link, link, link)
  • Reorder some imports in generateCalendar.tsx and Header.tsx to follow the alphabetical order (link, link, link)

@github-actions
Copy link
Contributor

github-actions bot commented May 17, 2023

@github-actions
Copy link
Contributor

size-limit report 📦

Path Size
./dist/antd.min.js 384.36 KB (+41 B 🔺)
./dist/antd-with-locales.min.js 443.6 KB (+38 B 🔺)

@codecov
Copy link

codecov bot commented May 17, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (24dd535) 100.00% compared to head (80c155a) 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           feature    #42432    +/-   ##
==========================================
  Coverage   100.00%   100.00%            
==========================================
  Files          619       640    +21     
  Lines        11048     10847   -201     
  Branches      3081      2944   -137     
==========================================
- Hits         11048     10847   -201     
Impacted Files Coverage Δ
components/auto-complete/index.tsx 100.00% <ø> (ø)
components/config-provider/context.ts 100.00% <ø> (ø)
components/divider/style/index.ts 100.00% <ø> (ø)
components/input-number/style/index.ts 100.00% <ø> (ø)
components/input/style/index.ts 100.00% <ø> (ø)
components/locale/en_US.ts 100.00% <ø> (ø)
components/locale/index.tsx 100.00% <ø> (ø)
components/locale/zh_CN.ts 100.00% <ø> (ø)
components/menu/hooks/useItems.tsx 100.00% <ø> (ø)
components/menu/index.tsx 100.00% <ø> (ø)
... and 72 more

... and 10 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@zombieJ zombieJ merged commit 71fc54e into feature May 17, 2023
@zombieJ zombieJ deleted the calendar-change branch May 17, 2023 13:18
@bombillazo
Copy link
Contributor

Hello, when is this new feature going to be available?

@li-jia-nan
Copy link
Member

li-jia-nan commented May 17, 2023

Hello, when is this new feature going to be available?

Hello, in the future version 5.6.0, about a month later.

Copy link
Contributor

@bombillazo bombillazo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be a fix needed for this.

onSelect={onInternalSelect}
onSelect={(nextDate) => {
onInternalSelect(nextDate, 'date');
}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this should be like this:

onSelect={(nextDate) => {
  onInternalSelect(nextDate, panelMode === 'date' ? 'date' : 'month');
}}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome PR !

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bombillazo
How about:

onSelect={(nextDate) => {
  onInternalSelect(nextDate, panelMode);
}}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good afternoon, you are welcome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants