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(comp:date-picker): add datetime type, add dateRangePicker #837

Merged
merged 1 commit into from
Apr 18, 2022

Conversation

sallerli1
Copy link
Contributor

@sallerli1 sallerli1 commented Apr 6, 2022

add datetime pick functionality

feat(comp:date-range-picker): add dateRangePicker

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Component style update
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • Application (the showcase website) / infrastructure changes
  • Other... Please describe:

What is the current behavior?

What is the new behavior?

新增 datetime 类型,同时选择日期与时间
新增日期范围选择,类型与日期选择一致
修改日期选择面板样式
修改week类型面板样式与视觉稿一致

新增日期范围选择 DateRangePicker

Other information

@idux-bot
Copy link

idux-bot bot commented Apr 6, 2022

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Apr 6, 2022

Codecov Report

Merging #837 (fb4f573) into main (95df1b9) will increase coverage by 0.43%.
The diff coverage is 97.07%.

❗ Current head fb4f573 differs from pull request most recent head efa6ad4. Consider uploading reports for the commit efa6ad4 to get more accurate results

@@            Coverage Diff             @@
##             main     #837      +/-   ##
==========================================
+ Coverage   93.29%   93.72%   +0.43%     
==========================================
  Files         633      649      +16     
  Lines       60449    62992    +2543     
  Branches     7234     7601     +367     
==========================================
+ Hits        56393    59037    +2644     
+ Misses       4056     3955     -101     
Impacted Files Coverage Δ
...s/components/_private/date-panel/src/DatePanel.tsx 100.00% <ø> (ø)
...ges/components/time-picker/src/overlay/Overlay.tsx 25.88% <0.00%> (+0.30%) ⬆️
...s/date-picker/src/composables/useKeyboardEvents.ts 53.48% <53.48%> (ø)
packages/components/date-picker/src/utils.ts 91.48% <91.48%> (ø)
.../date-picker/src/composables/useRangeActiveDate.ts 92.59% <92.59%> (ø)
...mponents/date-picker/src/composables/useControl.ts 94.52% <94.52%> (ø)
...ges/components/date-picker/src/content/Content.tsx 95.94% <95.31%> (+50.23%) ⬆️
...ents/date-picker/src/composables/usePickerState.ts 95.40% <95.40%> (ø)
...nts/date-picker/src/composables/useRangeControl.ts 96.17% <96.17%> (ø)
...ckages/components/_private/trigger/src/Trigger.tsx 96.33% <96.33%> (ø)
... and 58 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 95df1b9...efa6ad4. Read the comment docs.

@sallerli1 sallerli1 force-pushed the feat-date-time-picker-saller branch 2 times, most recently from 6362dae to ac7d73f Compare April 12, 2022 09:29
@sallerli1 sallerli1 changed the title feat(comp:date-picker): add datetime type feat(comp:date-picker): add datetime type, add dateRangePicker Apr 12, 2022
@sallerli1 sallerli1 force-pushed the feat-date-time-picker-saller branch from ac7d73f to f2e05b4 Compare April 12, 2022 09:48
packages/components/_private/date-panel/src/types.ts Outdated Show resolved Hide resolved
packages/components/date-picker/docs/Index.zh.md Outdated Show resolved Hide resolved
| `placeholder` | 选择框默认文本 | `string \| #placeholder` | - | - | 可以通过国际化配置默认值 |
| `timePicker` | 是否显示时间选择器 | `boolean \| TimePickerProps` | `false` | - | 仅在 `type='date'` 时生效 |
| `timePanelProps` | 时间选择器props | `TimePanelProps` | `false` | - | 仅在 `type='datetime'` 时生效 |
Copy link
Member

Choose a reason for hiding this comment

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

这个改回 timePicker 吧,其他组件都是不带 props 后缀的。

| `placeholder` | 选择框默认文本 | `string[] \| #placeholder=placement:'start'\|'end'` | - | - | 默认使用 `i18n` 配置 |
| `separator` | 自定义分隔符图标 | `string \| VNode \| #separator` | `'swap-right'` | ✅ | - |
| `timePicker` | 是否显示时间选择器 | `boolean \| TimePickerProps \| TimePickerProps[]` | `false` | - | 如果需要对前后的时间选择器配置不同的禁用条件,可以传入一个数组 |
| `timePanelProps` | 是否显示时间选择器 | `TimePanelProps \| TimePanelProps[]` | `false` | - | 如果需要对前后的时间选择器配置不同的禁用条件,可以传入一个数组 |
Copy link
Member

Choose a reason for hiding this comment

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

同上

@danranVm
Copy link
Member

  • 默认为不可输入
    image
  • 每次打开的时候,跟外面的输入框做一下同步
  • 这个 Demo 也给个 ture, false, overlay 的 radio 选择吧
    image

const prefixCls = mergedPrefixCls.value

return (
<div ref={triggerRef} class={classes.value} onClick={handleClick} onKeydown={handleKeyDown}>
<ɵTrigger class={prefixCls} v-slots={slots} {...triggerProps.value}>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<ɵTrigger class={prefixCls} v-slots={slots} {...triggerProps.value}>
<ɵTrigger className={prefixCls} v-slots={slots} {...triggerProps.value}>

@sallerli1 sallerli1 force-pushed the feat-date-time-picker-saller branch 2 times, most recently from d960212 to 91ff0c5 Compare April 18, 2022 03:34
feat(comp:date-picker): add dateRangePicker component

feat(comp:date-picker): remove week prefix according to ui

fix(comp:time-picker): fix time-picker scroll problem occured under PM

fix(comp:table): fix typescript type error

doc(comp:all): update less variable in documents
@sallerli1 sallerli1 force-pushed the feat-date-time-picker-saller branch from 91ff0c5 to efa6ad4 Compare April 18, 2022 03:38
@danranVm danranVm merged commit 6200d5a into IDuxFE:main Apr 18, 2022
@danranVm danranVm mentioned this pull request Apr 18, 2022
1 task
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.

None yet

2 participants