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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: New calendar apis, headerRender method #16535

Conversation

Projects
None yet
5 participants
@abgaryanharutyun
Copy link
Contributor

commented May 12, 2019

Added new calendar APIsrenderHeader

  • With renderHeader API now we can render custom header with all functionalities.

Thank you guys for creating an awesome UI for React. I am using ant for many years and I will be very happy to join to Ant team.

I will wait for feedbacks.

Thanks.

馃 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

馃懟 What's the background?

馃挕 Solution

Screen Shot 2019-05-12 at 5 38 32 PM

### 馃摑 Changelog
  • English Changelog:
    Not added yet
  • Chinese Changelog (optional):

鈽戯笍 Self Check before Merge

  • 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

View rendered components/calendar/demo/card-with-custom-header-api.md
View rendered components/calendar/index.en-US.md

@pr-triage pr-triage bot added the PR: unreviewed label May 12, 2019

@netlify

This comment has been minimized.

Copy link

commented May 12, 2019

Deploy preview for ant-design ready!

Built with commit fc6e55a

https://deploy-preview-16535--ant-design.netlify.com

@abgaryanharutyun abgaryanharutyun changed the title Added new calendar apis, renderHeader and small prop feat : Added new calendar apis, renderHeader and small prop May 12, 2019

Harut Abgaryan
@codecov

This comment has been minimized.

Copy link

commented May 12, 2019

Codecov Report

Merging #16535 into feature will decrease coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff             @@
##           feature   #16535      +/-   ##
===========================================
- Coverage     95.8%   95.75%   -0.05%     
===========================================
  Files          261      259       -2     
  Lines         7296     7193     -103     
  Branches      2024     1984      -40     
===========================================
- Hits          6990     6888     -102     
+ Misses         304      303       -1     
  Partials         2        2
Impacted Files Coverage 螖
components/calendar/index.tsx 96.73% <酶> (酶) 猬嗭笍
components/calendar/Header.tsx 96.84% <100%> (+0.59%) 猬嗭笍
components/grid/row.tsx 94.23% <0%> (-5.77%) 猬囷笍
components/button/button.tsx 93.26% <0%> (-0.75%) 猬囷笍
components/carousel/index.tsx 96.36% <0%> (-0.19%) 猬囷笍
components/table/Table.tsx 93.39% <0%> (-0.03%) 猬囷笍
components/drawer/index.tsx 98.73% <0%> (酶) 猬嗭笍
components/tree/Tree.tsx 96.87% <0%> (酶) 猬嗭笍
components/descriptions/index.tsx
components/_util/responsiveObserve.ts
... and 1 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 3e32364...fc6e55a. Read the comment docs.

@codecov

This comment has been minimized.

Copy link

commented May 12, 2019

Codecov Report

Merging #16535 into feature will decrease coverage by <.01%.
The diff coverage is 92.85%.

Impacted file tree graph

@@             Coverage Diff             @@
##           feature   #16535      +/-   ##
===========================================
- Coverage    95.65%   95.64%   -0.01%     
===========================================
  Files          258      258              
  Lines         7107     7121      +14     
  Branches      1968     1970       +2     
===========================================
+ Hits          6798     6811      +13     
- Misses         307      308       +1     
  Partials         2        2
Impacted Files Coverage 螖
components/calendar/Header.tsx 96.73% <100%> (+0.48%) 猬嗭笍
components/calendar/index.tsx 95.74% <50%> (-1%) 猬囷笍

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 e88589d...c88f3fb. Read the comment docs.

Harut Abgaryan

@abgaryanharutyun abgaryanharutyun changed the title feat : Added new calendar apis, renderHeader and small prop feat: New calendar apis, renderHeader and small prop May 12, 2019

Harut Abgaryan added some commits May 12, 2019

@abgaryanharutyun

This comment has been minimized.

Copy link
Contributor Author

commented May 13, 2019

Ant team can you please review this PR and send me some feedbacks @afc163, @zombieJ ...

@zombieJ

This comment has been minimized.

Copy link
Member

commented May 14, 2019

hi @abgaryanharutyun, Thanks for your contribution.
Could you help to tell that what's the background of customize header?

@abgaryanharutyun

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

Thanks for response @zombieJ

Ant calendar by default supports only select box for year and month. I think this is not flexible for all cases. For example, we are using ant calendar, but we need to change header style, ordering, change select box to slide. To cover all those cases I have decided to do this additional option.

Show resolved Hide resolved components/calendar/Header.tsx Outdated
Show resolved Hide resolved components/calendar/Header.tsx Outdated
Show resolved Hide resolved components/calendar/Header.tsx Outdated
Show resolved Hide resolved components/calendar/Header.tsx Outdated

Harut Abgaryan and others added some commits May 14, 2019

Harut Abgaryan
Merge branch 'feature' of https://github.com/abgaryanharutyun/ant-design
 into calendar-custome-header-and-small-size
@abgaryanharutyun

This comment has been minimized.

Copy link
Contributor Author

commented May 14, 2019

Hey @zombieJ thank you for your feedbacks.

I already fixed all your comments. Can you take a look again please?

Show resolved Hide resolved components/calendar/Header.tsx Outdated
@arisrayelyan

This comment has been minimized.

Copy link

commented May 15, 2019

Hi all,
I have an issue with customizing calendar header and this PR will be very helpful,
thanks @abgaryanharutyun !
Looking forward to see it on next release.

@delyanr

This comment has been minimized.

Copy link

commented May 15, 2019

Looking forward to this PR as well. Header customisation is essential, especially hoping to make "prev" and "next" buttons to move through the months instead of the drop-downs. Thanks for the work!

Harut Abgaryan added some commits May 16, 2019

Harut Abgaryan
@abgaryanharutyun

This comment has been minimized.

Copy link
Contributor Author

commented May 21, 2019

@zombieJ I fixed all your comments. You can take a look.

@abgaryanharutyun abgaryanharutyun changed the title feat: New calendar apis, renderHeader and small prop feat: New calendar apis, headerRender method May 21, 2019

Show resolved Hide resolved components/calendar/index.tsx Outdated
@abgaryanharutyun

This comment has been minimized.

Copy link
Contributor Author

commented May 22, 2019

@zombieJ I fixed all your comments you can take a look

Harut Abgaryan and others added some commits May 22, 2019

Harut Abgaryan
Harut Abgaryan
Merge branch 'feature' of https://github.com/abgaryanharutyun/ant-design
 into calendar-custome-header-and-small-size
@zombieJ

This comment has been minimized.

Copy link
Member

commented May 23, 2019

Hmmm...strange lint ci failed. Let me restart it.

@zombieJ

This comment has been minimized.

Copy link
Member

commented May 23, 2019

I'm OK with this. Pls help to double confirm.
@afc163 @ztplz

@afc163

afc163 approved these changes May 26, 2019

@afc163 afc163 referenced this pull request May 26, 2019

Merged

docs: 3.19.0 changelog #16796

1 of 10 tasks complete

@zombieJ zombieJ merged commit 9828715 into ant-design:feature May 26, 2019

22 of 24 checks passed

Header rules No header rules processed
Details
Pages changed 449 new files uploaded
Details
LGTM analysis: JavaScript No new or fixed alerts
Details
Mixed content No mixed content detected
Details
Redirect rules 18 redirect rules processed
Details
Semantic Pull Request ready to be squashed
Details
WIP Ready for review
Details
ant-design.ant-design #ant design succeeded
Details
ci/circleci: compile Your tests passed on CircleCI!
Details
ci/circleci: dist Your tests passed on CircleCI!
Details
ci/circleci: lint Your tests passed on CircleCI!
Details
ci/circleci: setup Your tests passed on CircleCI!
Details
ci/circleci: test_dist Your tests passed on CircleCI!
Details
ci/circleci: test_dist_15 Your tests passed on CircleCI!
Details
ci/circleci: test_dom Your tests passed on CircleCI!
Details
ci/circleci: test_dom_15 Your tests passed on CircleCI!
Details
ci/circleci: test_es Your tests passed on CircleCI!
Details
ci/circleci: test_es_15 Your tests passed on CircleCI!
Details
ci/circleci: test_lib Your tests passed on CircleCI!
Details
ci/circleci: test_lib_15 Your tests passed on CircleCI!
Details
ci/circleci: test_node Your tests passed on CircleCI!
Details
ci/circleci: test_node_15 Your tests passed on CircleCI!
Details
deploy/netlify Deploy preview ready!
Details
security/snyk - package.json (paranoidjk) No manifest changes detected

@pr-triage pr-triage bot added PR: merged and removed PR: unreviewed labels May 26, 2019

zombieJ added a commit that referenced this pull request May 26, 2019

zombieJ added a commit that referenced this pull request May 26, 2019

docs: 3.19.0 changelog (#16796)
* add changelog

* add #16535

* update

* add missing changelog

* add #16801 changelog

* adjust description

* more desc

* more info

* change logo

Kiku-git added a commit to Kiku-git/ant-design that referenced this pull request Jun 14, 2019

fix (#3)
* Add fault-tolerant processing for rowSelection.getCheckboxProps

* Upload prop onRemove: allow Promise as return type

* onDragEnter鐨勫嚱鏁板畾涔夌己灏戜竴涓猠xpandedKeys:string[]?

瀹樻柟鐨勭ず渚嬮噷鏈塭xpandedKeys, 鍙槸typescript瀹氫箟閲屾病鏈夛紝鎵浠ユ墿灞曚竴涓

* Fix docs (ant-design#16637)

* Format (ant-design#16639)

* `==` to `===`

close ant-design#16640

* fix close  animation

* Update drawer.less

* fix space missing in button (ant-design#16551)

* feat: Add Mentions component (ant-design#16532)

* init

* first demo

* support empty

* add loading support

* add form sample

* update form sample

* omit value & defaultValue

* add 2 rest demo

* placement support

* update docs

* fix test

* update docs

* add test case

* fix lint

* follow textarea style

* update docs style

* 馃拕 unified Cascader selected style with Select

* docs: Add the changelog of 3.18.2 (ant-design#16666)

* Bump 3.18.2

* fix form typescript doc

* prettier md files

* Fix stylelint errors

* Add renovate.json

* Update renovate.json

* Refined translation of St.Exupery quote 

including link to quote site

* fix horizontal divider style

* 馃啓 support ESC to close drawer

*  update snapshots

* 馃拕 improve code style of Drawer

* update drawer version

* update config-provider test

* fix shouldComponentUpdate

* Upload prop onRemove: fix action

https://github.com/react-component/upload/tree/d0cf0eecee3b31888791f8c57acddb575bd259d4#api

* Update dependency logrocket to v1

* 馃拕 chore some documents style

* 馃摑 update customize theme

* 馃啓 rc-drawer 1.9.3

* 馃幀 Add example for Select ``optionLabelProp` prop, ant-design#16709

*  update snapshots

* 馃拕 fix emoji lint problem

https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/accessible-emoji.md

* New component Descriptions (ant-design#14645)

* add new component: DescriptionList

* add warning message

* docs: fix doc typo

* feat: implement the size attribute

* docs: fix doc typo

* refactor: use new name Descriptions

* test: snapshots updated

* feat: support react15

* style: fix code style warring

* style: better var name

* style: better code style

* style: merge css class

* feat: add responsive config

* fix: fix error title

* style: use @border-radius-base

* update snapshot

* feat: set default column

* test: add test script

* style: fix property defaultProps is useless error

* style: more robust code

* style: fix codereview warning

* style: fix review warning

* use responsiveObserveserve

* fix review warning

* bug: add childrenArray copy,prevent changes to incoming parameters

* fix dom error

* fix typo

* fix test

* don't use this

* snapshot updated

* prettier md

* remove descriptions md text

* new rendering method

* doc :add dot

* style: add right border

* Update index.en-US.md

add missing prop `showTitle` in documentation of Pagination

* adjust Carousel children change goto Logic (ant-design#16756)

* 馃摑 Add Programmatic Usage of antd colors

* update preview demo

* 馃悰 Fix Cascader displayRender not interactive

close ant-design#16738 and ant-design#10433

this bug had been fixed in bc4143f before, but it was broken by ant-design#12407

here we change another method to fix ant-design#12395

* Create FUNDING.yml

* 馃摑 Add opencollective link

* upload disabled remove

* feat: Steps support clickable (ant-design#16773)

* support clickable

* update snapshot

* update desc

* Locale (feat ant-design#16752): Added Latvian localization (ant-design#16780)

* update getPopupContainer (ant-design#16778)

since select/index.d.ts requires getPopupContainer={triggerNode => HTMLElement} but parentNode actually is not HTMLElement.

* Remove ancient prop types (ant-design#16705)

* Remove ancient Modal.propTypes.align and Progress.propTypes.size

* Remove linkRender and nameRender from Breadcrumb

* 馃悰 Fix Input parser type

close ant-design#15226

* feat: New calendar apis, headerRender method (ant-design#16535)

* added new calendar api, renderHeader now we can customize calendar header

* fixed typo for tests

* error handling for renderHeader

* covering all cases with tests

* fixed tests and change console error to warning

* fixed feedbacks and code optimization

* cleanup callback function arguments

* removed unused changes

* fixed tests

* added extra classes

* fixed some comments

* tying to fix test for remote

* tying to fix test for remote in my local machin it works fine

* tying to fix test for remote in my local machin it works fine

* tying to fix test for remote in my local machin it works fine

* updated test snapshots

* fixed comment

* fixed linting

* fixed some texts

* added header for CN and added argument types

* removed extra row

* Allow users to define where tooltips should appear on slider marks (ant-design#16641)

* feat: add disable style to upload component

* Fix the problem that the Slider's Tooltip is in the incorrect position when use modal	 (ant-design#16717)

* Fix incorrect position of tooltip when use slider

* Remove useless comment

* Reduce code

* Update

*  getTooltipPopupContainer default to body

* Public Slider's ref

* Add docs

* Update docs

* 馃拕 Correct Statistic font color (ant-design#16801)

close ant-design#15514

* docs: 3.19.0 changelog (ant-design#16796)

* add changelog

* add ant-design#16535

* update

* add missing changelog

* add ant-design#16801 changelog

* adjust description

* more desc

* more info

* change logo

* fix: mentions ts definition update (ant-design#16814)

* fix mentions ts definition

* adjust logic of Mentions

* fix: Tooltip not hidden when menu is in control mode (ant-design#16812)

* fix: Select ts define (ant-design#16817)

* fix: Descriptions warning should work as expect (ant-design#16819)

* fix warning

* add MockDate

* Fix typescript compile error (ant-design#16816)

* 馃悰 Fix typo name icons, add warning and update docs (ant-design#16818)

close ant-design#13007
close ant-design#16810

deps: ant-design/ant-design-icons#63

* docs: 3.19.1 change-log (ant-design#16820)

* update changelog

* add missing one

*  Add test case for TransButton

* fix: Tabs card vertical support scroll (ant-design#16825)

* Update util.test.js

* fix(Transfer): set state on an unmounted component (ant-design#16822)

* chore: Add warning if use `inlineCollapsed` under Sider (ant-design#16826)

* typescript: adding forceSubmenuRender as MenuProps

* 馃拕 Optimize examples code style

* Update index.en-US.md

* 鈿★笍 export TypographyProps

close ant-design#15190

* add onChange prop type definition to Steps

* add onChange prop type definition to Steps (ant-design#16845)

* add semicolon

* fix: add webkitRelativePath (ant-design#16850)

* fix: fix type of RcFile

* fix: fix type of action in UploadProps

* Update xhr2 requirement from ^0.1.4 to ^0.2.0

Updates the requirements on [xhr2](https://github.com/pwnall/node-xhr2) to permit the latest version.
- [Release notes](https://github.com/pwnall/node-xhr2/releases)
- [Commits](pwnall/node-xhr2@v0.1.4...0.2.0)

* Remove okButtonDisabled/cancelButtonDisabled never used prop defs

- Also remove them from the CHANGELOG because they were never actually
implemented, the prop was renamed to okButtonProps/cancelButtonProps
within PR ant-design#10955 but these prop defs were left behind and ended up
incorrectly included in the CHANGELOG.

* 淇Breadcrumb.tsx 涓鐞唕oute.children 璺緞涓嶅

<Menu.Item key={child.breadcrumbName || child.path}>
                {itemRender(child, params, routes, [...paths, this.getPath(child.path, params)])}
</Menu.Item>
itemRender(...args) 涓矾寰勫簲璇ュ埌鎷兼帴褰撳墠child.path

* fix Breadcrumb.tsx

getPath() 鍙傛暟璧嬮粯璁ゅ

* fix: use @error-color & @warning-color instead of @text-color-danger & @text-color-warning ant-design#16856

* fix Breadcrumb.tsx

瀵逛簬瀛愯矾寰勬槸鍚︿负绌鸿繘琛屽垽鏂

* add antd pro 4.0 badge (ant-design#16894)

* Update ansi-styles requirement from ^3.2.1 to ^4.0.0

Updates the requirements on [ansi-styles](https://github.com/chalk/ansi-styles) to permit the latest version.
- [Release notes](https://github.com/chalk/ansi-styles/releases)
- [Commits](chalk/ansi-styles@v3.2.1...v4.0.0)

* doc: changelog 3.19.2

* doc: changelog

* tweak: order changelog

* doc: changelog

* doc: changelog

* doc: changelog

* doc: changelog

* doc: format

* doc: changelog

* 馃摑 changelog

* 馃摑 changelog

* release: 3.19.2

* 馃悰 fixes ant-design#16871 Cascader - Space during search

* 馃敡 Add packtracker

* Remove useless type

* fix: Transfer render Empty when customize without data (ant-design#16925)

* fix: Hide Spinner of InputNumber when type is number (ant-design#16926)

* fix: Hide Spinner of InputNumber when type is number

* Firefox not obedient

* fix: Breadcrumb validateDOMNesting warning (ant-design#16929)

* 馃悰 Fix Breadcrumb validateDOMNesting warning

```
Warning: validateDOMNesting(...): <a> cannot appear as a descendant of <a>.
    in a (created by Context.Consumer)
    in span (created by Context.Consumer)
    in a (created by Context.Consumer)
    in Trigger (created by Dropdown)
    in Dropdown (created by Context.Consumer)
    in Dropdown (created by Context.Consumer)
    in span (created by Context.Consumer)
    in BreadcrumbItem (created by Context.Consumer)
    in div (created by Context.Consumer)
    in Breadcrumb (created by TestBreadcrumb)
    in TestBreadcrumb
```

*  update snapshots

* Update Breadcrumb.tsx

* 馃悰 Fix abnormal scrollbar in Chrome

when rowSelection and title work together

close ant-design#16912

* 馃悰 Fix Table header extra scrollbar control

close ant-design#4637
close ant-design#14211

react-component/table#333

*  update snapshots

* 馃拕 Fix scrollbar border bottom

*  update snapshots

* 馃摑 fix size toc overflow style

* 馃拕 use marginRight remind developer

* fix: test ci

* rebase

* fix: Table miss border-raidus in Firefox (ant-design#16957)

* Revert "Merge pull request ant-design#16174 from ant-design/fix-table-chrome"

This reverts commit 686c1fc, reversing
changes made to 924afc2.

* firefox only

* add comment

*  update snapshots

* 馃啓 upgrade all deps to latest version

* 馃啓 fix for typescript@3.5

* 馃敡 ignore other files for packtracker

* Suppress autoprefixer warning

* add new less var

* less variable should be extended

*  Fix ci

* 馃摑 Add FAQ for DatePicker/RangePicker mode prop usage

* fix packtracker exclude_assets

* 馃悰 Fix Divider `orientation="center"` style

close ant-design#16987

* Add missing spanish translations

* Export TextProps and update english in error

*  Fix test snapshots

* Fix typo

* Update colors.zh-CN.md

* docs: 3.19.3 change-log (ant-design#16998)

* chore: update package.json

* fix: Table with sort should reset to first page (ant-design#17020)

* sort reset pagination

* add test case

* 馃悰 Fix margin issue of PageHeader extra

close ant-design#17025

* 猬嗭笍 Update majo requirement from ^0.7.1 to ^0.8.0

Updates the requirements on [majo](https://github.com/egoist/majo) to permit the latest version.
- [Release notes](https://github.com/egoist/majo/releases)
- [Commits](egoist/majo@v0.7.1...v0.8.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* 馃悰 Fix margin issue of PageHeader extra continually

* update calendar (ant-design#17038)

* 馃拕 Keep submenu selected style

* Update index.less

* Update default.less

* Update certain-category.md

* Update uncertain-category.md

*  update snapshots

* 馃摑 Fix image in feedback spec documentation

*  update snapshots

* use calc to fix tree line (ant-design#17055)

* fix: add link button to basic demo of button docs

* 馃拕 adjust bordered table header scrollbar style

* 馃拕 optimize bordered table header scrollbar style

continue after ant-design#17065

* Fix grammar on message documentation

* fix: remove margin for collapse arrow (ant-design#17009)

* remove margin for collapse arrow

* change translateY to -21px in collapse

* remove line-height to center arrow

* Fixing date formats for Arabic-Egypt locale

* Update index.zh-CN.md

add getPopupContainer props

* 馃悰 Fix Input not align with other components in Chrome

close ant-design#17082
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.