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(module:image): nz-image add press left or right to switch image #7321

Merged
merged 2 commits into from Apr 20, 2022

Conversation

amoycode
Copy link
Contributor

@amoycode amoycode commented Mar 14, 2022

The nz-image add nzEnableLeftRightArrow to support press left or right to switch image

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] 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?

Issue Number: N/A

What is the new behavior?

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Other information

The nz-image add nzEnableLeftRightArrow to support press `left` or `right` to switch image
@zorro-bot
Copy link

zorro-bot bot commented Mar 14, 2022

This preview will be available after the AzureCI is passed.

@codecov
Copy link

codecov bot commented Mar 14, 2022

Codecov Report

Merging #7321 (dd876d7) into master (2d77bc2) will increase coverage by 0.03%.
The diff coverage is 89.28%.

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

@@            Coverage Diff             @@
##           master    #7321      +/-   ##
==========================================
+ Coverage   91.59%   91.62%   +0.03%     
==========================================
  Files         487      487              
  Lines       16006    16019      +13     
  Branches     2604     2607       +3     
==========================================
+ Hits        14660    14678      +18     
+ Misses       1033     1027       -6     
- Partials      313      314       +1     
Impacted Files Coverage Δ
components/upload/upload.component.ts 92.59% <66.66%> (-1.90%) ⬇️
components/carousel/carousel.component.ts 92.68% <100.00%> (ø)
components/image/image-preview-ref.ts 100.00% <100.00%> (ø)
components/list/list-item-cell.ts 92.00% <100.00%> (+3.53%) ⬆️
components/table/src/table-style.service.ts 94.82% <0.00%> (-1.73%) ⬇️
components/tabs/tab-nav-bar.component.ts 87.94% <0.00%> (+0.70%) ⬆️
components/table/src/table/tr-measure.component.ts 91.30% <0.00%> (+4.34%) ⬆️
...ts/table/src/table/table-inner-scroll.component.ts 83.82% <0.00%> (+4.41%) ⬆️
components/table/src/table/tbody.component.ts 100.00% <0.00%> (+11.11%) ⬆️

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 2d77bc2...798059b. Read the comment docs.

Copy link
Member

@cipchk cipchk left a comment

Choose a reason for hiding this comment

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

建议同时对单元测试的覆盖。

components/image/image-preview-ref.ts Outdated Show resolved Hide resolved
@@ -14,6 +14,7 @@ export class NzImagePreviewOptions {
nzZoom?: number;
nzRotate?: number;
nzDirection?: Direction;
nzEnableLeftRightArrow?: boolean = true;
Copy link
Member

Choose a reason for hiding this comment

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

不建议增加该字段, nzKeyboard 本身就是表示是否键盘操作,这里增加一个额外字段,倘若鼠标中间键切换时是不是也应该有另一个字段;因此容易产生歧义,以其如此,不如直接使用 nzKeyboard 来判断足够了。

The nz-image add support press `left` or `right` to switch image
Copy link
Member

@cipchk cipchk left a comment

Choose a reason for hiding this comment

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

@stygian-desolator
Copy link
Collaborator

LGTM

@stygian-desolator
Copy link
Collaborator

👍

@simplejason simplejason merged commit b5f82b5 into NG-ZORRO:master Apr 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants