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: watermark): add watermark component (#924) #930

Merged
merged 1 commit into from
May 30, 2022

Conversation

tuchg
Copy link
Contributor

@tuchg tuchg commented May 25, 2022

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

What is the current behavior?

What is the new behavior?

#924

Other information

@idux-bot
Copy link

idux-bot bot commented May 25, 2022

This preview will be available after the AzureCI is passed.

@tuchg tuchg requested a review from danranVm May 25, 2022 08:53
@tuchg tuchg changed the title feat(comp: watermark): add component watermark (#924) feat(comp: watermark): add watermark component (#924) May 25, 2022
@codecov
Copy link

codecov bot commented May 25, 2022

Codecov Report

Merging #930 (c1763af) into main (2955e7f) will decrease coverage by 0.39%.
The diff coverage is 84.22%.

@@            Coverage Diff             @@
##             main     #930      +/-   ##
==========================================
- Coverage   93.38%   92.98%   -0.40%     
==========================================
  Files         679      727      +48     
  Lines       66670    68392    +1722     
  Branches     5888     5892       +4     
==========================================
+ Hits        62261    63597    +1336     
- Misses       4409     4795     +386     
Impacted Files Coverage Δ
...ponents/watermark/src/composables/useCalcBase64.ts 58.13% <58.13%> (ø)
packages/components/watermark/src/utils/index.ts 74.07% <74.07%> (ø)
packages/components/index.ts 96.38% <100.00%> (ø)
...s/components/watermark/__tests__/watermark.spec.ts 100.00% <100.00%> (ø)
packages/components/watermark/index.ts 100.00% <100.00%> (ø)
packages/components/watermark/src/Watermark.tsx 100.00% <100.00%> (ø)
packages/components/watermark/src/types.ts 100.00% <100.00%> (ø)
packages/components/alert/src/Alert.tsx 98.05% <0.00%> (-1.95%) ⬇️
packages/components/alert/__tests__/alert.spec.ts 100.00% <0.00%> (ø)
...ackages/components/button/__tests__/button.spec.ts 100.00% <0.00%> (ø)
... and 53 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 2955e7f...c1763af. Read the comment docs.

@tuchg tuchg force-pushed the feat-watermark branch 2 times, most recently from 063676b to 0fd8b08 Compare May 25, 2022 13:23
@tuchg tuchg closed this May 26, 2022
@tuchg tuchg deleted the feat-watermark branch May 26, 2022 04:06
@tuchg tuchg restored the feat-watermark branch May 26, 2022 04:10
@tuchg tuchg reopened this May 26, 2022
packages/components/watermark/docs/Index.zh.md Outdated Show resolved Hide resolved
packages/components/watermark/docs/Index.zh.md Outdated Show resolved Hide resolved
packages/components/watermark/src/utils/index.ts Outdated Show resolved Hide resolved
// low is default

case 'mid':
width /= 2
Copy link
Member

@danranVm danranVm May 26, 2022

Choose a reason for hiding this comment

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

尽可能避免直接给参数进行赋值操作。
另外建议这里抽象成一个数据表, 会让你的代码灵活很多,后续也可以考虑让用户自定义这个数据表,做到可配置。

const densityMap = {
low: {width:1, height:1, ...},
mid:{...},
heght:{...}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

其实是有对应参数开放的,只需要调节参数就行,数据表做不到数据的动态调整吧

packages/components/watermark/style/themes/seer.ts Outdated Show resolved Hide resolved
packages/components/watermark/src/Watermark.tsx Outdated Show resolved Hide resolved
@danranVm
Copy link
Member

在 PR 里关联一下对应的 issue 就好,没必要在把 API 设计贴过来了。

@danranVm danranVm merged commit 79b6435 into IDuxFE:main May 30, 2022
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