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: New Picker interactive #46685
Conversation
Run & review this pull request in StackBlitz Codeflow. |
Visual Regression Report for PR #46685 Failed ❌
Check Full Report for details |
New dependencies detected. Learn more about Socket for GitHub ↗︎
|
size-limit report 📦
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature #46685 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 732 734 +2
Lines 12548 12531 -17
Branches 3291 3272 -19
=========================================
- Hits 12548 12531 -17 ☔ View full report in Codecov by Sentry. |
先在 feature 吧所有浮层的 image test 都加上,这样这里能直接比较 diff,稳一点。 |
直接展开浮层会叠在一起,要把每个 Demo 都做一遍就过于重复了。看起来要先去做一个浮层单独对比的能力。 |
@@ -16,7 +19,7 @@ import Select from '../../select'; | |||
import Header, { type CalendarHeaderProps } from '../Header'; | |||
|
|||
const ref: { | |||
calendarProps?: PickerPanelProps<unknown>; | |||
calendarProps?: PickerPanelProps<any>; |
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.
rc-picker 里的 PickerPanelProps 是不是 PickerPanelProps<T = any>
这个泛型是必填的吗
@@ -30,7 +34,7 @@ describe('RangePicker', () => { | |||
it('should not throw error when value is reset to `[]`', () => { | |||
const birthday = dayjs('2000-01-01', 'YYYY-MM-DD'); | |||
const wrapper1 = render(<RangePicker value={[birthday, birthday]} open />); | |||
const wrapper2 = render(<RangePicker value={[] as unknown as null} open />); | |||
const wrapper2 = render(<RangePicker value={[] as unknown as RangeValue<dayjs.Dayjs>} open />); |
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.
value 不能直接传 [] 吗
.add(token.controlPaddingHorizontal) | ||
.equal(), | ||
}, | ||
// [` |
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.
没有删掉
``` | ||
|
||
注意:`align` 定义为 `5.13.0` 新增。 |
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.
13 不是要改成 14 吗
还有 footer 的高度也不一致。 |
maxDate、minDate、order、required 等属性貌似没有在 API 文档中出现。 maxDate、minDate 最好替换掉原来的 disabled 范围的演示。 |
[中文版模板 / Chinese template]
🤔 This is a ...
🔗 Related issue link
💡 Background and solution
📝 Changelog
Chinese
disabledDate
检查逻辑,现在会提供info.type
告知当前面板信息。multiple
支持多选能力。pickerValue
、defaultPickerValue
属性用于受控管理展开面板所在日期。defaultPickerValue
现在会在每次面板展开时都进行重置。preserveInvalidOnBlur
属性用于无障碍时失去焦点需要保留输入内容的场景。format
支持align
属性,允许通过掩码模式输入内容。required
属性。id
属性支持分别设置start
和end
输入框的id
。onFocus
和onBlur
事件会额外提供一个info.range
告知当前的焦点来自于哪个输入框。scrollOnChange
设置滚动时间时自动选择对应的时间。needConfirm
属性,允许设置需要确认、或者不确认的提交模式。cmponents
属性,允许自定义部分面板。locale
进行配置。format
支持LT
、LTS
日期格式。minDate
和maxDate
用于设置面板切换范围。order
属性。showWeek
属性。use12Hours
下,disabledTime
获取的hour
也会被裁剪成 0~12 的问题。allowClear
触发事件从onMouseDown
切换为onClick
。onKetDown
的preventDefault
参数,请直接通过event.preventDefault
进行调用。☑️ Self-Check before Merge