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

Picker only emit user change #6214

Merged
merged 3 commits into from
Sep 20, 2017
Merged

Picker only emit user change #6214

merged 3 commits into from
Sep 20, 2017

Conversation

Dreamacro
Copy link
Contributor

DatePicker 系列的 change 事件改为仅响应用户交互

@wacky6
Copy link
Contributor

wacky6 commented Aug 2, 2017

I prefer a cleaner approach. Using flags to distinguish user interaction seems unnecessarily complicated.

@Dreamacro
Copy link
Contributor Author

@wacky6
Emmmm, which approach are you prefer?

@wacky6
Copy link
Contributor

wacky6 commented Aug 2, 2017

I prefer emit change in user-related event handlers, leave out the flags.

@Leopoldthecoder Leopoldthecoder merged commit 1912c47 into ElemeFE:carbon Sep 20, 2017
@wacky6
Copy link
Contributor

wacky6 commented Sep 26, 2017

@Leopoldthecoder

I am working on a cleaner picker implementation, with bug fixes and refined default-value feature. Should be able to get rid of the user flag in this PR.

@Leopoldthecoder
Copy link
Contributor

Leopoldthecoder commented Sep 26, 2017

@wacky6 Cool

@Leopoldthecoder
Copy link
Contributor

@wacky6 In terms of default-value, after #7073, range typed DatePicker would break if the initial value is []: https://jsfiddle.net/leopoldthecuber/LkbeLLd9/ . #7233 is a fix. Just a heads-up for your refining it.

@wacky6
Copy link
Contributor

wacky6 commented Sep 27, 2017

Got it.

wacky6 added a commit to wacky6/element that referenced this pull request Oct 3, 2017
@wacky6
Copy link
Contributor

wacky6 commented Oct 4, 2017

*-Picker rework mostly finished.

Updating / adding tests. Should be able to PR later this week.

Spoiler:

  • experimental support to bind non-Date value, controlled with valueFormat
  • fix navigation issue
  • refined default-value, add support for array, make it reactive
  • refined highlight, can highlight today/current/default separately
  • simplified internal implementation, make room for more features
  • change event according to [Feature Request] modify / unify change events for form components #6011

@wacky6
Copy link
Contributor

wacky6 commented Oct 4, 2017

May later rework date-table to support Daylight Saving Times.

Currently, it does not highlight properly.

image

@Leopoldthecoder
Copy link
Contributor

Wow that's great

wacky6 added a commit to wacky6/element that referenced this pull request Oct 5, 2017
@wacky6 wacky6 mentioned this pull request Oct 5, 2017
Leopoldthecoder pushed a commit that referenced this pull request Oct 10, 2017
* Revert "Picker only emit user change (#6214)"

This reverts commit 1912c47.

* picker/util: add helper methods

range: n => Array
modify{Date, Time}: Date => Date
clear{Time, Milliseconds}: Date => Date
limitTimeRange: Date => Date
timeWithinRange: Date, [Date] => Boolean

* time-spinner: refactory

* time-panel: refactory

* picker refactory

* date-panel, *-table: refactory

* time-select: refactory

* test: update time-picker

* test: update date-picker

* time-range: refactory

* date-range: refactory

* test: update time-select

* test: update form date-picker/time-picker

* docs: update date-picker
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

3 participants